MDL-68524 js: Add prefetch module
[moodle.git] / lib / amd / build / prefetch.min.js
1 define ("core/prefetch",["exports","core/config"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var g="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function c(a){return f(a)||e(a)||d()}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function e(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++){c[b]=a[b]}return c}}var h=!1,i=[],j={},k,l=function(){if(i){var d=i.slice();i=[];("function"==typeof g.define&&g.define.amd?new Promise(function(a,b){g.require(["core/templates"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&g.require&&"component"===g.require.loader?Promise.resolve(require(("core/templates"))):Promise.resolve(g["core/templates"])).then(function(a){return a.prefetchTemplates(d)}).catch()}var a=j;j={};var b=[];Object.keys(a).forEach(function(d){b.push.apply(b,c(a[d].map(function(a){return{component:d,key:a}})))});("function"==typeof g.define&&g.define.amd?new Promise(function(a,b){g.require(["core/str"],a,b)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&g.require&&"component"===g.require.loader?Promise.resolve(require(("core/str"))):Promise.resolve(g["core/str"])).then(function(a){return a.get_strings(b)}).catch()},m=function(){if(0>=b.default.jsrev){return}if(k){return}if(h){l();return}k=setTimeout(function(){h=!0;k=null;("function"==typeof g.define&&g.define.amd?new Promise(function(a,c){g.require([b.default.iconsystemmodule],a,c)}):"undefined"!=typeof module&&module.exports&&"undefined"!=typeof require||"undefined"!=typeof module&&module.component&&g.require&&"component"===g.require.loader?Promise.resolve(require((b.default.iconsystemmodule))):Promise.resolve(g[b.default.iconsystemmodule])).then(function(a){var b=new a;o(b.getTemplateName());return b}).then(function(a){l();a.init()}).catch()},500)},n=function(a){i=i.concat(a);m()},o=function(a){return n([a])},p=function(a,b){if(!j[a]){j[a]=[]}j[a]=j[a].concat(b);m()},q=function(a,b){if(!j[a]){j[a]=[]}j[a].push(b);m()};n([].concat(["core/loading"],["core/modal"],["core/modal_backdrop"]));p("core",["cancel","closebuttontitle","loading","savechanges"]);p("core_form",["showless","showmore"]);a.default={prefetchTemplate:o,prefetchTemplates:n,prefetchString:q,prefetchStrings:p};return a.default});
2 //# sourceMappingURL=prefetch.min.js.map