You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
87 KiB
JavaScript

1 year ago
!function(){"use strict";var e=function(){var e=setTimeout;function n(){}function t(e){if(!(this instanceof t))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function i(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,t._immediateFn((function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null!==t){var i;try{i=t(e._value)}catch(e){return void o(n.promise,e)}r(n.promise,i)}else(1===e._state?r:o)(n.promise,e._value)}))):e._deferreds.push(n)}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var i=n.then;if(n instanceof t)return e._state=3,e._value=n,void a(e);if("function"==typeof i)return void c((r=i,u=n,function(){r.apply(u,arguments)}),e)}e._state=1,e._value=n,a(e)}catch(n){o(e,n)}var r,u}function o(e,n){e._state=2,e._value=n,a(e)}function a(e){2===e._state&&0===e._deferreds.length&&t._immediateFn((function(){e._handled||t._unhandledRejectionFn(e._value)}));for(var n=0,r=e._deferreds.length;r>n;n++)i(e,e._deferreds[n]);e._deferreds=null}function u(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function c(e,n){var t=!1;try{e((function(e){t||(t=!0,r(n,e))}),(function(e){t||(t=!0,o(n,e))}))}catch(e){if(t)return;t=!0,o(n,e)}}t.prototype.catch=function(e){return this.then(null,e)},t.prototype.then=function(e,t){var r=new this.constructor(n);return i(this,new u(e,t,r)),r},t.prototype.finally=function(e){var n=this.constructor;return this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){return n.reject(t)}))}))},t.all=function(e){return new t((function(n,t){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return n([]);var r=i.length;function o(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(n){o(e,n)}),t)}i[e]=a,0==--r&&n(i)}catch(e){t(e)}}for(var a=0;i.length>a;a++)o(a,i[a])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(n){n(e)}))},t.reject=function(e){return new t((function(n,t){t(e)}))},t.race=function(e){return new t((function(n,t){for(var i=0,r=e.length;r>i;i++)e[i].then(n,t)}))},t._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(n){e(n,0)},t._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var s=t;return/native code/.test(window.Promise)?window.Promise:s}();function n(e,n){return e+n}var t={}.hasOwnProperty;function i(e,n){return t.call(n,e)}function r(){return(r=Object.assign||function(e){for(var n=arguments.length,t=Array(n>1?n-1:0),r=1;n>r;r++)t[r-1]=arguments[r];return t.forEach((function(n){for(var t in n)i(t,n)&&(e[t]=n[t])})),e}).apply(void 0,arguments)}function o(e){return Array.isArray(e)}function a(e){return"object"==typeof e&&null!==e&&!o(e)}function u(e){if("keys"in Object&&"function"==typeof Object.keys)return Object.keys(e);var n=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n}function c(e,n){return u(n).reduce((function(t,i){return t[i]=e(n[i]),t}),{})}function s(e){return o(e)?e.map(s):a(e)?c(s,e):e}function d(e){return o(e)?e.filter((function(e){return null!=e&&!Number.isNaN(e)})):Object.keys(e).reduce((function(n,t){var i=e[t];return null==i||Number.isNaN(i)||(n[t]=i),n}),{})}function l(e,n){for(var t=0;n.length>t;t++){var i=n[t];if(e(i))return i}}function f(e,n){for(var t=n.length-1;t>=0;t--)if(e(n[t]))return n[t]}function p(e){return e}function m(e,n){return u(n).forEach((function(t){e(n[t],t)}))}function h(){return Math.random().toString(36).substring(2)}function v(e){var n=h();return i(n,e)?v(e):n}function g(e,n,t){var i=function(e,n){for(var t="string"==typeof e?e.sp