first
This commit is contained in:
commit
00b7dbd0b7
10404 files changed
+3285853
No files matched your search
Vendored
+17209
File diff suppressed because it is too large.
Load diff
+9
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/
|
||||
(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function r(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function e(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function o(n,t){return!(null==n||!n.length)&&g(n,t,0)>-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function c(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function a(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function l(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function s(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function h(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}function p(n){return n.match(Jn)||[]}function _(n,t,r){var e;return r(n,(function(n,r,u){if(t(n,r,u))return e=r,!1})),e}function v(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function g(n,t,r){return t==t?function(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):v(n,d,r)}function y(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function d(n){return n!=n}function b(n,t){var r=null==n?0:n.length;return r?j(n,t)/r:X}function w(n){return function(t){return null==t?N:t[n]}}function m(n){return function(t){return null==n?N:n[t]}}function x(n,t,r,e,u){return u(n,(function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)})),r}function j(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==N&&(r=r===N?i:r+i)}return r}function A(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function k(n){return n?n.slice(0,M(n)+1).replace(Zn,""):n}function O(n){return function(t){return n(t)}}function I(n,t){return c(t,(function(t){return n[t]}))}function R(n,t){return n.has(t)}function z(n,t){for(var r=-1,e=n.length;++r<e&&g(t,n[r],0)>-1;);return r}function E(n,t){for(var r=n.length;r--&&g(t,n[r],0)>-1;);return r}function S(n){return"\\"+Ht[n]}function W(n){return Pt.test(n)}function L(n){return qt.test(n)}function C(n){var t=-1,r=Array(n.size);return n.forEach((function(n,e){r[++t]=[e,n]})),r}function U(n,t){return function(r){return n(t(r))}}function B(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==Z||(n[r]=Z,i[u++]=r)}return i}function T(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=n})),r}function $(n){return W(n)?function(n){for(var t=Ft.lastIndex=0;Ft.test(n);)++t;return t}(n):hr(n)}function D(n){return W(n)?function(n){return n.match(Ft)||[]}(n):function(n){return n.split("")}(n)}function M(n){for(var t=n.length;t--&&Kn.test(n.charAt(t)););return t}function F(n){return n.match(Nt)||[]}var N,P="Expected a function",q="__lodash_hash_undefined__",Z="__lodash_placeholder__",K=16,V=32,G=64,H=128,J=256,Y=1/0,Q=9007199254740991,X=NaN,nn=4294967295,tn=[["ary",H],["bind",1],["bindKey",2],["curry",8],["curryRight",K],["flip",512],["partial",V],["partialRight",G],["rearg",J]],rn="[object Arguments]",en="[object Array]",un="[object Boolean]",on="[object Date]",fn="[object Error]",cn="[object Function]",an="[object GeneratorFunction]",ln="[object Map]",sn="[object Number]",hn="[object Object]",pn="[object Promise]",_n="[object RegExp]",vn="[object Set]",gn="[object String]",yn="[object Symbol]",dn="[object WeakMap]",bn="[object ArrayBuffer]",wn="[object DataView]",mn="[object Float32Array]",xn="[object Float64Array]",jn="[object Int8Array]",An="[object Int16Array]",kn="[object Int32Array]",On="[object Uint8Array]",In="[object Uint8ClampedArray]",Rn="[object Uint16Array]",zn="[object Uint32Array]",En=/\b__p \+= '';/g,Sn=/\b(__p \+=) '' \+/g,Wn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ln=/&(?:amp|lt|gt|quot|#39);/g,Cn=/[&<>"']/g,Un=RegExp(Ln.source),Bn=RegExp(Cn.source),Tn=/<%-([\s\S]+?)%>/g,$n=/<%([\s\S]+?)%>/g,Dn=/<%=([\s\S]+?)%>/g,Mn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fn=/^\w*$/,Nn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pn=/[\\^$.*+?()[\]{}|]/g,qn=RegExp(Pn.source),Zn=/^\s+/,Kn=/\s/,Vn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Gn=/\{\n\/\* \[wrapped with (.+)\] \*/,Hn=/,? & /,Jn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Yn=/[()=,{}\[\]\/\s]/,Qn=/\\(\\)?/g,Xn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nt=/\w*$/,tt=/^[-+]0x[0-9a-f]+$/i,rt=/^0b[01]+$/i,et=/^\[object .+?Constructor\]$/,ut=/^0o[0-7]+$/i,it=/^(?:0|[1-9]\d*)$/,ot=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ft=/($^)/,ct=/['\n\r\u2028\u2029\\]/g,at="\\Line truncated
|
||||
Vendored
+5685
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function _(){return H.apply(null,arguments)}function y(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function g(e){return void 0===e}function w(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Pt(e,t,n,s,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){if(null==e._isValid){var t=p(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function I(e){var t=l(NaN);return null!=e?E(p(t),e):p(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=_.momentProperties=[],z=!1;function $(e,t){var n,s,i,r=Z.length;if(g(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),g(t._i)||(e._i=t._i),g(t._f)||(e._f=t._f),g(t._l)||(e._l=t._l),g(t._strict)||(e._strict=t._strict),g(t._tzm)||(e._tzm=t._tzm),g(t._isUTC)||(e._isUTC=t._isUTC),g(t._offset)||(e._offset=t._offset),g(t._pf)||(e._pf=p(t)),g(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)g(i=t[s=Z[n]])||(e[s]=i);return e}function q(e){$(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,_.updateOffset(this),z=!1)}function v(e){return e instanceof q||null!=e&&null!=e._isAMomentObject}function B(e){!1===_.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=_.deprecationHandler&&_.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=_.deprecationHandler&&_.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function a(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=a(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndLine truncated
|
||||
+29869
File diff suppressed because it is too large.
Load diff
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
!function(){"use strict";var e,n;e=this,n=function(e,n){function t(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e,n){l(e,n),l(e+"Capture",n)}function l(e,n){for(ra[e]=n,e=0;e<n.length;e++)ta.add(n[e])}function a(e,n,t,r,l,a,u){this.acceptsBooleans=2===n||3===n||4===n,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=a,this.removeEmptyString=u}function u(e,n,t,r){var l=sa.hasOwnProperty(n)?sa[n]:null;(null!==l?0!==l.type:r||!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&(function(e,n,t,r){if(null==n||function(e,n,t,r){if(null!==t&&0===t.type)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==t?!t.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,n,t,r))return!0;if(r)return!1;if(null!==t)switch(t.type){case 3:return!n;case 4:return!1===n;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}(n,t,l,r)&&(t=null),r||null===l?function(e){return!!aa.call(ia,e)||!aa.call(oa,e)&&(ua.test(e)?ia[e]=!0:(oa[e]=!0,!1))}(n)&&(null===t?e.removeAttribute(n):e.setAttribute(n,""+t)):l.mustUseProperty?e[l.propertyName]=null===t?3!==l.type&&"":t:(n=l.attributeName,r=l.attributeNamespace,null===t?e.removeAttribute(n):(t=3===(l=l.type)||4===l&&!0===t?"":""+t,r?e.setAttributeNS(r,n,t):e.setAttribute(n,t))))}function o(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=_a&&e[_a]||e["@@iterator"])?e:null}function i(e,n,t){if(void 0===za)try{throw Error()}catch(e){za=(n=e.stack.trim().match(/\n( *(at )?)/))&&n[1]||""}return"\n"+za+e}function s(e,n){if(!e||Ta)return"";Ta=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(n){if(n&&r&&"string"==typeof n.stack){for(var l=n.stack.split("\n"),a=r.stack.split("\n"),u=l.length-1,o=a.length-1;1<=u&&0<=o&&l[u]!==a[o];)o--;for(;1<=u&&0<=o;u--,o--)if(l[u]!==a[o]){if(1!==u||1!==o)do{if(u--,0>--o||l[u]!==a[o]){var s="\n"+l[u].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=u&&0<=o);break}}}finally{Ta=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?i(e):""}function c(e){switch(e.tag){case 5:return i(e.type);case 16:return i("Lazy");case 13:return i("Suspense");case 19:return i("SuspenseList");case 0:case 2:case 15:return e=s(e.type,!1);case 11:return e=s(e.type.render,!1);case 1:return e=s(e.type,!0);default:return""}}function f(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ha:return"Fragment";case ma:return"Portal";case va:return"Profiler";case ga:return"StrictMode";case wa:return"Suspense";case Sa:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ba:return(e.displayName||"Context")+".Consumer";case ya:return(e._context.displayName||"Context")+".Provider";case ka:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case xa:return null!==(n=e.displayName||null)?n:f(e.type)||"Memo";case Ea:n=e._payload,e=e._init;try{return f(e(n))}catch(e){}}return null}function d(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=n.render).displayName||e.name||"",n.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return f(n);case 8:return n===ga?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof n)return n.displayName||n.name||null;if("string"==typeof n)return n}return null}function p(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function m(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function h(e){e._valueTracker||(e._valueTracker=function(e){var n=m(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&void 0!==t&&Line truncated
|
||||
Vendored
+3342
File diff suppressed because it is too large.
Load diff
+10
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
!function(){"use strict";var e,t;e=this,t=function(e){function t(e,t,n){this.props=e,this.context=t,this.refs=L,this.updater=n||T}function n(){}function r(e,t,n){this.props=e,this.context=t,this.refs=L,this.updater=n||T}function o(e,t,n){var r,o={},u=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(u=""+t.key),t)D.call(t,r)&&!V.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(1===i)o.children=n;else if(1<i){for(var l=Array(i),c=0;c<i;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===o[r]&&(o[r]=i[r]);return{$$typeof:g,type:e,key:u,ref:a,props:o,_owner:U.current}}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===g}function a(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function i(e,t,n,r,o){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var c=!1;if(null===e)c=!0;else switch(l){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case g:case k:c=!0}}if(c)return o=o(c=e),e=""===r?"."+a(c,0):r,M(o)?(n="",null!=e&&(n=e.replace(q,"$&/")+"/"),i(o,t,n,"",(function(e){return e}))):null!=o&&(u(o)&&(o=function(e,t){return{$$typeof:g,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(q,"$&/")+"/")+e)),t.push(o)),1;if(c=0,r=""===r?".":r+":",M(e))for(var f=0;f<e.length;f++){var s=r+a(l=e[f],f);c+=i(l,t,n,s,o)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=j&&e[j]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),f=0;!(l=e.next()).done;)c+=i(l=l.value,t,n,s=r+a(l,f++),o);else if("object"===l)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function l(e,t,n){if(null==e)return e;var r=[],o=0;return i(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function c(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}function f(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<y(o,t)))break e;e[r]=t,e[n]=o,n=r}}function s(e){return 0===e.length?null:e[0]}function p(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,u=o>>>1;r<u;){var a=2*(r+1)-1,i=e[a],l=a+1,c=e[l];if(0>y(i,n))l<o&&0>y(c,i)?(e[r]=c,e[l]=n,r=l):(e[r]=i,e[a]=n,r=a);else{if(!(l<o&&0>y(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function y(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}function d(e){for(var t=s(G);null!==t;){if(null===t.callback)p(G);else{if(!(t.startTime<=e))break;p(G),t.sortIndex=t.expirationTime,f(Y,t)}t=s(G)}}function b(e){if(ee=!1,d(e),!Z)if(null!==s(Y))Z=!0,_(v);else{var t=s(G);null!==t&&h(b,t.startTime-e)}}function v(e,t){Z=!1,ee&&(ee=!1,ne(ae),ae=-1),X=!0;var n=Q;try{for(d(t),K=s(Y);null!==K&&(!(K.expirationTime>t)||e&&!m());){var r=K.callback;if("function"==typeof r){K.callback=null,Q=K.priorityLevel;var o=r(K.expirationTime<=t);t=z(),"function"==typeof o?K.callback=o:K===s(Y)&&p(Y),d(t)}else p(Y);K=s(Y)}if(null!==K)var u=!0;else{var a=s(G);null!==a&&h(b,a.startTime-t),u=!1}return u}finally{K=null,Q=n,X=!1}}function m(){return!(z()-le<ie)}function _(e){ue=e,oe||(oe=!0,fe())}function h(e,t){ae=te((function(){e(z())}),t)}var g=Symbol.for("react.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),E=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),$=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),j=Symbol.iterator,T={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){},enqueueReplaceState:function(e,t,n,r){},enqueueSetState:function(e,t,n,r){}},O=Object.assign,L={};t.prototype.isReactComponent={},t.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},t.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},n.prototype=t.prototype;var F=r.prototype=new n;F.constructor=r,O(F,t.prototype),F.isPureReactComponent=!0;var M=Array.isArray,D=Object.prototype.hasOwnProperty,U={current:null},V={key:!0,ref:!0,__self:!0,__source:!0},q=/\/+/g,A={current:null},N={transition:null};if("object"==typeof performance&&"function"==typeof performance.now)var B=performance,z=function(){return B.noLine truncated
|
||||
+760
@@ -0,0 +1,760 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
var runtime = (function (exports) {
|
||||
"use strict";
|
||||
|
||||
var Op = Object.prototype;
|
||||
var hasOwn = Op.hasOwnProperty;
|
||||
var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; };
|
||||
var undefined; // More compressible than void 0.
|
||||
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
||||
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
||||
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
||||
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
||||
|
||||
function define(obj, key, value) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
return obj[key];
|
||||
}
|
||||
try {
|
||||
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
||||
define({}, "");
|
||||
} catch (err) {
|
||||
define = function(obj, key, value) {
|
||||
return obj[key] = value;
|
||||
};
|
||||
}
|
||||
|
||||
function wrap(innerFn, outerFn, self, tryLocsList) {
|
||||
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
||||
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
||||
var generator = Object.create(protoGenerator.prototype);
|
||||
var context = new Context(tryLocsList || []);
|
||||
|
||||
// The ._invoke method unifies the implementations of the .next,
|
||||
// .throw, and .return methods.
|
||||
defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) });
|
||||
|
||||
return generator;
|
||||
}
|
||||
exports.wrap = wrap;
|
||||
|
||||
// Try/catch helper to minimize deoptimizations. Returns a completion
|
||||
// record like context.tryEntries[i].completion. This interface could
|
||||
// have been (and was previously) designed to take a closure to be
|
||||
// invoked without arguments, but in all the cases we care about we
|
||||
// already have an existing method we want to call, so there's no need
|
||||
// to create a new function object. We can even get away with assuming
|
||||
// the method takes exactly one argument, since that happens to be true
|
||||
// in every case, so we don't have to touch the arguments object. The
|
||||
// only additional allocation required is the completion record, which
|
||||
// has a stable shape and so hopefully should be cheap to allocate.
|
||||
function tryCatch(fn, obj, arg) {
|
||||
try {
|
||||
return { type: "normal", arg: fn.call(obj, arg) };
|
||||
} catch (err) {
|
||||
return { type: "throw", arg: err };
|
||||
}
|
||||
}
|
||||
|
||||
var GenStateSuspendedStart = "suspendedStart";
|
||||
var GenStateSuspendedYield = "suspendedYield";
|
||||
var GenStateExecuting = "executing";
|
||||
var GenStateCompleted = "completed";
|
||||
|
||||
// Returning this object from the innerFn has the same effect as
|
||||
// breaking out of the dispatch switch statement.
|
||||
var ContinueSentinel = {};
|
||||
|
||||
// Dummy constructor functions that we use as the .constructor and
|
||||
// .constructor.prototype properties for functions that return Generator
|
||||
// objects. For full spec compliance, you may wish to configure your
|
||||
// minifier not to mangle the names of these two functions.
|
||||
function Generator() {}
|
||||
function GeneratorFunction() {}
|
||||
function GeneratorFunctionPrototype() {}
|
||||
|
||||
// This is a polyfill for %IteratorPrototype% for environments that
|
||||
// don't natively support it.
|
||||
var IteratorPrototype = {};
|
||||
define(IteratorPrototype, iteratorSymbol, function () {
|
||||
return this;
|
||||
});
|
||||
|
||||
var getProto = Object.getPrototypeOf;
|
||||
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
||||
if (NativeIteratorPrototype &&
|
||||
NativeIteratorPrototype !== Op &&
|
||||
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
||||
// This environment has a native %IteratorPrototype%; use it instead
|
||||
// of the polyfill.
|
||||
IteratorPrototype = NativeIteratorPrototype;
|
||||
}
|
||||
|
||||
var Gp = GeneratorFunctionPrototype.prototype =
|
||||
Generator.prototype = Object.create(IteratorPrototype);
|
||||
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
||||
defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true });
|
||||
defineProperty(
|
||||
GeneratorFunctionPrototype,
|
||||
"constructor",
|
||||
{ value: GeneratorFunction, configurable: true }
|
||||
);
|
||||
GeneratorFunction.displayName = define(
|
||||
GeneratorFunctionPrototype,
|
||||
toStringTagSymbol,
|
||||
"GeneratorFunction"
|
||||
);
|
||||
|
||||
// Helper for defining the .next, .throw, and .return methods of the
|
||||
// Iterator interface in terms of a single ._invoke method.
|
||||
function defineIteratorMethods(prototype) {
|
||||
["next", "throw", "return"].forEach(function(method) {
|
||||
define(prototype, method, function(arg) {
|
||||
return this._invoke(method, arg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
exports.isGeneratorFunction = function(genFun) {
|
||||
var ctor = typeof genFun === "function" && genFun.constructor;
|
||||
return ctor
|
||||
? ctor === GeneratorFunction ||
|
||||
// For the native GeneratorFunction constructor, the best we can
|
||||
// do is to check its .name property.
|
||||
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
||||
: false;
|
||||
};
|
||||
|
||||
exports.mark = function(genFun) {
|
||||
if (Object.setPrototypeOf) {
|
||||
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
||||
} else {
|
||||
genFun.__proto__ = GeneratorFunctionPrototype;
|
||||
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
||||
}
|
||||
genFun.prototype = Object.create(Gp);
|
||||
return genFun;
|
||||
};
|
||||
|
||||
// Within the body of any async function, `await x` is transformed to
|
||||
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
||||
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
||||
// meant to be awaited.
|
||||
exports.awrap = function(arg) {
|
||||
return { __await: arg };
|
||||
};
|
||||
|
||||
function AsyncIterator(generator, PromiseImpl) {
|
||||
function invoke(method, arg, resolve, reject) {
|
||||
var record = tryCatch(generator[method], generator, arg);
|
||||
if (record.type === "throw") {
|
||||
reject(record.arg);
|
||||
} else {
|
||||
var result = record.arg;
|
||||
var value = result.value;
|
||||
if (value &&
|
||||
typeof value === "object" &&
|
||||
hasOwn.call(value, "__await")) {
|
||||
return PromiseImpl.resolve(value.__await).then(function(value) {
|
||||
invoke("next", value, resolve, reject);
|
||||
}, function(err) {
|
||||
invoke("throw", err, resolve, reject);
|
||||
});
|
||||
}
|
||||
|
||||
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
||||
// When a yielded Promise is resolved, its final value becomes
|
||||
// the .value of the Promise<{value,done}> result for the
|
||||
// current iteration.
|
||||
result.value = unwrapped;
|
||||
resolve(result);
|
||||
}, function(error) {
|
||||
// If a rejected Promise was yielded, throw the rejection back
|
||||
// into the async generator function so it can be handled there.
|
||||
return invoke("throw", error, resolve, reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var previousPromise;
|
||||
|
||||
function enqueue(method, arg) {
|
||||
function callInvokeWithMethodAndArg() {
|
||||
return new PromiseImpl(function(resolve, reject) {
|
||||
invoke(method, arg, resolve, reject);
|
||||
});
|
||||
}
|
||||
|
||||
return previousPromise =
|
||||
// If enqueue has been called before, then we want to wait until
|
||||
// all previous Promises have been resolved before calling invoke,
|
||||
// so that results are always delivered in the correct order. If
|
||||
// enqueue has not been called before, then it is important to
|
||||
// call invoke immediately, without waiting on a callback to fire,
|
||||
// so that the async generator function has the opportunity to do
|
||||
// any necessary setup in a predictable way. This predictability
|
||||
// is why the Promise constructor synchronously invokes its
|
||||
// executor callback, and why async functions synchronously
|
||||
// execute code before the first await. Since we implement simple
|
||||
// async functions in terms of async generators, it is especially
|
||||
// important to get this right, even though it requires care.
|
||||
previousPromise ? previousPromise.then(
|
||||
callInvokeWithMethodAndArg,
|
||||
// Avoid propagating failures to Promises returned by later
|
||||
// invocations of the iterator.
|
||||
callInvokeWithMethodAndArg
|
||||
) : callInvokeWithMethodAndArg();
|
||||
}
|
||||
|
||||
// Define the unified helper method that is used to implement .next,
|
||||
// .throw, and .return (see defineIteratorMethods).
|
||||
defineProperty(this, "_invoke", { value: enqueue });
|
||||
}
|
||||
|
||||
defineIteratorMethods(AsyncIterator.prototype);
|
||||
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
||||
return this;
|
||||
});
|
||||
exports.AsyncIterator = AsyncIterator;
|
||||
|
||||
// Note that simple async functions are implemented on top of
|
||||
// AsyncIterator objects; they just return a Promise for the value of
|
||||
// the final result produced by the iterator.
|
||||
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
||||
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
||||
|
||||
var iter = new AsyncIterator(
|
||||
wrap(innerFn, outerFn, self, tryLocsList),
|
||||
PromiseImpl
|
||||
);
|
||||
|
||||
return exports.isGeneratorFunction(outerFn)
|
||||
? iter // If outerFn is a generator, return the full iterator.
|
||||
: iter.next().then(function(result) {
|
||||
return result.done ? result.value : iter.next();
|
||||
});
|
||||
};
|
||||
|
||||
function makeInvokeMethod(innerFn, self, context) {
|
||||
var state = GenStateSuspendedStart;
|
||||
|
||||
return function invoke(method, arg) {
|
||||
if (state === GenStateExecuting) {
|
||||
throw new Error("Generator is already running");
|
||||
}
|
||||
|
||||
if (state === GenStateCompleted) {
|
||||
if (method === "throw") {
|
||||
throw arg;
|
||||
}
|
||||
|
||||
// Be forgiving, per 25.3.3.3.3 of the spec:
|
||||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
||||
return doneResult();
|
||||
}
|
||||
|
||||
context.method = method;
|
||||
context.arg = arg;
|
||||
|
||||
while (true) {
|
||||
var delegate = context.delegate;
|
||||
if (delegate) {
|
||||
var delegateResult = maybeInvokeDelegate(delegate, context);
|
||||
if (delegateResult) {
|
||||
if (delegateResult === ContinueSentinel) continue;
|
||||
return delegateResult;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.method === "next") {
|
||||
// Setting context._sent for legacy support of Babel's
|
||||
// function.sent implementation.
|
||||
context.sent = context._sent = context.arg;
|
||||
|
||||
} else if (context.method === "throw") {
|
||||
if (state === GenStateSuspendedStart) {
|
||||
state = GenStateCompleted;
|
||||
throw context.arg;
|
||||
}
|
||||
|
||||
context.dispatchException(context.arg);
|
||||
|
||||
} else if (context.method === "return") {
|
||||
context.abrupt("return", context.arg);
|
||||
}
|
||||
|
||||
state = GenStateExecuting;
|
||||
|
||||
var record = tryCatch(innerFn, self, context);
|
||||
if (record.type === "normal") {
|
||||
// If an exception is thrown from innerFn, we leave state ===
|
||||
// GenStateExecuting and loop back for another invocation.
|
||||
state = context.done
|
||||
? GenStateCompleted
|
||||
: GenStateSuspendedYield;
|
||||
|
||||
if (record.arg === ContinueSentinel) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return {
|
||||
value: record.arg,
|
||||
done: context.done
|
||||
};
|
||||
|
||||
} else if (record.type === "throw") {
|
||||
state = GenStateCompleted;
|
||||
// Dispatch the exception by looping back around to the
|
||||
// context.dispatchException(context.arg) call above.
|
||||
context.method = "throw";
|
||||
context.arg = record.arg;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Call delegate.iterator[context.method](context.arg) and handle the
|
||||
// result, either by returning a { value, done } result from the
|
||||
// delegate iterator, or by modifying context.method and context.arg,
|
||||
// setting context.delegate to null, and returning the ContinueSentinel.
|
||||
function maybeInvokeDelegate(delegate, context) {
|
||||
var methodName = context.method;
|
||||
var method = delegate.iterator[methodName];
|
||||
if (method === undefined) {
|
||||
// A .throw or .return when the delegate iterator has no .throw
|
||||
// method, or a missing .next mehtod, always terminate the
|
||||
// yield* loop.
|
||||
context.delegate = null;
|
||||
|
||||
// Note: ["return"] must be used for ES3 parsing compatibility.
|
||||
if (methodName === "throw" && delegate.iterator["return"]) {
|
||||
// If the delegate iterator has a return method, give it a
|
||||
// chance to clean up.
|
||||
context.method = "return";
|
||||
context.arg = undefined;
|
||||
maybeInvokeDelegate(delegate, context);
|
||||
|
||||
if (context.method === "throw") {
|
||||
// If maybeInvokeDelegate(context) changed context.method from
|
||||
// "return" to "throw", let that override the TypeError below.
|
||||
return ContinueSentinel;
|
||||
}
|
||||
}
|
||||
if (methodName !== "return") {
|
||||
context.method = "throw";
|
||||
context.arg = new TypeError(
|
||||
"The iterator does not provide a '" + methodName + "' method");
|
||||
}
|
||||
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
var record = tryCatch(method, delegate.iterator, context.arg);
|
||||
|
||||
if (record.type === "throw") {
|
||||
context.method = "throw";
|
||||
context.arg = record.arg;
|
||||
context.delegate = null;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
var info = record.arg;
|
||||
|
||||
if (! info) {
|
||||
context.method = "throw";
|
||||
context.arg = new TypeError("iterator result is not an object");
|
||||
context.delegate = null;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
// Assign the result of the finished delegate to the temporary
|
||||
// variable specified by delegate.resultName (see delegateYield).
|
||||
context[delegate.resultName] = info.value;
|
||||
|
||||
// Resume execution at the desired location (see delegateYield).
|
||||
context.next = delegate.nextLoc;
|
||||
|
||||
// If context.method was "throw" but the delegate handled the
|
||||
// exception, let the outer generator proceed normally. If
|
||||
// context.method was "next", forget context.arg since it has been
|
||||
// "consumed" by the delegate iterator. If context.method was
|
||||
// "return", allow the original .return call to continue in the
|
||||
// outer generator.
|
||||
if (context.method !== "return") {
|
||||
context.method = "next";
|
||||
context.arg = undefined;
|
||||
}
|
||||
|
||||
} else {
|
||||
// Re-yield the result returned by the delegate method.
|
||||
return info;
|
||||
}
|
||||
|
||||
// The delegate iterator is finished, so forget it and continue with
|
||||
// the outer generator.
|
||||
context.delegate = null;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
// Define Generator.prototype.{next,throw,return} in terms of the
|
||||
// unified ._invoke helper method.
|
||||
defineIteratorMethods(Gp);
|
||||
|
||||
define(Gp, toStringTagSymbol, "Generator");
|
||||
|
||||
// A Generator should always return itself as the iterator object when the
|
||||
// @@iterator function is called on it. Some browsers' implementations of the
|
||||
// iterator prototype chain incorrectly implement this, causing the Generator
|
||||
// object to not be returned from this call. This ensures that doesn't happen.
|
||||
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
||||
define(Gp, iteratorSymbol, function() {
|
||||
return this;
|
||||
});
|
||||
|
||||
define(Gp, "toString", function() {
|
||||
return "[object Generator]";
|
||||
});
|
||||
|
||||
function pushTryEntry(locs) {
|
||||
var entry = { tryLoc: locs[0] };
|
||||
|
||||
if (1 in locs) {
|
||||
entry.catchLoc = locs[1];
|
||||
}
|
||||
|
||||
if (2 in locs) {
|
||||
entry.finallyLoc = locs[2];
|
||||
entry.afterLoc = locs[3];
|
||||
}
|
||||
|
||||
this.tryEntries.push(entry);
|
||||
}
|
||||
|
||||
function resetTryEntry(entry) {
|
||||
var record = entry.completion || {};
|
||||
record.type = "normal";
|
||||
delete record.arg;
|
||||
entry.completion = record;
|
||||
}
|
||||
|
||||
function Context(tryLocsList) {
|
||||
// The root entry object (effectively a try statement without a catch
|
||||
// or a finally block) gives us a place to store values thrown from
|
||||
// locations where there is no enclosing try statement.
|
||||
this.tryEntries = [{ tryLoc: "root" }];
|
||||
tryLocsList.forEach(pushTryEntry, this);
|
||||
this.reset(true);
|
||||
}
|
||||
|
||||
exports.keys = function(val) {
|
||||
var object = Object(val);
|
||||
var keys = [];
|
||||
for (var key in object) {
|
||||
keys.push(key);
|
||||
}
|
||||
keys.reverse();
|
||||
|
||||
// Rather than returning an object with a next method, we keep
|
||||
// things simple and return the next function itself.
|
||||
return function next() {
|
||||
while (keys.length) {
|
||||
var key = keys.pop();
|
||||
if (key in object) {
|
||||
next.value = key;
|
||||
next.done = false;
|
||||
return next;
|
||||
}
|
||||
}
|
||||
|
||||
// To avoid creating an additional object, we just hang the .value
|
||||
// and .done properties off the next function object itself. This
|
||||
// also ensures that the minifier will not anonymize the function.
|
||||
next.done = true;
|
||||
return next;
|
||||
};
|
||||
};
|
||||
|
||||
function values(iterable) {
|
||||
if (iterable || iterable === "") {
|
||||
var iteratorMethod = iterable[iteratorSymbol];
|
||||
if (iteratorMethod) {
|
||||
return iteratorMethod.call(iterable);
|
||||
}
|
||||
|
||||
if (typeof iterable.next === "function") {
|
||||
return iterable;
|
||||
}
|
||||
|
||||
if (!isNaN(iterable.length)) {
|
||||
var i = -1, next = function next() {
|
||||
while (++i < iterable.length) {
|
||||
if (hasOwn.call(iterable, i)) {
|
||||
next.value = iterable[i];
|
||||
next.done = false;
|
||||
return next;
|
||||
}
|
||||
}
|
||||
|
||||
next.value = undefined;
|
||||
next.done = true;
|
||||
|
||||
return next;
|
||||
};
|
||||
|
||||
return next.next = next;
|
||||
}
|
||||
}
|
||||
|
||||
throw new TypeError(typeof iterable + " is not iterable");
|
||||
}
|
||||
exports.values = values;
|
||||
|
||||
function doneResult() {
|
||||
return { value: undefined, done: true };
|
||||
}
|
||||
|
||||
Context.prototype = {
|
||||
constructor: Context,
|
||||
|
||||
reset: function(skipTempReset) {
|
||||
this.prev = 0;
|
||||
this.next = 0;
|
||||
// Resetting context._sent for legacy support of Babel's
|
||||
// function.sent implementation.
|
||||
this.sent = this._sent = undefined;
|
||||
this.done = false;
|
||||
this.delegate = null;
|
||||
|
||||
this.method = "next";
|
||||
this.arg = undefined;
|
||||
|
||||
this.tryEntries.forEach(resetTryEntry);
|
||||
|
||||
if (!skipTempReset) {
|
||||
for (var name in this) {
|
||||
// Not sure about the optimal order of these conditions:
|
||||
if (name.charAt(0) === "t" &&
|
||||
hasOwn.call(this, name) &&
|
||||
!isNaN(+name.slice(1))) {
|
||||
this[name] = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
stop: function() {
|
||||
this.done = true;
|
||||
|
||||
var rootEntry = this.tryEntries[0];
|
||||
var rootRecord = rootEntry.completion;
|
||||
if (rootRecord.type === "throw") {
|
||||
throw rootRecord.arg;
|
||||
}
|
||||
|
||||
return this.rval;
|
||||
},
|
||||
|
||||
dispatchException: function(exception) {
|
||||
if (this.done) {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
var context = this;
|
||||
function handle(loc, caught) {
|
||||
record.type = "throw";
|
||||
record.arg = exception;
|
||||
context.next = loc;
|
||||
|
||||
if (caught) {
|
||||
// If the dispatched exception was caught by a catch block,
|
||||
// then let that catch block handle the exception normally.
|
||||
context.method = "next";
|
||||
context.arg = undefined;
|
||||
}
|
||||
|
||||
return !! caught;
|
||||
}
|
||||
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
var record = entry.completion;
|
||||
|
||||
if (entry.tryLoc === "root") {
|
||||
// Exception thrown outside of any try block that could handle
|
||||
// it, so set the completion value of the entire function to
|
||||
// throw the exception.
|
||||
return handle("end");
|
||||
}
|
||||
|
||||
if (entry.tryLoc <= this.prev) {
|
||||
var hasCatch = hasOwn.call(entry, "catchLoc");
|
||||
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
||||
|
||||
if (hasCatch && hasFinally) {
|
||||
if (this.prev < entry.catchLoc) {
|
||||
return handle(entry.catchLoc, true);
|
||||
} else if (this.prev < entry.finallyLoc) {
|
||||
return handle(entry.finallyLoc);
|
||||
}
|
||||
|
||||
} else if (hasCatch) {
|
||||
if (this.prev < entry.catchLoc) {
|
||||
return handle(entry.catchLoc, true);
|
||||
}
|
||||
|
||||
} else if (hasFinally) {
|
||||
if (this.prev < entry.finallyLoc) {
|
||||
return handle(entry.finallyLoc);
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new Error("try statement without catch or finally");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
abrupt: function(type, arg) {
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
if (entry.tryLoc <= this.prev &&
|
||||
hasOwn.call(entry, "finallyLoc") &&
|
||||
this.prev < entry.finallyLoc) {
|
||||
var finallyEntry = entry;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (finallyEntry &&
|
||||
(type === "break" ||
|
||||
type === "continue") &&
|
||||
finallyEntry.tryLoc <= arg &&
|
||||
arg <= finallyEntry.finallyLoc) {
|
||||
// Ignore the finally entry if control is not jumping to a
|
||||
// location outside the try/catch block.
|
||||
finallyEntry = null;
|
||||
}
|
||||
|
||||
var record = finallyEntry ? finallyEntry.completion : {};
|
||||
record.type = type;
|
||||
record.arg = arg;
|
||||
|
||||
if (finallyEntry) {
|
||||
this.method = "next";
|
||||
this.next = finallyEntry.finallyLoc;
|
||||
return ContinueSentinel;
|
||||
}
|
||||
|
||||
return this.complete(record);
|
||||
},
|
||||
|
||||
complete: function(record, afterLoc) {
|
||||
if (record.type === "throw") {
|
||||
throw record.arg;
|
||||
}
|
||||
|
||||
if (record.type === "break" ||
|
||||
record.type === "continue") {
|
||||
this.next = record.arg;
|
||||
} else if (record.type === "return") {
|
||||
this.rval = this.arg = record.arg;
|
||||
this.method = "return";
|
||||
this.next = "end";
|
||||
} else if (record.type === "normal" && afterLoc) {
|
||||
this.next = afterLoc;
|
||||
}
|
||||
|
||||
return ContinueSentinel;
|
||||
},
|
||||
|
||||
finish: function(finallyLoc) {
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
if (entry.finallyLoc === finallyLoc) {
|
||||
this.complete(entry.completion, entry.afterLoc);
|
||||
resetTryEntry(entry);
|
||||
return ContinueSentinel;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"catch": function(tryLoc) {
|
||||
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
||||
var entry = this.tryEntries[i];
|
||||
if (entry.tryLoc === tryLoc) {
|
||||
var record = entry.completion;
|
||||
if (record.type === "throw") {
|
||||
var thrown = record.arg;
|
||||
resetTryEntry(entry);
|
||||
}
|
||||
return thrown;
|
||||
}
|
||||
}
|
||||
|
||||
// The context.catch method must only be called with a location
|
||||
// argument that corresponds to a known catch block.
|
||||
throw new Error("illegal catch attempt");
|
||||
},
|
||||
|
||||
delegateYield: function(iterable, resultName, nextLoc) {
|
||||
this.delegate = {
|
||||
iterator: values(iterable),
|
||||
resultName: resultName,
|
||||
nextLoc: nextLoc
|
||||
};
|
||||
|
||||
if (this.method === "next") {
|
||||
// Deliberately forget the last sent value so that we don't
|
||||
// accidentally pass it on to the delegate.
|
||||
this.arg = undefined;
|
||||
}
|
||||
|
||||
return ContinueSentinel;
|
||||
}
|
||||
};
|
||||
|
||||
// Regardless of whether this script is executing as a CommonJS module
|
||||
// or not, return the runtime object so that we can declare the variable
|
||||
// regeneratorRuntime in the outer scope, which allows this module to be
|
||||
// injected easily by `bin/regenerator --include-runtime script.js`.
|
||||
return exports;
|
||||
|
||||
}(
|
||||
// If this script is executing as a CommonJS module, use module.exports
|
||||
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
||||
// object. Either way, the resulting object will be used to initialize
|
||||
// the regeneratorRuntime variable at the top of this file.
|
||||
typeof module === "object" ? module.exports : {}
|
||||
));
|
||||
|
||||
try {
|
||||
regeneratorRuntime = runtime;
|
||||
} catch (accidentalStrictMode) {
|
||||
// This module should not be running in strict mode, so the above
|
||||
// assignment should always work unless something is misconfigured. Just
|
||||
// in case runtime.js accidentally runs in strict mode, in modern engines
|
||||
// we can explicitly access globalThis. In older engines we can escape
|
||||
// strict mode using a global Function call. This could conceivably fail
|
||||
// if a Content Security Policy forbids using Function, but in that case
|
||||
// the proper solution is to fix the accidental strict mode problem. If
|
||||
// you've misconfigured your bundler to force strict mode and applied a
|
||||
// CSP to forbid Function, and you're not willing to fix either of those
|
||||
// problems, please detail your unique predicament in a GitHub issue.
|
||||
if (typeof globalThis === "object") {
|
||||
globalThis.regeneratorRuntime = runtime;
|
||||
} else {
|
||||
Function("r", "regeneratorRuntime = r")(runtime);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var runtime=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=(w="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",a=w.asyncIterator||"@@asyncIterator",c=w.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(r){u=function(t,e,r){return t[e]=r}}function h(t,r,n,i){var a,c,u,h;r=r&&r.prototype instanceof v?r:v,r=Object.create(r.prototype),i=new O(i||[]);return o(r,"_invoke",{value:(a=t,c=n,u=i,h=f,function(t,r){if(h===p)throw new Error("Generator is already running");if(h===y){if("throw"===t)throw r;return{value:e,done:!0}}for(u.method=t,u.arg=r;;){var n=u.delegate;if(n&&(n=function t(r,n){var o=n.method,i=r.iterator[o];return i===e?(n.delegate=null,"throw"===o&&r.iterator.return&&(n.method="return",n.arg=e,t(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g):"throw"===(o=l(i,r.iterator,n.arg)).type?(n.method="throw",n.arg=o.arg,n.delegate=null,g):(i=o.arg)?i.done?(n[r.resultName]=i.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}(n,u),n)){if(n===g)continue;return n}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(h===f)throw h=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(h=p,"normal"===(n=l(a,c,u)).type){if(h=u.done?y:s,n.arg!==g)return{value:n.arg,done:u.done}}else"throw"===n.type&&(h=y,u.method="throw",u.arg=n.arg)}})}),r}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var f="suspendedStart",s="suspendedYield",p="executing",y="completed",g={};function v(){}function d(){}function m(){}var w,b,L=((b=(b=(u(w={},i,(function(){return this})),Object.getPrototypeOf))&&b(b(k([]))))&&b!==r&&n.call(b,i)&&(w=b),m.prototype=v.prototype=Object.create(w));function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var r;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,c){var u;if("throw"!==(o=l(t[o],t,i)).type)return(i=(u=o.arg).value)&&"object"==typeof i&&n.call(i,"__await")?e.resolve(i.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(i).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}));c(o.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}})}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function k(t){if(t||""===t){var r,o=t[i];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(o=function o(){for(;++r<t.length;)if(n.call(t,r))return o.value=t[r],o.done=!1,o;return o.value=e,o.done=!0,o}).next=o}throw new TypeError(typeof t+" is not iterable")}return o(L,"constructor",{value:d.prototype=m,configurable:!0}),o(m,"constructor",{value:d,configurable:!0}),d.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){return!!(t="function"==typeof t&&t.constructor)&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(L),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(h(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(L),u(L,c,"Generator"),u(L,i,(function(){return this})),u(L,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=k,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;0<=i;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.callLine truncated
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
|
||||
// DOMRect
|
||||
(function (global) {
|
||||
function number(v) {
|
||||
return v === undefined ? 0 : Number(v);
|
||||
}
|
||||
|
||||
function different(u, v) {
|
||||
return u !== v && !(isNaN(u) && isNaN(v));
|
||||
}
|
||||
|
||||
function DOMRect(xArg, yArg, wArg, hArg) {
|
||||
var x, y, width, height, left, right, top, bottom;
|
||||
|
||||
x = number(xArg);
|
||||
y = number(yArg);
|
||||
width = number(wArg);
|
||||
height = number(hArg);
|
||||
|
||||
Object.defineProperties(this, {
|
||||
x: {
|
||||
get: function () { return x; },
|
||||
set: function (newX) {
|
||||
if (different(x, newX)) {
|
||||
x = newX;
|
||||
left = right = undefined;
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
y: {
|
||||
get: function () { return y; },
|
||||
set: function (newY) {
|
||||
if (different(y, newY)) {
|
||||
y = newY;
|
||||
top = bottom = undefined;
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
width: {
|
||||
get: function () { return width; },
|
||||
set: function (newWidth) {
|
||||
if (different(width, newWidth)) {
|
||||
width = newWidth;
|
||||
left = right = undefined;
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
height: {
|
||||
get: function () { return height; },
|
||||
set: function (newHeight) {
|
||||
if (different(height, newHeight)) {
|
||||
height = newHeight;
|
||||
top = bottom = undefined;
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
left: {
|
||||
get: function () {
|
||||
if (left === undefined) {
|
||||
left = x + Math.min(0, width);
|
||||
}
|
||||
return left;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
right: {
|
||||
get: function () {
|
||||
if (right === undefined) {
|
||||
right = x + Math.max(0, width);
|
||||
}
|
||||
return right;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
top: {
|
||||
get: function () {
|
||||
if (top === undefined) {
|
||||
top = y + Math.min(0, height);
|
||||
}
|
||||
return top;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
bottom: {
|
||||
get: function () {
|
||||
if (bottom === undefined) {
|
||||
bottom = y + Math.max(0, height);
|
||||
}
|
||||
return bottom;
|
||||
},
|
||||
enumerable: true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
global.DOMRect = DOMRect;
|
||||
}(self));
|
||||
@@ -0,0 +1 @@
|
||||
!function(){function e(e){return void 0===e?0:Number(e)}function n(e,n){return!(e===n||isNaN(e)&&isNaN(n))}self.DOMRect=function(t,i,u,r){var o,f,c,a,m=e(t),b=e(i),d=e(u),g=e(r);Object.defineProperties(this,{x:{get:function(){return m},set:function(e){n(m,e)&&(m=e,o=f=void 0)},enumerable:!0},y:{get:function(){return b},set:function(e){n(b,e)&&(b=e,c=a=void 0)},enumerable:!0},width:{get:function(){return d},set:function(e){n(d,e)&&(d=e,o=f=void 0)},enumerable:!0},height:{get:function(){return g},set:function(e){n(g,e)&&(g=e,c=a=void 0)},enumerable:!0},left:{get:function(){return o=void 0===o?m+Math.min(0,d):o},enumerable:!0},right:{get:function(){return f=void 0===f?m+Math.max(0,d):f},enumerable:!0},top:{get:function(){return c=void 0===c?b+Math.min(0,g):c},enumerable:!0},bottom:{get:function(){return a=void 0===a?b+Math.max(0,g):a},enumerable:!0}})}}();
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){var t=e.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window);
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){var t=window.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}();
|
||||
+650
@@ -0,0 +1,650 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.WHATWGFetch = {})));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/* eslint-disable no-prototype-builtins */
|
||||
var g =
|
||||
(typeof globalThis !== 'undefined' && globalThis) ||
|
||||
(typeof self !== 'undefined' && self) ||
|
||||
// eslint-disable-next-line no-undef
|
||||
(typeof global !== 'undefined' && global) ||
|
||||
{};
|
||||
|
||||
var support = {
|
||||
searchParams: 'URLSearchParams' in g,
|
||||
iterable: 'Symbol' in g && 'iterator' in Symbol,
|
||||
blob:
|
||||
'FileReader' in g &&
|
||||
'Blob' in g &&
|
||||
(function() {
|
||||
try {
|
||||
new Blob();
|
||||
return true
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
})(),
|
||||
formData: 'FormData' in g,
|
||||
arrayBuffer: 'ArrayBuffer' in g
|
||||
};
|
||||
|
||||
function isDataView(obj) {
|
||||
return obj && DataView.prototype.isPrototypeOf(obj)
|
||||
}
|
||||
|
||||
if (support.arrayBuffer) {
|
||||
var viewClasses = [
|
||||
'[object Int8Array]',
|
||||
'[object Uint8Array]',
|
||||
'[object Uint8ClampedArray]',
|
||||
'[object Int16Array]',
|
||||
'[object Uint16Array]',
|
||||
'[object Int32Array]',
|
||||
'[object Uint32Array]',
|
||||
'[object Float32Array]',
|
||||
'[object Float64Array]'
|
||||
];
|
||||
|
||||
var isArrayBufferView =
|
||||
ArrayBuffer.isView ||
|
||||
function(obj) {
|
||||
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeName(name) {
|
||||
if (typeof name !== 'string') {
|
||||
name = String(name);
|
||||
}
|
||||
if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
|
||||
throw new TypeError('Invalid character in header field name: "' + name + '"')
|
||||
}
|
||||
return name.toLowerCase()
|
||||
}
|
||||
|
||||
function normalizeValue(value) {
|
||||
if (typeof value !== 'string') {
|
||||
value = String(value);
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
// Build a destructive iterator for the value list
|
||||
function iteratorFor(items) {
|
||||
var iterator = {
|
||||
next: function() {
|
||||
var value = items.shift();
|
||||
return {done: value === undefined, value: value}
|
||||
}
|
||||
};
|
||||
|
||||
if (support.iterable) {
|
||||
iterator[Symbol.iterator] = function() {
|
||||
return iterator
|
||||
};
|
||||
}
|
||||
|
||||
return iterator
|
||||
}
|
||||
|
||||
function Headers(headers) {
|
||||
this.map = {};
|
||||
|
||||
if (headers instanceof Headers) {
|
||||
headers.forEach(function(value, name) {
|
||||
this.append(name, value);
|
||||
}, this);
|
||||
} else if (Array.isArray(headers)) {
|
||||
headers.forEach(function(header) {
|
||||
if (header.length != 2) {
|
||||
throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
|
||||
}
|
||||
this.append(header[0], header[1]);
|
||||
}, this);
|
||||
} else if (headers) {
|
||||
Object.getOwnPropertyNames(headers).forEach(function(name) {
|
||||
this.append(name, headers[name]);
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
||||
Headers.prototype.append = function(name, value) {
|
||||
name = normalizeName(name);
|
||||
value = normalizeValue(value);
|
||||
var oldValue = this.map[name];
|
||||
this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
||||
};
|
||||
|
||||
Headers.prototype['delete'] = function(name) {
|
||||
delete this.map[normalizeName(name)];
|
||||
};
|
||||
|
||||
Headers.prototype.get = function(name) {
|
||||
name = normalizeName(name);
|
||||
return this.has(name) ? this.map[name] : null
|
||||
};
|
||||
|
||||
Headers.prototype.has = function(name) {
|
||||
return this.map.hasOwnProperty(normalizeName(name))
|
||||
};
|
||||
|
||||
Headers.prototype.set = function(name, value) {
|
||||
this.map[normalizeName(name)] = normalizeValue(value);
|
||||
};
|
||||
|
||||
Headers.prototype.forEach = function(callback, thisArg) {
|
||||
for (var name in this.map) {
|
||||
if (this.map.hasOwnProperty(name)) {
|
||||
callback.call(thisArg, this.map[name], name, this);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Headers.prototype.keys = function() {
|
||||
var items = [];
|
||||
this.forEach(function(value, name) {
|
||||
items.push(name);
|
||||
});
|
||||
return iteratorFor(items)
|
||||
};
|
||||
|
||||
Headers.prototype.values = function() {
|
||||
var items = [];
|
||||
this.forEach(function(value) {
|
||||
items.push(value);
|
||||
});
|
||||
return iteratorFor(items)
|
||||
};
|
||||
|
||||
Headers.prototype.entries = function() {
|
||||
var items = [];
|
||||
this.forEach(function(value, name) {
|
||||
items.push([name, value]);
|
||||
});
|
||||
return iteratorFor(items)
|
||||
};
|
||||
|
||||
if (support.iterable) {
|
||||
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
||||
}
|
||||
|
||||
function consumed(body) {
|
||||
if (body._noBody) return
|
||||
if (body.bodyUsed) {
|
||||
return Promise.reject(new TypeError('Already read'))
|
||||
}
|
||||
body.bodyUsed = true;
|
||||
}
|
||||
|
||||
function fileReaderReady(reader) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
reader.onload = function() {
|
||||
resolve(reader.result);
|
||||
};
|
||||
reader.onerror = function() {
|
||||
reject(reader.error);
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
function readBlobAsArrayBuffer(blob) {
|
||||
var reader = new FileReader();
|
||||
var promise = fileReaderReady(reader);
|
||||
reader.readAsArrayBuffer(blob);
|
||||
return promise
|
||||
}
|
||||
|
||||
function readBlobAsText(blob) {
|
||||
var reader = new FileReader();
|
||||
var promise = fileReaderReady(reader);
|
||||
var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
|
||||
var encoding = match ? match[1] : 'utf-8';
|
||||
reader.readAsText(blob, encoding);
|
||||
return promise
|
||||
}
|
||||
|
||||
function readArrayBufferAsText(buf) {
|
||||
var view = new Uint8Array(buf);
|
||||
var chars = new Array(view.length);
|
||||
|
||||
for (var i = 0; i < view.length; i++) {
|
||||
chars[i] = String.fromCharCode(view[i]);
|
||||
}
|
||||
return chars.join('')
|
||||
}
|
||||
|
||||
function bufferClone(buf) {
|
||||
if (buf.slice) {
|
||||
return buf.slice(0)
|
||||
} else {
|
||||
var view = new Uint8Array(buf.byteLength);
|
||||
view.set(new Uint8Array(buf));
|
||||
return view.buffer
|
||||
}
|
||||
}
|
||||
|
||||
function Body() {
|
||||
this.bodyUsed = false;
|
||||
|
||||
this._initBody = function(body) {
|
||||
/*
|
||||
fetch-mock wraps the Response object in an ES6 Proxy to
|
||||
provide useful test harness features such as flush. However, on
|
||||
ES5 browsers without fetch or Proxy support pollyfills must be used;
|
||||
the proxy-pollyfill is unable to proxy an attribute unless it exists
|
||||
on the object before the Proxy is created. This change ensures
|
||||
Response.bodyUsed exists on the instance, while maintaining the
|
||||
semantic of setting Request.bodyUsed in the constructor before
|
||||
_initBody is called.
|
||||
*/
|
||||
// eslint-disable-next-line no-self-assign
|
||||
this.bodyUsed = this.bodyUsed;
|
||||
this._bodyInit = body;
|
||||
if (!body) {
|
||||
this._noBody = true;
|
||||
this._bodyText = '';
|
||||
} else if (typeof body === 'string') {
|
||||
this._bodyText = body;
|
||||
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
||||
this._bodyBlob = body;
|
||||
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
||||
this._bodyFormData = body;
|
||||
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
||||
this._bodyText = body.toString();
|
||||
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
||||
this._bodyArrayBuffer = bufferClone(body.buffer);
|
||||
// IE 10-11 can't handle a DataView body.
|
||||
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
||||
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
||||
this._bodyArrayBuffer = bufferClone(body);
|
||||
} else {
|
||||
this._bodyText = body = Object.prototype.toString.call(body);
|
||||
}
|
||||
|
||||
if (!this.headers.get('content-type')) {
|
||||
if (typeof body === 'string') {
|
||||
this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
||||
} else if (this._bodyBlob && this._bodyBlob.type) {
|
||||
this.headers.set('content-type', this._bodyBlob.type);
|
||||
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
||||
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (support.blob) {
|
||||
this.blob = function() {
|
||||
var rejected = consumed(this);
|
||||
if (rejected) {
|
||||
return rejected
|
||||
}
|
||||
|
||||
if (this._bodyBlob) {
|
||||
return Promise.resolve(this._bodyBlob)
|
||||
} else if (this._bodyArrayBuffer) {
|
||||
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
||||
} else if (this._bodyFormData) {
|
||||
throw new Error('could not read FormData body as blob')
|
||||
} else {
|
||||
return Promise.resolve(new Blob([this._bodyText]))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
this.arrayBuffer = function() {
|
||||
if (this._bodyArrayBuffer) {
|
||||
var isConsumed = consumed(this);
|
||||
if (isConsumed) {
|
||||
return isConsumed
|
||||
} else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
|
||||
return Promise.resolve(
|
||||
this._bodyArrayBuffer.buffer.slice(
|
||||
this._bodyArrayBuffer.byteOffset,
|
||||
this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
|
||||
)
|
||||
)
|
||||
} else {
|
||||
return Promise.resolve(this._bodyArrayBuffer)
|
||||
}
|
||||
} else if (support.blob) {
|
||||
return this.blob().then(readBlobAsArrayBuffer)
|
||||
} else {
|
||||
throw new Error('could not read as ArrayBuffer')
|
||||
}
|
||||
};
|
||||
|
||||
this.text = function() {
|
||||
var rejected = consumed(this);
|
||||
if (rejected) {
|
||||
return rejected
|
||||
}
|
||||
|
||||
if (this._bodyBlob) {
|
||||
return readBlobAsText(this._bodyBlob)
|
||||
} else if (this._bodyArrayBuffer) {
|
||||
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
||||
} else if (this._bodyFormData) {
|
||||
throw new Error('could not read FormData body as text')
|
||||
} else {
|
||||
return Promise.resolve(this._bodyText)
|
||||
}
|
||||
};
|
||||
|
||||
if (support.formData) {
|
||||
this.formData = function() {
|
||||
return this.text().then(decode)
|
||||
};
|
||||
}
|
||||
|
||||
this.json = function() {
|
||||
return this.text().then(JSON.parse)
|
||||
};
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
// HTTP methods whose capitalization should be normalized
|
||||
var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
|
||||
|
||||
function normalizeMethod(method) {
|
||||
var upcased = method.toUpperCase();
|
||||
return methods.indexOf(upcased) > -1 ? upcased : method
|
||||
}
|
||||
|
||||
function Request(input, options) {
|
||||
if (!(this instanceof Request)) {
|
||||
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
var body = options.body;
|
||||
|
||||
if (input instanceof Request) {
|
||||
if (input.bodyUsed) {
|
||||
throw new TypeError('Already read')
|
||||
}
|
||||
this.url = input.url;
|
||||
this.credentials = input.credentials;
|
||||
if (!options.headers) {
|
||||
this.headers = new Headers(input.headers);
|
||||
}
|
||||
this.method = input.method;
|
||||
this.mode = input.mode;
|
||||
this.signal = input.signal;
|
||||
if (!body && input._bodyInit != null) {
|
||||
body = input._bodyInit;
|
||||
input.bodyUsed = true;
|
||||
}
|
||||
} else {
|
||||
this.url = String(input);
|
||||
}
|
||||
|
||||
this.credentials = options.credentials || this.credentials || 'same-origin';
|
||||
if (options.headers || !this.headers) {
|
||||
this.headers = new Headers(options.headers);
|
||||
}
|
||||
this.method = normalizeMethod(options.method || this.method || 'GET');
|
||||
this.mode = options.mode || this.mode || null;
|
||||
this.signal = options.signal || this.signal || (function () {
|
||||
if ('AbortController' in g) {
|
||||
var ctrl = new AbortController();
|
||||
return ctrl.signal;
|
||||
}
|
||||
}());
|
||||
this.referrer = null;
|
||||
|
||||
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
||||
throw new TypeError('Body not allowed for GET or HEAD requests')
|
||||
}
|
||||
this._initBody(body);
|
||||
|
||||
if (this.method === 'GET' || this.method === 'HEAD') {
|
||||
if (options.cache === 'no-store' || options.cache === 'no-cache') {
|
||||
// Search for a '_' parameter in the query string
|
||||
var reParamSearch = /([?&])_=[^&]*/;
|
||||
if (reParamSearch.test(this.url)) {
|
||||
// If it already exists then set the value with the current time
|
||||
this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
|
||||
} else {
|
||||
// Otherwise add a new '_' parameter to the end with the current time
|
||||
var reQueryString = /\?/;
|
||||
this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Request.prototype.clone = function() {
|
||||
return new Request(this, {body: this._bodyInit})
|
||||
};
|
||||
|
||||
function decode(body) {
|
||||
var form = new FormData();
|
||||
body
|
||||
.trim()
|
||||
.split('&')
|
||||
.forEach(function(bytes) {
|
||||
if (bytes) {
|
||||
var split = bytes.split('=');
|
||||
var name = split.shift().replace(/\+/g, ' ');
|
||||
var value = split.join('=').replace(/\+/g, ' ');
|
||||
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
||||
}
|
||||
});
|
||||
return form
|
||||
}
|
||||
|
||||
function parseHeaders(rawHeaders) {
|
||||
var headers = new Headers();
|
||||
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
||||
// https://tools.ietf.org/html/rfc7230#section-3.2
|
||||
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
||||
// Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
|
||||
// https://github.com/github/fetch/issues/748
|
||||
// https://github.com/zloirock/core-js/issues/751
|
||||
preProcessedHeaders
|
||||
.split('\r')
|
||||
.map(function(header) {
|
||||
return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
|
||||
})
|
||||
.forEach(function(line) {
|
||||
var parts = line.split(':');
|
||||
var key = parts.shift().trim();
|
||||
if (key) {
|
||||
var value = parts.join(':').trim();
|
||||
try {
|
||||
headers.append(key, value);
|
||||
} catch (error) {
|
||||
console.warn('Response ' + error.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
return headers
|
||||
}
|
||||
|
||||
Body.call(Request.prototype);
|
||||
|
||||
function Response(bodyInit, options) {
|
||||
if (!(this instanceof Response)) {
|
||||
throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
|
||||
}
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
this.type = 'default';
|
||||
this.status = options.status === undefined ? 200 : options.status;
|
||||
if (this.status < 200 || this.status > 599) {
|
||||
throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
|
||||
}
|
||||
this.ok = this.status >= 200 && this.status < 300;
|
||||
this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
|
||||
this.headers = new Headers(options.headers);
|
||||
this.url = options.url || '';
|
||||
this._initBody(bodyInit);
|
||||
}
|
||||
|
||||
Body.call(Response.prototype);
|
||||
|
||||
Response.prototype.clone = function() {
|
||||
return new Response(this._bodyInit, {
|
||||
status: this.status,
|
||||
statusText: this.statusText,
|
||||
headers: new Headers(this.headers),
|
||||
url: this.url
|
||||
})
|
||||
};
|
||||
|
||||
Response.error = function() {
|
||||
var response = new Response(null, {status: 200, statusText: ''});
|
||||
response.status = 0;
|
||||
response.type = 'error';
|
||||
return response
|
||||
};
|
||||
|
||||
var redirectStatuses = [301, 302, 303, 307, 308];
|
||||
|
||||
Response.redirect = function(url, status) {
|
||||
if (redirectStatuses.indexOf(status) === -1) {
|
||||
throw new RangeError('Invalid status code')
|
||||
}
|
||||
|
||||
return new Response(null, {status: status, headers: {location: url}})
|
||||
};
|
||||
|
||||
exports.DOMException = g.DOMException;
|
||||
try {
|
||||
new exports.DOMException();
|
||||
} catch (err) {
|
||||
exports.DOMException = function(message, name) {
|
||||
this.message = message;
|
||||
this.name = name;
|
||||
var error = Error(message);
|
||||
this.stack = error.stack;
|
||||
};
|
||||
exports.DOMException.prototype = Object.create(Error.prototype);
|
||||
exports.DOMException.prototype.constructor = exports.DOMException;
|
||||
}
|
||||
|
||||
function fetch(input, init) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var request = new Request(input, init);
|
||||
|
||||
if (request.signal && request.signal.aborted) {
|
||||
return reject(new exports.DOMException('Aborted', 'AbortError'))
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
function abortXhr() {
|
||||
xhr.abort();
|
||||
}
|
||||
|
||||
xhr.onload = function() {
|
||||
var options = {
|
||||
status: xhr.status,
|
||||
statusText: xhr.statusText,
|
||||
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
||||
};
|
||||
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
||||
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
||||
setTimeout(function() {
|
||||
resolve(new Response(body, options));
|
||||
}, 0);
|
||||
};
|
||||
|
||||
xhr.onerror = function() {
|
||||
setTimeout(function() {
|
||||
reject(new TypeError('Network request failed'));
|
||||
}, 0);
|
||||
};
|
||||
|
||||
xhr.ontimeout = function() {
|
||||
setTimeout(function() {
|
||||
reject(new TypeError('Network request failed'));
|
||||
}, 0);
|
||||
};
|
||||
|
||||
xhr.onabort = function() {
|
||||
setTimeout(function() {
|
||||
reject(new exports.DOMException('Aborted', 'AbortError'));
|
||||
}, 0);
|
||||
};
|
||||
|
||||
function fixUrl(url) {
|
||||
try {
|
||||
return url === '' && g.location.href ? g.location.href : url
|
||||
} catch (e) {
|
||||
return url
|
||||
}
|
||||
}
|
||||
|
||||
xhr.open(request.method, fixUrl(request.url), true);
|
||||
|
||||
if (request.credentials === 'include') {
|
||||
xhr.withCredentials = true;
|
||||
} else if (request.credentials === 'omit') {
|
||||
xhr.withCredentials = false;
|
||||
}
|
||||
|
||||
if ('responseType' in xhr) {
|
||||
if (support.blob) {
|
||||
xhr.responseType = 'blob';
|
||||
} else if (
|
||||
support.arrayBuffer
|
||||
) {
|
||||
xhr.responseType = 'arraybuffer';
|
||||
}
|
||||
}
|
||||
|
||||
if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
|
||||
var names = [];
|
||||
Object.getOwnPropertyNames(init.headers).forEach(function(name) {
|
||||
names.push(normalizeName(name));
|
||||
xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
|
||||
});
|
||||
request.headers.forEach(function(value, name) {
|
||||
if (names.indexOf(name) === -1) {
|
||||
xhr.setRequestHeader(name, value);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
request.headers.forEach(function(value, name) {
|
||||
xhr.setRequestHeader(name, value);
|
||||
});
|
||||
}
|
||||
|
||||
if (request.signal) {
|
||||
request.signal.addEventListener('abort', abortXhr);
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
// DONE (success or failure)
|
||||
if (xhr.readyState === 4) {
|
||||
request.signal.removeEventListener('abort', abortXhr);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
||||
})
|
||||
}
|
||||
|
||||
fetch.polyfill = true;
|
||||
|
||||
if (!g.fetch) {
|
||||
g.fetch = fetch;
|
||||
g.Headers = Headers;
|
||||
g.Request = Request;
|
||||
g.Response = Response;
|
||||
}
|
||||
|
||||
exports.Headers = Headers;
|
||||
exports.Request = Request;
|
||||
exports.Response = Response;
|
||||
exports.fetch = fetch;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
@@ -0,0 +1 @@
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.WHATWGFetch={})}(this,(function(t){"use strict";var e,r,o="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},n="URLSearchParams"in o,i="Symbol"in o&&"iterator"in Symbol,s="FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in o,h="ArrayBuffer"in o;function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function f(t){return"string"!=typeof t?String(t):t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function y(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function l(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function b(t){var e;return t.slice?t.slice(0):((e=new Uint8Array(t.byteLength)).set(new Uint8Array(t)),e.buffer)}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,(this._bodyInit=t)?"string"==typeof t?this._bodyText=t:s&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():h&&s&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):h&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return y(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(s)return this.blob().then(l);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,o=y(this);if(o)return o;if(this._bodyBlob)return o=this._bodyBlob,e=p(t=new FileReader),r=(r=/charset=([A-Za-z0-9_-]+)/.exec(o.type))?r[1]:"utf-8",t.readAsText(o,r),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}h&&(e=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&-1<e.indexOf(Object.prototype.toString.call(t))}),c.prototype.append=function(t,e){t=u(t),e=f(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},c.prototype.delete=function(t){delete this.map[u(t)]},c.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},c.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},c.prototype.set=function(t,e){this.map[u(t)]=f(e)},c.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},c.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),d(t)},c.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},c.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.Line truncated
|
||||
+441
@@ -0,0 +1,441 @@
|
||||
/* formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
||||
|
||||
/* global FormData self Blob File */
|
||||
/* eslint-disable no-inner-declarations */
|
||||
|
||||
if (typeof Blob !== 'undefined' && (typeof FormData === 'undefined' || !FormData.prototype.keys)) {
|
||||
const global = typeof globalThis === 'object'
|
||||
? globalThis
|
||||
: typeof window === 'object'
|
||||
? window
|
||||
: typeof self === 'object' ? self : this
|
||||
|
||||
// keep a reference to native implementation
|
||||
const _FormData = global.FormData
|
||||
|
||||
// To be monkey patched
|
||||
const _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send
|
||||
const _fetch = global.Request && global.fetch
|
||||
const _sendBeacon = global.navigator && global.navigator.sendBeacon
|
||||
// Might be a worker thread...
|
||||
const _match = global.Element && global.Element.prototype
|
||||
|
||||
// Unable to patch Request/Response constructor correctly #109
|
||||
// only way is to use ES6 class extend
|
||||
// https://github.com/babel/babel/issues/1966
|
||||
|
||||
const stringTag = global.Symbol && Symbol.toStringTag
|
||||
|
||||
// Add missing stringTags to blob and files
|
||||
if (stringTag) {
|
||||
if (!Blob.prototype[stringTag]) {
|
||||
Blob.prototype[stringTag] = 'Blob'
|
||||
}
|
||||
|
||||
if ('File' in global && !File.prototype[stringTag]) {
|
||||
File.prototype[stringTag] = 'File'
|
||||
}
|
||||
}
|
||||
|
||||
// Fix so you can construct your own File
|
||||
try {
|
||||
new File([], '') // eslint-disable-line
|
||||
} catch (a) {
|
||||
global.File = function File (b, d, c) {
|
||||
const blob = new Blob(b, c || {})
|
||||
const t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date()
|
||||
|
||||
Object.defineProperties(blob, {
|
||||
name: {
|
||||
value: d
|
||||
},
|
||||
lastModified: {
|
||||
value: +t
|
||||
},
|
||||
toString: {
|
||||
value () {
|
||||
return '[object File]'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (stringTag) {
|
||||
Object.defineProperty(blob, stringTag, {
|
||||
value: 'File'
|
||||
})
|
||||
}
|
||||
|
||||
return blob
|
||||
}
|
||||
}
|
||||
|
||||
function ensureArgs (args, expected) {
|
||||
if (args.length < expected) {
|
||||
throw new TypeError(`${expected} argument required, but only ${args.length} present.`)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string | undefined} filename
|
||||
* @returns {[string, File|string]}
|
||||
*/
|
||||
function normalizeArgs (name, value, filename) {
|
||||
if (value instanceof Blob) {
|
||||
filename = filename !== undefined
|
||||
? String(filename + '')
|
||||
: typeof value.name === 'string'
|
||||
? value.name
|
||||
: 'blob'
|
||||
|
||||
if (value.name !== filename || Object.prototype.toString.call(value) === '[object Blob]') {
|
||||
value = new File([value], filename)
|
||||
}
|
||||
return [String(name), value]
|
||||
}
|
||||
return [String(name), String(value)]
|
||||
}
|
||||
|
||||
// normalize line feeds for textarea
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#textarea-line-break-normalisation-transformation
|
||||
function normalizeLinefeeds (value) {
|
||||
return value.replace(/\r?\n|\r/g, '\r\n')
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {ArrayLike<T>} arr
|
||||
* @param {{ (elm: T): void; }} cb
|
||||
*/
|
||||
function each (arr, cb) {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
cb(arr[i])
|
||||
}
|
||||
}
|
||||
|
||||
const escape = str => str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
|
||||
|
||||
/**
|
||||
* @implements {Iterable}
|
||||
*/
|
||||
class FormDataPolyfill {
|
||||
/**
|
||||
* FormData class
|
||||
*
|
||||
* @param {HTMLFormElement=} form
|
||||
*/
|
||||
constructor (form) {
|
||||
/** @type {[string, string|File][]} */
|
||||
this._data = []
|
||||
|
||||
const self = this
|
||||
form && each(form.elements, (/** @type {HTMLInputElement} */ elm) => {
|
||||
if (
|
||||
!elm.name ||
|
||||
elm.disabled ||
|
||||
elm.type === 'submit' ||
|
||||
elm.type === 'button' ||
|
||||
elm.matches('form fieldset[disabled] *')
|
||||
) return
|
||||
|
||||
if (elm.type === 'file') {
|
||||
const files = elm.files && elm.files.length
|
||||
? elm.files
|
||||
: [new File([], '', { type: 'application/octet-stream' })] // #78
|
||||
|
||||
each(files, file => {
|
||||
self.append(elm.name, file)
|
||||
})
|
||||
} else if (elm.type === 'select-multiple' || elm.type === 'select-one') {
|
||||
each(elm.options, opt => {
|
||||
!opt.disabled && opt.selected && self.append(elm.name, opt.value)
|
||||
})
|
||||
} else if (elm.type === 'checkbox' || elm.type === 'radio') {
|
||||
if (elm.checked) self.append(elm.name, elm.value)
|
||||
} else {
|
||||
const value = elm.type === 'textarea' ? normalizeLinefeeds(elm.value) : elm.value
|
||||
self.append(elm.name, value)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a field
|
||||
*
|
||||
* @param {string} name field name
|
||||
* @param {string|Blob|File} value string / blob / file
|
||||
* @param {string=} filename filename to use with blob
|
||||
* @return {undefined}
|
||||
*/
|
||||
append (name, value, filename) {
|
||||
ensureArgs(arguments, 2)
|
||||
this._data.push(normalizeArgs(name, value, filename))
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all fields values given name
|
||||
*
|
||||
* @param {string} name Field name
|
||||
* @return {undefined}
|
||||
*/
|
||||
delete (name) {
|
||||
ensureArgs(arguments, 1)
|
||||
const result = []
|
||||
name = String(name)
|
||||
|
||||
each(this._data, entry => {
|
||||
entry[0] !== name && result.push(entry)
|
||||
})
|
||||
|
||||
this._data = result
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate over all fields as [name, value]
|
||||
*
|
||||
* @return {Iterator}
|
||||
*/
|
||||
* entries () {
|
||||
for (var i = 0; i < this._data.length; i++) {
|
||||
yield this._data[i]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate over all fields
|
||||
*
|
||||
* @param {Function} callback Executed for each item with parameters (value, name, thisArg)
|
||||
* @param {Object=} thisArg `this` context for callback function
|
||||
*/
|
||||
forEach (callback, thisArg) {
|
||||
ensureArgs(arguments, 1)
|
||||
for (const [name, value] of this) {
|
||||
callback.call(thisArg, value, name, this)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return first field value given name
|
||||
* or null if non existent
|
||||
*
|
||||
* @param {string} name Field name
|
||||
* @return {string|File|null} value Fields value
|
||||
*/
|
||||
get (name) {
|
||||
ensureArgs(arguments, 1)
|
||||
const entries = this._data
|
||||
name = String(name)
|
||||
for (let i = 0; i < entries.length; i++) {
|
||||
if (entries[i][0] === name) {
|
||||
return entries[i][1]
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all fields values given name
|
||||
*
|
||||
* @param {string} name Fields name
|
||||
* @return {Array} [{String|File}]
|
||||
*/
|
||||
getAll (name) {
|
||||
ensureArgs(arguments, 1)
|
||||
const result = []
|
||||
name = String(name)
|
||||
each(this._data, data => {
|
||||
data[0] === name && result.push(data[1])
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for field name existence
|
||||
*
|
||||
* @param {string} name Field name
|
||||
* @return {boolean}
|
||||
*/
|
||||
has (name) {
|
||||
ensureArgs(arguments, 1)
|
||||
name = String(name)
|
||||
for (let i = 0; i < this._data.length; i++) {
|
||||
if (this._data[i][0] === name) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate over all fields name
|
||||
*
|
||||
* @return {Iterator}
|
||||
*/
|
||||
* keys () {
|
||||
for (const [name] of this) {
|
||||
yield name
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite all values given name
|
||||
*
|
||||
* @param {string} name Filed name
|
||||
* @param {string} value Field value
|
||||
* @param {string=} filename Filename (optional)
|
||||
*/
|
||||
set (name, value, filename) {
|
||||
ensureArgs(arguments, 2)
|
||||
name = String(name)
|
||||
/** @type {[string, string|File][]} */
|
||||
const result = []
|
||||
const args = normalizeArgs(name, value, filename)
|
||||
let replace = true
|
||||
|
||||
// - replace the first occurrence with same name
|
||||
// - discards the remaining with same name
|
||||
// - while keeping the same order items where added
|
||||
each(this._data, data => {
|
||||
data[0] === name
|
||||
? replace && (replace = !result.push(args))
|
||||
: result.push(data)
|
||||
})
|
||||
|
||||
replace && result.push(args)
|
||||
|
||||
this._data = result
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate over all fields
|
||||
*
|
||||
* @return {Iterator}
|
||||
*/
|
||||
* values () {
|
||||
for (const [, value] of this) {
|
||||
yield value
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a native (perhaps degraded) FormData with only a `append` method
|
||||
* Can throw if it's not supported
|
||||
*
|
||||
* @return {FormData}
|
||||
*/
|
||||
['_asNative'] () {
|
||||
const fd = new _FormData()
|
||||
|
||||
for (const [name, value] of this) {
|
||||
fd.append(name, value)
|
||||
}
|
||||
|
||||
return fd
|
||||
}
|
||||
|
||||
/**
|
||||
* [_blob description]
|
||||
*
|
||||
* @return {Blob} [description]
|
||||
*/
|
||||
['_blob'] () {
|
||||
const boundary = '----formdata-polyfill-' + Math.random(),
|
||||
chunks = [],
|
||||
p = `--${boundary}\r\nContent-Disposition: form-data; name="`
|
||||
this.forEach((value, name) => typeof value == 'string'
|
||||
? chunks.push(p + escape(normalizeLinefeeds(name)) + `"\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
|
||||
: chunks.push(p + escape(normalizeLinefeeds(name)) + `"; filename="${escape(value.name)}"\r\nContent-Type: ${value.type||"application/octet-stream"}\r\n\r\n`, value, `\r\n`))
|
||||
chunks.push(`--${boundary}--`)
|
||||
return new Blob(chunks, {
|
||||
type: "multipart/form-data; boundary=" + boundary
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* The class itself is iterable
|
||||
* alias for formdata.entries()
|
||||
*
|
||||
* @return {Iterator}
|
||||
*/
|
||||
[Symbol.iterator] () {
|
||||
return this.entries()
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the default string description.
|
||||
*
|
||||
* @return {string} [object FormData]
|
||||
*/
|
||||
toString () {
|
||||
return '[object FormData]'
|
||||
}
|
||||
}
|
||||
|
||||
if (_match && !_match.matches) {
|
||||
_match.matches =
|
||||
_match.matchesSelector ||
|
||||
_match.mozMatchesSelector ||
|
||||
_match.msMatchesSelector ||
|
||||
_match.oMatchesSelector ||
|
||||
_match.webkitMatchesSelector ||
|
||||
function (s) {
|
||||
var matches = (this.document || this.ownerDocument).querySelectorAll(s)
|
||||
var i = matches.length
|
||||
while (--i >= 0 && matches.item(i) !== this) {}
|
||||
return i > -1
|
||||
}
|
||||
}
|
||||
|
||||
if (stringTag) {
|
||||
/**
|
||||
* Create the default string description.
|
||||
* It is accessed internally by the Object.prototype.toString().
|
||||
*/
|
||||
FormDataPolyfill.prototype[stringTag] = 'FormData'
|
||||
}
|
||||
|
||||
// Patch xhr's send method to call _blob transparently
|
||||
if (_send) {
|
||||
const setRequestHeader = global.XMLHttpRequest.prototype.setRequestHeader
|
||||
|
||||
global.XMLHttpRequest.prototype.setRequestHeader = function (name, value) {
|
||||
setRequestHeader.call(this, name, value)
|
||||
if (name.toLowerCase() === 'content-type') this._hasContentType = true
|
||||
}
|
||||
|
||||
global.XMLHttpRequest.prototype.send = function (data) {
|
||||
// need to patch send b/c old IE don't send blob's type (#44)
|
||||
if (data instanceof FormDataPolyfill) {
|
||||
const blob = data['_blob']()
|
||||
if (!this._hasContentType) this.setRequestHeader('Content-Type', blob.type)
|
||||
_send.call(this, blob)
|
||||
} else {
|
||||
_send.call(this, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Patch fetch's function to call _blob transparently
|
||||
if (_fetch) {
|
||||
global.fetch = function (input, init) {
|
||||
if (init && init.body && init.body instanceof FormDataPolyfill) {
|
||||
init.body = init.body['_blob']()
|
||||
}
|
||||
|
||||
return _fetch.call(this, input, init)
|
||||
}
|
||||
}
|
||||
|
||||
// Patch navigator.sendBeacon to use native FormData
|
||||
if (_sendBeacon) {
|
||||
global.navigator.sendBeacon = function (url, data) {
|
||||
if (data instanceof FormDataPolyfill) {
|
||||
data = data['_asNative']()
|
||||
}
|
||||
return _sendBeacon.call(this, url, data)
|
||||
}
|
||||
}
|
||||
|
||||
global['FormData'] = FormDataPolyfill
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! formdata-polyfill. MIT License. Jimmy W?rting <https://jimmy.warting.se/opensource> */
|
||||
!function(){var t;function e(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){return t==Array.prototype||t==Object.prototype||(t[e]=n.value),t};var r,o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function i(t,e){if(e)t:{var r=o;t=t.split(".");for(var i=0;i<t.length-1;i++){var a=t[i];if(!(a in r))break t;r=r[a]}(e=e(i=r[t=t[t.length-1]]))!=i&&null!=e&&n(r,t,{configurable:!0,writable:!0,value:e})}}function a(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function u(t){var n="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return n?n.call(t):{next:e(t)}}if(i("Symbol",(function(t){function e(t,e){this.A=t,n(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.A};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function t(n){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(r+(n||"")+"_"+o++,n)}})),i("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<r.length;i++){var u=o[r[i]];"function"==typeof u&&"function"!=typeof u.prototype[t]&&n(u.prototype,t,{configurable:!0,writable:!0,value:function(){return a(e(this))}})}return t})),"function"==typeof Object.setPrototypeOf)r=Object.setPrototypeOf;else{var l;t:{var s={};try{s.__proto__={a:!0},l=s.a;break t}catch(t){}l=!1}r=l?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var f=r;function c(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function h(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}function p(t,e){return t.h=3,{value:e}}function y(t){this.g=new c,this.G=t}function v(t,e,n,r){try{var o=e.call(t.g.j,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return t.g.m=!1,o;var i=o.value}catch(e){return t.g.j=null,t.g.s(e),g(t)}return t.g.j=null,r.call(t.g,i),g(t)}function g(t){for(;t.g.h;)try{var e=t.G(t.g);if(e)return t.g.m=!1,{value:e.value,done:!1}}catch(e){t.g.v=void 0,t.g.s(e)}if(t.g.m=!1,t.g.l){if(e=t.g.l,t.g.l=null,e.F)throw e.D;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function d(t){this.next=function(e){return t.o(e)},this.throw=function(e){return t.s(e)},this.return=function(e){return function(t,e){h(t.g);var n=t.g.j;return n?v(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.g.return):(t.g.return(e),g(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function b(t,e){return e=new d(new y(e)),f&&t.prototype&&f(e,t.prototype),e}if(c.prototype.o=function(t){this.v=t},c.prototype.s=function(t){this.l={D:t,F:!0},this.h=this.C||this.u},c.prototype.return=function(t){this.l={return:t},this.h=this.u},y.prototype.o=function(t){return h(this.g),this.g.j?v(this,this.g.j.next,t,this.g.o):(this.g.o(t),g(this))},y.prototype.s=function(t){return h(this.g),this.g.j?v(this,this.g.j.throw,t,this.g.o):(this.g.s(t),g(this))},i("Array.prototype.entries",(function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var n=0,r=!1,o={next:function(){if(!r&&n<t.length){var o=n++;return{value:e(o,t[o]),done:!1}}return r=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o}(this,(function(t,e){return[t,e]}))}})),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var m=function(t,e){for(var n=0;n<t.length;n++)e(t[n])},w=function(t){return t.replace(/\r?\n|\r/g,"\r\n")},S=function(t,e,n){return e instanceof Blob?(n=void 0!==n?String(n+""):"string"==typeof e.name?e.name:"blob",e.name===n&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new File([e],n)),[String(t),e]):[String(t),String(e)]},j=function(t,e){if(t.length<e)throw new TypeError(e+" argument required, but only "+t.length+" present.")},x="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,_=x.FormData,F=x.XMLHttpRequest&&x.XMLHttpRequest.prototype.send,A=x.Request&&x.fetch,M=x.navigator&&x.navigator.sendBeacon,D=x.Element&&x.Element.prototype,B=x.Symbol&&Symbol.toStringTag;B&&(Blob.prototype[B]||(Blob.prototype[B]="Blob"),"File"in x&&!File.prototype[B]&&(File.prototype[B]="File"));try{new File([],"")}catch(t){x.File=function(t,e,n){return t=new Blob(t,n||{}),Object.defineProperties(t,{name:{value:e},lastModified:{value:+(n&&void 0!==n.lastModified?new Date(n.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),B&&Object.definePropeLine truncated
|
||||
+970
@@ -0,0 +1,970 @@
|
||||
/* ES Module Shims Wasm 1.8.2 */
|
||||
(function () {
|
||||
|
||||
const hasWindow = typeof window !== 'undefined';
|
||||
const hasDocument = typeof document !== 'undefined';
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
const optionsScript = hasDocument ? document.querySelector('script[type=esms-options]') : undefined;
|
||||
|
||||
const esmsInitOptions = optionsScript ? JSON.parse(optionsScript.innerHTML) : {};
|
||||
Object.assign(esmsInitOptions, self.esmsInitOptions || {});
|
||||
|
||||
let shimMode = hasDocument ? !!esmsInitOptions.shimMode : true;
|
||||
|
||||
const importHook = globalHook(shimMode && esmsInitOptions.onimport);
|
||||
const resolveHook = globalHook(shimMode && esmsInitOptions.resolve);
|
||||
let fetchHook = esmsInitOptions.fetch ? globalHook(esmsInitOptions.fetch) : fetch;
|
||||
const metaHook = esmsInitOptions.meta ? globalHook(shimMode && esmsInitOptions.meta) : noop;
|
||||
|
||||
const mapOverrides = esmsInitOptions.mapOverrides;
|
||||
|
||||
let nonce = esmsInitOptions.nonce;
|
||||
if (!nonce && hasDocument) {
|
||||
const nonceElement = document.querySelector('script[nonce]');
|
||||
if (nonceElement)
|
||||
nonce = nonceElement.nonce || nonceElement.getAttribute('nonce');
|
||||
}
|
||||
|
||||
const onerror = globalHook(esmsInitOptions.onerror || noop);
|
||||
const onpolyfill = esmsInitOptions.onpolyfill ? globalHook(esmsInitOptions.onpolyfill) : () => {
|
||||
console.log('%c^^ Module TypeError above is polyfilled and can be ignored ^^', 'font-weight:900;color:#391');
|
||||
};
|
||||
|
||||
const { revokeBlobURLs, noLoadEventRetriggers, enforceIntegrity } = esmsInitOptions;
|
||||
|
||||
function globalHook (name) {
|
||||
return typeof name === 'string' ? self[name] : name;
|
||||
}
|
||||
|
||||
const enable = Array.isArray(esmsInitOptions.polyfillEnable) ? esmsInitOptions.polyfillEnable : [];
|
||||
const cssModulesEnabled = enable.includes('css-modules');
|
||||
const jsonModulesEnabled = enable.includes('json-modules');
|
||||
|
||||
const edge = !navigator.userAgentData && !!navigator.userAgent.match(/Edge\/\d+\.\d+/);
|
||||
|
||||
const baseUrl = hasDocument
|
||||
? document.baseURI
|
||||
: `${location.protocol}//${location.host}${location.pathname.includes('/')
|
||||
? location.pathname.slice(0, location.pathname.lastIndexOf('/') + 1)
|
||||
: location.pathname}`;
|
||||
|
||||
const createBlob = (source, type = 'text/javascript') => URL.createObjectURL(new Blob([source], { type }));
|
||||
let { skip } = esmsInitOptions;
|
||||
if (Array.isArray(skip)) {
|
||||
const l = skip.map(s => new URL(s, baseUrl).href);
|
||||
skip = s => l.some(i => i[i.length - 1] === '/' && s.startsWith(i) || s === i);
|
||||
}
|
||||
else if (typeof skip === 'string') {
|
||||
const r = new RegExp(skip);
|
||||
skip = s => r.test(s);
|
||||
} else if (skip instanceof RegExp) {
|
||||
skip = s => skip.test(s);
|
||||
}
|
||||
|
||||
const eoop = err => setTimeout(() => { throw err });
|
||||
|
||||
const throwError = err => { (self.reportError || hasWindow && window.safari && console.error || eoop)(err), void onerror(err); };
|
||||
|
||||
function fromParent (parent) {
|
||||
return parent ? ` imported from ${parent}` : '';
|
||||
}
|
||||
|
||||
let importMapSrcOrLazy = false;
|
||||
|
||||
function setImportMapSrcOrLazy () {
|
||||
importMapSrcOrLazy = true;
|
||||
}
|
||||
|
||||
// shim mode is determined on initialization, no late shim mode
|
||||
if (!shimMode) {
|
||||
if (document.querySelectorAll('script[type=module-shim],script[type=importmap-shim],link[rel=modulepreload-shim]').length) {
|
||||
shimMode = true;
|
||||
}
|
||||
else {
|
||||
let seenScript = false;
|
||||
for (const script of document.querySelectorAll('script[type=module],script[type=importmap]')) {
|
||||
if (!seenScript) {
|
||||
if (script.type === 'module' && !script.ep)
|
||||
seenScript = true;
|
||||
}
|
||||
else if (script.type === 'importmap' && seenScript) {
|
||||
importMapSrcOrLazy = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const backslashRegEx = /\\/g;
|
||||
|
||||
function asURL (url) {
|
||||
try {
|
||||
if (url.indexOf(':') !== -1)
|
||||
return new URL(url).href;
|
||||
}
|
||||
catch (_) {}
|
||||
}
|
||||
|
||||
function resolveUrl (relUrl, parentUrl) {
|
||||
return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (asURL(relUrl) || resolveIfNotPlainOrUrl('./' + relUrl, parentUrl));
|
||||
}
|
||||
|
||||
function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
|
||||
const hIdx = parentUrl.indexOf('#'), qIdx = parentUrl.indexOf('?');
|
||||
if (hIdx + qIdx > -2)
|
||||
parentUrl = parentUrl.slice(0, hIdx === -1 ? qIdx : qIdx === -1 || qIdx > hIdx ? hIdx : qIdx);
|
||||
if (relUrl.indexOf('\\') !== -1)
|
||||
relUrl = relUrl.replace(backslashRegEx, '/');
|
||||
// protocol-relative
|
||||
if (relUrl[0] === '/' && relUrl[1] === '/') {
|
||||
return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
|
||||
}
|
||||
// relative-url
|
||||
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
|
||||
relUrl.length === 1 && (relUrl += '/')) ||
|
||||
relUrl[0] === '/') {
|
||||
const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
|
||||
if (parentProtocol === 'blob:') {
|
||||
throw new TypeError(`Failed to resolve module specifier "${relUrl}". Invalid relative url or base scheme isn't hierarchical.`);
|
||||
}
|
||||
// Disabled, but these cases will give inconsistent results for deep backtracking
|
||||
//if (parentUrl[parentProtocol.length] !== '/')
|
||||
// throw new Error('Cannot resolve');
|
||||
// read pathname from parent URL
|
||||
// pathname taken to be part after leading "/"
|
||||
let pathname;
|
||||
if (parentUrl[parentProtocol.length + 1] === '/') {
|
||||
// resolving to a :// so we need to read out the auth and host
|
||||
if (parentProtocol !== 'file:') {
|
||||
pathname = parentUrl.slice(parentProtocol.length + 2);
|
||||
pathname = pathname.slice(pathname.indexOf('/') + 1);
|
||||
}
|
||||
else {
|
||||
pathname = parentUrl.slice(8);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// resolving to :/ so pathname is the /... part
|
||||
pathname = parentUrl.slice(parentProtocol.length + (parentUrl[parentProtocol.length] === '/'));
|
||||
}
|
||||
|
||||
if (relUrl[0] === '/')
|
||||
return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
|
||||
|
||||
// join together and split for removal of .. and . segments
|
||||
// looping the string instead of anything fancy for perf reasons
|
||||
// '../../../../../z' resolved to 'x/y' is just 'z'
|
||||
const segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
|
||||
|
||||
const output = [];
|
||||
let segmentIndex = -1;
|
||||
for (let i = 0; i < segmented.length; i++) {
|
||||
// busy reading a segment - only terminate on '/'
|
||||
if (segmentIndex !== -1) {
|
||||
if (segmented[i] === '/') {
|
||||
output.push(segmented.slice(segmentIndex, i + 1));
|
||||
segmentIndex = -1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// new segment - check if it is relative
|
||||
else if (segmented[i] === '.') {
|
||||
// ../ segment
|
||||
if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
|
||||
output.pop();
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
// ./ segment
|
||||
else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// it is the start of a new segment
|
||||
while (segmented[i] === '/') i++;
|
||||
segmentIndex = i;
|
||||
}
|
||||
// finish reading out the last segment
|
||||
if (segmentIndex !== -1)
|
||||
output.push(segmented.slice(segmentIndex));
|
||||
return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
|
||||
}
|
||||
}
|
||||
|
||||
function resolveAndComposeImportMap (json, baseUrl, parentMap) {
|
||||
const outMap = { imports: Object.assign({}, parentMap.imports), scopes: Object.assign({}, parentMap.scopes) };
|
||||
|
||||
if (json.imports)
|
||||
resolveAndComposePackages(json.imports, outMap.imports, baseUrl, parentMap);
|
||||
|
||||
if (json.scopes)
|
||||
for (let s in json.scopes) {
|
||||
const resolvedScope = resolveUrl(s, baseUrl);
|
||||
resolveAndComposePackages(json.scopes[s], outMap.scopes[resolvedScope] || (outMap.scopes[resolvedScope] = {}), baseUrl, parentMap);
|
||||
}
|
||||
|
||||
return outMap;
|
||||
}
|
||||
|
||||
function getMatch (path, matchObj) {
|
||||
if (matchObj[path])
|
||||
return path;
|
||||
let sepIndex = path.length;
|
||||
do {
|
||||
const segment = path.slice(0, sepIndex + 1);
|
||||
if (segment in matchObj)
|
||||
return segment;
|
||||
} while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1)
|
||||
}
|
||||
|
||||
function applyPackages (id, packages) {
|
||||
const pkgName = getMatch(id, packages);
|
||||
if (pkgName) {
|
||||
const pkg = packages[pkgName];
|
||||
if (pkg === null) return;
|
||||
return pkg + id.slice(pkgName.length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function resolveImportMap (importMap, resolvedOrPlain, parentUrl) {
|
||||
let scopeUrl = parentUrl && getMatch(parentUrl, importMap.scopes);
|
||||
while (scopeUrl) {
|
||||
const packageResolution = applyPackages(resolvedOrPlain, importMap.scopes[scopeUrl]);
|
||||
if (packageResolution)
|
||||
return packageResolution;
|
||||
scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), importMap.scopes);
|
||||
}
|
||||
return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain;
|
||||
}
|
||||
|
||||
function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap) {
|
||||
for (let p in packages) {
|
||||
const resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p;
|
||||
if ((!shimMode || !mapOverrides) && outPackages[resolvedLhs] && (outPackages[resolvedLhs] !== packages[resolvedLhs])) {
|
||||
throw Error(`Rejected map override "${resolvedLhs}" from ${outPackages[resolvedLhs]} to ${packages[resolvedLhs]}.`);
|
||||
}
|
||||
let target = packages[p];
|
||||
if (typeof target !== 'string')
|
||||
continue;
|
||||
const mapped = resolveImportMap(parentMap, resolveIfNotPlainOrUrl(target, baseUrl) || target, baseUrl);
|
||||
if (mapped) {
|
||||
outPackages[resolvedLhs] = mapped;
|
||||
continue;
|
||||
}
|
||||
console.warn(`Mapping "${p}" -> "${packages[p]}" does not resolve`);
|
||||
}
|
||||
}
|
||||
|
||||
let dynamicImport = !hasDocument && (0, eval)('u=>import(u)');
|
||||
|
||||
let supportsDynamicImport;
|
||||
|
||||
const dynamicImportCheck = hasDocument && new Promise(resolve => {
|
||||
const s = Object.assign(document.createElement('script'), {
|
||||
src: createBlob('self._d=u=>import(u)'),
|
||||
ep: true
|
||||
});
|
||||
s.setAttribute('nonce', nonce);
|
||||
s.addEventListener('load', () => {
|
||||
if (!(supportsDynamicImport = !!(dynamicImport = self._d))) {
|
||||
let err;
|
||||
window.addEventListener('error', _err => err = _err);
|
||||
dynamicImport = (url, opts) => new Promise((resolve, reject) => {
|
||||
const s = Object.assign(document.createElement('script'), {
|
||||
type: 'module',
|
||||
src: createBlob(`import*as m from'${url}';self._esmsi=m`)
|
||||
});
|
||||
err = undefined;
|
||||
s.ep = true;
|
||||
if (nonce)
|
||||
s.setAttribute('nonce', nonce);
|
||||
// Safari is unique in supporting module script error events
|
||||
s.addEventListener('error', cb);
|
||||
s.addEventListener('load', cb);
|
||||
function cb (_err) {
|
||||
document.head.removeChild(s);
|
||||
if (self._esmsi) {
|
||||
resolve(self._esmsi, baseUrl);
|
||||
self._esmsi = undefined;
|
||||
}
|
||||
else {
|
||||
reject(!(_err instanceof Event) && _err || err && err.error || new Error(`Error loading ${opts && opts.errUrl || url} (${s.src}).`));
|
||||
err = undefined;
|
||||
}
|
||||
}
|
||||
document.head.appendChild(s);
|
||||
});
|
||||
}
|
||||
document.head.removeChild(s);
|
||||
delete self._d;
|
||||
resolve();
|
||||
});
|
||||
document.head.appendChild(s);
|
||||
});
|
||||
|
||||
// support browsers without dynamic import support (eg Firefox 6x)
|
||||
let supportsJsonAssertions = false;
|
||||
let supportsCssAssertions = false;
|
||||
|
||||
const supports = hasDocument && HTMLScriptElement.supports;
|
||||
|
||||
let supportsImportMaps = supports && supports.name === 'supports' && supports('importmap');
|
||||
let supportsImportMeta = supportsDynamicImport;
|
||||
|
||||
const importMetaCheck = 'import.meta';
|
||||
const cssModulesCheck = `import"x"assert{type:"css"}`;
|
||||
const jsonModulesCheck = `import"x"assert{type:"json"}`;
|
||||
|
||||
let featureDetectionPromise = Promise.resolve(dynamicImportCheck).then(() => {
|
||||
if (!supportsDynamicImport)
|
||||
return;
|
||||
|
||||
if (!hasDocument)
|
||||
return Promise.all([
|
||||
supportsImportMaps || dynamicImport(createBlob(importMetaCheck)).then(() => supportsImportMeta = true, noop),
|
||||
cssModulesEnabled && dynamicImport(createBlob(cssModulesCheck.replace('x', createBlob('', 'text/css')))).then(() => supportsCssAssertions = true, noop),
|
||||
jsonModulesEnabled && dynamicImport(createBlob(jsonModulescheck.replace('x', createBlob('{}', 'text/json')))).then(() => supportsJsonAssertions = true, noop),
|
||||
]);
|
||||
|
||||
return new Promise(resolve => {
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.style.display = 'none';
|
||||
iframe.setAttribute('nonce', nonce);
|
||||
function cb ({ data }) {
|
||||
const isFeatureDetectionMessage = Array.isArray(data) && data[0] === 'esms';
|
||||
if (!isFeatureDetectionMessage) {
|
||||
return;
|
||||
}
|
||||
supportsImportMaps = data[1];
|
||||
supportsImportMeta = data[2];
|
||||
supportsCssAssertions = data[3];
|
||||
supportsJsonAssertions = data[4];
|
||||
resolve();
|
||||
document.head.removeChild(iframe);
|
||||
window.removeEventListener('message', cb, false);
|
||||
}
|
||||
window.addEventListener('message', cb, false);
|
||||
|
||||
const importMapTest = `<script nonce=${nonce || ''}>b=(s,type='text/javascript')=>URL.createObjectURL(new Blob([s],{type}));document.head.appendChild(Object.assign(document.createElement('script'),{type:'importmap',nonce:"${nonce}",innerText:\`{"imports":{"x":"\${b('')}"}}\`}));Promise.all([${
|
||||
supportsImportMaps ? 'true,true' : `'x',b('${importMetaCheck}')`}, ${cssModulesEnabled ? `b('${cssModulesCheck}'.replace('x',b('','text/css')))` : 'false'}, ${
|
||||
jsonModulesEnabled ? `b('${jsonModulesCheck}'.replace('x',b('{}','text/json')))` : 'false'}].map(x =>typeof x==='string'?import(x).then(x =>!!x,()=>false):x)).then(a=>parent.postMessage(['esms'].concat(a),'*'))<${''}/script>`;
|
||||
|
||||
// Safari will call onload eagerly on head injection, but we don't want the Wechat
|
||||
// path to trigger before setting srcdoc, therefore we track the timing
|
||||
let readyForOnload = false, onloadCalledWhileNotReady = false;
|
||||
function doOnload () {
|
||||
if (!readyForOnload) {
|
||||
onloadCalledWhileNotReady = true;
|
||||
return;
|
||||
}
|
||||
// WeChat browser doesn't support setting srcdoc scripts
|
||||
// But iframe sandboxes don't support contentDocument so we do this as a fallback
|
||||
const doc = iframe.contentDocument;
|
||||
if (doc && doc.head.childNodes.length === 0) {
|
||||
const s = doc.createElement('script');
|
||||
if (nonce)
|
||||
s.setAttribute('nonce', nonce);
|
||||
s.innerHTML = importMapTest.slice(15 + (nonce ? nonce.length : 0), -9);
|
||||
doc.head.appendChild(s);
|
||||
}
|
||||
}
|
||||
|
||||
iframe.onload = doOnload;
|
||||
// WeChat browser requires append before setting srcdoc
|
||||
document.head.appendChild(iframe);
|
||||
|
||||
// setting srcdoc is not supported in React native webviews on iOS
|
||||
// setting src to a blob URL results in a navigation event in webviews
|
||||
// document.write gives usability warnings
|
||||
readyForOnload = true;
|
||||
if ('srcdoc' in iframe)
|
||||
iframe.srcdoc = importMapTest;
|
||||
else
|
||||
iframe.contentDocument.write(importMapTest);
|
||||
// retrigger onload for Safari only if necessary
|
||||
if (onloadCalledWhileNotReady) doOnload();
|
||||
});
|
||||
});
|
||||
|
||||
/* es-module-lexer 1.4.1 */
|
||||
const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse(E,g="@"){if(!C)return init.then((()=>parse(E)));const I=E.length+1,k=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;k>0&&C.memory.grow(Math.ceil(k/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const o=[],D=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),k=C.se();let K;C.ip()&&(K=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),o.push({n:K,s:A,e:Q,ss:I,se:k,d:g,a:B});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),k=I[0],K=B<0?void 0:E.slice(B,g),o=K?K[0]:"";D.push({s:A,e:Q,ls:B,le:g,n:'"'===k||"'"===k?w(I):I,ln:'"'===o||"'"===o?w(K):K});}function w(A){try{return (0,eval)(A)}catch(A){}}return [o,D,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAAF/YAAAYAF/AGADf39/AX9gAn9/AX9gAn9/AAMwLwABAQICAgICAgICAgICAgICAgICAAMDAwQEAAAAAwAAAAADAwAFBgAAAAcABgIFBAUBcAEBAQUDAQABBg8CfwFBsPIAC38AQbDyAAsHdRQGbWVtb3J5AgACc2EAAAFlAAMCaXMABAJpZQAFAnNzAAYCc2UABwJhaQAIAmlkAAkCaXAACgJlcwALAmVlAAwDZWxzAA0DZWxlAA4CcmkADwJyZQAQAWYAEQJtcwASBXBhcnNlABMLX19oZWFwX2Jhc2UDAQryPS9oAQF/QQAgADYC9AlBACgC0AkiASAAQQF0aiIAQQA7AQBBACAAQQJqIgA2AvgJQQAgADYC/AlBAEEANgLUCUEAQQA2AuQJQQBBADYC3AlBAEEANgLYCUEAQQA2AuwJQQBBADYC4AkgAQu+AQEDf0EAKALkCSEEQQBBACgC/AkiBTYC5AlBACAENgLoCUEAIAVBIGo2AvwJIARBHGpB1AkgBBsgBTYCAEEAKALICSEEQQAoAsQJIQYgBSABNgIAIAUgADYCCCAFIAIgAkECakEAIAYgA0YbIAQgA0YbNgIMIAUgAzYCFCAFQQA2AhAgBSACNgIEIAVBADYCHCAFQQAoAsQJIANGIgI6ABgCQAJAIAINAEEAKALICSADRw0BC0EAQQE6AIAKCwteAQF/QQAoAuwJIgRBEGpB2AkgBBtBACgC/AkiBDYCAEEAIAQ2AuwJQQAgBEEUajYC/AlBAEEBOgCACiAEQQA2AhAgBCADNgIMIAQgAjYCCCAEIAE2AgQgBCAANgIACwgAQQAoAoQKCxUAQQAoAtwJKAIAQQAoAtAJa0EBdQseAQF/QQAoAtwJKAIEIgBBACgC0AlrQQF1QX8gABsLFQBBACgC3AkoAghBACgC0AlrQQF1Cx4BAX9BACgC3AkoAgwiAEEAKALQCWtBAXVBfyAAGwseAQF/QQAoAtwJKAIQIgBBACgC0AlrQQF1QX8gABsLOwEBfwJAQQAoAtwJKAIUIgBBACgCxAlHDQBBfw8LAkAgAEEAKALICUcNAEF+DwsgAEEAKALQCWtBAXULCwBBACgC3AktABgLFQBBACgC4AkoAgBBACgC0AlrQQF1CxUAQQAoAuAJKAIEQQAoAtAJa0EBdQseAQF/QQAoAuAJKAIIIgBBACgC0AlrQQF1QX8gABsLHgEBf0EAKALgCSgCDCIAQQAoAtAJa0EBdUF/IAAbCyUBAX9BAEEAKALcCSIAQRxqQdQJIAAbKAIAIgA2AtwJIABBAEcLJQEBf0EAQQAoAuAJIgBBEGpB2AkgABsoAgAiADYC4AkgAEEARwsIAEEALQCICgsIAEEALQCACgvyDAEGfyMAQYDQAGsiACQAQQBBAToAiApBAEEAKALMCTYCkApBAEEAKALQCUF+aiIBNgKkCkEAIAFBACgC9AlBAXRqIgI2AqgKQQBBADoAgApBAEEAOwGKCkEAQQA7AYwKQQBBADoAlApBAEEANgKECkEAQQA6APAJQQAgAEGAEGo2ApgKQQAgADYCnApBAEEAOgCgCgJAAkACQAJAA0BBACABQQJqIgM2AqQKIAEgAk8NAQJAIAMvAQAiAkF3akEFSQ0AAkACQAJAAkACQCACQZt/ag4FAQgICAIACyACQSBGDQQgAkEvRg0DIAJBO0YNAgwHC0EALwGMCg0BIAMQFEUNASABQQRqQYIIQQoQLg0BEBVBAC0AiAoNAUEAQQAoAqQKIgE2ApAKDAcLIAMQFEUNACABQQRqQYwIQQoQLg0AEBYLQQBBACgCpAo2ApAKDAELAkAgAS8BBCIDQSpGDQAgA0EvRw0EEBcMAQtBARAYC0EAKAKoCiECQQAoAqQKIQEMAAsLQQAhAiADIQFBAC0A8AkNAgwBC0EAIAE2AqQKQQBBADoAiAoLA0BBACABQQJqIgM2AqQKAkACQAJAAkACQAJAAkACQAJAIAFBACgCqApPDQAgAy8BACICQXdqQQVJDQgCQAJAAkACQAJAAkACQAJAAkACQCACQWBqDgoSEQYRERERBQECAAsCQAJAAkACQCACQaB/ag4KCxQUAxQBFBQUAgALIAJBhX9qDgMFEwYJC0EALwGMCg0SIAMQFEUNEiABQQRqQYIIQQoQLg0SEBUMEgsgAxAURQ0RIAFBBGpBjAhBChAuDREQFgwRCyADEBRFDRAgASkABELsgISDsI7AOVINECABLwEMIgNBd2oiAUEXSw0OQQEgAXRBn4CABHFFDQ4MDwtBAEEALwGMCiIBQQFqOwGMCkEAKAKYCiABQQN0aiIBQQE2AgAgAUEAKAKQCjYCBAwPC0EALwGMCiIDRQ0LQQAgA0F/aiICOwGMCkEALwGKCiIDRQ0OQQAoApgKIAJB//8DcUEDdGooAgBBBUcNDgJAIANBAnRBACgCnApqQXxqKAIAIgIoAgQNACACQQAoApAKQQJqNgIEC0EAIANBf2o7AYoKIAIgAUEEajYCDAwOCwJAQQAoApAKIgEvAQBBKUcNAEEAKALkCSIDRQ0AIAMoAgQgAUcNAEEAQQAoAugJIgM2AuQJAkAgA0UNACADQQA2AhwMAQtBAEEANgLUCQtBAEEALwGMCiIDQQFqOwGMCkEAKAKYCiADQQN0aiIDQQZBAkEALQCgChs2AgAgAyABNgIEQQBBADoAoAoMDQtBAC8BjAoiAUUNCUEAIAFBf2oiATsBjApBACgCmAogAUH//wNxQQN0aigCAEEERg0EDAwLQScQGQwLC0EiEBkMCgsgAkEvRw0JAkACQCABLwEEIgFBKkYNACABQS9HDQEQFwwMC0EBEBgMCwsCQAJAQQAoApAKIgEvAQAiAxAaRQ0AAkACQCADQVVqDgQACAEDCAsgAUF+ai8BAEErRg0GDAcLIAFBfmovAQBBLUYNBQwGCwJAIANB/QBGDQAgA0EpRw0FQQAoApgKQQAvAYwKQQN0aigCBBAbRQ0FDAYLQQAoApgKQQAvAYwKQQN0aiICKAIEEBwNBSACKAIAQQZGDQUMBAsgAUF+ai8BAEFQakH//wNxQQpJDQMMBAtBACgCmApBAC8BjAoiAUEDdCIDakEAKAKQCjYCBEEAIAFBAWo7AYwKQQAoApgKIANqQQM2AgALEB0MBwtBAC0A8AlBAC8BigpBAC8BjApyckUhAgwJCyABEB4NACADRQ0AIANBL0ZBAC0AlApBAEdxDQAgAUF+aiEBQQAoAtAJIQICQANAIAFBAmoiBCACTQ0BQQAgATYCkAogAS8BACEDIAFBfmoiBCEBIAMQH0UNAAsgBEECaiEEC0EBIQUgA0H//wNxECBFDQEgBEF+aiEBAkADQCABQQJqIgMgAk0NAUEAIAE2ApAKIAEvAQAhAyABQX5qIgQhASADECANAAsgBEECaiEDCyADECFFDQEQIkEAQQA6AJQKDAULECJBACEFC0EAIAU6AJQKDAMLECNBACECDAULIANBoAFHDQELQQBBAToAoAoLQQBBACgCpAo2ApAKC0EAKAKkCiEBDAALCyAAQYDQAGokACACCxoAAkBBACgC0AkgAEcNAEEBDwsgAEF+ahAkC/wKAQZ/QQBBACgCpAoiAEEMaiIBNgKkCkEAKALsCSECQQEQKCEDAkACQAJAAkACQAJAAkACQAJAQQAoAqQKIgQgAUcNACADECdFDQELAkACQAJAAkACQAJAAkAgA0EqRg0AIANB+wBHDQFBACAEQQJqNgKkCkEBECghA0EAKAKkCiEEA0ACQAJAIANB/
Line truncated
|
||||
|
||||
async function _resolve (id, parentUrl) {
|
||||
const urlResolved = resolveIfNotPlainOrUrl(id, parentUrl) || asURL(id);
|
||||
return {
|
||||
r: resolveImportMap(importMap, urlResolved || id, parentUrl) || throwUnresolved(id, parentUrl),
|
||||
// b = bare specifier
|
||||
b: !urlResolved && !asURL(id)
|
||||
};
|
||||
}
|
||||
|
||||
const resolve = resolveHook ? async (id, parentUrl) => {
|
||||
let result = resolveHook(id, parentUrl, defaultResolve);
|
||||
// will be deprecated in next major
|
||||
if (result && result.then)
|
||||
result = await result;
|
||||
return result ? { r: result, b: !resolveIfNotPlainOrUrl(id, parentUrl) && !asURL(id) } : _resolve(id, parentUrl);
|
||||
} : _resolve;
|
||||
|
||||
// importShim('mod');
|
||||
// importShim('mod', { opts });
|
||||
// importShim('mod', { opts }, parentUrl);
|
||||
// importShim('mod', parentUrl);
|
||||
async function importShim (id, ...args) {
|
||||
// parentUrl if present will be the last argument
|
||||
let parentUrl = args[args.length - 1];
|
||||
if (typeof parentUrl !== 'string')
|
||||
parentUrl = baseUrl;
|
||||
// needed for shim check
|
||||
await initPromise;
|
||||
if (importHook) await importHook(id, typeof args[1] !== 'string' ? args[1] : {}, parentUrl);
|
||||
if (acceptingImportMaps || shimMode || !baselinePassthrough) {
|
||||
if (hasDocument)
|
||||
processScriptsAndPreloads(true);
|
||||
if (!shimMode)
|
||||
acceptingImportMaps = false;
|
||||
}
|
||||
await importMapPromise;
|
||||
return topLevelLoad((await resolve(id, parentUrl)).r, { credentials: 'same-origin' });
|
||||
}
|
||||
|
||||
self.importShim = importShim;
|
||||
|
||||
function defaultResolve (id, parentUrl) {
|
||||
return resolveImportMap(importMap, resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) || throwUnresolved(id, parentUrl);
|
||||
}
|
||||
|
||||
function throwUnresolved (id, parentUrl) {
|
||||
throw Error(`Unable to resolve specifier '${id}'${fromParent(parentUrl)}`);
|
||||
}
|
||||
|
||||
const resolveSync = (id, parentUrl = baseUrl) => {
|
||||
parentUrl = `${parentUrl}`;
|
||||
const result = resolveHook && resolveHook(id, parentUrl, defaultResolve);
|
||||
return result && !result.then ? result : defaultResolve(id, parentUrl);
|
||||
};
|
||||
|
||||
function metaResolve (id, parentUrl = this.url) {
|
||||
return resolveSync(id, parentUrl);
|
||||
}
|
||||
|
||||
importShim.resolve = resolveSync;
|
||||
importShim.getImportMap = () => JSON.parse(JSON.stringify(importMap));
|
||||
importShim.addImportMap = importMapIn => {
|
||||
if (!shimMode) throw new Error('Unsupported in polyfill mode.');
|
||||
importMap = resolveAndComposeImportMap(importMapIn, baseUrl, importMap);
|
||||
};
|
||||
|
||||
const registry = importShim._r = {};
|
||||
importShim._w = {};
|
||||
|
||||
async function loadAll (load, seen) {
|
||||
if (load.b || seen[load.u])
|
||||
return;
|
||||
seen[load.u] = 1;
|
||||
await load.L;
|
||||
await Promise.all(load.d.map(dep => loadAll(dep, seen)));
|
||||
if (!load.n)
|
||||
load.n = load.d.some(dep => dep.n);
|
||||
}
|
||||
|
||||
let importMap = { imports: {}, scopes: {} };
|
||||
let baselinePassthrough;
|
||||
|
||||
const initPromise = featureDetectionPromise.then(() => {
|
||||
baselinePassthrough = esmsInitOptions.polyfillEnable !== true && supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy;
|
||||
if (hasDocument) {
|
||||
if (!supportsImportMaps) {
|
||||
const supports = HTMLScriptElement.supports || (type => type === 'classic' || type === 'module');
|
||||
HTMLScriptElement.supports = type => type === 'importmap' || supports(type);
|
||||
}
|
||||
if (shimMode || !baselinePassthrough) {
|
||||
new MutationObserver(mutations => {
|
||||
for (const mutation of mutations) {
|
||||
if (mutation.type !== 'childList') continue;
|
||||
for (const node of mutation.addedNodes) {
|
||||
if (node.tagName === 'SCRIPT') {
|
||||
if (node.type === (shimMode ? 'module-shim' : 'module'))
|
||||
processScript(node, true);
|
||||
if (node.type === (shimMode ? 'importmap-shim' : 'importmap'))
|
||||
processImportMap(node, true);
|
||||
}
|
||||
else if (node.tagName === 'LINK' && node.rel === (shimMode ? 'modulepreload-shim' : 'modulepreload')) {
|
||||
processPreload(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).observe(document, {childList: true, subtree: true});
|
||||
processScriptsAndPreloads();
|
||||
if (document.readyState === 'complete') {
|
||||
readyStateCompleteCheck();
|
||||
}
|
||||
else {
|
||||
async function readyListener() {
|
||||
await initPromise;
|
||||
processScriptsAndPreloads();
|
||||
if (document.readyState === 'complete') {
|
||||
readyStateCompleteCheck();
|
||||
document.removeEventListener('readystatechange', readyListener);
|
||||
}
|
||||
}
|
||||
document.addEventListener('readystatechange', readyListener);
|
||||
}
|
||||
}
|
||||
}
|
||||
return init;
|
||||
});
|
||||
let importMapPromise = initPromise;
|
||||
let firstPolyfillLoad = true;
|
||||
let acceptingImportMaps = true;
|
||||
|
||||
async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) {
|
||||
if (!shimMode)
|
||||
acceptingImportMaps = false;
|
||||
await initPromise;
|
||||
await importMapPromise;
|
||||
if (importHook) await importHook(url, typeof fetchOpts !== 'string' ? fetchOpts : {}, '');
|
||||
// early analysis opt-out - no need to even fetch if we have feature support
|
||||
if (!shimMode && baselinePassthrough) {
|
||||
// for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
|
||||
if (nativelyLoaded)
|
||||
return null;
|
||||
await lastStaticLoadPromise;
|
||||
return dynamicImport(source ? createBlob(source) : url, { errUrl: url || source });
|
||||
}
|
||||
const load = getOrCreateLoad(url, fetchOpts, null, source);
|
||||
const seen = {};
|
||||
await loadAll(load, seen);
|
||||
lastLoad = undefined;
|
||||
resolveDeps(load, seen);
|
||||
await lastStaticLoadPromise;
|
||||
if (source && !shimMode && !load.n) {
|
||||
if (nativelyLoaded) return;
|
||||
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
|
||||
return await dynamicImport(createBlob(source), { errUrl: source });
|
||||
}
|
||||
if (firstPolyfillLoad && !shimMode && load.n && nativelyLoaded) {
|
||||
onpolyfill();
|
||||
firstPolyfillLoad = false;
|
||||
}
|
||||
const module = await dynamicImport(!shimMode && !load.n && nativelyLoaded ? load.u : load.b, { errUrl: load.u });
|
||||
// if the top-level load is a shell, run its update function
|
||||
if (load.s)
|
||||
(await dynamicImport(load.s)).u$_(module);
|
||||
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
|
||||
// when tla is supported, this should return the tla promise as an actual handle
|
||||
// so readystate can still correspond to the sync subgraph exec completions
|
||||
return module;
|
||||
}
|
||||
|
||||
function revokeObjectURLs(registryKeys) {
|
||||
let batch = 0;
|
||||
const keysLength = registryKeys.length;
|
||||
const schedule = self.requestIdleCallback ? self.requestIdleCallback : self.requestAnimationFrame;
|
||||
schedule(cleanup);
|
||||
function cleanup() {
|
||||
const batchStartIndex = batch * 100;
|
||||
if (batchStartIndex > keysLength) return
|
||||
for (const key of registryKeys.slice(batchStartIndex, batchStartIndex + 100)) {
|
||||
const load = registry[key];
|
||||
if (load) URL.revokeObjectURL(load.b);
|
||||
}
|
||||
batch++;
|
||||
schedule(cleanup);
|
||||
}
|
||||
}
|
||||
|
||||
function urlJsString (url) {
|
||||
return `'${url.replace(/'/g, "\\'")}'`;
|
||||
}
|
||||
|
||||
let lastLoad;
|
||||
function resolveDeps (load, seen) {
|
||||
if (load.b || !seen[load.u])
|
||||
return;
|
||||
seen[load.u] = 0;
|
||||
|
||||
for (const dep of load.d)
|
||||
resolveDeps(dep, seen);
|
||||
|
||||
const [imports, exports] = load.a;
|
||||
|
||||
// "execution"
|
||||
const source = load.S;
|
||||
|
||||
// edge doesnt execute sibling in order, so we fix this up by ensuring all previous executions are explicit dependencies
|
||||
let resolvedSource = edge && lastLoad ? `import '${lastLoad}';` : '';
|
||||
|
||||
// once all deps have loaded we can inline the dependency resolution blobs
|
||||
// and define this blob
|
||||
let lastIndex = 0, depIndex = 0, dynamicImportEndStack = [];
|
||||
function pushStringTo (originalIndex) {
|
||||
while (dynamicImportEndStack[dynamicImportEndStack.length - 1] < originalIndex) {
|
||||
const dynamicImportEnd = dynamicImportEndStack.pop();
|
||||
resolvedSource += `${source.slice(lastIndex, dynamicImportEnd)}, ${urlJsString(load.r)}`;
|
||||
lastIndex = dynamicImportEnd;
|
||||
}
|
||||
resolvedSource += source.slice(lastIndex, originalIndex);
|
||||
lastIndex = originalIndex;
|
||||
}
|
||||
|
||||
for (const { s: start, ss: statementStart, se: statementEnd, d: dynamicImportIndex } of imports) {
|
||||
// dependency source replacements
|
||||
if (dynamicImportIndex === -1) {
|
||||
let depLoad = load.d[depIndex++], blobUrl = depLoad.b, cycleShell = !blobUrl;
|
||||
if (cycleShell) {
|
||||
// circular shell creation
|
||||
if (!(blobUrl = depLoad.s)) {
|
||||
blobUrl = depLoad.s = createBlob(`export function u$_(m){${
|
||||
depLoad.a[1].map(({ s, e }, i) => {
|
||||
const q = depLoad.S[s] === '"' || depLoad.S[s] === "'";
|
||||
return `e$_${i}=m${q ? `[` : '.'}${depLoad.S.slice(s, e)}${q ? `]` : ''}`;
|
||||
}).join(',')
|
||||
}}${
|
||||
depLoad.a[1].length ? `let ${depLoad.a[1].map((_, i) => `e$_${i}`).join(',')};` : ''
|
||||
}export {${
|
||||
depLoad.a[1].map(({ s, e }, i) => `e$_${i} as ${depLoad.S.slice(s, e)}`).join(',')
|
||||
}}\n//# sourceURL=${depLoad.r}?cycle`);
|
||||
}
|
||||
}
|
||||
|
||||
pushStringTo(start - 1);
|
||||
resolvedSource += `/*${source.slice(start - 1, statementEnd)}*/${urlJsString(blobUrl)}`;
|
||||
|
||||
// circular shell execution
|
||||
if (!cycleShell && depLoad.s) {
|
||||
resolvedSource += `;import*as m$_${depIndex} from'${depLoad.b}';import{u$_ as u$_${depIndex}}from'${depLoad.s}';u$_${depIndex}(m$_${depIndex})`;
|
||||
depLoad.s = undefined;
|
||||
}
|
||||
lastIndex = statementEnd;
|
||||
}
|
||||
// import.meta
|
||||
else if (dynamicImportIndex === -2) {
|
||||
load.m = { url: load.r, resolve: metaResolve };
|
||||
metaHook(load.m, load.u);
|
||||
pushStringTo(start);
|
||||
resolvedSource += `importShim._r[${urlJsString(load.u)}].m`;
|
||||
lastIndex = statementEnd;
|
||||
}
|
||||
// dynamic import
|
||||
else {
|
||||
pushStringTo(statementStart + 6);
|
||||
resolvedSource += `Shim(`;
|
||||
dynamicImportEndStack.push(statementEnd - 1);
|
||||
lastIndex = start;
|
||||
}
|
||||
}
|
||||
|
||||
// support progressive cycle binding updates (try statement avoids tdz errors)
|
||||
if (load.s)
|
||||
resolvedSource += `\n;import{u$_}from'${load.s}';try{u$_({${exports.filter(e => e.ln).map(({ s, e, ln }) => `${source.slice(s, e)}:${ln}`).join(',')}})}catch(_){};\n`;
|
||||
|
||||
function pushSourceURL (commentPrefix, commentStart) {
|
||||
const urlStart = commentStart + commentPrefix.length;
|
||||
const commentEnd = source.indexOf('\n', urlStart);
|
||||
const urlEnd = commentEnd !== -1 ? commentEnd : source.length;
|
||||
pushStringTo(urlStart);
|
||||
resolvedSource += new URL(source.slice(urlStart, urlEnd), load.r).href;
|
||||
lastIndex = urlEnd;
|
||||
}
|
||||
|
||||
let sourceURLCommentStart = source.lastIndexOf(sourceURLCommentPrefix);
|
||||
let sourceMapURLCommentStart = source.lastIndexOf(sourceMapURLCommentPrefix);
|
||||
|
||||
// ignore sourceMap comments before already spliced code
|
||||
if (sourceURLCommentStart < lastIndex) sourceURLCommentStart = -1;
|
||||
if (sourceMapURLCommentStart < lastIndex) sourceMapURLCommentStart = -1;
|
||||
|
||||
// sourceURL first / only
|
||||
if (sourceURLCommentStart !== -1 && (sourceMapURLCommentStart === -1 || sourceMapURLCommentStart > sourceURLCommentStart)) {
|
||||
pushSourceURL(sourceURLCommentPrefix, sourceURLCommentStart);
|
||||
}
|
||||
// sourceMappingURL
|
||||
if (sourceMapURLCommentStart !== -1) {
|
||||
pushSourceURL(sourceMapURLCommentPrefix, sourceMapURLCommentStart);
|
||||
// sourceURL last
|
||||
if (sourceURLCommentStart !== -1 && (sourceURLCommentStart > sourceMapURLCommentStart))
|
||||
pushSourceURL(sourceURLCommentPrefix, sourceURLCommentStart);
|
||||
}
|
||||
|
||||
pushStringTo(source.length);
|
||||
|
||||
if (sourceURLCommentStart === -1)
|
||||
resolvedSource += sourceURLCommentPrefix + load.r;
|
||||
|
||||
load.b = lastLoad = createBlob(resolvedSource);
|
||||
load.S = undefined;
|
||||
}
|
||||
|
||||
const sourceURLCommentPrefix = '\n//# sourceURL=';
|
||||
const sourceMapURLCommentPrefix = '\n//# sourceMappingURL=';
|
||||
|
||||
const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
|
||||
const wasmContentType = /^(application)\/wasm(;|$)/;
|
||||
const jsonContentType = /^(text|application)\/json(;|$)/;
|
||||
const cssContentType = /^(text|application)\/css(;|$)/;
|
||||
|
||||
const cssUrlRegEx = /url\(\s*(?:(["'])((?:\\.|[^\n\\"'])+)\1|((?:\\.|[^\s,"'()\\])+))\s*\)/g;
|
||||
|
||||
// restrict in-flight fetches to a pool of 100
|
||||
let p = [];
|
||||
let c = 0;
|
||||
function pushFetchPool () {
|
||||
if (++c > 100)
|
||||
return new Promise(r => p.push(r));
|
||||
}
|
||||
function popFetchPool () {
|
||||
c--;
|
||||
if (p.length)
|
||||
p.shift()();
|
||||
}
|
||||
|
||||
async function doFetch (url, fetchOpts, parent) {
|
||||
if (enforceIntegrity && !fetchOpts.integrity)
|
||||
throw Error(`No integrity for ${url}${fromParent(parent)}.`);
|
||||
const poolQueue = pushFetchPool();
|
||||
if (poolQueue) await poolQueue;
|
||||
try {
|
||||
var res = await fetchHook(url, fetchOpts);
|
||||
}
|
||||
catch (e) {
|
||||
e.message = `Unable to fetch ${url}${fromParent(parent)} - see network log for details.\n` + e.message;
|
||||
throw e;
|
||||
}
|
||||
finally {
|
||||
popFetchPool();
|
||||
}
|
||||
|
||||
if (!res.ok) {
|
||||
const error = new TypeError(`${res.status} ${res.statusText} ${res.url}${fromParent(parent)}`);
|
||||
error.response = res;
|
||||
throw error;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
async function fetchModule (url, fetchOpts, parent) {
|
||||
const res = await doFetch(url, fetchOpts, parent);
|
||||
const contentType = res.headers.get('content-type');
|
||||
if (jsContentType.test(contentType))
|
||||
return { r: res.url, s: await res.text(), t: 'js' };
|
||||
else if (wasmContentType.test(contentType)) {
|
||||
const module = importShim._w[url] = await WebAssembly.compileStreaming(res);
|
||||
let s = '', i = 0, importObj = '';
|
||||
for (const impt of WebAssembly.Module.imports(module)) {
|
||||
s += `import * as impt${i} from '${impt.module}';\n`;
|
||||
importObj += `'${impt.module}':impt${i++},`;
|
||||
}
|
||||
i = 0;
|
||||
s += `const instance = await WebAssembly.instantiate(importShim._w['${url}'], {${importObj}});\n`;
|
||||
for (const expt of WebAssembly.Module.exports(module)) {
|
||||
s += `const expt${i} = instance['${expt.name}'];\n`;
|
||||
s += `export { expt${i++} as "${expt.name}" };\n`;
|
||||
}
|
||||
return { r: res.url, s, t: 'wasm' };
|
||||
}
|
||||
else if (jsonContentType.test(contentType))
|
||||
return { r: res.url, s: `export default ${await res.text()}`, t: 'json' };
|
||||
else if (cssContentType.test(contentType)) {
|
||||
return { r: res.url, s: `var s=new CSSStyleSheet();s.replaceSync(${
|
||||
JSON.stringify((await res.text()).replace(cssUrlRegEx, (_match, quotes = '', relUrl1, relUrl2) => `url(${quotes}${resolveUrl(relUrl1 || relUrl2, url)}${quotes})`))
|
||||
});export default s;`, t: 'css' };
|
||||
}
|
||||
else
|
||||
throw Error(`Unsupported Content-Type "${contentType}" loading ${url}${fromParent(parent)}. Modules must be served with a valid MIME type like application/javascript.`);
|
||||
}
|
||||
|
||||
function getOrCreateLoad (url, fetchOpts, parent, source) {
|
||||
let load = registry[url];
|
||||
if (load && !source)
|
||||
return load;
|
||||
|
||||
load = {
|
||||
// url
|
||||
u: url,
|
||||
// response url
|
||||
r: source ? url : undefined,
|
||||
// fetchPromise
|
||||
f: undefined,
|
||||
// source
|
||||
S: undefined,
|
||||
// linkPromise
|
||||
L: undefined,
|
||||
// analysis
|
||||
a: undefined,
|
||||
// deps
|
||||
d: undefined,
|
||||
// blobUrl
|
||||
b: undefined,
|
||||
// shellUrl
|
||||
s: undefined,
|
||||
// needsShim
|
||||
n: false,
|
||||
// type
|
||||
t: null,
|
||||
// meta
|
||||
m: null
|
||||
};
|
||||
if (registry[url]) {
|
||||
let i = 0;
|
||||
while (registry[load.u + ++i]);
|
||||
load.u += i;
|
||||
}
|
||||
registry[load.u] = load;
|
||||
|
||||
load.f = (async () => {
|
||||
if (!source) {
|
||||
// preload fetch options override fetch options (race)
|
||||
let t;
|
||||
({ r: load.r, s: source, t } = await (fetchCache[url] || fetchModule(url, fetchOpts, parent)));
|
||||
if (t && !shimMode) {
|
||||
if (t === 'css' && !cssModulesEnabled || t === 'json' && !jsonModulesEnabled)
|
||||
throw Error(`${t}-modules require <script type="esms-options">{ "polyfillEnable": ["${t}-modules"] }<${''}/script>`);
|
||||
if (t === 'css' && !supportsCssAssertions || t === 'json' && !supportsJsonAssertions)
|
||||
load.n = true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
load.a = parse(source, load.u);
|
||||
}
|
||||
catch (e) {
|
||||
throwError(e);
|
||||
load.a = [[], [], false];
|
||||
}
|
||||
load.S = source;
|
||||
return load;
|
||||
})();
|
||||
|
||||
load.L = load.f.then(async () => {
|
||||
let childFetchOpts = fetchOpts;
|
||||
load.d = (await Promise.all(load.a[0].map(async ({ n, d }) => {
|
||||
if (d >= 0 && !supportsDynamicImport || d === -2 && !supportsImportMeta)
|
||||
load.n = true;
|
||||
if (d !== -1 || !n) return;
|
||||
const { r, b } = await resolve(n, load.r || load.u);
|
||||
if (b && (!supportsImportMaps || importMapSrcOrLazy))
|
||||
load.n = true;
|
||||
if (d !== -1) return;
|
||||
if (skip && skip(r)) return { b: r };
|
||||
if (childFetchOpts.integrity)
|
||||
childFetchOpts = Object.assign({}, childFetchOpts, { integrity: undefined });
|
||||
return getOrCreateLoad(r, childFetchOpts, load.r).f;
|
||||
}))).filter(l => l);
|
||||
});
|
||||
|
||||
return load;
|
||||
}
|
||||
|
||||
function processScriptsAndPreloads (mapsOnly = false) {
|
||||
if (!mapsOnly)
|
||||
for (const link of document.querySelectorAll(shimMode ? 'link[rel=modulepreload-shim]' : 'link[rel=modulepreload]'))
|
||||
processPreload(link);
|
||||
for (const script of document.querySelectorAll(shimMode ? 'script[type=importmap-shim]' : 'script[type=importmap]'))
|
||||
processImportMap(script);
|
||||
if (!mapsOnly)
|
||||
for (const script of document.querySelectorAll(shimMode ? 'script[type=module-shim]' : 'script[type=module]'))
|
||||
processScript(script);
|
||||
}
|
||||
|
||||
function getFetchOpts (script) {
|
||||
const fetchOpts = {};
|
||||
if (script.integrity)
|
||||
fetchOpts.integrity = script.integrity;
|
||||
if (script.referrerPolicy)
|
||||
fetchOpts.referrerPolicy = script.referrerPolicy;
|
||||
if (script.crossOrigin === 'use-credentials')
|
||||
fetchOpts.credentials = 'include';
|
||||
else if (script.crossOrigin === 'anonymous')
|
||||
fetchOpts.credentials = 'omit';
|
||||
else
|
||||
fetchOpts.credentials = 'same-origin';
|
||||
return fetchOpts;
|
||||
}
|
||||
|
||||
let lastStaticLoadPromise = Promise.resolve();
|
||||
|
||||
let domContentLoadedCnt = 1;
|
||||
function domContentLoadedCheck () {
|
||||
if (--domContentLoadedCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) {
|
||||
document.dispatchEvent(new Event('DOMContentLoaded'));
|
||||
}
|
||||
}
|
||||
// this should always trigger because we assume es-module-shims is itself a domcontentloaded requirement
|
||||
if (hasDocument) {
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
await initPromise;
|
||||
domContentLoadedCheck();
|
||||
});
|
||||
}
|
||||
|
||||
let readyStateCompleteCnt = 1;
|
||||
function readyStateCompleteCheck () {
|
||||
if (--readyStateCompleteCnt === 0 && !noLoadEventRetriggers && (shimMode || !baselinePassthrough)) {
|
||||
document.dispatchEvent(new Event('readystatechange'));
|
||||
}
|
||||
}
|
||||
|
||||
const hasNext = script => script.nextSibling || script.parentNode && hasNext(script.parentNode);
|
||||
const epCheck = (script, ready) => script.ep || !ready && (!script.src && !script.innerHTML || !hasNext(script)) || script.getAttribute('noshim') !== null || !(script.ep = true);
|
||||
|
||||
function processImportMap (script, ready = readyStateCompleteCnt > 0) {
|
||||
if (epCheck(script, ready)) return;
|
||||
// we dont currently support multiple, external or dynamic imports maps in polyfill mode to match native
|
||||
if (script.src) {
|
||||
if (!shimMode)
|
||||
return;
|
||||
setImportMapSrcOrLazy();
|
||||
}
|
||||
if (acceptingImportMaps) {
|
||||
importMapPromise = importMapPromise
|
||||
.then(async () => {
|
||||
importMap = resolveAndComposeImportMap(script.src ? await (await doFetch(script.src, getFetchOpts(script))).json() : JSON.parse(script.innerHTML), script.src || baseUrl, importMap);
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e);
|
||||
if (e instanceof SyntaxError)
|
||||
e = new Error(`Unable to parse import map ${e.message} in: ${script.src || script.innerHTML}`);
|
||||
throwError(e);
|
||||
});
|
||||
if (!shimMode)
|
||||
acceptingImportMaps = false;
|
||||
}
|
||||
}
|
||||
|
||||
function processScript (script, ready = readyStateCompleteCnt > 0) {
|
||||
if (epCheck(script, ready)) return;
|
||||
// does this load block readystate complete
|
||||
const isBlockingReadyScript = script.getAttribute('async') === null && readyStateCompleteCnt > 0;
|
||||
// does this load block DOMContentLoaded
|
||||
const isDomContentLoadedScript = domContentLoadedCnt > 0;
|
||||
if (isBlockingReadyScript) readyStateCompleteCnt++;
|
||||
if (isDomContentLoadedScript) domContentLoadedCnt++;
|
||||
const loadPromise = topLevelLoad(script.src || baseUrl, getFetchOpts(script), !script.src && script.innerHTML, !shimMode, isBlockingReadyScript && lastStaticLoadPromise)
|
||||
.then(() => {
|
||||
// if the type of the script tag "module-shim", browser does not dispatch a "load" event
|
||||
// see https://github.com/guybedford/es-module-shims/issues/346
|
||||
if (shimMode) {
|
||||
script.dispatchEvent(new Event('load'));
|
||||
}
|
||||
})
|
||||
.catch(throwError);
|
||||
if (isBlockingReadyScript)
|
||||
lastStaticLoadPromise = loadPromise.then(readyStateCompleteCheck);
|
||||
if (isDomContentLoadedScript)
|
||||
loadPromise.then(domContentLoadedCheck);
|
||||
}
|
||||
|
||||
const fetchCache = {};
|
||||
function processPreload (link) {
|
||||
if (link.ep) return;
|
||||
link.ep = true;
|
||||
if (fetchCache[link.href])
|
||||
return;
|
||||
fetchCache[link.href] = fetchModule(link.href, getFetchOpts(link));
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
!function(){const A="undefined"!=typeof window,Q="undefined"!=typeof document,e=()=>{};var t=Q?document.querySelector("script[type=esms-options]"):void 0;const C=t?JSON.parse(t.innerHTML):{};Object.assign(C,self.esmsInitOptions||{});let B=!Q||!!C.shimMode;const E=p(B&&C.onimport),o=p(B&&C.resolve);let i=C.fetch?p(C.fetch):fetch;const g=C.meta?p(B&&C.meta):e,n=C.mapOverrides;let s=C.nonce;!s&&Q&&(t=document.querySelector("script[nonce]"))&&(s=t.nonce||t.getAttribute("nonce"));const r=p(C.onerror||e),a=C.onpolyfill?p(C.onpolyfill):()=>{console.log("%c^^ Module TypeError above is polyfilled and can be ignored ^^","font-weight:900;color:#391")},{revokeBlobURLs:I,noLoadEventRetriggers:c,enforceIntegrity:l}=C;function p(A){return"string"==typeof A?self[A]:A}const f=(t=Array.isArray(C.polyfillEnable)?C.polyfillEnable:[]).includes("css-modules"),k=t.includes("json-modules"),w=!navigator.userAgentData&&!!navigator.userAgent.match(/Edge\/\d+\.\d+/),m=Q?document.baseURI:location.protocol+"//"+location.host+(location.pathname.includes("/")?location.pathname.slice(0,location.pathname.lastIndexOf("/")+1):location.pathname),K=(A,Q="text/javascript")=>URL.createObjectURL(new Blob([A],{type:Q}));let d=C.skip;if(Array.isArray(d)){const A=d.map((A=>new URL(A,m).href));d=Q=>A.some((A=>"/"===A[A.length-1]&&Q.startsWith(A)||Q===A))}else if("string"==typeof d){const A=new RegExp(d);d=Q=>A.test(Q)}else d instanceof RegExp&&(d=A=>d.test(A));const u=A=>setTimeout((()=>{throw A})),D=Q=>{(self.reportError||A&&window.safari&&console.error||u)(Q),r(Q)};function h(A){return A?" imported from "+A:""}let J=!1;if(!B)if(document.querySelectorAll("script[type=module-shim],script[type=importmap-shim],link[rel=modulepreload-shim]").length)B=!0;else{let A=!1;for(const Q of document.querySelectorAll("script[type=module],script[type=importmap]"))if(A){if("importmap"===Q.type&&A){J=!0;break}}else"module"!==Q.type||Q.ep||(A=!0)}const L=/\\/g;function N(A){try{if(-1!==A.indexOf(":"))return new URL(A).href}catch(A){}}function y(A,Q){return F(A,Q)||N(A)||F("./"+A,Q)}function F(A,Q){var e=Q.indexOf("#"),t=Q.indexOf("?");if(-2<e+t&&(Q=Q.slice(0,-1!==e&&(-1===t||e<t)?e:t)),"/"===(A=-1!==A.indexOf("\\")?A.replace(L,"/"):A)[0]&&"/"===A[1])return Q.slice(0,Q.indexOf(":")+1)+A;if("."===A[0]&&("/"===A[1]||"."===A[1]&&("/"===A[2]||2===A.length&&(A+="/"))||1===A.length&&(A+="/"))||"/"===A[0]){if("blob:"===(e=Q.slice(0,Q.indexOf(":")+1)))throw new TypeError(`Failed to resolve module specifier "${A}". Invalid relative url or base scheme isn't hierarchical.`);let t;if(t="/"===Q[e.length+1]?"file:"!==e?(t=Q.slice(e.length+2)).slice(t.indexOf("/")+1):Q.slice(8):Q.slice(e.length+("/"===Q[e.length])),"/"===A[0])return Q.slice(0,Q.length-t.length-1)+A;var C=t.slice(0,t.lastIndexOf("/")+1)+A,B=[];let E=-1;for(let A=0;A<C.length;A++)if(-1!==E)"/"===C[A]&&(B.push(C.slice(E,A+1)),E=-1);else{if("."===C[A]){if("."===C[A+1]&&("/"===C[A+2]||A+2===C.length)){B.pop(),A+=2;continue}if("/"===C[A+1]||A+1===C.length){A+=1;continue}}for(;"/"===C[A];)A++;E=A}return-1!==E&&B.push(C.slice(E)),Q.slice(0,Q.length-t.length)+B.join("")}}function U(A,Q,e){var t={imports:Object.assign({},e.imports),scopes:Object.assign({},e.scopes)};if(A.imports&&Y(A.imports,t.imports,Q,e),A.scopes)for(var C in A.scopes){var B=y(C,Q);Y(A.scopes[C],t.scopes[B]||(t.scopes[B]={}),Q,e)}return t}function q(A,Q){if(Q[A])return A;let e=A.length;do{var t=A.slice(0,e+1);if(t in Q)return t}while(-1!==(e=A.lastIndexOf("/",e-1)))}function v(A,Q){var e=q(A,Q);if(e&&null!==(Q=Q[e]))return Q+A.slice(e.length)}function R(A,Q,e){let t=e&&q(e,A.scopes);for(;t;){var C=v(Q,A.scopes[t]);if(C)return C;t=q(t.slice(0,t.lastIndexOf("/")),A.scopes)}return v(Q,A.imports)||-1!==Q.indexOf(":")&&Q}function Y(A,Q,e,t){for(var C in A){var E=F(C,e)||C;if((!B||!n)&&Q[E]&&Q[E]!==A[E])throw Error(`Rejected map override "${E}" from ${Q[E]} to ${A[E]}.`);var o=A[C];"string"==typeof o&&((o=R(t,F(o,e)||o,e))?Q[E]=o:console.warn(`Mapping "${C}" -> "${A[C]}" does not resolve`))}}let M,S=!Q&&(0,eval)("u=>import(u)");t=Q&&new Promise((A=>{const Q=Object.assign(document.createElement("script"),{src:K("self._d=u=>import(u)"),ep:!0});Q.setAttribute("nonce",s),Q.addEventListener("load",(()=>{if(!(M=!!(S=self._d))){let A;window.addEventListener("error",(Q=>A=Q)),S=(Q,e)=>new Promise(((t,C)=>{const B=Object.assign(document.createElement("script"),{type:"module",src:K(`import*as m from'${Q}';self._esmsi=m`)});function E(E){document.head.removeChild(B),self._esmsi?(t(self._esmsi,m),self._esmsi=void 0):(C(!(E instanceof Event)&&E||A&&A.error||new Error(`Error loading ${e&&e.errUrl||Q} (${B.src}).`)),A=void 0)}A=void 0,B.ep=!0,s&&B.setAttribute("nonce",s),B.addEventListener("error",E),B.addEventListener("load",E),document.head.appendChild(B)}))}document.head.removeChild(Q),delete self._d,A()})),document.head.appendChild(Q)}));let G=!1,b=!1;var x=Q&&HTMLScriptElement.supports;let H=x&&"supports"===x.name&&x("importmap"),$=M;const j="import.meta",O='import"x"asserLine truncated
|
||||
+840
@@ -0,0 +1,840 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
||||
typeof define === 'function' && define.amd ? define('inert', factory) :
|
||||
(factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
/**
|
||||
* This work is licensed under the W3C Software and Document License
|
||||
* (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).
|
||||
*/
|
||||
|
||||
(function () {
|
||||
// Return early if we're not running inside of the browser.
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Convenience function for converting NodeLists.
|
||||
/** @type {typeof Array.prototype.slice} */
|
||||
var slice = Array.prototype.slice;
|
||||
|
||||
/**
|
||||
* IE has a non-standard name for "matches".
|
||||
* @type {typeof Element.prototype.matches}
|
||||
*/
|
||||
var matches = Element.prototype.matches || Element.prototype.msMatchesSelector;
|
||||
|
||||
/** @type {string} */
|
||||
var _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', '[contenteditable]'].join(',');
|
||||
|
||||
/**
|
||||
* `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert`
|
||||
* attribute.
|
||||
*
|
||||
* Its main functions are:
|
||||
*
|
||||
* - to create and maintain a set of managed `InertNode`s, including when mutations occur in the
|
||||
* subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering
|
||||
* each focusable node in the subtree with the singleton `InertManager` which manages all known
|
||||
* focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode`
|
||||
* instance exists for each focusable node which has at least one inert root as an ancestor.
|
||||
*
|
||||
* - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert`
|
||||
* attribute is removed from the root node). This is handled in the destructor, which calls the
|
||||
* `deregister` method on `InertManager` for each managed inert node.
|
||||
*/
|
||||
|
||||
var InertRoot = function () {
|
||||
/**
|
||||
* @param {!HTMLElement} rootElement The HTMLElement at the root of the inert subtree.
|
||||
* @param {!InertManager} inertManager The global singleton InertManager object.
|
||||
*/
|
||||
function InertRoot(rootElement, inertManager) {
|
||||
_classCallCheck(this, InertRoot);
|
||||
|
||||
/** @type {!InertManager} */
|
||||
this._inertManager = inertManager;
|
||||
|
||||
/** @type {!HTMLElement} */
|
||||
this._rootElement = rootElement;
|
||||
|
||||
/**
|
||||
* @type {!Set<!InertNode>}
|
||||
* All managed focusable nodes in this InertRoot's subtree.
|
||||
*/
|
||||
this._managedNodes = new Set();
|
||||
|
||||
// Make the subtree hidden from assistive technology
|
||||
if (this._rootElement.hasAttribute('aria-hidden')) {
|
||||
/** @type {?string} */
|
||||
this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden');
|
||||
} else {
|
||||
this._savedAriaHidden = null;
|
||||
}
|
||||
this._rootElement.setAttribute('aria-hidden', 'true');
|
||||
|
||||
// Make all focusable elements in the subtree unfocusable and add them to _managedNodes
|
||||
this._makeSubtreeUnfocusable(this._rootElement);
|
||||
|
||||
// Watch for:
|
||||
// - any additions in the subtree: make them unfocusable too
|
||||
// - any removals from the subtree: remove them from this inert root's managed nodes
|
||||
// - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable
|
||||
// element, make that node a managed node.
|
||||
this._observer = new MutationObserver(this._onMutation.bind(this));
|
||||
this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this whenever this object is about to become obsolete. This unwinds all of the state
|
||||
* stored in this object and updates the state of all of the managed nodes.
|
||||
*/
|
||||
|
||||
|
||||
_createClass(InertRoot, [{
|
||||
key: 'destructor',
|
||||
value: function destructor() {
|
||||
this._observer.disconnect();
|
||||
|
||||
if (this._rootElement) {
|
||||
if (this._savedAriaHidden !== null) {
|
||||
this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden);
|
||||
} else {
|
||||
this._rootElement.removeAttribute('aria-hidden');
|
||||
}
|
||||
}
|
||||
|
||||
this._managedNodes.forEach(function (inertNode) {
|
||||
this._unmanageNode(inertNode.node);
|
||||
}, this);
|
||||
|
||||
// Note we cast the nulls to the ANY type here because:
|
||||
// 1) We want the class properties to be declared as non-null, or else we
|
||||
// need even more casts throughout this code. All bets are off if an
|
||||
// instance has been destroyed and a method is called.
|
||||
// 2) We don't want to cast "this", because we want type-aware optimizations
|
||||
// to know which properties we're setting.
|
||||
this._observer = /** @type {?} */null;
|
||||
this._rootElement = /** @type {?} */null;
|
||||
this._managedNodes = /** @type {?} */null;
|
||||
this._inertManager = /** @type {?} */null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_makeSubtreeUnfocusable',
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Node} startNode
|
||||
*/
|
||||
value: function _makeSubtreeUnfocusable(startNode) {
|
||||
var _this2 = this;
|
||||
|
||||
composedTreeWalk(startNode, function (node) {
|
||||
return _this2._visitNode(node);
|
||||
});
|
||||
|
||||
var activeElement = document.activeElement;
|
||||
|
||||
if (!document.body.contains(startNode)) {
|
||||
// startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement.
|
||||
var node = startNode;
|
||||
/** @type {!ShadowRoot|undefined} */
|
||||
var root = undefined;
|
||||
while (node) {
|
||||
if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
||||
root = /** @type {!ShadowRoot} */node;
|
||||
break;
|
||||
}
|
||||
node = node.parentNode;
|
||||
}
|
||||
if (root) {
|
||||
activeElement = root.activeElement;
|
||||
}
|
||||
}
|
||||
if (startNode.contains(activeElement)) {
|
||||
activeElement.blur();
|
||||
// In IE11, if an element is already focused, and then set to tabindex=-1
|
||||
// calling blur() will not actually move the focus.
|
||||
// To work around this we call focus() on the body instead.
|
||||
if (activeElement === document.activeElement) {
|
||||
document.body.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {!Node} node
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_visitNode',
|
||||
value: function _visitNode(node) {
|
||||
if (node.nodeType !== Node.ELEMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
var element = /** @type {!HTMLElement} */node;
|
||||
|
||||
// If a descendant inert root becomes un-inert, its descendants will still be inert because of
|
||||
// this inert root, so all of its managed nodes need to be adopted by this InertRoot.
|
||||
if (element !== this._rootElement && element.hasAttribute('inert')) {
|
||||
this._adoptInertRoot(element);
|
||||
}
|
||||
|
||||
if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) {
|
||||
this._manageNode(element);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the given node with this InertRoot and with InertManager.
|
||||
* @param {!Node} node
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_manageNode',
|
||||
value: function _manageNode(node) {
|
||||
var inertNode = this._inertManager.register(node, this);
|
||||
this._managedNodes.add(inertNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister the given node with this InertRoot and with InertManager.
|
||||
* @param {!Node} node
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_unmanageNode',
|
||||
value: function _unmanageNode(node) {
|
||||
var inertNode = this._inertManager.deregister(node, this);
|
||||
if (inertNode) {
|
||||
this._managedNodes['delete'](inertNode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister the entire subtree starting at `startNode`.
|
||||
* @param {!Node} startNode
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_unmanageSubtree',
|
||||
value: function _unmanageSubtree(startNode) {
|
||||
var _this3 = this;
|
||||
|
||||
composedTreeWalk(startNode, function (node) {
|
||||
return _this3._unmanageNode(node);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* If a descendant node is found with an `inert` attribute, adopt its managed nodes.
|
||||
* @param {!HTMLElement} node
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_adoptInertRoot',
|
||||
value: function _adoptInertRoot(node) {
|
||||
var inertSubroot = this._inertManager.getInertRoot(node);
|
||||
|
||||
// During initialisation this inert root may not have been registered yet,
|
||||
// so register it now if need be.
|
||||
if (!inertSubroot) {
|
||||
this._inertManager.setInert(node, true);
|
||||
inertSubroot = this._inertManager.getInertRoot(node);
|
||||
}
|
||||
|
||||
inertSubroot.managedNodes.forEach(function (savedInertNode) {
|
||||
this._manageNode(savedInertNode.node);
|
||||
}, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used when mutation observer detects subtree additions, removals, or attribute changes.
|
||||
* @param {!Array<!MutationRecord>} records
|
||||
* @param {!MutationObserver} self
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_onMutation',
|
||||
value: function _onMutation(records, self) {
|
||||
records.forEach(function (record) {
|
||||
var target = /** @type {!HTMLElement} */record.target;
|
||||
if (record.type === 'childList') {
|
||||
// Manage added nodes
|
||||
slice.call(record.addedNodes).forEach(function (node) {
|
||||
this._makeSubtreeUnfocusable(node);
|
||||
}, this);
|
||||
|
||||
// Un-manage removed nodes
|
||||
slice.call(record.removedNodes).forEach(function (node) {
|
||||
this._unmanageSubtree(node);
|
||||
}, this);
|
||||
} else if (record.type === 'attributes') {
|
||||
if (record.attributeName === 'tabindex') {
|
||||
// Re-initialise inert node if tabindex changes
|
||||
this._manageNode(target);
|
||||
} else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) {
|
||||
// If a new inert root is added, adopt its managed nodes and make sure it knows about the
|
||||
// already managed nodes from this inert subroot.
|
||||
this._adoptInertRoot(target);
|
||||
var inertSubroot = this._inertManager.getInertRoot(target);
|
||||
this._managedNodes.forEach(function (managedNode) {
|
||||
if (target.contains(managedNode.node)) {
|
||||
inertSubroot._manageNode(managedNode.node);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
}, {
|
||||
key: 'managedNodes',
|
||||
get: function get() {
|
||||
return new Set(this._managedNodes);
|
||||
}
|
||||
|
||||
/** @return {boolean} */
|
||||
|
||||
}, {
|
||||
key: 'hasSavedAriaHidden',
|
||||
get: function get() {
|
||||
return this._savedAriaHidden !== null;
|
||||
}
|
||||
|
||||
/** @param {?string} ariaHidden */
|
||||
|
||||
}, {
|
||||
key: 'savedAriaHidden',
|
||||
set: function set(ariaHidden) {
|
||||
this._savedAriaHidden = ariaHidden;
|
||||
}
|
||||
|
||||
/** @return {?string} */
|
||||
,
|
||||
get: function get() {
|
||||
return this._savedAriaHidden;
|
||||
}
|
||||
}]);
|
||||
|
||||
return InertRoot;
|
||||
}();
|
||||
|
||||
/**
|
||||
* `InertNode` initialises and manages a single inert node.
|
||||
* A node is inert if it is a descendant of one or more inert root elements.
|
||||
*
|
||||
* On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and
|
||||
* either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element
|
||||
* is intrinsically focusable or not.
|
||||
*
|
||||
* `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an
|
||||
* `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the
|
||||
* `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s
|
||||
* remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists,
|
||||
* or removes the `tabindex` attribute if the element is intrinsically focusable.
|
||||
*/
|
||||
|
||||
|
||||
var InertNode = function () {
|
||||
/**
|
||||
* @param {!Node} node A focusable element to be made inert.
|
||||
* @param {!InertRoot} inertRoot The inert root element associated with this inert node.
|
||||
*/
|
||||
function InertNode(node, inertRoot) {
|
||||
_classCallCheck(this, InertNode);
|
||||
|
||||
/** @type {!Node} */
|
||||
this._node = node;
|
||||
|
||||
/** @type {boolean} */
|
||||
this._overrodeFocusMethod = false;
|
||||
|
||||
/**
|
||||
* @type {!Set<!InertRoot>} The set of descendant inert roots.
|
||||
* If and only if this set becomes empty, this node is no longer inert.
|
||||
*/
|
||||
this._inertRoots = new Set([inertRoot]);
|
||||
|
||||
/** @type {?number} */
|
||||
this._savedTabIndex = null;
|
||||
|
||||
/** @type {boolean} */
|
||||
this._destroyed = false;
|
||||
|
||||
// Save any prior tabindex info and make this node untabbable
|
||||
this.ensureUntabbable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this whenever this object is about to become obsolete.
|
||||
* This makes the managed node focusable again and deletes all of the previously stored state.
|
||||
*/
|
||||
|
||||
|
||||
_createClass(InertNode, [{
|
||||
key: 'destructor',
|
||||
value: function destructor() {
|
||||
this._throwIfDestroyed();
|
||||
|
||||
if (this._node && this._node.nodeType === Node.ELEMENT_NODE) {
|
||||
var element = /** @type {!HTMLElement} */this._node;
|
||||
if (this._savedTabIndex !== null) {
|
||||
element.setAttribute('tabindex', this._savedTabIndex);
|
||||
} else {
|
||||
element.removeAttribute('tabindex');
|
||||
}
|
||||
|
||||
// Use `delete` to restore native focus method.
|
||||
if (this._overrodeFocusMethod) {
|
||||
delete element.focus;
|
||||
}
|
||||
}
|
||||
|
||||
// See note in InertRoot.destructor for why we cast these nulls to ANY.
|
||||
this._node = /** @type {?} */null;
|
||||
this._inertRoots = /** @type {?} */null;
|
||||
this._destroyed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {boolean} Whether this object is obsolete because the managed node is no longer inert.
|
||||
* If the object has been destroyed, any attempt to access it will cause an exception.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_throwIfDestroyed',
|
||||
|
||||
|
||||
/**
|
||||
* Throw if user tries to access destroyed InertNode.
|
||||
*/
|
||||
value: function _throwIfDestroyed() {
|
||||
if (this.destroyed) {
|
||||
throw new Error('Trying to access destroyed InertNode');
|
||||
}
|
||||
}
|
||||
|
||||
/** @return {boolean} */
|
||||
|
||||
}, {
|
||||
key: 'ensureUntabbable',
|
||||
|
||||
|
||||
/** Save the existing tabindex value and make the node untabbable and unfocusable */
|
||||
value: function ensureUntabbable() {
|
||||
if (this.node.nodeType !== Node.ELEMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
var element = /** @type {!HTMLElement} */this.node;
|
||||
if (matches.call(element, _focusableElementsString)) {
|
||||
if ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.hasAttribute('tabindex')) {
|
||||
this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;
|
||||
}
|
||||
element.setAttribute('tabindex', '-1');
|
||||
if (element.nodeType === Node.ELEMENT_NODE) {
|
||||
element.focus = function () {};
|
||||
this._overrodeFocusMethod = true;
|
||||
}
|
||||
} else if (element.hasAttribute('tabindex')) {
|
||||
this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex;
|
||||
element.removeAttribute('tabindex');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add another inert root to this inert node's set of managing inert roots.
|
||||
* @param {!InertRoot} inertRoot
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'addInertRoot',
|
||||
value: function addInertRoot(inertRoot) {
|
||||
this._throwIfDestroyed();
|
||||
this._inertRoots.add(inertRoot);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the given inert root from this inert node's set of managing inert roots.
|
||||
* If the set of managing inert roots becomes empty, this node is no longer inert,
|
||||
* so the object should be destroyed.
|
||||
* @param {!InertRoot} inertRoot
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'removeInertRoot',
|
||||
value: function removeInertRoot(inertRoot) {
|
||||
this._throwIfDestroyed();
|
||||
this._inertRoots['delete'](inertRoot);
|
||||
if (this._inertRoots.size === 0) {
|
||||
this.destructor();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'destroyed',
|
||||
get: function get() {
|
||||
return (/** @type {!InertNode} */this._destroyed
|
||||
);
|
||||
}
|
||||
}, {
|
||||
key: 'hasSavedTabIndex',
|
||||
get: function get() {
|
||||
return this._savedTabIndex !== null;
|
||||
}
|
||||
|
||||
/** @return {!Node} */
|
||||
|
||||
}, {
|
||||
key: 'node',
|
||||
get: function get() {
|
||||
this._throwIfDestroyed();
|
||||
return this._node;
|
||||
}
|
||||
|
||||
/** @param {?number} tabIndex */
|
||||
|
||||
}, {
|
||||
key: 'savedTabIndex',
|
||||
set: function set(tabIndex) {
|
||||
this._throwIfDestroyed();
|
||||
this._savedTabIndex = tabIndex;
|
||||
}
|
||||
|
||||
/** @return {?number} */
|
||||
,
|
||||
get: function get() {
|
||||
this._throwIfDestroyed();
|
||||
return this._savedTabIndex;
|
||||
}
|
||||
}]);
|
||||
|
||||
return InertNode;
|
||||
}();
|
||||
|
||||
/**
|
||||
* InertManager is a per-document singleton object which manages all inert roots and nodes.
|
||||
*
|
||||
* When an element becomes an inert root by having an `inert` attribute set and/or its `inert`
|
||||
* property set to `true`, the `setInert` method creates an `InertRoot` object for the element.
|
||||
* The `InertRoot` in turn registers itself as managing all of the element's focusable descendant
|
||||
* nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance
|
||||
* is created for each such node, via the `_managedNodes` map.
|
||||
*/
|
||||
|
||||
|
||||
var InertManager = function () {
|
||||
/**
|
||||
* @param {!Document} document
|
||||
*/
|
||||
function InertManager(document) {
|
||||
_classCallCheck(this, InertManager);
|
||||
|
||||
if (!document) {
|
||||
throw new Error('Missing required argument; InertManager needs to wrap a document.');
|
||||
}
|
||||
|
||||
/** @type {!Document} */
|
||||
this._document = document;
|
||||
|
||||
/**
|
||||
* All managed nodes known to this InertManager. In a map to allow looking up by Node.
|
||||
* @type {!Map<!Node, !InertNode>}
|
||||
*/
|
||||
this._managedNodes = new Map();
|
||||
|
||||
/**
|
||||
* All inert roots known to this InertManager. In a map to allow looking up by Node.
|
||||
* @type {!Map<!Node, !InertRoot>}
|
||||
*/
|
||||
this._inertRoots = new Map();
|
||||
|
||||
/**
|
||||
* Observer for mutations on `document.body`.
|
||||
* @type {!MutationObserver}
|
||||
*/
|
||||
this._observer = new MutationObserver(this._watchForInert.bind(this));
|
||||
|
||||
// Add inert style.
|
||||
addInertStyle(document.head || document.body || document.documentElement);
|
||||
|
||||
// Wait for document to be loaded.
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this));
|
||||
} else {
|
||||
this._onDocumentLoaded();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the given element should be an inert root or not.
|
||||
* @param {!HTMLElement} root
|
||||
* @param {boolean} inert
|
||||
*/
|
||||
|
||||
|
||||
_createClass(InertManager, [{
|
||||
key: 'setInert',
|
||||
value: function setInert(root, inert) {
|
||||
if (inert) {
|
||||
if (this._inertRoots.has(root)) {
|
||||
// element is already inert
|
||||
return;
|
||||
}
|
||||
|
||||
var inertRoot = new InertRoot(root, this);
|
||||
root.setAttribute('inert', '');
|
||||
this._inertRoots.set(root, inertRoot);
|
||||
// If not contained in the document, it must be in a shadowRoot.
|
||||
// Ensure inert styles are added there.
|
||||
if (!this._document.body.contains(root)) {
|
||||
var parent = root.parentNode;
|
||||
while (parent) {
|
||||
if (parent.nodeType === 11) {
|
||||
addInertStyle(parent);
|
||||
}
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this._inertRoots.has(root)) {
|
||||
// element is already non-inert
|
||||
return;
|
||||
}
|
||||
|
||||
var _inertRoot = this._inertRoots.get(root);
|
||||
_inertRoot.destructor();
|
||||
this._inertRoots['delete'](root);
|
||||
root.removeAttribute('inert');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the InertRoot object corresponding to the given inert root element, if any.
|
||||
* @param {!Node} element
|
||||
* @return {!InertRoot|undefined}
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'getInertRoot',
|
||||
value: function getInertRoot(element) {
|
||||
return this._inertRoots.get(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the given InertRoot as managing the given node.
|
||||
* In the case where the node has a previously existing inert root, this inert root will
|
||||
* be added to its set of inert roots.
|
||||
* @param {!Node} node
|
||||
* @param {!InertRoot} inertRoot
|
||||
* @return {!InertNode} inertNode
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'register',
|
||||
value: function register(node, inertRoot) {
|
||||
var inertNode = this._managedNodes.get(node);
|
||||
if (inertNode !== undefined) {
|
||||
// node was already in an inert subtree
|
||||
inertNode.addInertRoot(inertRoot);
|
||||
} else {
|
||||
inertNode = new InertNode(node, inertRoot);
|
||||
}
|
||||
|
||||
this._managedNodes.set(node, inertNode);
|
||||
|
||||
return inertNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* De-register the given InertRoot as managing the given inert node.
|
||||
* Removes the inert root from the InertNode's set of managing inert roots, and remove the inert
|
||||
* node from the InertManager's set of managed nodes if it is destroyed.
|
||||
* If the node is not currently managed, this is essentially a no-op.
|
||||
* @param {!Node} node
|
||||
* @param {!InertRoot} inertRoot
|
||||
* @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: 'deregister',
|
||||
value: function deregister(node, inertRoot) {
|
||||
var inertNode = this._managedNodes.get(node);
|
||||
if (!inertNode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
inertNode.removeInertRoot(inertRoot);
|
||||
if (inertNode.destroyed) {
|
||||
this._managedNodes['delete'](node);
|
||||
}
|
||||
|
||||
return inertNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used when document has finished loading.
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_onDocumentLoaded',
|
||||
value: function _onDocumentLoaded() {
|
||||
// Find all inert roots in document and make them actually inert.
|
||||
var inertElements = slice.call(this._document.querySelectorAll('[inert]'));
|
||||
inertElements.forEach(function (inertElement) {
|
||||
this.setInert(inertElement, true);
|
||||
}, this);
|
||||
|
||||
// Comment this out to use programmatic API only.
|
||||
this._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used when mutation observer detects attribute changes.
|
||||
* @param {!Array<!MutationRecord>} records
|
||||
* @param {!MutationObserver} self
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: '_watchForInert',
|
||||
value: function _watchForInert(records, self) {
|
||||
var _this = this;
|
||||
records.forEach(function (record) {
|
||||
switch (record.type) {
|
||||
case 'childList':
|
||||
slice.call(record.addedNodes).forEach(function (node) {
|
||||
if (node.nodeType !== Node.ELEMENT_NODE) {
|
||||
return;
|
||||
}
|
||||
var inertElements = slice.call(node.querySelectorAll('[inert]'));
|
||||
if (matches.call(node, '[inert]')) {
|
||||
inertElements.unshift(node);
|
||||
}
|
||||
inertElements.forEach(function (inertElement) {
|
||||
this.setInert(inertElement, true);
|
||||
}, _this);
|
||||
}, _this);
|
||||
break;
|
||||
case 'attributes':
|
||||
if (record.attributeName !== 'inert') {
|
||||
return;
|
||||
}
|
||||
var target = /** @type {!HTMLElement} */record.target;
|
||||
var inert = target.hasAttribute('inert');
|
||||
_this.setInert(target, inert);
|
||||
break;
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
}]);
|
||||
|
||||
return InertManager;
|
||||
}();
|
||||
|
||||
/**
|
||||
* Recursively walk the composed tree from |node|.
|
||||
* @param {!Node} node
|
||||
* @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed,
|
||||
* before descending into child nodes.
|
||||
* @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any.
|
||||
*/
|
||||
|
||||
|
||||
function composedTreeWalk(node, callback, shadowRootAncestor) {
|
||||
if (node.nodeType == Node.ELEMENT_NODE) {
|
||||
var element = /** @type {!HTMLElement} */node;
|
||||
if (callback) {
|
||||
callback(element);
|
||||
}
|
||||
|
||||
// Descend into node:
|
||||
// If it has a ShadowRoot, ignore all child elements - these will be picked
|
||||
// up by the <content> or <shadow> elements. Descend straight into the
|
||||
// ShadowRoot.
|
||||
var shadowRoot = /** @type {!HTMLElement} */element.shadowRoot;
|
||||
if (shadowRoot) {
|
||||
composedTreeWalk(shadowRoot, callback, shadowRoot);
|
||||
return;
|
||||
}
|
||||
|
||||
// If it is a <content> element, descend into distributed elements - these
|
||||
// are elements from outside the shadow root which are rendered inside the
|
||||
// shadow DOM.
|
||||
if (element.localName == 'content') {
|
||||
var content = /** @type {!HTMLContentElement} */element;
|
||||
// Verifies if ShadowDom v0 is supported.
|
||||
var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : [];
|
||||
for (var i = 0; i < distributedNodes.length; i++) {
|
||||
composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// If it is a <slot> element, descend into assigned nodes - these
|
||||
// are elements from outside the shadow root which are rendered inside the
|
||||
// shadow DOM.
|
||||
if (element.localName == 'slot') {
|
||||
var slot = /** @type {!HTMLSlotElement} */element;
|
||||
// Verify if ShadowDom v1 is supported.
|
||||
var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : [];
|
||||
for (var _i = 0; _i < _distributedNodes.length; _i++) {
|
||||
composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If it is neither the parent of a ShadowRoot, a <content> element, a <slot>
|
||||
// element, nor a <shadow> element recurse normally.
|
||||
var child = node.firstChild;
|
||||
while (child != null) {
|
||||
composedTreeWalk(child, callback, shadowRootAncestor);
|
||||
child = child.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a style element to the node containing the inert specific styles
|
||||
* @param {!Node} node
|
||||
*/
|
||||
function addInertStyle(node) {
|
||||
if (node.querySelector('style#inert-style, link#inert-style')) {
|
||||
return;
|
||||
}
|
||||
var style = document.createElement('style');
|
||||
style.setAttribute('id', 'inert-style');
|
||||
style.textContent = '\n' + '[inert] {\n' + ' pointer-events: none;\n' + ' cursor: default;\n' + '}\n' + '\n' + '[inert], [inert] * {\n' + ' -webkit-user-select: none;\n' + ' -moz-user-select: none;\n' + ' -ms-user-select: none;\n' + ' user-select: none;\n' + '}\n';
|
||||
node.appendChild(style);
|
||||
}
|
||||
|
||||
if (!HTMLElement.prototype.hasOwnProperty('inert')) {
|
||||
/** @type {!InertManager} */
|
||||
var inertManager = new InertManager(document);
|
||||
|
||||
Object.defineProperty(HTMLElement.prototype, 'inert', {
|
||||
enumerable: true,
|
||||
/** @this {!HTMLElement} */
|
||||
get: function get() {
|
||||
return this.hasAttribute('inert');
|
||||
},
|
||||
/** @this {!HTMLElement} */
|
||||
set: function set(inert) {
|
||||
inertManager.setInert(this, inert);
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
})));
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"object"==typeof exports&&"undefined"!=typeof module||"function"!=typeof define||!define.amd?e():define("inert",e)}((function(){"use strict";var e,t,n,i,o,r,s=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e};function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){d(this,u),this._inertManager=t,this._rootElement=e,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}function h(e,t){d(this,h),this._node=e,this._overrodeFocusMethod=!1,this._inertRoots=new Set([t]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}function l(e){if(d(this,l),!e)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=e,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),_(e.head||e.body||e.documentElement),"loading"===e.readyState?e.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}function c(e,t,n){if(e.nodeType==Node.ELEMENT_NODE){var i=e;if(s=(t&&t(i),i.shadowRoot))return void c(s,t,s);if("content"==i.localName){for(var o=(s=i).getDistributedNodes?s.getDistributedNodes():[],r=0;r<o.length;r++)c(o[r],t,n);return}if("slot"==i.localName){for(var s,a=(s=i).assignedNodes?s.assignedNodes({flatten:!0}):[],d=0;d<a.length;d++)c(a[d],t,n);return}}for(var u=e.firstChild;null!=u;)c(u,t,n),u=u.nextSibling}function _(e){var t;e.querySelector("style#inert-style, link#inert-style")||((t=document.createElement("style")).setAttribute("id","inert-style"),t.textContent="\n[inert] {\n pointer-events: none;\n cursor: default;\n}\n\n[inert], [inert] * {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n",e.appendChild(t))}"undefined"!=typeof window&&(e=Array.prototype.slice,t=Element.prototype.matches||Element.prototype.msMatchesSelector,n=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),s(u,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach((function(e){this._unmanageNode(e.node)}),this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(e){var t=this,n=(c(e,(function(e){return t._visitNode(e)})),document.activeElement);if(!document.body.contains(e)){for(var i=e,o=void 0;i;){if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){o=i;break}i=i.parentNode}o&&(n=o.activeElement)}e.contains(n)&&(n.blur(),n===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(e){e.nodeType===Node.ELEMENT_NODE&&(e!==this._rootElement&&e.hasAttribute("inert")&&this._adoptInertRoot(e),(t.call(e,n)||e.hasAttribute("tabindex"))&&this._manageNode(e))}},{key:"_manageNode",value:function(e){e=this._inertManager.register(e,this),this._managedNodes.add(e)}},{key:"_unmanageNode",value:function(e){(e=this._inertManager.deregister(e,this))&&this._managedNodes.delete(e)}},{key:"_unmanageSubtree",value:function(e){var t=this;c(e,(function(e){return t._unmanageNode(e)}))}},{key:"_adoptInertRoot",value:function(e){var t=this._inertManager.getInertRoot(e);t||(this._inertManager.setInert(e,!0),t=this._inertManager.getInertRoot(e)),t.managedNodes.forEach((function(e){this._manageNode(e.node)}),this)}},{key:"_onMutation",value:function(t,n){t.forEach((function(t){var n,i=t.target;"childList"===t.type?(e.call(t.addedNodes).forEach((function(e){this._makeSubtreeUnfocusable(e)}),this),e.call(t.removedNodes).forEach((function(e){this._unmanageSubtree(e)}),this)):"attributes"===t.type&&("tabindex"===t.attributeName?this._manageNode(i):i!==this._rootElement&&"inert"===t.attributeName&&i.hasAttribute("inert")&&(this._adoptInertRoot(i),n=this._inertManager.getInertRoot(i),this._managedNodes.forEach((function(e){i.contains(e.node)&&n._manageNode(e.node)}))))}),this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return null!==this._savedAriaHidden}},{key:"savedAriaHidden",set:function(e){this._savedAriaHidden=e},get:function(){return this._savedAriLine truncated
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
// Node.prototype.contains
|
||||
(function() {
|
||||
|
||||
function contains(node) {
|
||||
if (!(0 in arguments)) {
|
||||
throw new TypeError('1 argument is required');
|
||||
}
|
||||
|
||||
do {
|
||||
if (this === node) {
|
||||
return true;
|
||||
}
|
||||
// eslint-disable-next-line no-cond-assign
|
||||
} while (node = node && node.parentNode);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// IE
|
||||
if ('HTMLElement' in self && 'contains' in HTMLElement.prototype) {
|
||||
try {
|
||||
delete HTMLElement.prototype.contains;
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if ('Node' in self) {
|
||||
Node.prototype.contains = contains;
|
||||
} else {
|
||||
document.contains = Element.prototype.contains = contains;
|
||||
}
|
||||
|
||||
}());
|
||||
@@ -0,0 +1 @@
|
||||
!function(){function e(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}if("HTMLElement"in self&&"contains"in HTMLElement.prototype)try{delete HTMLElement.prototype.contains}catch(e){}"Node"in self?Node.prototype.contains=e:document.contains=Element.prototype.contains=e}();
|
||||
@@ -0,0 +1,304 @@
|
||||
/*----------------------------------------
|
||||
* objectFitPolyfill 2.3.5
|
||||
*
|
||||
* Made by Constance Chen
|
||||
* Released under the ISC license
|
||||
*
|
||||
* https://github.com/constancecchen/object-fit-polyfill
|
||||
*--------------------------------------*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// if the page is being rendered on the server, don't continue
|
||||
if (typeof window === 'undefined') return;
|
||||
|
||||
// Workaround for Edge 16-18, which only implemented object-fit for <img> tags
|
||||
var edgeMatch = window.navigator.userAgent.match(/Edge\/(\d{2})\./);
|
||||
var edgeVersion = edgeMatch ? parseInt(edgeMatch[1], 10) : null;
|
||||
var edgePartialSupport = edgeVersion
|
||||
? edgeVersion >= 16 && edgeVersion <= 18
|
||||
: false;
|
||||
|
||||
// If the browser does support object-fit, we don't need to continue
|
||||
var hasSupport = 'objectFit' in document.documentElement.style !== false;
|
||||
if (hasSupport && !edgePartialSupport) {
|
||||
window.objectFitPolyfill = function() {
|
||||
return false;
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the container's parent element to make sure it will
|
||||
* correctly handle and clip absolutely positioned children
|
||||
*
|
||||
* @param {node} $container - parent element
|
||||
*/
|
||||
var checkParentContainer = function($container) {
|
||||
var styles = window.getComputedStyle($container, null);
|
||||
var position = styles.getPropertyValue('position');
|
||||
var overflow = styles.getPropertyValue('overflow');
|
||||
var display = styles.getPropertyValue('display');
|
||||
|
||||
if (!position || position === 'static') {
|
||||
$container.style.position = 'relative';
|
||||
}
|
||||
if (overflow !== 'hidden') {
|
||||
$container.style.overflow = 'hidden';
|
||||
}
|
||||
// Guesstimating that people want the parent to act like full width/height wrapper here.
|
||||
// Mostly attempts to target <picture> elements, which default to inline.
|
||||
if (!display || display === 'inline') {
|
||||
$container.style.display = 'block';
|
||||
}
|
||||
if ($container.clientHeight === 0) {
|
||||
$container.style.height = '100%';
|
||||
}
|
||||
|
||||
// Add a CSS class hook, in case people need to override styles for any reason.
|
||||
if ($container.className.indexOf('object-fit-polyfill') === -1) {
|
||||
$container.className = $container.className + ' object-fit-polyfill';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Check for pre-set max-width/height, min-width/height,
|
||||
* positioning, or margins, which can mess up image calculations
|
||||
*
|
||||
* @param {node} $media - img/video element
|
||||
*/
|
||||
var checkMediaProperties = function($media) {
|
||||
var styles = window.getComputedStyle($media, null);
|
||||
var constraints = {
|
||||
'max-width': 'none',
|
||||
'max-height': 'none',
|
||||
'min-width': '0px',
|
||||
'min-height': '0px',
|
||||
top: 'auto',
|
||||
right: 'auto',
|
||||
bottom: 'auto',
|
||||
left: 'auto',
|
||||
'margin-top': '0px',
|
||||
'margin-right': '0px',
|
||||
'margin-bottom': '0px',
|
||||
'margin-left': '0px',
|
||||
};
|
||||
|
||||
for (var property in constraints) {
|
||||
var constraint = styles.getPropertyValue(property);
|
||||
|
||||
if (constraint !== constraints[property]) {
|
||||
$media.style[property] = constraints[property];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculate & set object-position
|
||||
*
|
||||
* @param {string} axis - either "x" or "y"
|
||||
* @param {node} $media - img or video element
|
||||
* @param {string} objectPosition - e.g. "50% 50%", "top left"
|
||||
*/
|
||||
var setPosition = function(axis, $media, objectPosition) {
|
||||
var position, other, start, end, side;
|
||||
objectPosition = objectPosition.split(' ');
|
||||
|
||||
if (objectPosition.length < 2) {
|
||||
objectPosition[1] = objectPosition[0];
|
||||
}
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (axis === 'x') {
|
||||
position = objectPosition[0];
|
||||
other = objectPosition[1];
|
||||
start = 'left';
|
||||
end = 'right';
|
||||
side = $media.clientWidth;
|
||||
} else if (axis === 'y') {
|
||||
position = objectPosition[1];
|
||||
other = objectPosition[0];
|
||||
start = 'top';
|
||||
end = 'bottom';
|
||||
side = $media.clientHeight;
|
||||
} else {
|
||||
return; // Neither x or y axis specified
|
||||
}
|
||||
|
||||
if (position === start || other === start) {
|
||||
$media.style[start] = '0';
|
||||
return;
|
||||
}
|
||||
|
||||
if (position === end || other === end) {
|
||||
$media.style[end] = '0';
|
||||
return;
|
||||
}
|
||||
|
||||
if (position === 'center' || position === '50%') {
|
||||
$media.style[start] = '50%';
|
||||
$media.style['margin-' + start] = side / -2 + 'px';
|
||||
return;
|
||||
}
|
||||
|
||||
// Percentage values (e.g., 30% 10%)
|
||||
if (position.indexOf('%') >= 0) {
|
||||
position = parseInt(position, 10);
|
||||
|
||||
if (position < 50) {
|
||||
$media.style[start] = position + '%';
|
||||
$media.style['margin-' + start] = side * (position / -100) + 'px';
|
||||
} else {
|
||||
position = 100 - position;
|
||||
$media.style[end] = position + '%';
|
||||
$media.style['margin-' + end] = side * (position / -100) + 'px';
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// Length-based values (e.g. 10px / 10em)
|
||||
else {
|
||||
$media.style[start] = position;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculate & set object-fit
|
||||
*
|
||||
* @param {node} $media - img/video/picture element
|
||||
*/
|
||||
var objectFit = function($media) {
|
||||
// IE 10- data polyfill
|
||||
var fit = $media.dataset
|
||||
? $media.dataset.objectFit
|
||||
: $media.getAttribute('data-object-fit');
|
||||
var position = $media.dataset
|
||||
? $media.dataset.objectPosition
|
||||
: $media.getAttribute('data-object-position');
|
||||
|
||||
// Default fallbacks
|
||||
fit = fit || 'cover';
|
||||
position = position || '50% 50%';
|
||||
|
||||
// If necessary, make the parent container work with absolutely positioned elements
|
||||
var $container = $media.parentNode;
|
||||
checkParentContainer($container);
|
||||
|
||||
// Check for any pre-set CSS which could mess up image calculations
|
||||
checkMediaProperties($media);
|
||||
|
||||
// Reset any pre-set width/height CSS and handle fit positioning
|
||||
$media.style.position = 'absolute';
|
||||
$media.style.width = 'auto';
|
||||
$media.style.height = 'auto';
|
||||
|
||||
// `scale-down` chooses either `none` or `contain`, whichever is smaller
|
||||
if (fit === 'scale-down') {
|
||||
if (
|
||||
$media.clientWidth < $container.clientWidth &&
|
||||
$media.clientHeight < $container.clientHeight
|
||||
) {
|
||||
fit = 'none';
|
||||
} else {
|
||||
fit = 'contain';
|
||||
}
|
||||
}
|
||||
|
||||
// `none` (width/height auto) and `fill` (100%) and are straightforward
|
||||
if (fit === 'none') {
|
||||
setPosition('x', $media, position);
|
||||
setPosition('y', $media, position);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fit === 'fill') {
|
||||
$media.style.width = '100%';
|
||||
$media.style.height = '100%';
|
||||
setPosition('x', $media, position);
|
||||
setPosition('y', $media, position);
|
||||
return;
|
||||
}
|
||||
|
||||
// `cover` and `contain` must figure out which side needs covering, and add CSS positioning & centering
|
||||
$media.style.height = '100%';
|
||||
|
||||
if (
|
||||
(fit === 'cover' && $media.clientWidth > $container.clientWidth) ||
|
||||
(fit === 'contain' && $media.clientWidth < $container.clientWidth)
|
||||
) {
|
||||
$media.style.top = '0';
|
||||
$media.style.marginTop = '0';
|
||||
setPosition('x', $media, position);
|
||||
} else {
|
||||
$media.style.width = '100%';
|
||||
$media.style.height = 'auto';
|
||||
$media.style.left = '0';
|
||||
$media.style.marginLeft = '0';
|
||||
setPosition('y', $media, position);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize plugin
|
||||
*
|
||||
* @param {node} media - Optional specific DOM node(s) to be polyfilled
|
||||
*/
|
||||
var objectFitPolyfill = function(media) {
|
||||
if (typeof media === 'undefined' || media instanceof Event) {
|
||||
// If left blank, or a default event, all media on the page will be polyfilled.
|
||||
media = document.querySelectorAll('[data-object-fit]');
|
||||
} else if (media && media.nodeName) {
|
||||
// If it's a single node, wrap it in an array so it works.
|
||||
media = [media];
|
||||
} else if (typeof media === 'object' && media.length && media[0].nodeName) {
|
||||
// If it's an array of DOM nodes (e.g. a jQuery selector), it's fine as-is.
|
||||
media = media;
|
||||
} else {
|
||||
// Otherwise, if it's invalid or an incorrect type, return false to let people know.
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < media.length; i++) {
|
||||
if (!media[i].nodeName) continue;
|
||||
|
||||
var mediaType = media[i].nodeName.toLowerCase();
|
||||
|
||||
if (mediaType === 'img') {
|
||||
if (edgePartialSupport) continue; // Edge supports object-fit for images (but nothing else), so no need to polyfill
|
||||
|
||||
if (media[i].complete) {
|
||||
objectFit(media[i]);
|
||||
} else {
|
||||
media[i].addEventListener('load', function() {
|
||||
objectFit(this);
|
||||
});
|
||||
}
|
||||
} else if (mediaType === 'video') {
|
||||
if (media[i].readyState > 0) {
|
||||
objectFit(media[i]);
|
||||
} else {
|
||||
media[i].addEventListener('loadedmetadata', function() {
|
||||
objectFit(this);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
objectFit(media[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
// Loading hasn't finished yet
|
||||
document.addEventListener('DOMContentLoaded', objectFitPolyfill);
|
||||
} else {
|
||||
// `DOMContentLoaded` has already fired
|
||||
objectFitPolyfill();
|
||||
}
|
||||
|
||||
window.addEventListener('resize', objectFitPolyfill);
|
||||
|
||||
window.objectFitPolyfill = objectFitPolyfill;
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
!function(){"use strict";if("undefined"!=typeof window){var t=window.navigator.userAgent.match(/Edge\/(\d{2})\./),e=t?parseInt(t[1],10):null,i=!!e&&16<=e&&e<=18;if("objectFit"in document.documentElement.style==0||i){var n=function(t,e,i){var n,o,l,a,d;if((i=i.split(" ")).length<2&&(i[1]=i[0]),"x"===t)n=i[0],o=i[1],l="left",a="right",d=e.clientWidth;else{if("y"!==t)return;n=i[1],o=i[0],l="top",a="bottom",d=e.clientHeight}if(n!==l&&o!==l){if(n!==a&&o!==a)return"center"===n||"50%"===n?(e.style[l]="50%",void(e.style["margin-"+l]=d/-2+"px")):void(0<=n.indexOf("%")?(n=parseInt(n,10))<50?(e.style[l]=n+"%",e.style["margin-"+l]=d*(n/-100)+"px"):(n=100-n,e.style[a]=n+"%",e.style["margin-"+a]=d*(n/-100)+"px"):e.style[l]=n);e.style[a]="0"}else e.style[l]="0"},o=function(t){var e=t.dataset?t.dataset.objectFit:t.getAttribute("data-object-fit"),i=t.dataset?t.dataset.objectPosition:t.getAttribute("data-object-position");e=e||"cover",i=i||"50% 50%";var o=t.parentNode;return function(t){var e=window.getComputedStyle(t,null),i=e.getPropertyValue("position"),n=e.getPropertyValue("overflow"),o=e.getPropertyValue("display");i&&"static"!==i||(t.style.position="relative"),"hidden"!==n&&(t.style.overflow="hidden"),o&&"inline"!==o||(t.style.display="block"),0===t.clientHeight&&(t.style.height="100%"),-1===t.className.indexOf("object-fit-polyfill")&&(t.className=t.className+" object-fit-polyfill")}(o),function(t){var e=window.getComputedStyle(t,null),i={"max-width":"none","max-height":"none","min-width":"0px","min-height":"0px",top:"auto",right:"auto",bottom:"auto",left:"auto","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px"};for(var n in i)e.getPropertyValue(n)!==i[n]&&(t.style[n]=i[n])}(t),t.style.position="absolute",t.style.width="auto",t.style.height="auto","scale-down"===e&&(e=t.clientWidth<o.clientWidth&&t.clientHeight<o.clientHeight?"none":"contain"),"none"===e?(n("x",t,i),void n("y",t,i)):"fill"===e?(t.style.width="100%",t.style.height="100%",n("x",t,i),void n("y",t,i)):(t.style.height="100%",void("cover"===e&&t.clientWidth>o.clientWidth||"contain"===e&&t.clientWidth<o.clientWidth?(t.style.top="0",t.style.marginTop="0",n("x",t,i)):(t.style.width="100%",t.style.height="auto",t.style.left="0",t.style.marginLeft="0",n("y",t,i))))},l=function(t){if(void 0===t||t instanceof Event)t=document.querySelectorAll("[data-object-fit]");else if(t&&t.nodeName)t=[t];else if("object"!=typeof t||!t.length||!t[0].nodeName)return!1;for(var e=0;e<t.length;e++)if(t[e].nodeName){var n=t[e].nodeName.toLowerCase();if("img"===n){if(i)continue;t[e].complete?o(t[e]):t[e].addEventListener("load",(function(){o(this)}))}else"video"===n?0<t[e].readyState?o(t[e]):t[e].addEventListener("loadedmetadata",(function(){o(this)})):o(t[e])}return!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",l):l(),window.addEventListener("resize",l),window.objectFitPolyfill=l}else window.objectFitPolyfill=function(){return!1}}}();
|
||||
+2987
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
!function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return i(t[o][1][e]||e)}),u,u.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],2:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},{"../internals/is-object":37}],3:[function(e,t,n){var r=e("../internals/well-known-symbol"),i=e("../internals/object-create"),a=e("../internals/object-define-property"),o=r("unscopables"),s=Array.prototype;null==s[o]&&a.f(s,o,{configurable:!0,value:i(null)}),t.exports=function(e){s[o][e]=!0}},{"../internals/object-create":45,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],4:[function(e,t,n){t.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},{}],5:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},{"../internals/is-object":37}],6:[function(e,t,n){"use strict";var r=e("../internals/function-bind-context"),i=e("../internals/to-object"),a=e("../internals/call-with-safe-iteration-closing"),o=e("../internals/is-array-iterator-method"),s=e("../internals/to-length"),l=e("../internals/create-property"),c=e("../internals/get-iterator-method");t.exports=function(e){var t,n,u,f,p,h,b=i(e),d="function"==typeof this?this:Array,y=arguments.length,g=y>1?arguments[1]:void 0,v=void 0!==g,m=c(b),w=0;if(v&&(g=r(g,y>2?arguments[2]:void 0,2)),null==m||d==Array&&o(m))for(n=new d(t=s(b.length));t>w;w++)h=v?g(b[w],w):b[w],l(n,w,h);else for(p=(f=m.call(b)).next,n=new d;!(u=p.call(f)).done;w++)h=v?a(f,g,[u.value,w],!0):u.value,l(n,w,h);return n.length=w,n}},{"../internals/call-with-safe-iteration-closing":8,"../internals/create-property":16,"../internals/function-bind-context":23,"../internals/get-iterator-method":25,"../internals/is-array-iterator-method":35,"../internals/to-length":71,"../internals/to-object":72}],7:[function(e,t,n){var r=e("../internals/to-indexed-object"),i=e("../internals/to-length"),a=e("../internals/to-absolute-index"),o=function(e){return function(t,n,o){var s,l=r(t),c=i(l.length),u=a(o,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/to-absolute-index":68,"../internals/to-indexed-object":69,"../internals/to-length":71}],8:[function(e,t,n){var r=e("../internals/an-object");t.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},{"../internals/an-object":5}],9:[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],10:[function(e,t,n){var r=e("../internals/to-string-tag-support"),i=e("../internals/classof-raw"),a=e("../internals/well-known-symbol")("toStringTag"),o="Arguments"==i(function(){return arguments}());t.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),a))?n:o?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},{"../internals/classof-raw":9,"../internals/to-string-tag-support":74,"../internals/well-known-symbol":77}],11:[function(e,t,n){var r=e("../internals/has"),i=e("../internals/own-keys"),a=e("../internals/object-get-own-property-descriptor"),o=e("../internals/object-define-property");t.exports=function(e,t){for(var n=i(t),s=o.f,l=a.f,c=0;c<n.length;c++){var u=n[c];r(e,u)||s(e,u,l(t,u))}}},{"../internals/has":28,"../internals/object-define-property":47,"../internals/object-get-own-property-descriptor":48,"../internals/own-keys":56}],12:[function(e,t,n){var r=e("../internals/fails");t.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},{"../internals/fails":22}],13:[function(e,t,n){"use strict";var r=e("../internals/iterators-core").IteratorPrototype,i=e("../internals/object-create"),a=e("../internals/create-property-descriptor"),o=e("../internals/set-to-string-tag"),s=e("../internals/iterators"),l=function(){return this};t.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(r,{next:a(1,n)}),o(e,c,!1,!0),s[c]=l,e}},{"../internals/create-property-descriptor":15,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-create":45,"../internals/set-to-string-tag":62}],14:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/object-define-properLine truncated
|
||||
+4356
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
!function(r){"use strict";var t,e,n;e={},(n=function(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}).m=t=[function(r,t,e){e(1),e(70),e(77),e(80),e(81),e(83),e(95),e(96),e(98),e(101),e(103),e(104),e(113),e(114),e(117),e(123),e(138),e(140),e(141),r.exports=e(142)},function(r,t,e){var n=e(2),o=e(38),a=e(62),c=e(67),i=e(69);n({target:"Array",proto:!0,arity:1,forced:e(6)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(r){return r instanceof TypeError}}()},{push:function(r){var t=o(this),e=a(t),n=arguments.length;i(e+n);for(var u=0;u<n;u++)t[e]=arguments[u],e++;return c(t,e),e}})},function(t,e,n){var o=n(3),a=n(4).f,c=n(42),i=n(46),u=n(36),f=n(54),s=n(66);t.exports=function(t,e){var n,p,l,y=t.target,h=t.global,v=t.stat,g=h?o:v?o[y]||u(y,{}):o[y]&&o[y].prototype;if(g)for(n in e){if(p=e[n],l=t.dontCallGetSet?(l=a(g,n))&&l.value:g[n],!s(h?n:y+(v?".":"#")+n,t.forced)&&l!==r){if(typeof p==typeof l)continue;f(p,l)}(t.sham||l&&l.sham)&&c(p,"sham",!0),i(g,n,p,t)}}},function(r,t,e){function n(r){return r&&r.Math===Math&&r}r.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(r,t,e){var n=e(5),o=e(7),a=e(9),c=e(10),i=e(11),u=e(17),f=e(37),s=e(40),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(r,t){if(r=i(r),t=u(t),s)try{return p(r,t)}catch(r){}if(f(r,t))return c(!o(a.f,r,t),r[t])}},function(r,t,e){e=e(6),r.exports=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(r,t,e){r.exports=function(r){try{return!!r()}catch(r){return!0}}},function(r,t,e){e=e(8);var n=Function.prototype.call;r.exports=e?n.bind(n):function(){return n.apply(n,arguments)}},function(r,t,e){e=e(6),r.exports=!e((function(){var r=function(){}.bind();return"function"!=typeof r||r.hasOwnProperty("prototype")}))},function(r,t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!n.call({1:2},1);t.f=a?function(r){return!!(r=o(this,r))&&r.enumerable}:n},function(r,t,e){r.exports=function(r,t){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:t}}},function(r,t,e){var n=e(12),o=e(15);r.exports=function(r){return n(o(r))}},function(r,t,e){var n=e(13),o=e(6),a=e(14),c=Object,i=n("".split);r.exports=o((function(){return!c("z").propertyIsEnumerable(0)}))?function(r){return"String"===a(r)?i(r,""):c(r)}:c},function(r,t,e){var n=e(8),o=(e=Function.prototype).call;e=n&&e.bind.bind(o,o);r.exports=n?e:function(r){return function(){return o.apply(r,arguments)}}},function(r,t,e){var n=(e=e(13))({}.toString),o=e("".slice);r.exports=function(r){return o(n(r),8,-1)}},function(r,t,e){var n=e(16),o=TypeError;r.exports=function(r){if(n(r))throw new o("Can't call method on "+r);return r}},function(t,e,n){t.exports=function(t){return null===t||t===r}},function(r,t,e){var n=e(18),o=e(21);r.exports=function(r){return r=n(r,"string"),o(r)?r:r+""}},function(t,e,n){var o=n(7),a=n(19),c=n(21),i=n(28),u=n(31),f=(n=n(32),TypeError),s=n("toPrimitive");t.exports=function(t,e){if(!a(t)||c(t))return t;var n=i(t,s);if(n){if(n=o(n,t,e=e===r?"default":e),!a(n)||c(n))return n;throw new f("Can't convert object to primitive value")}return u(t,e=e===r?"number":e)}},function(r,t,e){var n=e(20);r.exports=function(r){return"object"==typeof r?null!==r:n(r)}},function(t,e,n){var o="object"==typeof document&&document.all;t.exports=void 0===o&&o!==r?function(r){return"function"==typeof r||r===o}:function(r){return"function"==typeof r}},function(r,t,e){var n=e(22),o=e(20),a=e(23),c=(e=e(24),Object);r.exports=e?function(r){return"symbol"==typeof r}:function(r){var t=n("Symbol");return o(t)&&a(t.prototype,c(r))}},function(t,e,n){var o=n(3),a=n(20);t.exports=function(t,e){return arguments.length<2?(n=o[t],a(n)?n:r):o[t]&&o[t][e];var n}},function(r,t,e){e=e(13),r.exports=e({}.isPrototypeOf)},function(r,t,e){e=e(25),r.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(r,t,e){var n=e(26),o=e(6),a=e(3).String;r.exports=!!Object.getOwnPropertySymbols&&!o((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(r,t,e){var n,o,a=e(3),c=e(27);e=a.process,a=a.Deno;!(o=(a=(a=e&&e.versions||a&&a.version)&&a.v8)?0<(n=a.split("."))[0]&&n[0]<4?1:+(n[0]+n[1]):o)&&c&&(!(n=c.match(/Edge\/(\d+)/))||74<=n[1])&&(n=c.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){r.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(t,e,n){var o=n(29),a=n(16);t.exports=function(t,e){return e=t[e],a(e)?r:o(e)}},function(r,t,e){var n=e(20),o=e(30),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.Line truncated
|
||||
Reference in new issue
Block a user