{"version":3,"file":"render.js","sources":["src/render.js"],"sourcesContent":["/**\n * Confidential and Proprietary for Oracle Corporation\n *\n * This computer program contains valuable, confidential, and\n * proprietary information. Disclosure, use, or reproduction\n * without the written authorization of Oracle is prohibited.\n *\n * Copyright (c) 2021, Oracle and/or its affiliates.\n */\ndefine(['require', 'mustache', 'jquery'], function (require, Mustache, $) {\n\t/**\n\t * This is a generic AMD wrapper module for backwards compatibility.\n\t * It enables RequireJS dyanmic loading of JavaScript Module based custom components.\n\t */\n\tfunction ContentLayout(params) {\n\t\tconst moduleURL = require.toUrl('./render.mjs')\n\n\t\t// import the module file from the assets folder\n\t\tthis.loadModule = import(moduleURL)\n\t\t\t.then(({\n\t\t\t\tdefault: ModuleComponent\n\t\t\t}) => {\n\t\t\t\t// return a new instance of the component\n\t\t\t\tif (ModuleComponent) {\n\t\t\t\t\t// augment parameters with 3rd party libs\n\t\t\t\t\tconst moduleParams = Object.assign({}, params)\n\t\t\t\t\tmoduleParams.$ = params.$ || $\n\t\t\t\t\tmoduleParams.Mustache = params.Mustache || Mustache\n\n\t\t\t\t\t// create the new module component\n\t\t\t\t\treturn Promise.resolve(new ModuleComponent(moduleParams))\n\t\t\t\t} else {\n\t\t\t\t\treturn Promise.reject('Failed to load module: ' + moduleURL)\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((e) => {\n\t\t\t\t// typically this will be caused by syntax errors in the render.mjs file\n\t\t\t\t// make sure the render.mjs file can be imported directly\n\t\t\t\tconsole.error(e)\n\t\t\t})\n\t}\n\n\tContentLayout.prototype.contentVersion = '>=1.0.0 <2.0.0'\n\n\tContentLayout.prototype.render = function (parentObj) {\n\t\t// wait for the actual module to load and then render it\n\t\tthis.loadModule.then((module) => {\n\t\t\tmodule.render(parentObj)\n\t\t})\n\t}\n\n\tContentLayout.prototype.hydrate = function (parentObj) {\n\t\t// wait for the actual module to load and then hydrate it\n\t\tthis.loadModule.then((module) => {\n\t\t\tmodule.hydrate(parentObj)\n\t\t})\n\t}\n\n\treturn ContentLayout\n})\n"],"names":["define","require","Mustache","$","ContentLayout","params","moduleURL","toUrl","this","loadModule","import","then","_ref","default","ModuleComponent","moduleParams","Object","assign","Promise","resolve","reject","catch","e","console","error","prototype","contentVersion","render","parentObj","module","hydrate"],"mappings":"yBASAA,OAAO,CAAC,UAAW,WAAY,WAAW,SAAUC,EAASC,EAAUC,GAKtE,SAASC,EAAcC,GACtB,MAAeC,EAAGL,EAAQM,MAAM,gBAGhCC,KAAKC,WAAaC,OAAOJ,GACvBK,MAAKC,IAEA,IADLC,QAASC,GAETF,EACA,GAAIE,EAAiB,CAEpB,MAAkBC,EAAGC,OAAOC,OAAO,CAAd,EAAkBZ,GAKvC,OAJAU,EAAaZ,EAAIE,EAAOF,GAAKA,EAC7BY,EAAab,SAAWG,EAAOH,UAAYA,EAG7BgB,QAACC,QAAQ,IAAIL,EAAgBC,GAC3C,CACA,OAAcG,QAACE,OAAO,0BAA4Bd,EAClD,IAEDe,OAAOC,IAGPC,QAAQC,MAAMF,EAAd,GAEF,CAkBD,OAhBAlB,EAAcqB,UAAUC,eAAiB,iBAEzCtB,EAAcqB,UAAUE,OAAS,SAAUC,GAE1CpB,KAAKC,WAAWE,MAAMkB,IACrBA,EAAOF,OAAOC,EAAd,GAED,EAEDxB,EAAcqB,UAAUK,QAAU,SAAUF,GAE3CpB,KAAKC,WAAWE,MAAMkB,IACrBA,EAAOC,QAAQF,EAAf,GAED,EAEMxB,CACP"}