From e6ae30ad35a0edbb65df1a98c41562f883b5998c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20L=C3=BCth?= Date: Fri, 17 Apr 2020 02:02:26 +0200 Subject: [PATCH] utilize worker for xhr loading and JSON.parse, remove IE9/10 compatibility --- .eslintrc.json | 3 +- README.md | 64 ++++++++++---------- addon/handler/json.js | 23 +++++-- dist/cache/dispose.js | 2 +- dist/cache/states.js | 2 +- dist/cache/states.js.map | 2 +- dist/demand.js | 4 +- dist/demand.js.map | 2 +- dist/handler/css.js | 2 +- dist/handler/html.js | 2 +- dist/handler/json.js | 4 +- dist/handler/json.js.map | 2 +- dist/handler/legacy.js | 2 +- dist/handler/text.js | 2 +- dist/plugin/cookie.js | 2 +- dist/plugin/lzstring.js | 2 +- dist/plugin/sri.js | 2 +- package-lock.json | 105 ++++++++++++++++---------------- package.json | 4 +- src/abstract/handler.js | 8 +-- src/class/loader.js | 127 +++++++++++++++++++++++++-------------- src/class/task.js | 86 ++++++++++++++++++++++++++ src/class/xhr.js | 54 ----------------- src/demand.js | 4 +- src/function/defer.js | 69 ++++++--------------- src/shortcuts.js | 2 - src/validator/isArray.js | 5 +- 27 files changed, 315 insertions(+), 271 deletions(-) create mode 100644 src/class/task.js delete mode 100644 src/class/xhr.js diff --git a/.eslintrc.json b/.eslintrc.json index 27bda50..344440b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -29,7 +29,8 @@ }, "globals": { "demand": true, - "provide": true + "provide": true, + "ArrayBuffer": true }, "root": true } diff --git a/README.md b/README.md index 869b8f9..ef39075 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Qoopido.demand is a modular, flexible and 100% async JavaScript module loader with a promise like interface that utilizes localStorage as a caching layer. It comes in a rather tiny package of **~7kB minified and gzipped**. -Qoopido.demand originated from my daily use of require.js for the initial development of my Qoopido.nucleus library which is strictly atomic by nature, unbundled. +Qoopido.demand originated from my daily use of require.js for the initial development of my Qoopido.nucleus library which is strictly atomic by nature, unbundled. ## Key features in detail - promise like interface (no native promise support required) @@ -25,14 +25,16 @@ Qoopido.demand originated from my daily use of require.js for the initial develo ## Compatibility -Qoopido.demand is developed for Chrome, Firefox, Safari, Opera and IE9+. +Qoopido.demand is developed for Chrome, Firefox, Safari, Edge, Opera and IE11+. + +Active Support for IE9 and IE10 has been removed in Qoopido.demand 6.0.0 due to upcoming refactorings/cleanups and the lack of market share of these browsers today. Support for IE8 has been actively removed in Qoopido.demand 4.0.0 due to the lack of justifiable polyfills for parts of some underlying pattern. I do test on MacOS Sierra where Qoopido.demand is fully working on Chrome, Firefox, Safari and Opera. IE9, 10, 11 as well as Edge are testet on the official Microsoft VMs via VirtualBox. ## Requirements -Due to modules getting loaded via XHR/XDR a remote server has to have CORS enabled. Be assured that most of the usual CDNs have CORS enabled by default. +Due to modules getting loaded via XHR a remote server has to have CORS enabled. Be assured that most of the usual CDNs have CORS enabled by default. ## External dependencies None! @@ -68,9 +70,9 @@ The last parameter of the above code snippet is a configuration object. It just // enables or disables caching in general (when true/false) // optional, defaults to "true" cache: true, - + // fine grained cache control (when object) - // any path or part of a path can be set to true to + // any path or part of a path can be set to true to // activate caching or false to disable it. // The longest matching path wins over others. cache: { @@ -78,31 +80,31 @@ The last parameter of the above code snippet is a configuration object. It just '/app/': true, '/app/nocache': false }, - + // cache will be validated against version // optional, defaults to "undefined" version: '1.0.0', - + // cache will be validated against lifetime, if > 0 // optional, defaults to "0" // unit: seconds lifetime: 60, - + // sets the timeout for XHR requests // optional, defaults to "8" (limited to "2" up to "20") // unit: seconds - timeout: 8, - - // base path from where your relative + timeout: 8, + + // base path from where your relative // dependencies get loaded // optional, defaults to "/" base: '[path/url to your scripts]', - + // optional pattern: { '/nucleus': ['[path/url to Qoopido.nucleus]', '[fallback path/url to Qoopido.nucleus]'], '/app': '[path/url to your modules]', - // just an example, loading jQuery + bundle + // just an example, loading jQuery + bundle // will not work due to the nature of jQuery '/jquery': '//cdn.jsdelivr.net/jquery/2.1.4/jquery.min', '/jquery+ui': '//cdn.jsdelivr.net/g/jquery@2.1.4,jquery.ui@1.11.4' @@ -138,22 +140,22 @@ The last parameter of the above code snippet is a configuration object. It just '/nucleus/': function(dependencies) { var fragments = [], i = 0, dependency; - + for(; (dependency = dependencies[i]); i++) { fragments.push(dependency.id.replace(/^\/nucleus\//, '') + '.js'); } - + return '//cdn.jsdelivr.net/g/qoopido.nucleus@2.0.1(' + fragments.join('+') + ')'; }, // handle creation of auto-bundle URL for your modules from your server '/app/': function(dependencies) { var fragments = [], i = 0, dependency; - + for(; (dependency = dependencies[i]); i++) { fragments.push(dependency.id.replace(/^\/js\//, '') + '.js'); } - + return '/genie/?module[]=' + fragments.join('&module[]='); } } @@ -177,10 +179,10 @@ The demanded ```main``` module from the above script might look like the followi modules: { } }); - + return true; // just return true if there really is nothing to return } - + provide([ 'demand', 'provide' ], definition); }(this)); ``` @@ -270,7 +272,7 @@ As any parameter that is part of the path declaration is optional you gain total Qoopido.demand's original idea was (and still is) to not need a server-side built-process to pre-compile static bundles but to directly load any module required on demand. This decision really embraces new technologies like HTTP/2 that do not establish a new connection for each single request but instead are able to handle all requests with a single connection. While this is absolutely great HTTP/2 is not 100% supported by servers and clients yet and even if it is, requesting many assets may still slow down your perceived loading experience. - + To handle this Qoopido.demand has a built-in plugin called ```genie``` which can be configured to create auto-bundle requests for all direct dependencies of a module. To give you a more detailed example think about a module depending on ```/nucleus/dom/element```, ```/nucleus/dom/collection``` and ```/nucleus/component/sense```. If ```genie``` is enabled for paths prefixed with```/nucleus/``` it will determine if any of the dependencies are already loaded and if there are at least two left for any auto-bundle configured they will get loaded via a single request. @@ -279,7 +281,7 @@ So if none of the dependencies of the aforementioned example are yet loaded all **Sidenote** > CDNs like jsdelivr allow to request bundles already. A very simple PHP script is part of this repository and can be found under ```/genie/index.php``` (adjust the BASE path accordingly). To be able to adopt ```genie``` for any kind of bundle URL it uses a callback function which is explained in the section **Configuration**. - + ## Providing inline modules Beside demanding other modules you can as well provide your own, just like in the following example: @@ -324,7 +326,7 @@ In addition to inline modules you just need some minimal boilerplate code and an This example illustrates a module named ```/app/test``` which we already know as the first dependency of the prior example. As with the inline module the ```definition``` function will receive all dependencies as arguments passed so they are in scope of the actual module. -See these [gists](https://gist.github.com/search?utf8=%E2%9C%93&q=Qoopido.demand+user%3Adlueth&ref=searchresults) to find some skeletons for frequently used types of modules ;) +See these [gists](https://gist.github.com/search?utf8=%E2%9C%93&q=Qoopido.demand+user%3Adlueth&ref=searchresults) to find some skeletons for frequently used types of modules ;) ## Path resolution @@ -336,7 +338,7 @@ Absolute URLs starting either with a protocol or ```//``` will not get altered a As always resolving relative paths against ```base``` might not be desired and you would prefer or need a relative resolution demand provides three special dependencies: -Whenever you request ```demand```, ```provide``` or ```path``` as a dependency of a module your modules definition wil get passed a *localized* version of it. +Whenever you request ```demand```, ```provide``` or ```path``` as a dependency of a module your modules definition wil get passed a *localized* version of it. ```javascript (function(global) { @@ -347,12 +349,12 @@ Whenever you request ```demand```, ```provide``` or ```path``` as a dependency o demand('dependency').then( function() {} ); - + provide('module', function module() { }) }; } - + provide([ 'demand', 'provide', 'path' ], definition); }(this)); ``` @@ -362,13 +364,13 @@ If you load the above Module from e.g. the directory ```app/``` and name it ```m ## Available plugins Beside the above mentioned handlers ```demand``` offers a variety of plugins with different aims. Currently ```demand``` provides the following loadable plugins: - + - Cookie: store module cache states in cookies to exchange cache states with the server - LZString: compress/decompress localStorage content to safe space - SRI: adds sub-resource-integrity checks when loading modules - + Plugins have to be loaded manually by simply demanding them. They can be configured via ```demand.configure``` just like the bundle handler mentioned above. ```cookie``` as well as ```lzstring``` use the same configuration theme while ```sri```works only slightly different: - + ```javascript (function(global) { 'use strict'; @@ -376,14 +378,14 @@ Plugins have to be loaded manually by simply demanding them. They can be configu demand.configure({ modules: { '/demand/plugin/cookie': { - // enable cookie plugin for modules + // enable cookie plugin for modules // starting with /app/ '/app/': true }, '/demand/plugin/lzstring': { // enable compression for all modules ... '': true, - // ... but disable it for modules + // ... but disable it for modules // starting with a certain path '/app/do/not/compress': false }, @@ -430,7 +432,7 @@ Demand also provides means to get information of the state of modules. Similar t // ... that could not be loaded/resolved demand.list.rejected(); - + // .. that where successfully loaded and resolved demand.list.resolved(); ``` diff --git a/addon/handler/json.js b/addon/handler/json.js index 92b8662..7b333a8 100644 --- a/addon/handler/json.js +++ b/addon/handler/json.js @@ -1,9 +1,16 @@ (function() { 'use strict'; - function definition(path, abstractHandler, isObject, merge) { + function definition(path, abstractHandler, Task, Failure, isObject, merge) { var regexMatchType = /^application\/json/, - settings = { suffix: '.json' }; + settings = { suffix: '.json' }, + parseJson = new Task(function(resolve, reject, source) { + try { + resolve(JSON.parse(source)); + } catch(error) { + reject(error); + } + }); demand .on('postConfigure:' + path, function(options) { @@ -30,14 +37,18 @@ } }, process: function(dependency) { - var data = JSON.parse(dependency.source); - - provide(function() { return data; }); + parseJson(dependency.source) + .then(function(data) { + provide(function() { return data; }); + }) + .catch(function() { + dependency.dfd.reject(new Failure('error parsing', dependency.path)); + }); } }; return new (HandlerJson.extends(abstractHandler)); } - provide([ 'path', '/demand/abstract/handler', '/demand/validator/isObject', '/demand/function/merge' ], definition); + provide([ 'path', '/demand/abstract/handler', '/demand/task', '/demand/failure', '/demand/validator/isObject', '/demand/function/merge' ], definition); }()); diff --git a/dist/cache/dispose.js b/dist/cache/dispose.js index 2aad715..a3923f6 100644 --- a/dist/cache/dispose.js +++ b/dist/cache/dispose.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["/demand/function/iterate","./states"],(function(e,c){function t(e,c){return e.accessedc.accessed?1:0}return function(e){var n,s=c();for(s.sort(t);e>0&&s.length;)e-=(n=s.shift()).size,demand.cache.clear(n.id)}}))}(); //# sourceMappingURL=dispose.js.map diff --git a/dist/cache/states.js b/dist/cache/states.js index d2e117a..60fc670 100644 --- a/dist/cache/states.js +++ b/dist/cache/states.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(e){"use strict";provide(["/demand/function/iterate"],(function(t){var n=new RegExp("^\\[demand\\]\\[(.+?)\\]\\[state\\]$"),a=/^(.+?),(\d+),(\d*),(.+?),(\d+)$/;function r(t){var r,i=t.match(n);i&&(r=function(t){var n,r=e.getItem(t);if(r&&(n=r.match(a)))return Array.prototype.slice.call(n,1)}("[demand]["+i[1]+"][state]"),this.push({id:i[1],version:r[0],size:parseInt(r[1],10),expires:r[2]?new Date(parseInt(r[2],10)):null,demand:r[3],accessed:new Date(parseInt(r[4],10))}))}return function(){return t(e,r,[])}}))}(localStorage); //# sourceMappingURL=states.js.map diff --git a/dist/cache/states.js.map b/dist/cache/states.js.map index 3d838df..7158b99 100644 --- a/dist/cache/states.js.map +++ b/dist/cache/states.js.map @@ -1 +1 @@ -{"version":3,"sources":["cache/states.js"],"names":["localStorage","provide","functionIterate","regexMatchState","RegExp","regexMatchProperties","filterStates","property","state","match","key","matches","getItem","Array","prototype","slice","call","getState","this","push","id","version","size","parseInt","expires","Date","demand","accessed"],"mappings":";CAAC,SAASA,GACT,aA4CAC,QAAQ,CAAE,6BA1CV,SAAoBC,GACnB,IAECC,EAAuB,IAAIC,OAAO,wCAClCC,EAAuB,kCAexB,SAASC,EAAaC,GACrB,IACCC,EADGC,EAAQF,EAASE,MAAMN,GAGxBM,IACFD,EAlBF,SAAkBE,GACjB,IACCC,EADGH,EAAQR,EAAaY,QAAQF,GAGjC,GAAGF,IAAUG,EAAUH,EAAMC,MAAMJ,IAClC,OAAOQ,MAAMC,UAAUC,MAAMC,KAAKL,EAAS,GAanCM,CARF,YAQkBR,EAAM,GARG,YAUjCS,KAAKC,KAAK,CACTC,GAAUX,EAAM,GAChBY,QAAUb,EAAM,GAChBc,KAAUC,SAASf,EAAM,GAAI,IAC7BgB,QAAUhB,EAAM,GAAK,IAAIiB,KAAKF,SAASf,EAAM,GAAI,KAAO,KACxDkB,OAAUlB,EAAM,GAChBmB,SAAU,IAAIF,KAAKF,SAASf,EAAM,GAAI,QAKzC,OAAO,WACN,OAAON,EAAgBF,EAAcM,EAAc,QAzCtD,CA8CEN","file":"states.js","sourcesContent":["(function(localStorage) {\n\t'use strict';\n\n\tfunction definition(functionIterate) {\n\t\tvar PREFIX = 'demand',\n\t\t\tSUFFIX = 'state',\n\t\t\tregexMatchState = new RegExp('^\\\\[' + PREFIX + '\\\\]\\\\[(.+?)\\\\]\\\\[' + SUFFIX + '\\\\]$'),\n\t\t\tregexMatchProperties = /^(.+?),(\\d+),(\\d*),(.+?),(\\d+)$/;\n\n\t\tfunction getState(key) {\n\t\t\tvar state = localStorage.getItem(key),\n\t\t\t\tmatches;\n\n\t\t\tif(state && (matches = state.match(regexMatchProperties))) {\n\t\t\t\treturn Array.prototype.slice.call(matches, 1);\n\t\t\t}\n\t\t}\n\n\t\tfunction getKey(id) {\n\t\t\treturn '[' + PREFIX + '][' + id + '][' + SUFFIX + ']';\n\t\t}\n\n\t\tfunction filterStates(property) {\n\t\t\tvar match = property.match(regexMatchState),\n\t\t\t\tstate;\n\n\t\t\tif(match) {\n\t\t\t\tstate = getState(getKey(match[1]));\n\n\t\t\t\tthis.push({\n\t\t\t\t\tid: match[1],\n\t\t\t\t\tversion: state[0],\n\t\t\t\t\tsize: parseInt(state[1], 10),\n\t\t\t\t\texpires: state[2] ? new Date(parseInt(state[2], 10)) : null,\n\t\t\t\t\tdemand: state[3],\n\t\t\t\t\taccessed: new Date(parseInt(state[4], 10))\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn function cacheStats() {\n\t\t\treturn functionIterate(localStorage, filterStates, []);\n\t\t};\n\t}\n\n\tprovide([ '/demand/function/iterate' ], definition);\n}(localStorage));\n"]} \ No newline at end of file +{"version":3,"sources":["cache/states.js"],"names":["localStorage","provide","functionIterate","regexMatchState","RegExp","regexMatchProperties","filterStates","property","state","match","key","matches","getItem","Array","prototype","slice","call","getState","this","push","id","version","size","parseInt","expires","Date","demand","accessed"],"mappings":";CAAC,SAASA,GACT,aA4CAC,QAAQ,CAAE,6BA1CV,SAAoBC,GACnB,IAECC,EAAuB,IAAIC,OAAO,wCAClCC,EAAuB,kCAexB,SAASC,EAAaC,GACrB,IACCC,EADGC,EAAQF,EAASE,MAAMN,GAGxBM,IACFD,EAlBF,SAAkBE,GACjB,IACCC,EADGH,EAAQR,EAAaY,QAAQF,GAGjC,GAAGF,IAAUG,EAAUH,EAAMC,MAAMJ,IAClC,OAAOQ,MAAMC,UAAUC,MAAMC,KAAKL,EAAS,GAanCM,CARF,YAQkBR,EAAM,GARxB,YAUNS,KAAKC,KAAK,CACTC,GAAUX,EAAM,GAChBY,QAAUb,EAAM,GAChBc,KAAUC,SAASf,EAAM,GAAI,IAC7BgB,QAAUhB,EAAM,GAAK,IAAIiB,KAAKF,SAASf,EAAM,GAAI,KAAO,KACxDkB,OAAUlB,EAAM,GAChBmB,SAAU,IAAIF,KAAKF,SAASf,EAAM,GAAI,QAKzC,OAAO,WACN,OAAON,EAAgBF,EAAcM,EAAc,QAzCtD,CA8CEN","file":"states.js","sourcesContent":["(function(localStorage) {\n\t'use strict';\n\n\tfunction definition(functionIterate) {\n\t\tvar PREFIX = 'demand',\n\t\t\tSUFFIX = 'state',\n\t\t\tregexMatchState = new RegExp('^\\\\[' + PREFIX + '\\\\]\\\\[(.+?)\\\\]\\\\[' + SUFFIX + '\\\\]$'),\n\t\t\tregexMatchProperties = /^(.+?),(\\d+),(\\d*),(.+?),(\\d+)$/;\n\n\t\tfunction getState(key) {\n\t\t\tvar state = localStorage.getItem(key),\n\t\t\t\tmatches;\n\n\t\t\tif(state && (matches = state.match(regexMatchProperties))) {\n\t\t\t\treturn Array.prototype.slice.call(matches, 1);\n\t\t\t}\n\t\t}\n\n\t\tfunction getKey(id) {\n\t\t\treturn '[' + PREFIX + '][' + id + '][' + SUFFIX + ']';\n\t\t}\n\n\t\tfunction filterStates(property) {\n\t\t\tvar match = property.match(regexMatchState),\n\t\t\t\tstate;\n\n\t\t\tif(match) {\n\t\t\t\tstate = getState(getKey(match[1]));\n\n\t\t\t\tthis.push({\n\t\t\t\t\tid: match[1],\n\t\t\t\t\tversion: state[0],\n\t\t\t\t\tsize: parseInt(state[1], 10),\n\t\t\t\t\texpires: state[2] ? new Date(parseInt(state[2], 10)) : null,\n\t\t\t\t\tdemand: state[3],\n\t\t\t\t\taccessed: new Date(parseInt(state[4], 10))\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn function cacheStats() {\n\t\t\treturn functionIterate(localStorage, filterStates, []);\n\t\t};\n\t}\n\n\tprovide([ '/demand/function/iterate' ], definition);\n}(localStorage));\n"]} \ No newline at end of file diff --git a/dist/demand.js b/dist/demand.js index 614f8d9..40754a8 100644 --- a/dist/demand.js +++ b/dist/demand.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ -!function(e,t,n){"use strict";var r,i,o,u,a=e.document,c="demand"in e&&e.demand,s={version:"1.0.0",cache:{},timeout:8e3,pattern:{},modules:{},handler:"module"},d=Array.prototype,l=d.slice,f=d.concat,h=Object,p=h.prototype.toString,v=h.create,m=h.defineProperty,g=h.getOwnPropertyNames,y=h.getOwnPropertyDescriptor,w=a.createElement("a");function x(e,t,n,r){return{__proto__:null,value:e,enumerable:!!r,configurable:!!n,writable:!!t}}function b(e,t){return typeof e===t}function j(e){return e&&b(e,"object")}function q(e){return b(e,"number")&&isFinite(e)&&Math.floor(e)===e&&e>=0}function R(e,t){return e instanceof t}!function(t){function n(e,t,n,r,i){m(this,e,new x(t,n,r,i))}function r(e){for(var t,n=this.prototype,r=g(n),i={constructor:new x(this,!0,!0)},o=0;(t=r[o])&&!i[t];o++)i[t]=y(n,t);try{this.prototype=v(e.prototype||e,i)}catch(e){}if(this.prototype===n)throw new TypeError("Unable to extend, prototype is not writable");return this}n.call(Object.prototype,"define",n),n.call(e.Object.prototype,"define",n),Function.prototype.define("extends",r),e.Function.prototype.define("extends",r)}();var k,E=(k=/^\bv?(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b$/i,function(e){return b(e,"string")&&k.test(e)});function P(e,t,n){for(var r,i=h.keys(e),o=0;void 0!==(r=i[o])&&!1!==t.call(n,r,e[r]);o++);return n}var C,M,S,O,A=function(){function e(e,t){var n,r=this[e];void 0!==t&&(j(t)?(n=j(r),r=void 0!==t.length?n&&void 0!==r.length?r:[]:n&&void 0===r.length?r:{},this[e]=A(r,t)):this[e]=t)}return function(){for(var t,n=arguments[0],r=1;void 0!==(t=arguments[r]);r++)P(t,e,n);return n}}(),$=function(){var e=new RegExp("[xy]","g");function t(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(e,t)}}(),I=(O="setImmediate"in e,"MutationObserver"in e?function(e){C=a.createElement("div"),new MutationObserver((function(){e()})).observe(C,{attributes:!0}),C.setAttribute("i","1")}:!O&&"postMessage"in e&&!("importScripts"in e)&&"addEventListener"in e?(S={},e.addEventListener("message",(function(t){var n;t.source===e&&t.data&&(n=S[t.data])&&(n(),delete S[t.data])}),!1),function(t){var n=$();S[n]=t,e.postMessage(n,"*")}):!O&&"onreadystatechange"in(C=a.createElement("script"))?function(e){C.onreadystatechange=function(){C.onreadystatechange=null,C.parentNode.removeChild(C),e()},a.body.appendChild(C)}:(M=O?setImmediate:t,function(e){M(e)}));function T(e,t,n){return l.call(e,t,n)}var D=function(){var e=/^cache(Miss|Hit|Clear|Exceed)|queue(En|De)queue|(pre|post)(Resolve|Configure|Request|Process|Cache)|provide|reject$/,t={};function n(n,r,i){var o,u;if(b(r,"string")&&b(i,"function"))for(r=r.split(" ");o=r.shift();)o=o.split(":"),e.test(o[0])&&((t[o[0]]||(t[o[0]]={on:[],after:[]}))[n].push({callback:i,filter:o[1]}),"on"===n&&"postConfigure"===o[0]&&(u=s.modules[o[1]])&&i(u))}function r(){}return r.prototype={emit:function(e,n){var r,i,o,u=t[e];if(u){for(r=T(arguments,2),i=0;o=u.on[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r);for(i=0;o=u.after[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r)}return this},on:function(e,t){return n("on",e,t),this},after:function(e,t){return n("after",e,t),this}},new r}(),H="WeakMap"in e&&!("ActiveXObject"in e)?e.WeakMap:function(){function e(e,t){var n;if((n=t[e.id])&&n[0]===t)return n}function t(){this.define("id","weakmap-"+$())}return t.prototype={set:function(t,n){var r=e(this,t);return r?r[1]=n:t.define(this.id,[t,n]),this},get:function(t){var n=e(this,t);if(n)return n[1]},delete:function(t){var n=e(this,t);n&&(n.length=0,delete t[this.id])},has:function(t){return!!e(this,t)}},t}();function N(){return b(this.uuid,"undefined")&&this.define("uuid",$()),this}var L=function(){var e=new H;function t(){var t=N.call(this);return e.set(t,[]),t}return t.prototype={enqueue:function(){var t=T(arguments);e.set(this,e.get(this).concat(t)),D.emit("queueEnqueue",this.uuid,t)},dequeue:function(){var t=e.get(this).shift();return D.emit("queueDequeue",this.uuid,t),t},get current(){return e.get(this)[0]},get length(){return e.get(this).length}},t.extends(N)}(),z=function(){var r,i="object"==typeof e.safari&&e.safari.pushNotification?"beforeunload":"visibilitychange",o=e.requestIdleCallback||function(e,n){var r=+new Date;return t((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(+new Date-r))}})}),n&&n.timeout)},u=e.cancelIdleCallback||function(e){n(e)},c=new L;function s(){c.dequeue()(),r=c.length&&o(s)}return e.addEventListener(i,(function(e){var t;if(c.length&&("visibilitychange"!==e.type||"hidden"===a.visibilityState)){r=u(r);do{t&&t()}while(t=c.dequeue())}}),!0),function(e,t){c.enqueue(e),!r&&c.length&&(r=o(s,{timeout:t}))}}();function X(){return+new Date}var _,F=(_=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,function(e){return e.replace(_,"\\$&")});function U(e){return w.href=e,w.href}var W=/^(http(s?):)?\/\//i,B=/^\//,G=/((?:\/\/|\/\*)#)\s*(sourceMappingURL)\s*=\s*(?!(?:http[s]?:)?\/\/)(.+?)\.map(?:\s+)?(\*\/)?/g,J=new RegExp("^"+F(U("/"))),K=new RegExp("^demand|provide|path$"),Q=/^(mock:)?([+-])?((?:[-\w]+\/?)+)?(?:@(.+?))?(?:#(\d+))?!/;function V(e,t){var n=e.replace(Q,"");return B.test(n)||W.test(n)||(n="/"+U((t&&U(t+"/../")||"/")+n).replace(J,"")),n}function Y(e,t){var n=e.match(Q);return(n&&n[1]?"mock:":"")+(n&&n[3]||s.handler)+"!"+V(e,t)}var Z=function(){function e(e,t){return et?1:0}function t(e){if(!E(e))throw new TypeError('"version" must be a valid semver version string');e=function(e){var t,n=e.split("-"),r=0;for(n=n[1]?Array.prototype.concat(n[0].split("."),n[1].split(".")):n[0].split(".");t=n[r];r++)n[r]=parseInt(t,10).toString()===t?parseInt(t,10):t;return n}(e),this.major=e.shift(),this.minor=e.shift(),this.patch=e.shift(),this.identifier=e}return t.prototype={toString:function(){return this.major+"."+this.minor+"."+this.patch+(this.identifier.length?"-"+this.identifier.join("."):"")},compare:function(t){return e(this.major,t.major)||e(this.minor,t.minor)||e(this.patch,t.patch)||function(e,t){var n,r,i,o,u=0;if(e.length&&!t.length)return-1;if(!e.length&&t.length)return 1;if(!e.length&&!t.length)return 0;do{if(n=e[u],o=typeof(r=t[u]),"undefined"==(i=typeof n)&&"undefined"===o)return 0;if("undefined"===o)return 1;if("undefined"===i)return-1;if(n===r);else{if("string"===i&&"string"!==o)return 1;if("string"!==i&&"string"===o)return-1;if(n>r)return 1;if(nt.weight)&&(t=r)})),!!t&&t.state)}function l(e){return u.getItem(e)}function f(e,t){u[t?"setItem":"removeItem"](e,t)}function h(e){var t,n=l(e);if(n&&(t=n.match(i)))return T(t,1)}function p(e,t){t[4]=X(),f(e,t.join(","))}function v(e,t,n){D.emit(e,t.id,t,n)}function m(){z(this.clear.expired.bind(this.clear),s.delay)}return D.on("cacheMiss",(function(e){z((function(){t.clear(e.id)}))})).on("cacheExceed",(function(e){r("-!/demand/cache/dispose").then((function(n){z((function(){n(e.source.length),t.set(e)}),s.delay)}))})).on("postRequest",(function(e){e.source&&d(e)&&(c[e.id]=!0)})).after("postProcess",(function(e){c[e.id]&&z((function(){t.set(e)}),s.delay)})),m.prototype={get:o?function(e){var t,n;if(d(e)){if(t="[demand]["+e.id+"]",!(n=h(t+"[state]")))return;return 1===e.version.compare(new Z(n[0]))||n[2]&&e.lifetime&&n[2]<=X()?void(e.invalid=!0):(e.source=l(t+"[value]"),z((function(){p(t+"[state]",n)}),s.delay),!0)}}:function(){},resolve:o?function(e){this.get(e)?v("cacheHit",e):v("cacheMiss",e)}:function(e){v("cacheMiss",e)},set:o?function(e){var t,n,i;if(d(e)){t=[e.version,e.source.length,e.lifetime?X()+e.lifetime:null,r.version],n="[demand]["+e.id+"]",v("preCache",e,t);try{if(i=a?u.remainingSpace:null,f(n+"[value]",e.source),p(n+"[state]",t),null!==i&&u.remainingSpace===i)throw new Error;v("postCache",e,t)}catch(t){v("cacheExceed",e)}}}:function(){},clear:o?function(e){var t=Y(e),n="[demand]["+t+"]";l(n+"[state]")&&(f(n+"[state]"),f(n+"[value]"),v("cacheClear",ie.get(t)||new ie(t,null,!1)))}:function(){}},m.prototype.clear.all=o?function(){var e;P(u,(function(t){(e=t.match(n))&&this(e[1])}),this)}:function(){},m.prototype.clear.expired=o?function(){var e,t;P(u,(function(r){(e=r.match(n))&&(t=h("[demand]["+e[1]+"][state]"))&&t[2]>0&&t[2]<=X()&&this(e[1])}),this)}:function(){},t=new m}(),te=function(){var e=new H;function t(){e.get(this).handle("resolved",arguments)}function n(){e.get(this).handle("rejected",arguments)}function r(t,n){var r,i,o=e.get(this);for("pending"===o.state&&(o.state=t,o.value=n);r=o[o.state].shift();)try{if((i=r.handler.apply(null,o.value))&&"function"==typeof i.then){i.then(r.dfd.resolve,r.dfd.reject);continue}if("undefined"==typeof i){r.dfd["resolved"===o.state?"resolve":"reject"].apply(null,o.value);continue}r.dfd.resolve(i)}catch(e){r.dfd.reject(e)}o.resolved.length=0,o.rejected.length=0}function i(e,t,n){e.then((function(){n.resolved[t]=T(arguments),n.count++,o(n)}),(function(){n.rejected.push(T(arguments)),o(n)}))}function o(e){e.count===e.total?e.dfd.resolve.apply(null,f.apply([],e.resolved)):e.rejected.length+e.count===e.total&&e.dfd.reject.apply(null,f.apply([],e.rejected))}function u(i){return e.set(this,{state:"pending",handle:r.bind(this),value:null,resolved:[],rejected:[],count:0}),i(t.bind(this),n.bind(this)),this}return u.prototype={catch:function(e){return this.then(void 0,(function(){var t,n=u.defer();try{(t=e.apply(null,arguments))&&"function"==typeof t.then?t.then(n.resolve,n.reject):n.resolve(t)}catch(e){n.reject(e)}return n.pledge}))},always:function(e){return this.then(e,(function(){var t,n=u.defer();try{(t=e.apply(null,arguments))&&"function"==typeof t.then?t.then(n.resolve,n.reject):n.reject.apply(null,arguments)}catch(e){n.reject(e)}return n.pledge}))},then:function(t,n){var r=e.get(this),i=u.defer();return r.resolved.push({handler:t||function(){return u.resolve.apply(null,arguments)},dfd:i}),r.rejected.push({handler:n||function(){return u.reject.apply(null,arguments)},dfd:i}),"pending"!==r.state&&I(r.handle),i.pledge},isPending:function(){return"pending"===e.get(this).state},isResolved:function(){return"resolved"===e.get(this).state},isRejected:function(){return"rejected"===e.get(this).state}},u.prototype.finally=u.prototype.always,u.defer=function(){var e={};return e.pledge=new u((function(t,n){e.resolve=t,e.reject=n})),e},u.all=function(e){var t,n,r=u.defer(),o=0;if(e.length)for(t={dfd:r,resolved:[],rejected:[],total:e.length,count:0};n=e[o];o++)i(n,o,t);else r.resolve();return r.pledge},u.race=function(e){for(var t,n=u.defer(),r=0;t=e[r];r++)t.then(n.resolve,n.reject);return e.length||n.resolve(),n.pledge},u.resolve=function(){var e=u.defer();return e.resolve.apply(null,arguments),e.pledge},u.reject=function(){var e=u.defer();return e.reject.apply(null,arguments),e.pledge},u}(),ne=function(){var e=new H;function t(){e.set(this,{})}return t.prototype={get:function(t){return t?e.get(this)[t]:e.get(this)},set:function(t,n){e.get(this)[t]=n},remove:function(t){delete e.get(this)[t]}},t}();function re(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=T(n)),this}re.prototype={toString:function(){var e="demand: "+this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=re.traverse(this.stack,e,1)),e}},re.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=re.traverse(r.stack,t,n+1));return t};var ie=function(){var e=new ne,t=/^(?:mock:|internal!)/i,n=[];function o(e,t){this[e]=t}function u(e){t.test(e)||this.push(e)}function c(e,n){!t.test(e)&&n.pledge.isPending()&&this.push(e)}function d(e,n){!t.test(e)&&n.pledge.isResolved()&&this.push(e)}function l(e,n){!t.test(e)&&n.pledge.isRejected()&&this.push(e)}function f(){return P(e.get(),u,[])}function h(t,r,i){var o=this,u=t.match(Q)||n;return o.path=V(t,r),o.mock=!!u[1],o.cache=u[2]?"+"===u[1]:null,o.type=u[3]||s.handler,o.version=new Z(u[4]||s.version),o.lifetime=u[5]&&1e3*u[5]||s.lifetime,o.id=(o.mock?"mock:":"")+o.type+"!"+o.path,o.uri=(o.mock?"mock:":"")+o.type+"@"+o.version+(q(o.lifetime)&&o.lifetime>0?"#"+o.lifetime:"")+"!"+o.path,o.dfd=te.defer(),o.pledge=o.dfd.pledge,o.invalid=!1,o.pledge.then((function(){o.value=T(arguments)})),!1!==i&&e.set(o.id,o),o}return f.pending=function(){return P(e.get(),c,[])},f.resolved=function(){return P(e.get(),d,[])},f.rejected=function(){return P(e.get(),l,[])},h.prototype={enqueue:!0},h.get=function(t,n){return e.get(Y(t,n))},h.resolve=function(e,t){var n,u=t&&K.test(e),a=u?this.get("internal!"+t+"/"+e):this.get(e,t);if(!a)if(u){switch(a=new h("internal!"+t+"/"+e),e){case"demand":n=P(r,o,r.bind(t));break;case"provide":n=i.bind(t);break;case"path":n=t}a.dfd.resolve(n)}else a=new h(e,t),r("/demand/handler/"+a.type).then((function(e){a.handler=e,a.mock?a.dfd.resolve(e):ee.resolve(a)}),(function(){a.dfd.reject(new re("error loading (handler)",self.id))}));return a},h.remove=function(t,n,r){var i=Y(t,n),o=a.querySelector('[demand-id="'+i+'"]');e.remove(i),e.remove("mock:"+i),o&&o.parentNode.removeChild(o),!1!==r&&ee.clear(i)},h.list=f,h}(),oe=function(){var e=/(.+)\/$/;function t(t,n){this[t]={url:U(n).replace(e,"$1"),match:new RegExp("^"+F(n))}}function n(e,n){this.weight=e.length,this.match=new RegExp("^"+F(e)),this.location=[].concat(n),P(this.location,t,this.location)}return n.prototype={matches:function(e){return this.match.test(e)},process:function(e,t){var n=this.location[t];if(n)return e.replace(this.match,n.url)}},n}(),ue=function(r){var i="XDomainRequest"in e&&e.XDomainRequest||r;function o(){this.readyState<4&&this.abort()}return function(e){var u,a=te.defer(),c=J.test(e)?new r:new i,d=o.bind(c),l=s.timeout;return c.ontimeout=c.onerror=c.onabort=function(){a.reject(c.status)},c.onprogress=c.onreadystatechange=function(){n(u),u=t(d,l)},c.onload=function(){u=n(u),"status"in c&&200!==c.status?a.reject(c.status):a.resolve(c.responseText,c.getResponseHeader&&c.getResponseHeader("content-type"))},c.open("GET",e,!0),c.send(),u=t(d,l),a.pledge}}(XMLHttpRequest);function ae(e){var t,n=/^(?:\?|)$/;function r(t,n){n&&e.handler.validate&&!e.handler.validate(n)?e.dfd.reject(new re("error loading (content-type)",e.id)):(e.source=t,D.emit("postRequest",e.type,e))}function i(t){e.dfd.reject(new re("error loading"+(t?" (status)":""),e.id))}W.test(e.path)||P(s.pattern,(function(n,r){r.matches(e.path)&&(!t||t.weight>>0}r=function(){function t(e,t){this[e]={weight:e.length,state:t}}function n(e,t){"base"!==e&&(this[e]=new oe(e,t))}function r(e,t){var n=this[e]=this[e]||{};D.emit("preConfigure",e,n),A(n,t),D.emit("postConfigure",e,n)}function i(){var t,n,r=T(arguments),i=this!==e?this:null,o=0;for(D.emit("preResolve",null,r,i);t=r[o];o++)b(t,"string")?r[o]=ie.resolve(t,i).pledge:(r[o]=(n=te.defer()).pledge,n.resolve(t));return(r.length>1?te.all(r):r[0]).always((function(){D.emit("postResolve",null,r,i)}))}return i.configure=function(e){var o=e.cache,u=e.version,a=e.delay,c=e.timeout,d=e.lifetime,l=e.base,f=e.pattern,h=e.modules,p=s.modules;return b(o,"boolean")?s.cache[""]={weight:0,state:o}:j(o)&&P(o,t,s.cache),E(u)&&(s.version=u),q(a)&&(s.delay=1e3*a),q(c)&&(s.timeout=1e3*Math.min(Math.max(c,2),20)),q(d)&&d>0&&(s.lifetime=1e3*d),b(l,"string")&&""!==l&&(s.pattern.base=new oe("",l)),j(f)&&P(f,n,s.pattern),j(h)&&P(h,r,p),i},i.version="5.3.1",i.on=D.on.bind(i),i.get=function(e,t){var n=ie.get(e,t);return n&&n.value},i.list=ie.list,i.remove=ie.remove,i.cache={clear:ee.clear},D.after("cacheMiss",(function(e){new ae(e)})).after("postRequest",(function(e){var t=e.handler.onPostRequest;t&&t(e)})).after("cacheHit postRequest",(function(e){D.emit("preProcess",e.id,e)})).after("preRequest",(function(e){var t=e.handler.onPreRequest;t&&t(e)})).after("preProcess",(function(e){var t=e.handler.onPreProcess;t&&t(e),e.pledge.then((function(){D.emit("postProcess",e.id,e)})),!0===e.enqueue?o.enqueue(e):R(e.enqueue,te)&&e.enqueue.then((function(){o.enqueue(e)}))})),i}(),e.define("demand",r),i=function(){var t,n,i,o=b(arguments[0],"string")?arguments[0]:null,a=this!==e?this:null,c=ce(arguments[o?1:0])?arguments[o?1:0]:null,s=c?arguments[o?2:1]:arguments[o?1:0];if(!o&&u.current&&(o=(t=u.current).uri,u.process()),o)return t=t||new ie(o,a),n=R(s,te),i=b(s,"function"),c?r.apply(t.path,c).then((function(){t.dfd.resolve(i?s.apply(null,arguments):s)}),(function(){t.dfd.reject(new re("error providing",t.id,arguments))})):n?s.then(t.dfd.resolve,t.dfd.reject):t.dfd.resolve(i?s():s),t.dfd.pledge.then((function(){D.emit("provide",t.path,t)}),(function(){D.emit("reject",t.path,t)})),t.dfd.pledge;!b(console,"undefined")&&console.error(new re("unspecified anonymous provide"))},e.define("provide",i),r.configure({cache:!0,base:"/",pattern:{"/demand":U((c&&c.url||location.href)+"/../").slice(0,-1)}}),c&&c.settings&&r.configure(c.settings);var de=function(){var e=new H;function t(t){var n=this,i={queue:t,current:null};e.set(n,i),r.on("queueEnqueue:"+t.uuid,(function(){!i.current&&n.process()}))}return t.prototype={process:function(){var t,n=e.get(this);!n.queue.length||(t=n.current=n.queue.dequeue()).pledge.isRejected()?n.current=null:t.handler.process&&t.handler.process(t)},get current(){return e.get(this).current}},t}();function le(e,t){for(var n,r;n=G.exec(t);)w.href=e,W.test(n[2])?r=w.protocol+"//"+w.host+n[3]:(w.pathname+="/../"+n[3],r=w.protocol+"//"+w.host+w.pathname),t=t.replace(n[0],n[1]+" "+n[2]+"="+r+".map"+(n[4]?" "+n[4]:""));return t}function fe(){}fe.prototype={validate:null,onPreRequest:null,onPostRequest:null,onPreProcess:null,process:null};var he=function(){var e=a.getElementsByTagName("head")[0],t=/^(application|text)\/(x-)?javascript/,n={suffix:".js"};function i(){}return r.on("postConfigure:/demand/handler/module",(function(e){j(e)&&A(n,e)})),i.prototype={validate:function(e){return t.test(e)},onPreRequest:function(e,t){var r;(t="undefined"!=typeof t?t:n.suffix)&&(r=e.url.pathname,e.url.pathname=r.slice(-t.length)!==t?r+t:r)},onPostRequest:function(e){e.source=le(e.url,e.source)},process:function(t){var n;t.source&&((n=a.createElement("script")).async=!0,n.text=t.source,n.setAttribute("demand-id",t.id),e.appendChild(n))}},new(i.extends(fe))}();function re(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=T(n)),this}re.prototype={toString:function(){var e="demand: "+this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=re.traverse(this.stack,e,1)),e}},re.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=re.traverse(r.stack,t,n+1));return t};var pe=function(){var e={};function t(e,t){var n,r;for(n=0;r=t[n];n++)b(r,"string")&&(t[n]=Y(r))}function n(){}return r.on("postConfigure:/demand/handler/bundle",(function(n){j(n)&&P(e=n,t)})),n.prototype={validate:he.validate,onPreProcess:function(t){var n,r,i,u,a,c=t.source,s=t.dfd,d=e[t.path];function l(){s.reject(new re("error resolving",t.id,arguments))}if(t.enqueue=!1,d&&(n=function(t){for(var n,r,i=0;r=t[i];i++)if(r=(r=r.match(Q))&&r[3]||e.handler,n){if(r!==n)return!1}else n=r;return n}(d))){for(;r=G.exec(c);)c=c.replace(r[0],"");for(t.source=c,i=[],a=0;u=d[a];a++)i.push(ie.resolve("mock:"+u).pledge);te.all(i).then((function(){for(i.length=0,a=0;u=d[a];a++)(u=d[a]=ie.get(u)||new ie(u)).handler=arguments[a],i.push(u.pledge);"module"===n?(o.enqueue.apply(o,d),he.process(t)):(he.process(t),o.enqueue.apply(o,d)),te.all(i).then(s.resolve,l)}),l)}else l()}},new(n.extends(fe))}(),ve=function(){var e=/^text\/.+$/,t={suffix:".html"};function n(){}return r.on("postConfigure:/demand/handler/component",(function(e){j(e)&&A(t,e)})),n.prototype={validate:function(t){return e.test(t)},onPreRequest:function(e,n){var r;(n="undefined"!=typeof n?n:t.suffix)&&(r=e.url.pathname,e.url.pathname=r.slice(-n.length)!==n?r+n:r)},onPostRequest:function(e){e.source=le(e.url,e.source)},onPreProcess:function(e){var t,n,r,i,u=e.path,c=e.dfd,s=a.createElement("body"),d=[],l=[];function f(){c.reject(new re("error resolving",e.id,arguments))}for(e.enqueue=!1,s.innerHTML=e.source;t=s.firstElementChild;)(n=t.getAttribute("type"))&&(i=n+"!"+u+((r=t.getAttribute("path"))?"/"+r:""),t.parentNode.removeChild(t),d.push({source:t.textContent,uri:i}),l.push(ie.resolve("mock:"+i).pledge));te.all(l).then((function(){var t,n,r,i=[];for(l.length=0,t=0;n=d[t];t++)(r=ie.get(n.uri)||new ie(n.uri)).source=le(r.url,n.source),r.handler=arguments[t],i.push(r),l.push(r.pledge),o.enqueue(r);te.all(l).then((function(){var r=e.path.length+1,o={};for(t=0;n=arguments[t];t++)o[i[t].path.substr(r)||"main"]=n;c.resolve(o)}),f)}),f)}},new(n.extends(fe))}(),me=function(){var e="/demand/plugin/genie",t=[];function n(e){for(var n,r,i=0;n=t[i];i++)0===e.indexOf(n.prefix)&&(!r||n.weight>r.weight)&&(r=n);return r}function i(){for(var e,t=0;e=this[t];t++)e.dfd.resolve(arguments[t])}function o(){for(var e,t=0;e=this[t];t++)e.dfd.reject(new re("error resolving",e.id))}function u(e,n){t.push({prefix:e,weight:e.length,fn:n})}function a(t,n){var u,a=n.matches,c=0;if(a.length>1){for(n.id=e+"/"+se(JSON.stringify(n.matches));u=a[c];c++)a[c]=new ie(u.uri);r.configure(function(e){var t,n,r=e.matches,i={pattern:{},modules:{"/demand/handler/bundle":{}}},o=0;for(i.pattern[e.id]=e.fn(r),i.modules["/demand/handler/bundle"][e.id]=t=[];n=r[o];o++)t.push(n.path);return i}(n)),r("bundle!"+n.id).then(i.bind(a),o.bind(a))}}return r.on("postConfigure:"+e,(function(e){j(e)&&(t.length=0,P(e,u))})).on("preResolve",(function(e,t){for(var r,i,o={},u=0;r=e[u];u++)!b(r,"string")||K.test(r)||ie.get(r,t)||"module"===(r=new ie(r,t,!1)).type&&(i=n(r.path))&&!ee.get(r)&&(o[i.prefix]||(o[i.prefix]={fn:i.fn,matches:[]})).matches.push(r);P(o,a)})),!0}();function ge(e,t){i(e,(function(){return t}))}if(o=new L,u=new de(o),ge("/demand/abstract/uuid",N),ge("/demand/abstract/handler",fe),ge("/demand/handler/module",he),ge("/demand/handler/bundle",pe),ge("/demand/handler/component",ve),ge("/demand/plugin/genie",me),ge("/demand/validator/isTypeOf",b),ge("/demand/validator/isArray",ce),ge("/demand/validator/isObject",j),ge("/demand/validator/isInstanceOf",R),ge("/demand/validator/isSemver",E),ge("/demand/function/resolveUrl",U),ge("/demand/function/resolveSourcemaps",le),ge("/demand/function/merge",A),ge("/demand/function/iterate",P),ge("/demand/function/hash",se),ge("/demand/function/defer",I),ge("/demand/function/idle",z),ge("/demand/function/uuid",$),ge("/demand/weakmap",H),ge("/demand/descriptor",x),ge("/demand/pledge",te),ge("/demand/queue",L),ge("/demand/xhr",ue),ge("/demand/failure",re),ge("/demand/semver",Z),c&&c.main)switch(typeof c.main){case"string":r(c.main);break;case"function":i("main",c.main())}}("demand-loader"===this.name?parent:this,setTimeout,clearTimeout); +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +!function(e,t,n){"use strict";var r,i,o,u,a=e.document,s="demand"in e&&e.demand,c={version:"1.0.0",cache:{},timeout:8e3,pattern:{},modules:{},handler:"module"},l=Array.prototype,f=l.slice,d=l.concat,h=Object,p=h.create,v=h.defineProperty,m=h.getOwnPropertyNames,g=h.getOwnPropertyDescriptor,y=a.createElement("a");function w(e,t,n,r){return{__proto__:null,value:e,enumerable:!!r,configurable:!!n,writable:!!t}}function x(e,t){return typeof e===t}function b(e){return e&&x(e,"object")}function j(e){return x(e,"number")&&isFinite(e)&&Math.floor(e)===e&&e>=0}function q(e,t){return e instanceof t}!function(t){function n(e,t,n,r,i){v(this,e,new w(t,n,r,i))}function r(e){for(var t,n=this.prototype,r=m(n),i={constructor:new w(this,!0,!0)},o=0;(t=r[o])&&!i[t];o++)i[t]=g(n,t);try{this.prototype=p(e.prototype||e,i)}catch(e){}if(this.prototype===n)throw new TypeError("Unable to extend, prototype is not writable");return this}n.call(Object.prototype,"define",n),n.call(e.Object.prototype,"define",n),Function.prototype.define("extends",r),e.Function.prototype.define("extends",r)}();var k,R=(k=/^\bv?(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b$/i,function(e){return x(e,"string")&&k.test(e)});function P(e,t,n){for(var r,i=h.keys(e),o=0;void 0!==(r=i[o])&&!1!==t.call(n,r,e[r]);o++);return n}var E,M,C=function(){function e(e,t){var n,r=this[e];void 0!==t&&(b(t)?(n=b(r),r=void 0!==t.length?n&&void 0!==r.length?r:[]:n&&void 0===r.length?r:{},this[e]=C(r,t)):this[e]=t)}return function(){for(var t,n=arguments[0],r=1;void 0!==(t=arguments[r]);r++)P(t,e,n);return n}}(),S=function(){var e=new RegExp("[xy]","g");function t(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(e,t)}}(),T="setImmediate"in e&&"function"==typeof e.setImmediate?e.setImmediate:"MutationObserver"in e&&"function"==typeof e.MutationObserver?(E={},M=a.createElement("div"),new MutationObserver((function(e){e.forEach((function(e){var t=e.attributeName.substr(1);E[t]&&E[t](),delete E[t]}))})).observe(M,{attributes:!0}),function(e){var t=S();E[t]=e,M.setAttribute("i"+t,1)}):t;function A(e,t,n){return f.call(e,t,n)}var O=function(){var e=/^cache(Miss|Hit|Clear|Exceed)|queue(En|De)queue|(pre|post)(Resolve|Configure|Request|Process|Cache)|provide|reject$/,t={};function n(n,r,i){var o,u;if(x(r,"string")&&x(i,"function"))for(r=r.split(" ");o=r.shift();)o=o.split(":"),e.test(o[0])&&((t[o[0]]||(t[o[0]]={on:[],after:[]}))[n].push({callback:i,filter:o[1]}),"on"===n&&"postConfigure"===o[0]&&(u=c.modules[o[1]])&&i(u))}function r(){}return r.prototype={emit:function(e,n){var r,i,o,u=t[e];if(u){for(r=A(arguments,2),i=0;o=u.on[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r);for(i=0;o=u.after[i];i++)o.filter&&o.filter!==n||o.callback.apply(null,r)}return this},on:function(e,t){return n("on",e,t),this},after:function(e,t){return n("after",e,t),this}},new r}(),$="WeakMap"in e&&!("ActiveXObject"in e)?e.WeakMap:function(){function e(e,t){var n;if((n=t[e.id])&&n[0]===t)return n}function t(){this.define("id","weakmap-"+S())}return t.prototype={set:function(t,n){var r=e(this,t);return r?r[1]=n:t.define(this.id,[t,n]),this},get:function(t){var n=e(this,t);if(n)return n[1]},delete:function(t){var n=e(this,t);n&&(n.length=0,delete t[this.id])},has:function(t){return!!e(this,t)}},t}();function I(){return x(this.uuid,"undefined")&&this.define("uuid",S()),this}var H=function(){var e=new $;function t(){var t=I.call(this);return e.set(t,[]),t}return t.prototype={enqueue:function(){var t=A(arguments);e.set(this,e.get(this).concat(t)),O.emit("queueEnqueue",this.uuid,t)},dequeue:function(){var t=e.get(this).shift();return O.emit("queueDequeue",this.uuid,t),t},get current(){return e.get(this)[0]},get length(){return e.get(this).length}},t.extends(I)}(),N=function(){var r,i="object"==typeof e.safari&&e.safari.pushNotification?"beforeunload":"visibilitychange",o=e.requestIdleCallback||function(e,n){var r=+new Date;return t((function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(+new Date-r))}})}),n&&n.timeout)},u=e.cancelIdleCallback||function(e){n(e)},s=new H;function c(){s.dequeue()(),r=s.length&&o(c)}return e.addEventListener(i,(function(e){var t;if(s.length&&("visibilitychange"!==e.type||"hidden"===a.visibilityState)){r=u(r);do{t&&t()}while(t=s.dequeue())}}),!0),function(e,t){s.enqueue(e),!r&&s.length&&(r=o(c,{timeout:t}))}}();function D(){return+new Date}var L,B=(L=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,function(e){return e.replace(L,"\\$&")});function U(e){return y.href=e,y.href}var z=/^(http(s?):)?\/\//i,_=/^\//,F=/((?:\/\/|\/\*)#)\s*(sourceMappingURL)\s*=\s*(?!(?:http[s]?:)?\/\/)(.+?)\.map(?:\s+)?(\*\/)?/g,W=new RegExp("^"+B(U("/"))),X=new RegExp("^demand|provide|path$"),G=/^(mock:)?([+-])?((?:[-\w]+\/?)+)?(?:@(.+?))?(?:#(\d+))?!/;function J(e,t){var n=e.replace(G,"");return _.test(n)||z.test(n)||(n="/"+U((t&&U(t+"/../")||"/")+n).replace(W,"")),n}function K(e,t){var n=e.match(G);return(n&&n[1]?"mock:":"")+(n&&n[3]||c.handler)+"!"+J(e,t)}var Q=function(){function e(e,t){return et?1:0}function t(e){if(!R(e))throw new TypeError('"version" must be a valid semver version string');e=function(e){var t,n=e.split("-"),r=0;for(n=n[1]?Array.prototype.concat(n[0].split("."),n[1].split(".")):n[0].split(".");t=n[r];r++)n[r]=parseInt(t,10).toString()===t?parseInt(t,10):t;return n}(e),this.major=e.shift(),this.minor=e.shift(),this.patch=e.shift(),this.identifier=e}return t.prototype={toString:function(){return this.major+"."+this.minor+"."+this.patch+(this.identifier.length?"-"+this.identifier.join("."):"")},compare:function(t){return e(this.major,t.major)||e(this.minor,t.minor)||e(this.patch,t.patch)||function(e,t){var n,r,i,o,u=0;if(e.length&&!t.length)return-1;if(!e.length&&t.length)return 1;if(!e.length&&!t.length)return 0;do{if(n=e[u],o=typeof(r=t[u]),"undefined"==(i=typeof n)&&"undefined"===o)return 0;if("undefined"===o)return 1;if("undefined"===i)return-1;if(n===r);else{if("string"===i&&"string"!==o)return 1;if("string"!==i&&"string"===o)return-1;if(n>r)return 1;if(nt.weight)&&(t=r)})),!!t&&t.state)}function f(e){return u.getItem(e)}function d(e,t){u[t?"setItem":"removeItem"](e,t)}function h(e){var t,n=f(e);if(n&&(t=n.match(i)))return A(t,1)}function p(e,t){t[4]=D(),d(e,t.join(","))}function v(e,t,n){O.emit(e,t.id,t,n)}function m(){N(this.clear.expired.bind(this.clear),c.delay)}return O.on("cacheMiss",(function(e){N((function(){t.clear(e.id)}))})).on("cacheExceed",(function(e){r("-!/demand/cache/dispose").then((function(n){N((function(){n(e.source.length),t.set(e)}),c.delay)}))})).on("postRequest",(function(e){e.source&&l(e)&&(s[e.id]=!0)})).after("postProcess",(function(e){s[e.id]&&N((function(){t.set(e)}),c.delay)})),m.prototype={get:o?function(e){var t,n;if(l(e)){if(t="[demand]["+e.id+"]",!(n=h(t+"[state]")))return;return 1===e.version.compare(new Q(n[0]))||n[2]&&e.lifetime&&n[2]<=D()?void(e.invalid=!0):(e.source=f(t+"[value]"),N((function(){p(t+"[state]",n)}),c.delay),!0)}}:function(){},resolve:o?function(e){this.get(e)?v("cacheHit",e):v("cacheMiss",e)}:function(e){v("cacheMiss",e)},set:o?function(e){var t,n,i;if(l(e)){t=[e.version,e.source.length,e.lifetime?D()+e.lifetime:null,r.version],n="[demand]["+e.id+"]",v("preCache",e,t);try{if(i=a?u.remainingSpace:null,d(n+"[value]",e.source),p(n+"[state]",t),null!==i&&u.remainingSpace===i)throw new Error;v("postCache",e,t)}catch(t){v("cacheExceed",e)}}}:function(){},clear:o?function(e){var t=K(e),n="[demand]["+t+"]";f(n+"[state]")&&(d(n+"[state]"),d(n+"[value]"),v("cacheClear",re.get(t)||new re(t,null,!1)))}:function(){}},m.prototype.clear.all=o?function(){var e;P(u,(function(t){(e=t.match(n))&&this(e[1])}),this)}:function(){},m.prototype.clear.expired=o?function(){var e,t;P(u,(function(r){(e=r.match(n))&&(t=h("[demand]["+e[1]+"][state]"))&&t[2]>0&&t[2]<=D()&&this(e[1])}),this)}:function(){},t=new m}(),Y=function(){var e=new $;function t(){e.get(this).handle("resolved",arguments)}function n(){e.get(this).handle("rejected",arguments)}function r(t,n){var r,i,o=e.get(this);for("pending"===o.state&&(o.state=t,o.value=n);r=o[o.state].shift();)try{if((i=r.handler.apply(null,o.value))&&"function"==typeof i.then){i.then(r.dfd.resolve,r.dfd.reject);continue}if("undefined"==typeof i){r.dfd["resolved"===o.state?"resolve":"reject"].apply(null,o.value);continue}r.dfd.resolve(i)}catch(e){r.dfd.reject(e)}o.resolved.length=0,o.rejected.length=0}function i(e,t,n){e.then((function(){n.resolved[t]=A(arguments),n.count++,o(n)}),(function(){n.rejected.push(A(arguments)),o(n)}))}function o(e){e.count===e.total?e.dfd.resolve.apply(null,d.apply([],e.resolved)):e.rejected.length+e.count===e.total&&e.dfd.reject.apply(null,d.apply([],e.rejected))}function u(i){return e.set(this,{state:"pending",handle:r.bind(this),value:null,resolved:[],rejected:[],count:0}),i(t.bind(this),n.bind(this)),this}return u.prototype={catch:function(e){return this.then(void 0,(function(){var t,n=u.defer();try{(t=e.apply(null,arguments))&&"function"==typeof t.then?t.then(n.resolve,n.reject):n.resolve(t)}catch(e){n.reject(e)}return n.pledge}))},always:function(e){return this.then(e,(function(){var t,n=u.defer();try{(t=e.apply(null,arguments))&&"function"==typeof t.then?t.then(n.resolve,n.reject):n.reject.apply(null,arguments)}catch(e){n.reject(e)}return n.pledge}))},then:function(t,n){var r=e.get(this),i=u.defer();return r.resolved.push({handler:t||function(){return u.resolve.apply(null,arguments)},dfd:i}),r.rejected.push({handler:n||function(){return u.reject.apply(null,arguments)},dfd:i}),"pending"!==r.state&&T(r.handle),i.pledge},isPending:function(){return"pending"===e.get(this).state},isResolved:function(){return"resolved"===e.get(this).state},isRejected:function(){return"rejected"===e.get(this).state}},u.prototype.finally=u.prototype.always,u.defer=function(){var e={};return e.pledge=new u((function(t,n){e.resolve=t,e.reject=n})),e},u.all=function(e){var t,n,r=u.defer(),o=0;if(e.length)for(t={dfd:r,resolved:[],rejected:[],total:e.length,count:0};n=e[o];o++)i(n,o,t);else r.resolve();return r.pledge},u.race=function(e){for(var t,n=u.defer(),r=0;t=e[r];r++)t.then(n.resolve,n.reject);return e.length||n.resolve(),n.pledge},u.resolve=function(){var e=u.defer();return e.resolve.apply(null,arguments),e.pledge},u.reject=function(){var e=u.defer();return e.reject.apply(null,arguments),e.pledge},u}(),Z=function(){var e=new $;function t(){e.set(this,{})}return t.prototype={get:function(t){return t?e.get(this)[t]:e.get(this)},set:function(t,n){e.get(this)[t]=n},remove:function(t){delete e.get(this)[t]}},t}();function ee(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=A(n)),this}ee.prototype={toString:function(){var e="demand: "+this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=ee.traverse(this.stack,e,1)),e}},ee.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=ee.traverse(r.stack,t,n+1));return t};var te,ne,re=function(){var e=new Z,t=/^(?:mock:|internal!)/i,n=[];function o(e,t){this[e]=t}function u(e){t.test(e)||this.push(e)}function s(e,n){!t.test(e)&&n.pledge.isPending()&&this.push(e)}function l(e,n){!t.test(e)&&n.pledge.isResolved()&&this.push(e)}function f(e,n){!t.test(e)&&n.pledge.isRejected()&&this.push(e)}function d(){return P(e.get(),u,[])}function h(t,r,i){var o=this,u=t.match(G)||n;return o.path=J(t,r),o.mock=!!u[1],o.cache=u[2]?"+"===u[1]:null,o.type=u[3]||c.handler,o.version=new Q(u[4]||c.version),o.lifetime=u[5]&&1e3*u[5]||c.lifetime,o.id=(o.mock?"mock:":"")+o.type+"!"+o.path,o.uri=(o.mock?"mock:":"")+o.type+"@"+o.version+(j(o.lifetime)&&o.lifetime>0?"#"+o.lifetime:"")+"!"+o.path,o.dfd=Y.defer(),o.pledge=o.dfd.pledge,o.invalid=!1,o.pledge.then((function(){o.value=A(arguments)})),!1!==i&&e.set(o.id,o),o}return d.pending=function(){return P(e.get(),s,[])},d.resolved=function(){return P(e.get(),l,[])},d.rejected=function(){return P(e.get(),f,[])},h.prototype={enqueue:!0},h.get=function(t,n){return e.get(K(t,n))},h.resolve=function(e,t){var n,u=t&&X.test(e),a=u?this.get("internal!"+t+"/"+e):this.get(e,t);if(!a)if(u){switch(a=new h("internal!"+t+"/"+e),e){case"demand":n=P(r,o,r.bind(t));break;case"provide":n=i.bind(t);break;case"path":n=t}a.dfd.resolve(n)}else a=new h(e,t),r("/demand/handler/"+a.type).then((function(e){a.handler=e,a.mock?a.dfd.resolve(e):V.resolve(a)}),(function(){a.dfd.reject(new ee("error loading (handler)",self.id))}));return a},h.remove=function(t,n,r){var i=K(t,n),o=a.querySelector('[demand-id="'+i+'"]');e.remove(i),e.remove("mock:"+i),o&&o.parentNode.removeChild(o),!1!==r&&V.clear(i)},h.list=d,h}(),ie=function(){var e=/(.+)\/$/;function t(t,n){this[t]={url:U(n).replace(e,"$1"),match:new RegExp("^"+B(n))}}function n(e,n){this.weight=e.length,this.match=new RegExp("^"+B(e)),this.location=[].concat(n),P(this.location,t,this.location)}return n.prototype={matches:function(e){return this.match.test(e)},process:function(e,t){var n=this.location[t];if(n)return e.replace(this.match,n.url)}},n}(),oe=function(){var e={};function t(e){return e instanceof ArrayBuffer||e instanceof MessagePort||"ImageBitmap"in self&&e instanceof ImageBitmap}return function(n){var r,i;return r="$task = "+n+"; $isTransferable = "+t+"; onmessage = "+function(e){var t,n=Array.prototype.slice,r=e.data;function i(e){t||(t=!0,postMessage([r[0],0,e.toString()]))}try{$task.apply($task,[function(){var e;t||(t=!0,e=n.call(arguments),postMessage([r[0],1,e],e.filter($isTransferable)))},i].concat(r[1]))}catch(e){i(e)}},(i=new Worker(URL.createObjectURL(new Blob([r],{type:"application/javascript"})))).onmessage=function(t){var n=t.data[0],r=n?e[n]:null;n&&r&&(t.data[1]?r.resolve.apply(null,t.data[2]):r.reject(t.data[2]),delete e[n])},function(){var n=Y.defer(),r=S(),o=A(arguments);return e[r]=n,i.postMessage([r,o],o.filter(t)),n.pledge}}}(),ue=(te=/^(?:\?|)$/,ne=new oe((function(e,t,n){var r,i,o=new XMLHttpRequest;r=function(){this.readyState<4&&this.abort()}.bind(o),o.ontimeout=o.onerror=o.onabort=function(){t(o.statusText)},o.onprogress=o.onreadystatechange=function(){self.clearTimeout(i),i=self.setTimeout(r,1e4)},o.onload=function(){i=self.clearTimeout(i),"status"in o&&200!==o.status?t(o.statusText):e(o.responseText,o.getResponseHeader&&o.getResponseHeader("content-type"))},o.open("GET",n,!0),o.send(),i=self.setTimeout(r,1e4)})),function(e){var t;function n(t,n){n&&e.handler.validate&&!e.handler.validate(n)?e.dfd.reject(new ee("error loading (content-type)",e.id)):(e.source=t,O.emit("postRequest",e.type,e))}z.test(e.path)||P(c.pattern,(function(n,r){r.matches(e.path)&&(!t||t.weight>>0}r=function(){function t(e,t){this[e]={weight:e.length,state:t}}function n(e,t){"base"!==e&&(this[e]=new ie(e,t))}function r(e,t){var n=this[e]=this[e]||{};O.emit("preConfigure",e,n),C(n,t),O.emit("postConfigure",e,n)}function i(){var t,n,r=A(arguments),i=this!==e?this:null,o=0;for(O.emit("preResolve",null,r,i);t=r[o];o++)x(t,"string")?r[o]=re.resolve(t,i).pledge:(r[o]=(n=Y.defer()).pledge,n.resolve(t));return(r.length>1?Y.all(r):r[0]).always((function(){O.emit("postResolve",null,r,i)}))}return i.configure=function(e){var o=e.cache,u=e.version,a=e.delay,s=e.timeout,l=e.lifetime,f=e.base,d=e.pattern,h=e.modules,p=c.modules;return x(o,"boolean")?c.cache[""]={weight:0,state:o}:b(o)&&P(o,t,c.cache),R(u)&&(c.version=u),j(a)&&(c.delay=1e3*a),j(s)&&(c.timeout=1e3*Math.min(Math.max(s,2),20)),j(l)&&l>0&&(c.lifetime=1e3*l),x(f,"string")&&""!==f&&(c.pattern.base=new ie("",f)),b(d)&&P(d,n,c.pattern),b(h)&&P(h,r,p),i},i.version="6.0.0",i.on=O.on.bind(i),i.get=function(e,t){var n=re.get(e,t);return n&&n.value},i.list=re.list,i.remove=re.remove,i.cache={clear:V.clear},O.after("cacheMiss",(function(e){new ue(e)})).after("postRequest",(function(e){var t=e.handler.onPostRequest;t&&t(e)})).after("cacheHit postRequest",(function(e){O.emit("preProcess",e.id,e)})).after("preRequest",(function(e){var t=e.handler.onPreRequest;t&&t(e)})).after("preProcess",(function(e){var t=e.handler.onPreProcess;t&&t(e),e.pledge.then((function(){O.emit("postProcess",e.id,e)})),!0===e.enqueue?o.enqueue(e):q(e.enqueue,Y)&&e.enqueue.then((function(){o.enqueue(e)}))})),i}(),e.define("demand",r),i=function(){var t,n,i,o=x(arguments[0],"string")?arguments[0]:null,a=this!==e?this:null,s=ae(arguments[o?1:0])?arguments[o?1:0]:null,c=s?arguments[o?2:1]:arguments[o?1:0];if(!o&&u.current&&(o=(t=u.current).uri,u.process()),o)return t=t||new re(o,a),n=q(c,Y),i=x(c,"function"),s?r.apply(t.path,s).then((function(){t.dfd.resolve(i?c.apply(null,arguments):c)}),(function(){t.dfd.reject(new ee("error providing",t.id,arguments))})):n?c.then(t.dfd.resolve,t.dfd.reject):t.dfd.resolve(i?c():c),t.dfd.pledge.then((function(){O.emit("provide",t.path,t)}),(function(){O.emit("reject",t.path,t)})),t.dfd.pledge;!x(console,"undefined")&&console.error(new ee("unspecified anonymous provide"))},e.define("provide",i),r.configure({cache:!0,base:"/",pattern:{"/demand":U((s&&s.url||location.href)+"/../").slice(0,-1)}}),s&&s.settings&&r.configure(s.settings);var ce=function(){var e=new $;function t(t){var n=this,i={queue:t,current:null};e.set(n,i),r.on("queueEnqueue:"+t.uuid,(function(){!i.current&&n.process()}))}return t.prototype={process:function(){var t,n=e.get(this);!n.queue.length||(t=n.current=n.queue.dequeue()).pledge.isRejected()?n.current=null:t.handler.process&&t.handler.process(t)},get current(){return e.get(this).current}},t}();function le(e,t){for(var n,r;n=F.exec(t);)y.href=e,z.test(n[2])?r=y.protocol+"//"+y.host+n[3]:(y.pathname+="/../"+n[3],r=y.protocol+"//"+y.host+y.pathname),t=t.replace(n[0],n[1]+" "+n[2]+"="+r+".map"+(n[4]?" "+n[4]:""));return t}function fe(){}fe.prototype={validate:null,onPreRequest:null,onPostRequest:null,onPreProcess:null,process:null};var de=function(){var e=a.getElementsByTagName("head")[0],t=/^(application|text)\/(x-)?javascript/,n={suffix:".js"};function i(){}return r.on("postConfigure:/demand/handler/module",(function(e){b(e)&&C(n,e)})),i.prototype={validate:function(e){return t.test(e)},onPreRequest:function(e,t){var r;(t="undefined"!=typeof t?t:n.suffix)&&(r=e.url.pathname,e.url.pathname=r.slice(-t.length)!==t?r+t:r)},onPostRequest:function(e){e.source=le(e.url,e.source)},process:function(t){var n;t.source&&((n=a.createElement("script")).async=!0,n.text=t.source,n.setAttribute("demand-id",t.id),e.appendChild(n))}},new(i.extends(fe))}();function ee(e,t,n){return this.message=e,t&&(this.module=t),n&&(this.stack=A(n)),this}ee.prototype={toString:function(){var e="demand: "+this.message+" "+(this.module?'"'+this.module+'"':"");return this.stack&&(e=ee.traverse(this.stack,e,1)),e}},ee.traverse=function(e,t,n){for(var r,i=new Array(n+1).join(" "),o=0;r=e[o];o++)t+="\n"+i+"> "+r.message+" "+(r.module?'"'+r.module+'"':""),r.stack&&(t=ee.traverse(r.stack,t,n+1));return t};var he=function(){var e={};function t(e,t){var n,r;for(n=0;r=t[n];n++)x(r,"string")&&(t[n]=K(r))}function n(){}return r.on("postConfigure:/demand/handler/bundle",(function(n){b(n)&&P(e=n,t)})),n.prototype={validate:de.validate,onPreProcess:function(t){var n,r,i,u,a,s=t.source,c=t.dfd,l=e[t.path];function f(){c.reject(new ee("error resolving",t.id,arguments))}if(t.enqueue=!1,l&&(n=function(t){for(var n,r,i=0;r=t[i];i++)if(r=(r=r.match(G))&&r[3]||e.handler,n){if(r!==n)return!1}else n=r;return n}(l))){for(;r=F.exec(s);)s=s.replace(r[0],"");for(t.source=s,i=[],a=0;u=l[a];a++)i.push(re.resolve("mock:"+u).pledge);Y.all(i).then((function(){for(i.length=0,a=0;u=l[a];a++)(u=l[a]=re.get(u)||new re(u)).handler=arguments[a],i.push(u.pledge);"module"===n?(o.enqueue.apply(o,l),de.process(t)):(de.process(t),o.enqueue.apply(o,l)),Y.all(i).then(c.resolve,f)}),f)}else f()}},new(n.extends(fe))}(),pe=function(){var e=/^text\/.+$/,t={suffix:".html"};function n(){}return r.on("postConfigure:/demand/handler/component",(function(e){b(e)&&C(t,e)})),n.prototype={validate:function(t){return e.test(t)},onPreRequest:function(e,n){var r;(n="undefined"!=typeof n?n:t.suffix)&&(r=e.url.pathname,e.url.pathname=r.slice(-n.length)!==n?r+n:r)},onPostRequest:function(e){e.source=le(e.url,e.source)},onPreProcess:function(e){var t,n,r,i,u=e.path,s=e.dfd,c=a.createElement("body"),l=[],f=[];function d(){s.reject(new ee("error resolving",e.id,arguments))}for(e.enqueue=!1,c.innerHTML=e.source;t=c.firstElementChild;)(n=t.getAttribute("type"))&&(i=n+"!"+u+((r=t.getAttribute("path"))?"/"+r:""),t.parentNode.removeChild(t),l.push({source:t.textContent,uri:i}),f.push(re.resolve("mock:"+i).pledge));Y.all(f).then((function(){var t,n,r,i=[];for(f.length=0,t=0;n=l[t];t++)(r=re.get(n.uri)||new re(n.uri)).source=le(r.url,n.source),r.handler=arguments[t],i.push(r),f.push(r.pledge),o.enqueue(r);Y.all(f).then((function(){var r=e.path.length+1,o={};for(t=0;n=arguments[t];t++)o[i[t].path.substr(r)||"main"]=n;s.resolve(o)}),d)}),d)}},new(n.extends(fe))}(),ve=function(){var e="/demand/plugin/genie",t=[];function n(e){for(var n,r,i=0;n=t[i];i++)0===e.indexOf(n.prefix)&&(!r||n.weight>r.weight)&&(r=n);return r}function i(){for(var e,t=0;e=this[t];t++)e.dfd.resolve(arguments[t])}function o(){for(var e,t=0;e=this[t];t++)e.dfd.reject(new ee("error resolving",e.id))}function u(e,n){t.push({prefix:e,weight:e.length,fn:n})}function a(t,n){var u,a=n.matches,s=0;if(a.length>1){for(n.id=e+"/"+se(JSON.stringify(n.matches));u=a[s];s++)a[s]=new re(u.uri);r.configure(function(e){var t,n,r=e.matches,i={pattern:{},modules:{"/demand/handler/bundle":{}}},o=0;for(i.pattern[e.id]=e.fn(r),i.modules["/demand/handler/bundle"][e.id]=t=[];n=r[o];o++)t.push(n.path);return i}(n)),r("bundle!"+n.id).then(i.bind(a),o.bind(a))}}return r.on("postConfigure:"+e,(function(e){b(e)&&(t.length=0,P(e,u))})).on("preResolve",(function(e,t){for(var r,i,o={},u=0;r=e[u];u++)!x(r,"string")||X.test(r)||re.get(r,t)||"module"===(r=new re(r,t,!1)).type&&(i=n(r.path))&&!V.get(r)&&(o[i.prefix]||(o[i.prefix]={fn:i.fn,matches:[]})).matches.push(r);P(o,a)})),!0}();function me(e,t){i(e,(function(){return t}))}if(o=new H,u=new ce(o),me("/demand/abstract/uuid",I),me("/demand/abstract/handler",fe),me("/demand/handler/module",de),me("/demand/handler/bundle",he),me("/demand/handler/component",pe),me("/demand/plugin/genie",ve),me("/demand/validator/isTypeOf",x),me("/demand/validator/isArray",ae),me("/demand/validator/isObject",b),me("/demand/validator/isInstanceOf",q),me("/demand/validator/isSemver",R),me("/demand/function/resolveUrl",U),me("/demand/function/resolveSourcemaps",le),me("/demand/function/merge",C),me("/demand/function/iterate",P),me("/demand/function/hash",se),me("/demand/function/defer",T),me("/demand/function/idle",N),me("/demand/function/uuid",S),me("/demand/function/toArray",A),me("/demand/task",oe),me("/demand/weakmap",$),me("/demand/descriptor",w),me("/demand/pledge",Y),me("/demand/queue",H),me("/demand/failure",ee),me("/demand/semver",Q),s&&s.main)switch(typeof s.main){case"string":r(s.main);break;case"function":i("main",s.main())}}("demand-loader"===this.name?parent:this,setTimeout,clearTimeout); //# sourceMappingURL=demand.js.map diff --git a/dist/demand.js.map b/dist/demand.js.map index 7ca1570..9051271 100644 --- a/dist/demand.js.map +++ b/dist/demand.js.map @@ -1 +1 @@ -{"version":3,"sources":["demand.js"],"names":["global","setTimeout","clearTimeout","demand","provide","queue","processor","document","options","settings","version","cache","timeout","pattern","modules","handler","arrayPrototype","Array","prototype","arrayPrototypeSlice","slice","arrayPrototypeConcat","concat","object","Object","objectPrototypeToString","toString","objectCreate","create","objectDefineProperty","defineProperty","objectGetOwnPropertyNames","getOwnPropertyNames","objectGetOwnPropertyDescriptor","getOwnPropertyDescriptor","linkElement","createElement","ClassDescriptor","value","writable","configurable","enumerable","__proto__","validatorIsTypeOf","type","validatorIsObject","validatorIsPositive","isFinite","Math","floor","validatorIsInstanceOf","module","strPrototype","objectDefine","name","this","functionExtends","source","property","names","properties","constructor","i","e","TypeError","call","Function","define","regexMatchSemver","validatorIsSemver","test","functionIterate","callback","context","keys","undefined","element","fallback","storage","hasSetImmediate","functionMerge","mergeProperties","targetPropertyIsObject","targetProperty","length","target","arguments","functionUuid","regex","RegExp","randomize","character","r","random","replace","functionDefer","fn","MutationObserver","observe","attributes","setAttribute","addEventListener","event","data","uuid","postMessage","onreadystatechange","parentNode","removeChild","body","appendChild","setImmediate","functionToArray","arrayLikeObject","start","end","singletonEvent","regexMatchEvent","listener","addListener","events","pointer","split","shift","on","after","push","filter","EVENT_POSTFIX","Event","emit","parameter","item","apply","ClassWeakmap","WeakMap","getEntry","key","entry","id","set","get","delete","has","AbstractUuid","ClassQueue","self","enqueue","items","EVENT_QUEUE","dequeue","current","extends","functionIdle","eventName","safari","pushNotification","requestIdleCallback","Date","didTimeout","timeRemaining","max","cancelIdleCallback","process","visibilityState","delay","functionGetTimestamp","regexMatchRegex","functionEscapeRegex","functionResolveUrl","url","href","regexIsAbsoluteUri","regexIsAbsolutePath","regexMatchSourcemap","regexMatchBaseUrl","regexMatchInternal","regexMatchParameter","functionResolvePath","uri","path","functionResolveId","match","ClassSemver","compareLevel","a","b","temp","parts","parseInt","parse","major","minor","patch","identifier","join","compare","pa","pb","tpa","tpb","compareIdentifier","singletonCache","regexMatchState","regexMatchProperties","supportsLocalStorage","localStorage","exception","supportsRemainingSpace","enabled","dependency","indexOf","weight","state","getKey","getItem","setKey","getState","matches","setState","Cache","clear","expired","bind","EVENT_CACHE","then","cacheDispose","STORAGE_PREFIX","lifetime","invalid","resolve","spaceBefore","EVENT_PREFIX","remainingSpace","Error","error","ClassDependency","all","ClassPledge","handle","reject","result","dfd","pledge","index","resolved","count","check","rejected","total","executor","catch","defer","always","resolveListener","rejectListener","isPending","isResolved","isRejected","finally","pledges","race","ClassRegistry","remove","ClassFailure","message","stack","DEMAND_ID","traverse","depth","indention","registry","matchInternal","placeholder","setProperty","add","addPending","addResolved","addRejected","list","register","mock","pending","isInternal","MODULE_PREFIX","ERROR_LOAD","node","querySelector","ClassPattern","regexMatchTrailingSlash","location","ClassXhr","XMLHttpRequest","XDomainRequest","checkState","readyState","abort","xhr","boundCheckState","ontimeout","onerror","onabort","status","onprogress","onload","responseText","getResponseHeader","open","send","ClassLoader","regexMatchEmptySearch","response","validate","load","search","validatorIsArray","functionHash","input","charCodeAt","updateCacheSettings","updatePatternSettings","updateModuleSettings","dependencies","configure","base","min","onPostRequest","EVENT_CACHE_HIT","onPreRequest","onPreProcess","isPledge","isFunction","definition","console","/demand","ClassProcessor","EVENT_QUEUE_ENQUEUE","functionResolveSourcemaps","replacement","exec","protocol","host","pathname","abstractHandler","handlerModule","getElementsByTagName","regexMatchType","suffix","HandlerModule","EVENT_POST_CONFIGURE","script","async","text","handlerBundle","updateDependencies","HandlerBundle","getType","handlerComponent","HandlerComponent","container","innerHTML","firstElementChild","getAttribute","textContent","component","components","offset","substr","pluginGenie","MODULE_PREFIX_PLUGIN","matchPattern","prefix","resolveDependencies","rejectDependencies","addPattern","resolveBundles","JSON","stringify","bundle","configuration","/demand/handler/bundle","MODULE_PREFIX_HANDLER","generateConfiguration","bundles","assignModule","MODULE_PREFIX_ABSTRACT","MODULE_PREFIX_VALIDATOR","MODULE_PREFIX_FUNCTION","main","parent"],"mappings":";CAYC,SAASA,EAAQC,EAAYC,GAC7B,aAGA,IAGCC,EAAQC,EAASC,EAAOC,EAHrBC,EAAWP,EAAOO,SACrBC,EAAW,WAAYR,GAAUA,EAAOG,OACxCM,EAAW,CAAEC,QAAS,QAASC,M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lFyB,WAklFxBhY,EAAQ,OAAQI,EAAQ4X,SAznF7B,CA8nFgB,kBAAd7U,KAAKD,KAA2B+U,OAAS9U,KAAMtD,WAAYC","file":"demand.js","sourcesContent":["/* global\n\tglobal, document, demand, provide, queue, processor, settings, setTimeout, clearTimeout,\n\tMODULE_PREFIX, MODULE_PREFIX_HANDLER, MODULE_PREFIX_VALIDATOR, MODULE_PREFIX_PLUGIN, MODULE_PREFIX_FUNCTION, MODULE_PREFIX_ABSTRACT, STRING_STRING, STRING_FUNCTION, TRUE,\n\tvalidatorIsTypeOf, validatorIsArray, validatorIsObject, validatorIsInstanceOf, validatorIsSemver,\n\tfunctionResolveUrl, functionResolveSourcemaps, functionMerge, functionIterate, functionDefer, functionIdle, functionHash, functionUuid,\n\tAbstractUuid, abstractHandler,\n\tClassDependency, ClassQueue, ClassProcessor, ClassPledge, ClassXhr, ClassFailure, ClassDescriptor, ClassWeakmap, ClassSemver,\n\thandlerModule, handlerBundle, handlerComponent,\n \tpluginGenie\n*/\n\n/*eslint no-unused-vars: [2, { \"vars\": \"local\", \"args\": \"none\" }]*/\n(function(global, setTimeout, clearTimeout) {\n\t'use strict';\n\n\t/* eslint-disable no-unused-vars */\n\tvar document = global.document,\n\t\toptions = 'demand' in global && global.demand,\n\t\tsettings = { version: '1.0.0', cache: {}, timeout: 8000, pattern: {}, modules: {}, handler: 'module' },\n\t\tdemand, provide, queue, processor;\n\n\t// include inheritance\n\t\t//=require inheritance.js\n\n\t// include main components\n\t\t//=require function/demand.js\n\t\t//=require function/provide.js\n\n\t// process initial configuration\n\t\tdemand.configure({ cache: TRUE, base: '/', pattern: { '/demand': functionResolveUrl(((options && options.url) || location.href) + '/../').slice(0, -1)} });\n\t\toptions && options.settings && demand.configure(options.settings);\n\n\t// include additional components\n\t\t//=require function/hash.js\n\t\t//=require class/queue.js\n\t\t//=require class/processor.js\n\t\t//=require handler/module.js\n\t\t//=require handler/bundle.js\n\t\t//=require handler/component.js\n\t\t//=require plugin/genie.js\n\n\t// initialize\n\t\tqueue = new ClassQueue();\n\t\tprocessor = new ClassProcessor(queue);\n\n\t\tfunction assignModule(id, module) {\n\t\t\tprovide(id, function() { return module; });\n\t\t}\n\n\t\tassignModule(MODULE_PREFIX_ABSTRACT + 'uuid', AbstractUuid);\n\t\tassignModule(MODULE_PREFIX_ABSTRACT + 'handler', abstractHandler);\n\t\tassignModule(MODULE_PREFIX_HANDLER + 'module', handlerModule);\n\t\tassignModule(MODULE_PREFIX_HANDLER + 'bundle', handlerBundle);\n\t\tassignModule(MODULE_PREFIX_HANDLER + 'component', handlerComponent);\n\t\tassignModule(MODULE_PREFIX_PLUGIN + 'genie', pluginGenie);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isTypeOf', validatorIsTypeOf);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isArray', validatorIsArray);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isObject', validatorIsObject);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isInstanceOf', validatorIsInstanceOf);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isSemver', validatorIsSemver);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'resolveUrl', functionResolveUrl);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'resolveSourcemaps', functionResolveSourcemaps);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'merge', functionMerge);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'iterate', functionIterate);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'hash', functionHash);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'defer', functionDefer);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'idle', functionIdle);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'uuid', functionUuid);\n\t\tassignModule(MODULE_PREFIX + 'weakmap', ClassWeakmap);\n\t\tassignModule(MODULE_PREFIX + 'descriptor', ClassDescriptor);\n\t\tassignModule(MODULE_PREFIX + 'pledge', ClassPledge);\n\t\tassignModule(MODULE_PREFIX + 'queue', ClassQueue);\n\t\tassignModule(MODULE_PREFIX + 'xhr', ClassXhr);\n\t\tassignModule(MODULE_PREFIX + 'failure', ClassFailure);\n\t\tassignModule(MODULE_PREFIX + 'semver', ClassSemver);\n\n\t\tif(options && options.main) {\n\t\t\tswitch(typeof options.main) {\n\t\t\t\tcase STRING_STRING:\n\t\t\t\t\tdemand(options.main);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase STRING_FUNCTION:\n\t\t\t\t\tprovide('main', options.main());\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n}(this.name === 'demand-loader' ? parent : this, setTimeout, clearTimeout));\n"]} \ No newline at end of file +{"version":3,"sources":["demand.js"],"names":["global","setTimeout","clearTimeout","demand","provide","queue","processor","document","options","settings","version","cache","timeout","pattern","modules","handler","arrayPrototype","Array","prototype","arrayPrototypeSlice","slice","arrayPrototypeConcat","concat","object","Object","objectCreate","create","objectDefineProperty","defineProperty","objectGetOwnPropertyNames","getOwnPropertyNames","objectGetOwnPropertyDescriptor","getOwnPropertyDescriptor","linkElement","createElement","ClassDescriptor","value","writable","configurable","enumerable","__proto__","validatorIsTypeOf","type","validatorIsObject","validatorIsPositive","isFinite","Math","floor","validatorIsInstanceOf","module","strPrototype","objectDefine","name","this","functionExtends","source","property","names","properties","constructor","i","e","TypeError","call","Function","define","regexMatchSemver","validatorIsSemver","test","functionIterate","callback","context","keys","undefined","storage","element","functionMerge","mergeProperties","targetPropertyIsObject","targetProperty","length","target","arguments","functionUuid","regex","RegExp","randomize","character","r","random","toString","replace","functionDefer","setImmediate","MutationObserver","records","forEach","record","uuid","attributeName","substr","observe","attributes","fn","setAttribute","functionToArray","arrayLikeObject","start","end","singletonEvent","regexMatchEvent","listener","addListener","events","event","pointer","split","shift","on","after","push","filter","EVENT_POSTFIX","Event","emit","parameter","item","apply","ClassWeakmap","WeakMap","getEntry","key","entry","id","set","get","delete","has","AbstractUuid","ClassQueue","self","enqueue","items","EVENT_QUEUE","dequeue","current","extends","functionIdle","eventName","safari","pushNotification","requestIdleCallback","Date","didTimeout","timeRemaining","max","cancelIdleCallback","process","addEventListener","visibilityState","delay","functionGetTimestamp","regexMatchRegex","functionEscapeRegex","functionResolveUrl","url","href","regexIsAbsoluteUri","regexIsAbsolutePath","regexMatchSourcemap","regexMatchBaseUrl","regexMatchInternal","regexMatchParameter","functionResolvePath","uri","path","functionResolveId","match","ClassSemver","compareLevel","a","b","temp","parts","parseInt","parse","major","minor","patch","identifier","join","compare","pa","pb","tpa","tpb","compareIdentifier","singletonCache","regexMatchState","regexMatchProperties","supportsLocalStorage","localStorage","exception","supportsRemainingSpace","enabled","dependency","indexOf","weight","state","getKey","getItem","setKey","getState","matches","setState","Cache","clear","expired","bind","EVENT_CACHE","then","cacheDispose","STORAGE_PREFIX","lifetime","invalid","resolve","spaceBefore","EVENT_PREFIX","remainingSpace","Error","error","ClassDependency","all","ClassPledge","handle","reject","result","dfd","pledge","index","resolved","count","check","rejected","total","executor","catch","defer","always","resolveListener","rejectListener","isPending","isResolved","isRejected","finally","pledges","race","ClassRegistry","remove","ClassFailure","message","stack","DEMAND_ID","traverse","depth","indention","regexMatchEmptySearch","loadXhr","registry","matchInternal","placeholder","setProperty","add","addPending","addResolved","addRejected","list","register","mock","pending","isInternal","MODULE_PREFIX","ERROR_LOAD","node","querySelector","parentNode","removeChild","ClassPattern","regexMatchTrailingSlash","location","ClassTask","lookup","isTransferable","ArrayBuffer","MessagePort","ImageBitmap","task","script","worker","isSettled","toArray","data","postMessage","$task","args","$isTransferable","Worker","URL","createObjectURL","Blob","onmessage","ClassLoader","checkState","xhr","XMLHttpRequest","readyState","abort","ontimeout","onerror","onabort","statusText","onprogress","onreadystatechange","onload","status","responseText","getResponseHeader","open","send","response","validate","load","search","validatorIsArray","isArray","functionHash","input","charCodeAt","updateCacheSettings","updatePatternSettings","updateModuleSettings","dependencies","configure","base","min","onPostRequest","EVENT_CACHE_HIT","onPreRequest","onPreProcess","isPledge","isFunction","definition","console","/demand","ClassProcessor","EVENT_QUEUE_ENQUEUE","functionResolveSourcemaps","replacement","exec","protocol","host","pathname","abstractHandler","handlerModule","getElementsByTagName","regexMatchType","suffix","HandlerModule","EVENT_POST_CONFIGURE","async","text","appendChild","handlerBundle","updateDependencies","HandlerBundle","getType","handlerComponent","HandlerComponent","container","innerHTML","firstElementChild","getAttribute","textContent","component","components","offset","pluginGenie","MODULE_PREFIX_PLUGIN","matchPattern","prefix","resolveDependencies","rejectDependencies","addPattern","resolveBundles","JSON","stringify","bundle","configuration","/demand/handler/bundle","MODULE_PREFIX_HANDLER","generateConfiguration","bundles","assignModule","MODULE_PREFIX_ABSTRACT","MODULE_PREFIX_VALIDATOR","MODULE_PREFIX_FUNCTION","main","parent"],"mappings":";CAYC,SAASA,EAAQC,EAAYC,GAC7B,aAGA,IAGCC,EAAQC,EAASC,EAAOC,EAHrBC,EAAWP,EAAOO,SACrBC,EAAW,WAAYR,GAAUA,EAAOG,OACxCM,EAAW,CAAEC,QAAS,QAASC,MAAO,GAAIC,QAAS,IAAMC,QAAS,GAAIC,QAAS,GAAIC,QAAS,UAsExFC,EAAiCC,MAAMC,UAC1CC,EAAiCH,EAAeI,MAChDC,EAAiCL,EAAeM,OAChDC,EAAiCC,OACjCC,EAAiCF,EAAOG,OACxCC,EAAiCJ,EAAOK,eACxCC,EAAiCN,EAAOO,oBACxCC,EAAiCR,EAAOS,yBACxCC,EAAiC1B,EAAS2B,cAAc,KASzD,SAASC,EAAgBC,EAAOC,EAAUC,EAAcC,GACvD,MAAO,CACNC,UAhEyB,KAiEzBJ,MAAcA,EACdG,aAAgBA,EAChBD,eAAgBA,EAChBD,WAAgBA,GAqElB,SAASI,EAAkBlB,EAAQmB,GAClC,cAAcnB,IAAWmB,EAsB1B,SAASC,EAAkBpB,GAC1B,OAAOA,GAAUkB,EAAkBlB,EA1JT,UAgL3B,SAASqB,EAAoBR,GAC5B,OAAOK,EAAkBL,E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AA0BvG,GAEpC1K,GAAWA,EAAQ8Y,KACrB,cAAc9Y,EAAQ8Y,MACrB,IAhnFyB,SAinFxBnZ,EAAOK,EAAQ8Y,MAEf,MACD,IAjnFyB,WAknFxBlZ,EAAQ,OAAQI,EAAQ8Y,SAzpF7B,CA8pFgB,kBAAdjW,KAAKD,KAA2BmW,OAASlW,KAAMpD,WAAYC","file":"demand.js","sourcesContent":["/* global\n\tglobal, document, demand, provide, queue, processor, settings, setTimeout, clearTimeout,\n\tMODULE_PREFIX, MODULE_PREFIX_HANDLER, MODULE_PREFIX_VALIDATOR, MODULE_PREFIX_PLUGIN, MODULE_PREFIX_FUNCTION, MODULE_PREFIX_ABSTRACT, STRING_STRING, STRING_FUNCTION, TRUE,\n\tvalidatorIsTypeOf, validatorIsArray, validatorIsObject, validatorIsInstanceOf, validatorIsSemver,\n\tfunctionResolveUrl, functionResolveSourcemaps, functionMerge, functionIterate, functionDefer, functionToArray, functionIdle, functionHash, functionUuid,\n\tAbstractUuid, abstractHandler,\n\tClassDependency, ClassQueue, ClassProcessor, ClassPledge, ClassFailure, ClassDescriptor, ClassWeakmap, ClassTask, ClassSemver,\n\thandlerModule, handlerBundle, handlerComponent,\n \tpluginGenie\n*/\n\n/*eslint no-unused-vars: [2, { \"vars\": \"local\", \"args\": \"none\" }]*/\n(function(global, setTimeout, clearTimeout) {\n\t'use strict';\n\n\t/* eslint-disable no-unused-vars */\n\tvar document = global.document,\n\t\toptions = 'demand' in global && global.demand,\n\t\tsettings = { version: '1.0.0', cache: {}, timeout: 8000, pattern: {}, modules: {}, handler: 'module' },\n\t\tdemand, provide, queue, processor;\n\n\t// include inheritance\n\t\t//=require inheritance.js\n\n\t// include main components\n\t\t//=require function/demand.js\n\t\t//=require function/provide.js\n\n\t// process initial configuration\n\t\tdemand.configure({ cache: TRUE, base: '/', pattern: { '/demand': functionResolveUrl(((options && options.url) || location.href) + '/../').slice(0, -1)} });\n\t\toptions && options.settings && demand.configure(options.settings);\n\n\t// include additional components\n\t\t//=require function/hash.js\n\t\t//=require class/queue.js\n\t\t//=require class/processor.js\n\t\t//=require handler/module.js\n\t\t//=require handler/bundle.js\n\t\t//=require handler/component.js\n\t\t//=require plugin/genie.js\n\n\t// initialize\n\t\tqueue = new ClassQueue();\n\t\tprocessor = new ClassProcessor(queue);\n\n\t\tfunction assignModule(id, module) {\n\t\t\tprovide(id, function() { return module; });\n\t\t}\n\n\t\tassignModule(MODULE_PREFIX_ABSTRACT + 'uuid', AbstractUuid);\n\t\tassignModule(MODULE_PREFIX_ABSTRACT + 'handler', abstractHandler);\n\t\tassignModule(MODULE_PREFIX_HANDLER + 'module', handlerModule);\n\t\tassignModule(MODULE_PREFIX_HANDLER + 'bundle', handlerBundle);\n\t\tassignModule(MODULE_PREFIX_HANDLER + 'component', handlerComponent);\n\t\tassignModule(MODULE_PREFIX_PLUGIN + 'genie', pluginGenie);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isTypeOf', validatorIsTypeOf);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isArray', validatorIsArray);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isObject', validatorIsObject);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isInstanceOf', validatorIsInstanceOf);\n\t\tassignModule(MODULE_PREFIX_VALIDATOR + 'isSemver', validatorIsSemver);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'resolveUrl', functionResolveUrl);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'resolveSourcemaps', functionResolveSourcemaps);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'merge', functionMerge);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'iterate', functionIterate);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'hash', functionHash);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'defer', functionDefer);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'idle', functionIdle);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'uuid', functionUuid);\n\t\tassignModule(MODULE_PREFIX_FUNCTION + 'toArray', functionToArray);\n\t\tassignModule(MODULE_PREFIX + 'task', ClassTask);\n\t\tassignModule(MODULE_PREFIX + 'weakmap', ClassWeakmap);\n\t\tassignModule(MODULE_PREFIX + 'descriptor', ClassDescriptor);\n\t\tassignModule(MODULE_PREFIX + 'pledge', ClassPledge);\n\t\tassignModule(MODULE_PREFIX + 'queue', ClassQueue);\n\t\tassignModule(MODULE_PREFIX + 'failure', ClassFailure);\n\t\tassignModule(MODULE_PREFIX + 'semver', ClassSemver);\n\n\t\tif(options && options.main) {\n\t\t\tswitch(typeof options.main) {\n\t\t\t\tcase STRING_STRING:\n\t\t\t\t\tdemand(options.main);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase STRING_FUNCTION:\n\t\t\t\t\tprovide('main', options.main());\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n}(this.name === 'demand-loader' ? parent : this, setTimeout, clearTimeout));\n"]} \ No newline at end of file diff --git a/dist/handler/css.js b/dist/handler/css.js index cfd9803..419df12 100644 --- a/dist/handler/css.js +++ b/dist/handler/css.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(e){"use strict";provide(["path","/demand/abstract/handler","/demand/function/resolveSourcemaps","/demand/validator/isObject","/demand/function/merge"],(function(t,n,r,s,o){var u=e.getElementsByTagName("head")[0],a=e.createElement("a"),i=/url\s*\(\s*["']?(.+?)["']?\s*\)/gi,c=/@import\s+["'](.+?)["']/gi,d=/^\//i,f=/^data:|http(s?):|\/\//i,l=/^text\/css/,m={suffix:".css"};function p(e){return a.href=e,a}function h(e,t,n){return f.test(t[1])||(e=e.replace(t[0],n)),e}function v(){}return demand.on("postConfigure:"+t,(function(e){s(e)&&o(m,e)})),v.prototype={validate:function(e){return l.test(e)},onPreRequest:function(e,t){var n;(t="undefined"!=typeof t?t:m.suffix)&&(n=e.url.pathname,e.url.pathname=n.slice(-t.length)!==t?n+t:n)},onPostRequest:function(e){for(var t,n=p(e.url+"/.."),s=n.href,o="//"+n.host,u=e.source;t=i.exec(u);)u=h(u,t,'url("'+p(d.test(t[1])?o+t[1]:s+t[1]).href+'")');for(;t=c.exec(u);)u=h(u,t,'@import "'+p(d.test(t[1])?o+t[1]:s+t[1]).href+'"');e.source=r(e.url,u)},process:function(t){var n=e.querySelector('[demand-id="'+t.id+'"]');n||((n=e.createElement("style")).type="text/css",n.setAttribute("demand-id",t.id),u.appendChild(n)),"STYLE"===n.tagName&&(n.styleSheet?n.styleSheet.cssText=t.source:n.textContent=t.source),provide((function(){return n}))}},new(v.extends(n))}))}(document); //# sourceMappingURL=css.js.map diff --git a/dist/handler/html.js b/dist/handler/html.js index 5c3cf9b..6666160 100644 --- a/dist/handler/html.js +++ b/dist/handler/html.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["path","/demand/abstract/handler","/demand/validator/isObject","/demand/function/merge"],(function(e,n,t,r){var o=/^text\/html/,u=document.createElement("body"),i={suffix:".html"};function a(){}return demand.on("postConfigure:"+e,(function(e){t(e)&&r(i,e)})),a.prototype={validate:function(e){return o.test(e)},onPreRequest:function(e,n){var t;(n="undefined"!=typeof n?n:i.suffix)&&(t=e.url.pathname,e.url.pathname=t.slice(-n.length)!==n?t+n:t)},process:function(e){provide((function(){return function(e){var n,t=document.createDocumentFragment();for(u.innerHTML=e;n=u.firstElementChild;)t.appendChild(n);return t}(e.source)}))}},new(a.extends(n))}))}(); //# sourceMappingURL=html.js.map diff --git a/dist/handler/json.js b/dist/handler/json.js index 4cee3a9..8fe435f 100644 --- a/dist/handler/json.js +++ b/dist/handler/json.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ -!function(){"use strict";provide(["path","/demand/abstract/handler","/demand/validator/isObject","/demand/function/merge"],(function(n,e,t,o){var r=/^application\/json/,a={suffix:".json"};function i(){}return demand.on("postConfigure:"+n,(function(n){t(n)&&o(a,n)})),i.prototype={validate:function(n){return r.test(n)},onPreRequest:function(n,e){var t;(e="undefined"!=typeof e?e:a.suffix)&&(t=n.url.pathname,n.url.pathname=t.slice(-e.length)!==e?t+e:t)},process:function(n){var e=JSON.parse(n.source);provide((function(){return e}))}},new(i.extends(e))}))}(); +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +!function(){"use strict";provide(["path","/demand/abstract/handler","/demand/task","/demand/failure","/demand/validator/isObject","/demand/function/merge"],(function(n,e,t,r,a,o){var i=/^application\/json/,u={suffix:".json"},c=new t((function(n,e,t){try{n(JSON.parse(t))}catch(n){e(n)}}));function d(){}return demand.on("postConfigure:"+n,(function(n){a(n)&&o(u,n)})),d.prototype={validate:function(n){return i.test(n)},onPreRequest:function(n,e){var t;(e="undefined"!=typeof e?e:u.suffix)&&(t=n.url.pathname,n.url.pathname=t.slice(-e.length)!==e?t+e:t)},process:function(n){c(n.source).then((function(n){provide((function(){return n}))})).catch((function(){n.dfd.reject(new r("error parsing",n.path))}))}},new(d.extends(e))}))}(); //# sourceMappingURL=json.js.map diff --git a/dist/handler/json.js.map b/dist/handler/json.js.map index ab0332a..8a3cee8 100644 --- a/dist/handler/json.js.map +++ b/dist/handler/json.js.map @@ -1 +1 @@ -{"version":3,"sources":["handler/json.js"],"names":["provide","path","abstractHandler","isObject","merge","regexMatchType","settings","suffix","HandlerJson","demand","on","options","prototype","validate","type","test","onPreRequest","dependency","pathname","url","slice","length","process","data","JSON","parse","source","extends"],"mappings":";CAAC,WACA,aAwCAA,QAAQ,CAAE,OAAQ,2BAA4B,6BAA8B,2BAtC5E,SAAoBC,EAAMC,EAAiBC,EAAUC,GACpD,IAAIC,EAAiB,qBACpBC,EAAiB,CAAEC,OAAQ,SAS5B,SAASC,KAwBT,OA/BAC,OACEC,GAAG,iBAAmBT,GAAM,SAASU,GAClCR,EAASQ,IACXP,EAAME,EAAUK,MAMnBH,EAAYI,UAAY,CACvBC,SAAU,SAASC,GAClB,OAAOT,EAAeU,KAAKD,IAE5BE,aAAc,SAASC,EAAYV,GAClC,IAAIW,GAEJX,EAA4B,oBAAXA,EAA0BA,EAASD,EAASC,UAG5DW,EAAWD,EAAWE,IAAID,SAE1BD,EAAWE,IAAID,SAAWA,EAASE,OAAOb,EAAOc,UAAYd,EAASW,EAAWX,EAASW,IAG5FI,QAAS,SAASL,GACjB,IAAIM,EAAOC,KAAKC,MAAMR,EAAWS,QAEjC1B,SAAQ,WAAa,OAAOuB,OAIvB,IAAKf,EAAYmB,QAAQzB,OAtClC","file":"json.js","sourcesContent":["(function() {\n\t'use strict';\n\n\tfunction definition(path, abstractHandler, isObject, merge) {\n\t\tvar regexMatchType = /^application\\/json/,\n\t\t\tsettings = { suffix: '.json' };\n\n\t\tdemand\n\t\t\t.on('postConfigure:' + path, function(options) {\n\t\t\t\tif(isObject(options)) {\n\t\t\t\t\tmerge(settings, options);\n\t\t\t\t}\n\t\t\t});\n\n\t\tfunction HandlerJson() {}\n\n\t\tHandlerJson.prototype = {\n\t\t\tvalidate: function(type) {\n\t\t\t\treturn regexMatchType.test(type);\n\t\t\t},\n\t\t\tonPreRequest: function(dependency, suffix) {\n\t\t\t\tvar pathname;\n\n\t\t\t\tsuffix = (typeof suffix !== 'undefined') ? suffix : settings.suffix;\n\n\t\t\t\tif(suffix) {\n\t\t\t\t\tpathname = dependency.url.pathname;\n\n\t\t\t\t\tdependency.url.pathname = pathname.slice(-suffix.length) !== suffix ? pathname + suffix : pathname;\n\t\t\t\t}\n\t\t\t},\n\t\t\tprocess: function(dependency) {\n\t\t\t\tvar data = JSON.parse(dependency.source);\n\n\t\t\t\tprovide(function() { return data; });\n\t\t\t}\n\t\t};\n\n\t\treturn new (HandlerJson.extends(abstractHandler));\n\t}\n\n\tprovide([ 'path', '/demand/abstract/handler', '/demand/validator/isObject', '/demand/function/merge' ], definition);\n}());\n"]} \ No newline at end of file +{"version":3,"sources":["handler/json.js"],"names":["provide","path","abstractHandler","Task","Failure","isObject","merge","regexMatchType","settings","suffix","parseJson","resolve","reject","source","JSON","parse","error","HandlerJson","demand","on","options","prototype","validate","type","test","onPreRequest","dependency","pathname","url","slice","length","process","then","data","catch","dfd","extends"],"mappings":";CAAC,WACA,aAmDAA,QAAQ,CAAE,OAAQ,2BAA4B,eAAgB,kBAAmB,6BAA8B,2BAjD/G,SAAoBC,EAAMC,EAAiBC,EAAMC,EAASC,EAAUC,GACnE,IAAIC,EAAiB,qBACpBC,EAAiB,CAAEC,OAAQ,SAC3BC,EAAiB,IAAIP,GAAK,SAASQ,EAASC,EAAQC,GACnD,IACCF,EAAQG,KAAKC,MAAMF,IAClB,MAAMG,GACPJ,EAAOI,OAWV,SAASC,KA4BT,OAnCAC,OACEC,GAAG,iBAAmBlB,GAAM,SAASmB,GAClCf,EAASe,IACXd,EAAME,EAAUY,MAMnBH,EAAYI,UAAY,CACvBC,SAAU,SAASC,GAClB,OAAOhB,EAAeiB,KAAKD,IAE5BE,aAAc,SAASC,EAAYjB,GAClC,IAAIkB,GAEJlB,EAA4B,oBAAXA,EAA0BA,EAASD,EAASC,UAG5DkB,EAAWD,EAAWE,IAAID,SAE1BD,EAAWE,IAAID,SAAWA,EAASE,OAAOpB,EAAOqB,UAAYrB,EAASkB,EAAWlB,EAASkB,IAG5FI,QAAS,SAASL,GACjBhB,EAAUgB,EAAWb,QACnBmB,MAAK,SAASC,GACdjC,SAAQ,WAAa,OAAOiC,QAE5BC,OAAM,WACNR,EAAWS,IAAIvB,OAAO,IAAIR,EAAQ,gBAAiBsB,EAAWzB,YAK3D,IAAKgB,EAAYmB,QAAQlC,OAjDlC","file":"json.js","sourcesContent":["(function() {\n\t'use strict';\n\n\tfunction definition(path, abstractHandler, Task, Failure, isObject, merge) {\n\t\tvar regexMatchType = /^application\\/json/,\n\t\t\tsettings = { suffix: '.json' },\n\t\t\tparseJson = new Task(function(resolve, reject, source) {\n\t\t\t\ttry {\n\t\t\t\t\tresolve(JSON.parse(source));\n\t\t\t\t} catch(error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\n\t\tdemand\n\t\t\t.on('postConfigure:' + path, function(options) {\n\t\t\t\tif(isObject(options)) {\n\t\t\t\t\tmerge(settings, options);\n\t\t\t\t}\n\t\t\t});\n\n\t\tfunction HandlerJson() {}\n\n\t\tHandlerJson.prototype = {\n\t\t\tvalidate: function(type) {\n\t\t\t\treturn regexMatchType.test(type);\n\t\t\t},\n\t\t\tonPreRequest: function(dependency, suffix) {\n\t\t\t\tvar pathname;\n\n\t\t\t\tsuffix = (typeof suffix !== 'undefined') ? suffix : settings.suffix;\n\n\t\t\t\tif(suffix) {\n\t\t\t\t\tpathname = dependency.url.pathname;\n\n\t\t\t\t\tdependency.url.pathname = pathname.slice(-suffix.length) !== suffix ? pathname + suffix : pathname;\n\t\t\t\t}\n\t\t\t},\n\t\t\tprocess: function(dependency) {\n\t\t\t\tparseJson(dependency.source)\n\t\t\t\t\t.then(function(data) {\n\t\t\t\t\t\tprovide(function() { return data; });\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function() {\n\t\t\t\t\t\tdependency.dfd.reject(new Failure('error parsing', dependency.path));\n\t\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\treturn new (HandlerJson.extends(abstractHandler));\n\t}\n\n\tprovide([ 'path', '/demand/abstract/handler', '/demand/task', '/demand/failure', '/demand/validator/isObject', '/demand/function/merge' ], definition);\n}());\n"]} \ No newline at end of file diff --git a/dist/handler/legacy.js b/dist/handler/legacy.js index 1bdedeb..2404809 100644 --- a/dist/handler/legacy.js +++ b/dist/handler/legacy.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["path","/demand/failure","/demand/handler/module","/demand/validator/isObject","/demand/function/merge"],(function(e,n,t,o,u){var r={suffix:".js"};function d(){var e,o=this,u=o.dfd,d=r[o.path]&&r[o.path].probe;function i(e){provide((function(){return e}))}function a(){u.reject(new n("error probing",o.path))}t.process(o),d?(e=d(i,a))&&i(e):a()}function i(){}return demand.on("postConfigure:"+e,(function(e){o(e)&&u(r,e)})),i.prototype={onPreRequest:function(e,n){var o=r[e.path]&&r[e.path].dependencies;n="undefined"!=typeof n?n:r.suffix,t.onPreRequest(e,n||!1),o&&(e.enqueue=demand.apply(null,o))},onPreProcess:function(e){var n=r[e.path]&&r[e.path].dependencies;n&&"boolean"==typeof e.enqueue&&(e.enqueue=demand.apply(null,n))},process:function(e){var t=d.bind(e);!0===e.enqueue?t():e.enqueue.then(t,(function(){e.dfd.reject(new n("error resolving",e.path,arguments))}))}},new(i.extends(t))}))}(); //# sourceMappingURL=legacy.js.map diff --git a/dist/handler/text.js b/dist/handler/text.js index 9c50889..b5b00e4 100644 --- a/dist/handler/text.js +++ b/dist/handler/text.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(){"use strict";provide(["path","/demand/abstract/handler","/demand/validator/isObject","/demand/function/merge"],(function(n,e,t,r){var o=/^text\/.+/,u={};function i(){}return demand.on("postConfigure:"+n,(function(n){t(n)&&r(u,n)})),i.prototype={validate:function(n){return o.test(n)},onPreRequest:function(n,e){var t;(e="undefined"!=typeof e?e:u.suffix)&&(t=n.url.pathname,n.url.pathname=t.slice(-e.length)!==e?t+e:t)},process:function(n){provide((function(){return n.source}))}},new(i.extends(e))}))}(); //# sourceMappingURL=text.js.map diff --git a/dist/plugin/cookie.js b/dist/plugin/cookie.js index f55c465..7bdb0d1 100644 --- a/dist/plugin/cookie.js +++ b/dist/plugin/cookie.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ !function(n){"use strict";provide(["path","/demand/function/iterate","/demand/validator/isObject","/demand/validator/isTypeOf"],(function(t,e,o,i){var a,c="Thu, 01 Jan 1970 00:00:00 GMT",r=[];function u(t,e,o){(a||function(n){for(var t,e,o=0;t=r[o];o++)0===n.indexOf(t.pattern)&&(!e||t.weight>e.weight)&&(e=t);return!!e&&e.state}(t.path))&&(n.cookie="demand["+t.type+"]["+t.path+"]="+encodeURIComponent(e)+"; expires="+o+"; path=/")}return demand.on("postConfigure:"+t,(function(n){o(n)?(r.length=0,e(n,(function(n,t){r.push({pattern:n,weight:n.length,state:t})}))):i(n,"boolean")&&(a=n)})).on("cacheMiss",(function(n){u(n,"",c)})).on("cacheClear",(function(n){u(n,"",c)})).on("postCache",(function(n,t){u(n,JSON.stringify(t),"Fri, 31 Dec 9999 23:59:59 GMT")})),!0}))}(document); //# sourceMappingURL=cookie.js.map diff --git a/dist/plugin/lzstring.js b/dist/plugin/lzstring.js index 8a34968..a844c6a 100644 --- a/dist/plugin/lzstring.js +++ b/dist/plugin/lzstring.js @@ -1,3 +1,3 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ var LZString=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(n,r){if(!e[n]){e[n]={};for(var o=0;o>>8,o[2*e+1]=s%256}return o},decompressFromUint8Array:function(r){if(null==r)return i.decompress(r);for(var o=new Array(r.length/2),e=0,t=o.length;e>=1}else{for(t=1,e=0;e>=1}0==--f&&(f=Math.pow(2,h),h++),delete a[p]}else for(t=s[p],e=0;e>=1;0==--f&&(f=Math.pow(2,h),h++),s[c]=l++,p=String(u)}if(""!==p){if(Object.prototype.hasOwnProperty.call(a,p)){if(p.charCodeAt(0)<256){for(e=0;e>=1}else{for(t=1,e=0;e>=1}0==--f&&(f=Math.pow(2,h),h++),delete a[p]}else for(t=s[p],e=0;e>=1;0==--f&&(f=Math.pow(2,h),h++)}for(t=2,e=0;e>=1;for(;;){if(m<<=1,g==r-1){d.push(o(m));break}g++}return d.join("")},decompress:function(n){return null==n?"":""==n?null:i._decompress(n.length,32768,(function(r){return n.charCodeAt(r)}))},_decompress:function(r,o,e){var t,i,s,a,u,c,p,f=[],l=4,h=4,d=3,m="",g=[],v={val:e(0),position:o,index:1};for(t=0;t<3;t+=1)f[t]=t;for(s=0,u=Math.pow(2,2),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;p=n(s);break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;p=n(s);break;case 2:return""}for(f[3]=p,i=p,g.push(p);;){if(v.index>r)return"";for(s=0,u=Math.pow(2,d),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;switch(p=s){case 0:for(s=0,u=Math.pow(2,8),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[h++]=n(s),p=h-1,l--;break;case 1:for(s=0,u=Math.pow(2,16),c=1;c!=u;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=o,v.val=e(v.index++)),s|=(a>0?1:0)*c,c<<=1;f[h++]=n(s),p=h-1,l--;break;case 2:return g.join("")}if(0==l&&(l=Math.pow(2,d),d++),f[p])m=f[p];else{if(p!==h)return null;m=i+i.charAt(0)}g.push(m),f[h++]=i+m.charAt(0),i=m,0==--l&&(l=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define((function(){return LZString})):"undefined"!=typeof module&&null!=module?module.exports=LZString:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",(function(){return LZString})),function(n){"use strict";provide(["path","/demand/function/iterate","/demand/validator/isObject","/demand/validator/isTypeOf"],(function(r,o,e,t){var i=[{pattern:r,weight:r.length,state:!1}],s={};function a(n){for(var r,o,e=0;r=i[e];e++)0===n.indexOf(r.pattern)&&(!o||r.weight>o.weight)&&(o=r);return!!o&&o.state}return demand.on("postConfigure:"+r,(function(n){e(n)?(i.length=0,o(n,(function(n,r){i.push({pattern:n,weight:n.length,state:r})}))):t(n,"boolean")&&i.push({pattern:"",weight:0,state:n})})).on("cacheHit",(function(n){a(n.path)&&(s[n.id]=!0)})).on("preCache",(function(r){a(r.path)&&(r.source=n.LZString.compressToUTF16(r.source))})).on("preProcess",(function(r){s[r.id]&&(r.source=n.LZString.decompressFromUTF16(r.source))})),!0}))}(this); //# sourceMappingURL=lzstring.js.map diff --git a/dist/plugin/sri.js b/dist/plugin/sri.js index 20f8eab..8c4baaf 100644 --- a/dist/plugin/sri.js +++ b/dist/plugin/sri.js @@ -1,4 +1,4 @@ -/**! Qoopido.demand 5.3.1 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ +/**! Qoopido.demand 6.0.0 | https://github.com/dlueth/qoopido.demand | (c) 2020 Dirk Lueth */ /** * @preserve A JavaScript implementation of the SHA family of hashes, as * defined in FIPS PUB 180-4 and FIPS PUB 202, as well as the corresponding diff --git a/package-lock.json b/package-lock.json index b2d975f..e571726 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "qoopido.demand", - "version": "5.3.0", + "version": "5.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,9 +14,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", - "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", "dev": true }, "@babel/highlight": { @@ -154,9 +154,9 @@ "dev": true }, "@types/node": { - "version": "13.9.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.9.8.tgz", - "integrity": "sha512-1WgO8hsyHynlx7nhP1kr0OFzsgKz5XDQL+Lfc3b1Q3qIln/n8cKD4m09NJ0+P1Rq7Zgnc7N0+SsMnoD1rEb0kA==", + "version": "13.11.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.1.tgz", + "integrity": "sha512-eWQGP3qtxwL8FGneRrC5DwrJLGN4/dH1clNTuLfN81HCrxVtxRjygDTUoZJ5ASlDEeo0ppYFQjQIlXhtXpOn6g==", "dev": true }, "abbrev": { @@ -1033,9 +1033,9 @@ } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "cliui": { @@ -1839,18 +1839,18 @@ "dev": true }, "esquery": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.2.0.tgz", - "integrity": "sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.0.tgz", + "integrity": "sha512-/5qB+Mb0m2bh86tjGbA8pB0qBfdmCIK6ZNPjcw4/TtEH0+tTf0wLA5HK4KMTweSMwLGHwBDWCBV+6+2+EuHmgg==", "dev": true, "requires": { "estraverse": "^5.0.0" }, "dependencies": { "estraverse": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.0.0.tgz", - "integrity": "sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", "dev": true } } @@ -2110,9 +2110,9 @@ "dev": true }, "fastq": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.1.tgz", - "integrity": "sha512-mpIH5sKYueh3YyeJwqtVo8sORi0CgtmkVbK6kZStpQlZBYQuTzG2CZ7idSiJuA7bY0SFCWUc5WIs+oYumGCQNw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", + "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -3400,9 +3400,9 @@ } }, "gulp-load-plugins": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-2.0.2.tgz", - "integrity": "sha512-nG1qSZZpuMIoGZSaBLutL/m7qYIGSHneprOZVdp1UNDuxp2kniXYNIxvDiPxUiFfjhcNaJ66sUGJAyK+MlhE1w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/gulp-load-plugins/-/gulp-load-plugins-2.0.3.tgz", + "integrity": "sha512-U/1Sml7UbyOu2kH6Fbpo+ka2xyp4DRH6+oDtHgC8oKsnlQRuiBQYQ/LS4k6HxBv1HJlucaNV/SdwZXtLBuvSqg==", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -3411,7 +3411,7 @@ "gulplog": "^1.0.0", "has-gulplog": "^0.1.0", "micromatch": "^4.0.2", - "resolve": "^1.14.1" + "resolve": "^1.15.1" }, "dependencies": { "findup-sync": { @@ -4291,16 +4291,24 @@ "dev": true }, "js-beautify": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.3.tgz", - "integrity": "sha512-wfk/IAWobz1TfApSdivH5PJ0miIHgDoYb1ugSqHcODPmaYu46rYe5FVuIEkhjg8IQiv6rDNPyhsqbsohI/C2vQ==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.11.0.tgz", + "integrity": "sha512-a26B+Cx7USQGSWnz9YxgJNMmML/QG2nqIaL7VVYPCXbqiKz8PN0waSNvroMtvAK6tY7g/wPdNWGEP+JTNIBr6A==", "dev": true, "requires": { "config-chain": "^1.1.12", "editorconfig": "^0.15.3", "glob": "^7.1.3", - "mkdirp": "~0.5.1", - "nopt": "~4.0.1" + "mkdirp": "~1.0.3", + "nopt": "^4.0.3" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } } }, "js-tokens": { @@ -4871,9 +4879,9 @@ } }, "mkdirp": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", - "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -5831,9 +5839,9 @@ "dev": true }, "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -6304,9 +6312,9 @@ } }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true }, "supports-color": { @@ -6378,9 +6386,9 @@ } }, "terser": { - "version": "4.6.10", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.10.tgz", - "integrity": "sha512-qbF/3UOo11Hggsbsqm2hPa6+L4w7bkr+09FNseEe8xrcVD3APGLFqE+Oz1ZKAxjYnFsj80rLOfgAtJ0LNJjtTA==", + "version": "4.6.11", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.11.tgz", + "integrity": "sha512-76Ynm7OXUG5xhOpblhytE7X58oeNSmC8xnNhjWVo8CksHit0U0kO4hfNbPrrYwowLWFgM2n9L176VNx2QaHmtA==", "dev": true, "requires": { "commander": "^2.20.0", @@ -6590,21 +6598,12 @@ "dev": true }, "uglify-js": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.8.1.tgz", - "integrity": "sha512-W7KxyzeaQmZvUFbGj4+YFshhVrMBGSg2IbcYAjGWGvx8DHvJMclbTDMpffdxFUGPBHjIytk7KJUR/KUXstUGDw==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", + "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", "dev": true, "requires": { - "commander": "~2.20.3", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "commander": "~2.20.3" } }, "unc-path-regex": { diff --git a/package.json b/package.json index e93f905..0cfe851 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "qoopido.demand", "title": "Qoopido.demand", "description": "Promise like module loader using XHR requests and localStorage caching to dynamically load JavaScript and CSS + dynamic dependency resolution + support for custom handlers", - "version": "5.3.1", + "version": "6.0.0", "homepage": "https://github.com/dlueth/qoopido.demand", "author": { "name": "Dirk Lueth", @@ -59,7 +59,7 @@ "gulp-inject-version": "1.0.1", "gulp-jsbeautifier": "3.0.1", "gulp-livereload": "4.0.2", - "gulp-load-plugins": "2.0.2", + "gulp-load-plugins": "2.0.3", "gulp-rename": "2.0.0", "gulp-size": "3.0.0", "gulp-sourcemaps": "2.6.5", diff --git a/src/abstract/handler.js b/src/abstract/handler.js index 39c80b0..10970db 100644 --- a/src/abstract/handler.js +++ b/src/abstract/handler.js @@ -10,9 +10,9 @@ function abstractHandler() { } abstractHandler.prototype = { - validate: NULL, - onPreRequest: NULL, + validate: NULL, + onPreRequest: NULL, onPostRequest: NULL, - onPreProcess: NULL, - process: NULL + onPreProcess: NULL, + process: NULL }; diff --git a/src/class/loader.js b/src/class/loader.js index f6fe206..a524708 100644 --- a/src/class/loader.js +++ b/src/class/loader.js @@ -4,7 +4,7 @@ regexIsAbsoluteUri, linkElement, functionIterate, functionResolveUrl, functionGetTimestamp, - ClassXhr, ClassFailure, + ClassTask, ClassFailure, singletonEvent */ @@ -14,63 +14,100 @@ //=require function/resolveUrl.js //=require function/iterate.js //=require singleton/event.js -//=require class/xhr.js +//=require class/task.js //=require class/failure.js -function ClassLoader(dependency) { - var regexMatchEmptySearch = /^(?:\?|)$/, - pattern; +var ClassLoader = (function() { + var regexMatchEmptySearch = /^(?:\?|)$/, + loadXhr = new ClassTask(function(resolve, reject, url) { + var xhr = new XMLHttpRequest(), + timeout = 10000, + checkState, pointer; - function resolve(response, type) { - if(!type || !dependency.handler.validate || dependency.handler.validate(type)) { - dependency.source = response; + checkState = function() { + if(this.readyState < 4) { + this.abort(); + } + }.bind(xhr); - singletonEvent.emit(EVENT_POST_REQUEST, dependency.type, dependency); - } else { - dependency.dfd.reject(new ClassFailure(ERROR_LOAD + ' (content-type)', dependency.id)); - } - } + xhr.ontimeout = xhr.onerror = xhr.onabort = function() { + reject(xhr.statusText); + }; - function reject(status) { - dependency.dfd.reject(new ClassFailure(ERROR_LOAD + (status ? ' (status)' : ''), dependency.id)); - } + xhr.onprogress = xhr.onreadystatechange = function() { + self.clearTimeout(pointer); + + pointer = self.setTimeout(checkState, timeout); + }; + + xhr.onload = function() { + pointer = self.clearTimeout(pointer); + + if(!('status' in xhr) || xhr.status === 200) { + resolve(xhr.responseText, xhr.getResponseHeader && xhr.getResponseHeader('content-type')); + } else { + reject(xhr.statusText); + } + }; + + xhr.open('GET', url, true); + xhr.send(); + + pointer = self.setTimeout(checkState, timeout); + }); - function load(location) { - location = location || 0; - dependency.url = document.createElement('a'); + function ClassLoader(dependency) { + var pattern; - dependency.url.href = pattern ? functionResolveUrl(pattern.process(dependency.path, location)) : dependency.path; + function resolve(response, type) { + if(!type || !dependency.handler.validate || dependency.handler.validate(type)) { + dependency.source = response; - if(dependency.invalid) { - dependency.url.search += ((regexMatchEmptySearch.test(dependency.url.search)) ? '' : '&') + functionGetTimestamp(); + singletonEvent.emit(EVENT_POST_REQUEST, dependency.type, dependency); + } else { + dependency.dfd.reject(new ClassFailure(ERROR_LOAD + ' (content-type)', dependency.id)); + } } - singletonEvent.emit(EVENT_PRE_REQUEST, dependency.type, dependency); + function reject(status) { + dependency.dfd.reject(new ClassFailure(ERROR_LOAD + (status ? ' (status)' : ''), dependency.id)); + } + + function load(location) { + location = location || 0; + dependency.url = document.createElement('a'); + + dependency.url.href = pattern ? functionResolveUrl(pattern.process(dependency.path, location)) : dependency.path; - new ClassXhr(dependency.url).then( - resolve, - ( - pattern ? - function() { - location++; + if(dependency.invalid) { + dependency.url.search += ((regexMatchEmptySearch.test(dependency.url.search)) ? '' : '&') + functionGetTimestamp(); + } - if(pattern.location[location]) { - load(location); - } else { - reject(); + singletonEvent.emit(EVENT_PRE_REQUEST, dependency.type, dependency); + + loadXhr(dependency.url.href) + .then( + resolve, + function(error) { + location++; + + if (pattern && pattern.location[location]) { + load(location); + } else { + reject(error); + } } - } - : - reject - ) - ); - } + ); + } - if(!regexIsAbsoluteUri.test(dependency.path)) { - functionIterate(settings.pattern, function(property, value) { - value.matches(dependency.path) && (!pattern || pattern.weight < value.weight) && (pattern = value); - }); + if(!regexIsAbsoluteUri.test(dependency.path)) { + functionIterate(settings.pattern, function(property, value) { + value.matches(dependency.path) && (!pattern || pattern.weight < value.weight) && (pattern = value); + }); + } + + load(); } - load(); -} + return ClassLoader; +}()); diff --git a/src/class/task.js b/src/class/task.js new file mode 100644 index 0000000..743ac3b --- /dev/null +++ b/src/class/task.js @@ -0,0 +1,86 @@ +/* global + global, document, demand, provide, queue, processor, settings, setTimeout, clearTimeout, + functionToArray, functionUuid, + ClassPledge +*/ + +//=require function/toArray.js +//=require function/uuid.js +//=require class/pledge.js + +var ClassTask = (function() { + var lookup = {}; + + function isTransferable(value) { + return (value instanceof ArrayBuffer) || (value instanceof MessagePort) || ('ImageBitmap' in self && value instanceof ImageBitmap); + } + + function Task(task) { + var script, worker; + + /* global $task, $isTransferable */ + script = '$task = ' + task + '; $isTransferable = ' + isTransferable + '; onmessage = ' + function(message) { + var toArray = Array.prototype.slice, + data = message.data, + isSettled; + + function resolve() { + var args; + + if(!isSettled) { + isSettled = true; + args = toArray.call(arguments); + + postMessage([ data[0], 1, args], args.filter($isTransferable)); + } + } + + function reject(error) { + if(!isSettled) { + isSettled = true; + + postMessage([ data[0], 0, error.toString() ]); + } + } + + try { + $task.apply($task, [ resolve, reject ].concat(data[1])); + } catch(error) { + reject(error); + } + }; + + worker = new Worker(URL.createObjectURL(new Blob([ script ], { type: 'application/javascript' }))); + + worker.onmessage = function(message) { + var uuid = message.data[0], + dfd = uuid ? lookup[uuid] : null; + + if(!uuid || !dfd) { + return; + } + + if(message.data[1]) { + dfd.resolve.apply(null, message.data[2]); + } else { + dfd.reject(message.data[2]); + } + + delete lookup[uuid]; + } + + return function() { + var dfd = ClassPledge.defer(), + uuid = functionUuid(), + args = functionToArray(arguments); + + lookup[uuid] = dfd; + + worker.postMessage([ uuid, args ], args.filter(isTransferable)); + + return dfd.pledge; + } + } + + return Task; +}()); diff --git a/src/class/xhr.js b/src/class/xhr.js deleted file mode 100644 index 7919e87..0000000 --- a/src/class/xhr.js +++ /dev/null @@ -1,54 +0,0 @@ -/* global - global, document, demand, provide, queue, processor, settings, setTimeout, clearTimeout, - TRUE, - regexMatchBaseUrl, - ClassPledge -*/ - -//=require constants.js -//=require shortcuts.js -//=require variables.js -//=require class/pledge.js - -var ClassXhr = (function(XMLHttpRequest) { - var XDomainRequest = 'XDomainRequest' in global && global.XDomainRequest || XMLHttpRequest; - - function checkState() { - if(this.readyState < 4) { - this.abort(); - } - } - - return function ClassXhr(url) { - var dfd = ClassPledge.defer(), - xhr = regexMatchBaseUrl.test(url) ? new XMLHttpRequest() : new XDomainRequest(), - boundCheckState = checkState.bind(xhr), - timeout = settings.timeout, - pointer; - - xhr.ontimeout = xhr.onerror = xhr.onabort = function() { - dfd.reject(xhr.status); - }; - xhr.onprogress = xhr.onreadystatechange = function() { - clearTimeout(pointer); - - pointer = setTimeout(boundCheckState, timeout); - }; - xhr.onload = function() { - pointer = clearTimeout(pointer); - - if(!('status' in xhr) || xhr.status === 200) { - dfd.resolve(xhr.responseText, xhr.getResponseHeader && xhr.getResponseHeader('content-type')); - } else { - dfd.reject(xhr.status); - } - }; - - xhr.open('GET', url, TRUE); - xhr.send(); - - pointer = setTimeout(boundCheckState, timeout); - - return dfd.pledge; - }; -}(XMLHttpRequest)); diff --git a/src/demand.js b/src/demand.js index 039a0a6..85f9ed8 100644 --- a/src/demand.js +++ b/src/demand.js @@ -4,7 +4,7 @@ validatorIsTypeOf, validatorIsArray, validatorIsObject, validatorIsInstanceOf, validatorIsSemver, functionResolveUrl, functionResolveSourcemaps, functionMerge, functionIterate, functionDefer, functionToArray, functionIdle, functionHash, functionUuid, AbstractUuid, abstractHandler, - ClassDependency, ClassQueue, ClassProcessor, ClassPledge, ClassXhr, ClassFailure, ClassDescriptor, ClassWeakmap, ClassSemver, + ClassDependency, ClassQueue, ClassProcessor, ClassPledge, ClassFailure, ClassDescriptor, ClassWeakmap, ClassTask, ClassSemver, handlerModule, handlerBundle, handlerComponent, pluginGenie */ @@ -67,11 +67,11 @@ assignModule(MODULE_PREFIX_FUNCTION + 'idle', functionIdle); assignModule(MODULE_PREFIX_FUNCTION + 'uuid', functionUuid); assignModule(MODULE_PREFIX_FUNCTION + 'toArray', functionToArray); + assignModule(MODULE_PREFIX + 'task', ClassTask); assignModule(MODULE_PREFIX + 'weakmap', ClassWeakmap); assignModule(MODULE_PREFIX + 'descriptor', ClassDescriptor); assignModule(MODULE_PREFIX + 'pledge', ClassPledge); assignModule(MODULE_PREFIX + 'queue', ClassQueue); - assignModule(MODULE_PREFIX + 'xhr', ClassXhr); assignModule(MODULE_PREFIX + 'failure', ClassFailure); assignModule(MODULE_PREFIX + 'semver', ClassSemver); diff --git a/src/function/defer.js b/src/function/defer.js index 4ceb8d4..10ba739 100644 --- a/src/function/defer.js +++ b/src/function/defer.js @@ -1,9 +1,3 @@ -/** - * Based on setAsap: - * Repo: https://github.com/taylorhakes/setAsap - * License: https://github.com/taylorhakes/setAsap/blob/master/LICENSE - */ - /* global global, document, demand, provide, queue, processor, settings, setTimeout, clearTimeout, NULL, TRUE, FALSE, @@ -22,62 +16,35 @@ * @param {function} function */ var functionDefer = (function() { - var hasSetImmediate = 'setImmediate' in global, - element, fallback; + var storage, observer, element; - if('MutationObserver' in global) { - return function functionDefer(fn) { - element = document.createElement('div'); - - new MutationObserver(function() { fn(); }) - .observe(element, { attributes: TRUE }); - - element.setAttribute('i', '1'); - }; + if('setImmediate' in global && typeof global.setImmediate === 'function') { + return global.setImmediate; } - if(!hasSetImmediate && 'postMessage' in global && !('importScripts' in global) && 'addEventListener' in global) { - return (function() { - var storage = {}; + if('MutationObserver' in global && typeof global.MutationObserver === 'function') { + storage = {}; + element = document.createElement('div'); + observer = new MutationObserver(function(records) { + records.forEach(function(record) { + var uuid = record.attributeName.substr(1); - function onMessage(event) { - var fn; + storage[uuid] && storage[uuid](); - if(event.source === global && event.data && (fn = storage[event.data])) { - fn(); + delete storage[uuid]; + }); + }); - delete storage[event.data]; - } - } + observer.observe(element, { attributes: TRUE }); - global.addEventListener('message', onMessage, FALSE); - - return function functionDefer(fn) { - var uuid = functionUuid(); - - storage[uuid] = fn; - - global.postMessage(uuid, '*'); - }; - }()); - } - - if(!hasSetImmediate && 'onreadystatechange' in (element = document.createElement('script'))) { return function functionDefer(fn) { - element.onreadystatechange = function onreadystatechange() { - element.onreadystatechange = NULL; - element.parentNode.removeChild(element); + var uuid = functionUuid(); - fn(); - }; + storage[uuid] = fn; - document.body.appendChild(element); + element.setAttribute('i' + uuid, 1); }; } - fallback = hasSetImmediate ? setImmediate : setTimeout; // eslint-disable-line no-undef - - return function functionDefer(fn) { - fallback(fn); - }; + return setTimeout; }()); diff --git a/src/shortcuts.js b/src/shortcuts.js index 547622d..dde7c19 100644 --- a/src/shortcuts.js +++ b/src/shortcuts.js @@ -6,8 +6,6 @@ var arrayPrototype = Array.prototype, arrayPrototypeSlice = arrayPrototype.slice, arrayPrototypeConcat = arrayPrototype.concat, object = Object, - objectPrototype = object.prototype, - objectPrototypeToString = objectPrototype.toString, objectCreate = object.create, objectDefineProperty = object.defineProperty, objectGetOwnPropertyNames = object.getOwnPropertyNames, diff --git a/src/validator/isArray.js b/src/validator/isArray.js index b7923e0..ce76fc9 100644 --- a/src/validator/isArray.js +++ b/src/validator/isArray.js @@ -1,10 +1,7 @@ /* global global, document, demand, provide, queue, processor, settings, setTimeout, clearTimeout, - objectPrototypeToString */ -//=require shortcuts.js - /** * isArray * @@ -16,5 +13,5 @@ */ function validatorIsArray(value) { - return objectPrototypeToString.call(value) === '[object Array]'; + return Array.isArray(value); }