{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/views/Common/JavaScriptLoader.js"],"names":["console","log","window","Launchpad","deferJsTimer","loadScript","url","callback","script","document","createElement","type","async","defer","readyState","onreadystatechange","onload","src","body","append","loadStyle","href","link","rel","media","getElementsByTagName","appendChild","scriptListLoader","jsLoadList","forEach","x","gtmtrigger","innerHTML","id","className","prepend","handlePageBuilderObserver","MutationObserver","WebKitMutationObserver","obsConfig","childList","characterData","attributes","subtree","targetNodes","getElementById","editableAreaCount","myObserver","mutationRecords","mutation","_typeof","addedNodes","ktcEditableArea","target","classList","contains","targetLastChild","querySelector","pageBuilderAreaCount","disconnect","observe","loadJS","viewEvent","evt","pageBuilderEditMode","deferJs","addEventListener","setTimeout","ready","deferJsType"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AACA;AACA;AACAA,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC;AACnCC,MAAM,CAACC,SAAS,CAACC,YAAY,GAAGF,MAAM,CAACC,SAAS,CAACC,YAAY,IAAI,IAAI,CAAC,CAAC;;AAEvE,SAASC,UAAUA,CAACC,GAAG,EAAEC,QAAQ,EAAE;EAClC,IAAI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AAC,uBAAuB,CAAC;AACrC,CAAC;AAED,IAAIC,MAAM,CAACC,SAAS,CAAC8D,OAAO,EAAE;EAC7B,IAAI/D,MAAM,CAACC,SAAS,CAACkE,WAAW,KAAK,kBAAkB,EAAE;IACxDrE,OAAO,CAACC,GAAG,CAAC,yCAAyC,CAAC;IACtDQ,QAAQ,CAACyD,gBAAgB,CAAC,kBAAkB,EAAED,OAAO,CAAC;EACvD,CAAC,MAAM,IAAI/D,MAAM,CAACC,SAAS,CAACkE,WAAW,KAAK,QAAQ,EAAE;IACrDnE,MAAM,CAACc,MAAM,GAAG,YAAM;MAAE;MACvBhB,OAAO,CAACC,GAAG,CAAC,+BAA+B,CAAC;MAC5CgE,OAAO,CAAC,CAAC;IACV,CAAC;EACF,CAAC,MAAM;IACNjE,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;IAC7CgE,OAAO,CAAC,CAAC;EACV;EACAjE,OAAO,CAACC,GAAG,CAAC,qBAAqB,CAAC;AACnC,CAAC,MAAM;EACN6D,SAAS,CAAC,CAAC;AACZ,C","file":"JavaScriptLoader.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/views/Common/JavaScriptLoader.js\");\n","/* eslint-disable no-console */\r\n//https://javascript.info/script-async-defer\r\n//https://javascript.info/onload-ondomcontentloaded\r\nconsole.log('jsScriptLoader start');\r\nwindow.Launchpad.deferJsTimer = window.Launchpad.deferJsTimer || 2750; // defaults to 2750\r\n\r\nfunction loadScript(url, callback) {\r\n\tlet script = document.createElement('script');\r\n\tscript.type = 'text/javascript';\r\n\tscript.async = false;\r\n\tscript.defer = true;\r\n\tif (script.readyState) { // only required for IE <9\r\n\t\tscript.onreadystatechange = () => {\r\n\t\t\tif (script.readyState === 'loaded' || script.readyState === 'complete') {\r\n\t\t\t\tscript.onreadystatechange = null;\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t} else { //Others\r\n\t\tscript.onload = () => {\r\n\t\t\tif (callback) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\tscript.src = url;\r\n\tdocument.body.append(script);\r\n}\r\n\r\nfunction loadStyle(href) {\r\n\tlet link = document.createElement('link');\r\n\tlink.href = href;\r\n\tlink.type = 'text/css';\r\n\tlink.rel = 'stylesheet';\r\n\tlink.media = 'screen,print';\r\n\tdocument.getElementsByTagName('head')[0].appendChild(link);\r\n}\r\n\r\nfunction scriptListLoader() {\r\n\twindow.Launchpad.jsLoadList.forEach((x) => {\r\n\t\tloadScript(x.url, x.callback);\r\n\t});\r\n\r\n\tconsole.log('jsScriptLoader JS Loaded');\r\n\r\n\tlet gtmtrigger = document.createElement('div');\r\n\tgtmtrigger.innerHTML = ' ';\r\n\tgtmtrigger.id = 'gtmloadtrigger';\r\n\tgtmtrigger.className = 'gtmloadtrigger';\r\n\tdocument.getElementsByTagName('body')[0].prepend(gtmtrigger);\r\n}\r\n\r\nfunction handlePageBuilderObserver() {\r\n\tlet MutationObserver = window.MutationObserver || window.WebKitMutationObserver;\r\n\tlet obsConfig = { childList: true, characterData: true, attributes: true, subtree: true };\r\n\tlet targetNodes = document.getElementById('main');\r\n\tlet editableAreaCount = 0;\r\n\r\n\tlet myObserver = new MutationObserver((mutationRecords) => {\r\n\t\tmutationRecords.forEach((mutation) => {\r\n\t\t\tif (typeof mutation.addedNodes === 'object') {\r\n\t\t\t\tlet ktcEditableArea = mutation.target.classList.contains('ktc-editable-area');\r\n\t\t\t\tif (ktcEditableArea) {\r\n\t\t\t\t\teditableAreaCount += 1;\r\n\t\t\t\t\tlet targetLastChild = targetNodes.querySelector('.ktc-editable-area:last-child');\r\n\r\n\t\t\t\t\tif (mutation.target === targetLastChild || editableAreaCount === window.Launchpad.pageBuilderAreaCount) {\r\n\t\t\t\t\t\tscriptListLoader();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmyObserver.disconnect();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\tmyObserver.observe(targetNodes, obsConfig);\r\n}\r\n\r\nwindow.loadJS = true;\r\nfunction viewEvent(evt) {\r\n\tif (window.Launchpad.pageBuilderEditMode) {\r\n\t\thandlePageBuilderObserver();\r\n\t} else if (window.loadJS) {\r\n\t\twindow.loadJS = false;\r\n\t\tscriptListLoader();\t\t\r\n\t}\r\n}\r\n\r\nfunction deferJs() {\r\n\tconsole.log('jsScriptLoader loadscript_event');\r\n\tdocument.addEventListener('mousedown', viewEvent);\r\n\tdocument.addEventListener('mousemove', viewEvent);\r\n\tdocument.addEventListener('touchstart', viewEvent);\r\n\tdocument.addEventListener('scroll', viewEvent);\r\n\tdocument.addEventListener('keydown', viewEvent);\r\n\r\n\tsetTimeout(() => {\r\n\t\tconsole.log('jsScriptLoader timed js');\r\n\t\tviewEvent();\r\n\t}, window.Launchpad.deferJsTimer);\r\n\t// 2.5 seconds is the period in which google includes its JS for page speed\r\n\t// increase to 2750 to ensure defer\r\n}\r\n\r\nfunction ready() {\r\n\tconsole.log('jsScriptLoader DOMContentLoaded');\r\n}\r\ndocument.addEventListener('DOMContentLoaded', ready);\t\t\r\n\r\nwindow.onload = () => { // can also use window.addEventListener('load', (event) => {\r\n\tconsole.log('jsScriptLoader onload');\r\n};\r\n\r\nif (window.Launchpad.deferJs) {\t\r\n\tif (window.Launchpad.deferJsType === 'DOMContentLoaded') {\t\r\n\t\tconsole.log('jsScriptLoader DeferJs DOMContentLoaded');\t\r\n\t\tdocument.addEventListener('DOMContentLoaded', deferJs);\t\t\r\n\t} else if (window.Launchpad.deferJsType === 'onload') {\r\n\t\twindow.onload = () => { // can also use window.addEventListener('load', (event) => {\r\n\t\t\tconsole.log('jsScriptLoader DeferJs onload');\r\n\t\t\tdeferJs();\r\n\t\t};\r\n\t} else {\r\n\t\tconsole.log('jsScriptLoader DeferJs default');\r\n\t\tdeferJs();\r\n\t}\r\n\tconsole.log('jsScriptLoader done');\r\n} else {\r\n\tviewEvent();\r\n}\r\n"],"sourceRoot":""}