New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cacheability

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cacheability - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

4

lib/browser/cacheability.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Cacheability",[],e):"object"==typeof exports?exports.Cacheability=e():t.Cacheability=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=22)}([function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(24),o=r(29);t.exports=r(4)?function(t,e,r){return n.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){t.exports=!r(2)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){function r(t){return t}t.exports=r},function(t,e){function r(t){return o.call(t)}var n=Object.prototype,o=n.toString;t.exports=r},function(t,e){function r(t){return null!=t&&"object"==typeof t}t.exports=r},function(t,e,r){"use strict";var n=r(3),o=r(11),i=r(2),u=r(6),s=r(14);t.exports=function(t,e,r){var a=s(t),f=r(u,a,""[t]),c=f[0],l=f[1];i(function(){var e={};return e[a]=function(){return 7},7!=""[t](e)})&&(o(String.prototype,t,c),n(RegExp.prototype,a,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},function(t,e,r){var n=r(0),o=r(3),i=r(12),u=r(5)("src"),s=Function.toString,a=(""+s).split("toString");r(13).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,r,s){var f="function"==typeof r;f&&(i(r,"name")||o(r,"name",e)),t[e]!==r&&(f&&(i(r,u)||o(r,u,t[e]?""+t[e]:a.join(String(e)))),t===n?t[e]=r:s?t[e]?t[e]=r:o(t,e,r):(delete t[e],o(t,e,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[u]||s.call(this)})},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e){var r=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(15)("wks"),o=r(5),i=r(0).Symbol,u="function"==typeof i;(t.exports=function(t){return n[t]||(n[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=n},function(t,e,r){var n=r(0),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){var n=r(18),o=r(6);t.exports=function(t){return n(o(t))}},function(t,e,r){var n=r(16);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){function n(t){return function(e){return o(u(i(e).replace(s,"")),t,"")}}var o=r(48),i=r(49),u=r(50),s=RegExp("['’]","g");t.exports=n},function(t,e){function r(t){return n.test(t)}var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(23),r(30),r(32);var o=n(r(47)),i=n(r(54)),u=n(r(56)),s=n(r(59)),a=n(r(60)),f=r(69);r(73);var c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};(0,f.polyfill)();var l=function(){function t(){this._headerKeys=["cache-control","etag"],this._metadata={}}return t._getDirectives=function(t){return t.split(", ")},t._parseCacheControl=function(e){void 0===e&&(e="");var r=t._getDirectives(e),n={};return r.forEach(function(t){if(t.match(/=/)){var e=t.split("="),r=e[0],o=e[1];return void(n[(0,a.default)(r)]=Number(o))}n[(0,a.default)(t)]=!0}),n},t._setTTL=function(t){if((0,u.default)(t)){var e=t,r=e.maxAge,n=e.sMaxage,o=n||r;if(o){var i=1e3*o;return Date.now()+i}}},Object.defineProperty(t.prototype,"metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),t.prototype.checkTTL=function(){return!this._metadata.ttl||this._metadata.ttl>Date.now()},t.prototype.parseCacheControl=function(e){return(0,i.default)(e)?(this._metadata={cacheControl:t._parseCacheControl(e)},this._metadata.ttl=t._setTTL(this._metadata.cacheControl),this._metadata):(this._metadata={},this._metadata)},t.prototype.parseHeaders=function(e){if(!(e instanceof Headers||(0,u.default)(e)))return this._metadata={},this._metadata;var r=e instanceof Headers?this._parseHeaders(e):e,n=t._parseCacheControl(r.cacheControl),o=t._setTTL(n);return this._metadata=c({},r,{cacheControl:n,ttl:o}),this._metadata},t.prototype.printCacheControl=function(){if((0,u.default)(this._metadata.cacheControl)){var t=c({},this._metadata.cacheControl),e=this._metadata.ttl,r=0;if(this.checkTTL()){var n=e;r=Math.round((n-Date.now())/1e3)}t.sMaxage&&(t.sMaxage=r),t.maxAge&&(t.maxAge=r);var i=[];return Object.keys(t).forEach(function(e){if((0,s.default)(t[e]))return void i.push((0,o.default)(e));i.push((0,o.default)(e)+"="+t[e])}),i.join(", ")}},t.prototype.setMetadata=function(t){var e=t;(0,u.default)(t)||(e={}),this._metadata=e},t.prototype._parseHeaders=function(t){var e={};return this._headerKeys.forEach(function(r){var n=t.get(r);n&&(e[(0,a.default)(r)]=n)}),e},t}(),p=l;e.default=p},function(t,e,r){r(10)("match",1,function(t,e,r){return[function(r){"use strict";var n=t(this),o=void 0==r?void 0:r[e];return void 0!==o?o.call(r,n):new RegExp(r)[e](String(n))},r]})},function(t,e,r){var n=r(25),o=r(26),i=r(28),u=Object.defineProperty;e.f=r(4)?Object.defineProperty:function(t,e,r){if(n(t),e=i(e,!0),n(r),o)try{return u(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var n=r(1);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){t.exports=!r(4)&&!r(2)(function(){return 7!=Object.defineProperty(r(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(1),o=r(0).document,i=n(o)&&n(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,r){var n=r(1);t.exports=function(t,e){if(!n(t))return t;var r,o;if(e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!n(o=r.call(t)))return o;if(!e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){r(10)("split",2,function(t,e,n){"use strict";var o=r(31),i=n,u=[].push,s="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[s]||2!="ab".split(/(?:ab)*/)[s]||4!=".".split(/(.?)(.?)/)[s]||".".split(/()()/)[s]>1||"".split(/.?/)[s]){var a=void 0===/()??/.exec("")[1];n=function(t,e){var r=String(this);if(void 0===t&&0===e)return[];if(!o(t))return i.call(r,t,e);var n,f,c,l,p,h=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,v=void 0===e?4294967295:e>>>0,b=new RegExp(t.source,d+"g");for(a||(n=new RegExp("^"+b.source+"$(?!\\s)",d));(f=b.exec(r))&&!((c=f.index+f[0][s])>y&&(h.push(r.slice(y,f.index)),!a&&f[s]>1&&f[0].replace(n,function(){for(p=1;p<arguments[s]-2;p++)void 0===arguments[p]&&(f[p]=void 0)}),f[s]>1&&f.index<r[s]&&u.apply(h,f.slice(1)),l=f[0][s],y=c,h[s]>=v));)b.lastIndex===f.index&&b.lastIndex++;return y===r[s]?!l&&b.test("")||h.push(""):h.push(r.slice(y)),h[s]>v?h.slice(0,v):h}}else"0".split(void 0,0)[s]&&(n=function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)});return[function(r,o){var i=t(this),u=void 0==r?void 0:r[e];return void 0!==u?u.call(r,i,o):n.call(String(i),r,o)},n]})},function(t,e,r){var n=r(1),o=r(16),i=r(14)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,r){var n=r(33);n(n.S+n.F,"Object",{assign:r(36)})},function(t,e,r){var n=r(0),o=r(13),i=r(3),u=r(11),s=r(34),a=function(t,e,r){var f,c,l,p,h=t&a.F,d=t&a.G,y=t&a.S,v=t&a.P,b=t&a.B,x=d?n:y?n[e]||(n[e]={}):(n[e]||{}).prototype,m=d?o:o[e]||(o[e]={}),_=m.prototype||(m.prototype={});d&&(r=e);for(f in r)c=!h&&x&&void 0!==x[f],l=(c?x:r)[f],p=b&&c?s(l,n):v&&"function"==typeof l?s(Function.call,l):l,x&&u(x,f,l,t&a.U),m[f]!=l&&i(m,f,p),v&&_[f]!=l&&(_[f]=l)};n.core=o,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,r){var n=r(35);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){"use strict";var n=r(37),o=r(44),i=r(45),u=r(46),s=r(18),a=Object.assign;t.exports=!a||r(2)(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=a({},t)[r]||Object.keys(a({},e)).join("")!=n})?function(t,e){for(var r=u(t),a=arguments.length,f=1,c=o.f,l=i.f;a>f;)for(var p,h=s(arguments[f++]),d=c?n(h).concat(c(h)):n(h),y=d.length,v=0;y>v;)l.call(h,p=d[v++])&&(r[p]=h[p]);return r}:a},function(t,e,r){var n=r(38),o=r(43);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e,r){var n=r(12),o=r(17),i=r(39)(!1),u=r(42)("IE_PROTO");t.exports=function(t,e){var r,s=o(t),a=0,f=[];for(r in s)r!=u&&n(s,r)&&f.push(r);for(;e.length>a;)n(s,r=e[a++])&&(~i(f,r)||f.push(r));return f}},function(t,e,r){var n=r(17),o=r(40),i=r(41);t.exports=function(t){return function(e,r,u){var s,a=n(e),f=o(a.length),c=i(u,f);if(t&&r!=r){for(;f>c;)if((s=a[c++])!=s)return!0}else for(;f>c;c++)if((t||c in a)&&a[c]===r)return t||c||0;return!t&&-1}}},function(t,e,r){var n=r(19),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,r){var n=r(19),o=Math.max,i=Math.min;t.exports=function(t,e){return t=n(t),t<0?o(t+e,0):i(t,e)}},function(t,e,r){var n=r(15)("keys"),o=r(5);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){var n=r(6);t.exports=function(t){return Object(n(t))}},function(t,e,r){var n=r(20),o=n(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()});t.exports=o},function(t,e){function r(t,e,r,n){var o=-1,i=null==t?0:t.length;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}t.exports=r},function(t,e){function r(t){return t}t.exports=r},function(t,e,r){function n(t,e,r){return t=u(t),e=r?void 0:e,void 0===e?i(t)?s(t):o(t):t.match(e)||[]}var o=r(51),i=r(52),u=r(7),s=r(53);t.exports=n},function(t,e){function r(t){return t.match(n)||[]}var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=r},function(t,e){function r(t){return n.test(t)}var n=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=r},function(t,e){function r(t){return t.match(y)||[]}var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="["+n+"]",i="[a-z\\xdf-\\xf6\\xf8-\\xff]",u="[^\\ud800-\\udfff"+n+"\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",f="[A-Z\\xc0-\\xd6\\xd8-\\xde]",c="(?:"+i+"|"+u+")",l="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",p="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",s,a].join("|")+")[\\ufe0e\\ufe0f]?"+l+")*",h="[\\ufe0e\\ufe0f]?"+l+p,d="(?:"+["[\\u2700-\\u27bf]",s,a].join("|")+")"+h,y=RegExp([f+"?"+i+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[o,f,"$"].join("|")+")","(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[o,f+c,"$"].join("|")+")",f+"?"+c+"+(?:['’](?:d|ll|m|re|s|t|ve))?",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)","\\d+",d].join("|"),"g");t.exports=r},function(t,e,r){function n(t){return"string"==typeof t||!i(t)&&u(t)&&o(t)==s}var o=r(8),i=r(55),u=r(9),s="[object String]";t.exports=n},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){function n(t){if(!u(t)||o(t)!=s)return!1;var e=i(t);if(null===e)return!0;var r=l.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==p}var o=r(8),i=r(57),u=r(9),s="[object Object]",a=Function.prototype,f=Object.prototype,c=a.toString,l=f.hasOwnProperty,p=c.call(Object);t.exports=n},function(t,e,r){var n=r(58),o=n(Object.getPrototypeOf,Object);t.exports=o},function(t,e){function r(t,e){return function(r){return t(e(r))}}t.exports=r},function(t,e,r){function n(t){return!0===t||!1===t||i(t)&&o(t)==u}var o=r(8),i=r(9),u="[object Boolean]";t.exports=n},function(t,e,r){var n=r(61),o=r(20),i=o(function(t,e,r){return e=e.toLowerCase(),t+(r?n(e):e)});t.exports=i},function(t,e,r){function n(t){return i(o(t).toLowerCase())}var o=r(7),i=r(62);t.exports=n},function(t,e,r){var n=r(63),o=n("toUpperCase");t.exports=o},function(t,e,r){function n(t){return function(e){e=s(e);var r=i(e)?u(e):void 0,n=r?r[0]:e.charAt(0),a=r?o(r,1).join(""):e.slice(1);return n[t]()+a}}var o=r(64),i=r(21),u=r(66),s=r(7);t.exports=n},function(t,e,r){function n(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:o(t,e,r)}var o=r(65);t.exports=n},function(t,e){function r(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}t.exports=r},function(t,e,r){function n(t){return i(t)?u(t):o(t)}var o=r(67),i=r(21),u=r(68);t.exports=n},function(t,e){function r(t){return t.split("")}t.exports=r},function(t,e){function r(t){return t.match(l)||[]}var n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",a="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",i,u].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*",f="[\\ufe0e\\ufe0f]?"+s+a,c="(?:"+["[^\\ud800-\\udfff]"+n+"?",n,i,u,"[\\ud800-\\udfff]"].join("|")+")",l=RegExp(o+"(?="+o+")|"+c+f,"g");t.exports=r},function(t,e,r){(function(e,n){/*!
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Cacheability",[],e):"object"==typeof exports?exports.Cacheability=e():t.Cacheability=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=22)}([function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(24),o=r(29);t.exports=r(4)?function(t,e,r){return n.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){t.exports=!r(2)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){function r(t){return t}t.exports=r},function(t,e){function r(t){return o.call(t)}var n=Object.prototype,o=n.toString;t.exports=r},function(t,e){function r(t){return null!=t&&"object"==typeof t}t.exports=r},function(t,e,r){"use strict";var n=r(3),o=r(11),i=r(2),u=r(6),s=r(14);t.exports=function(t,e,r){var a=s(t),f=r(u,a,""[t]),c=f[0],l=f[1];i(function(){var e={};return e[a]=function(){return 7},7!=""[t](e)})&&(o(String.prototype,t,c),n(RegExp.prototype,a,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},function(t,e,r){var n=r(0),o=r(3),i=r(12),u=r(5)("src"),s=Function.toString,a=(""+s).split("toString");r(13).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,r,s){var f="function"==typeof r;f&&(i(r,"name")||o(r,"name",e)),t[e]!==r&&(f&&(i(r,u)||o(r,u,t[e]?""+t[e]:a.join(String(e)))),t===n?t[e]=r:s?t[e]?t[e]=r:o(t,e,r):(delete t[e],o(t,e,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[u]||s.call(this)})},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e){var r=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(15)("wks"),o=r(5),i=r(0).Symbol,u="function"==typeof i;(t.exports=function(t){return n[t]||(n[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=n},function(t,e,r){var n=r(0),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){var n=r(18),o=r(6);t.exports=function(t){return n(o(t))}},function(t,e,r){var n=r(16);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){function n(t){return function(e){return o(u(i(e).replace(s,"")),t,"")}}var o=r(48),i=r(49),u=r(50),s=RegExp("['’]","g");t.exports=n},function(t,e){function r(t){return n.test(t)}var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=r},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r(23),r(30),r(32);var o=n(r(47)),i=n(r(54)),u=n(r(56)),s=n(r(57)),a=n(r(58)),f=r(67);r(71);var c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t};(0,f.polyfill)();var l=function(){function t(){}return t._getDirectives=function(t){return t.split(", ")},t._parseCacheControl=function(e){var r={};return e.length?(t._getDirectives(e).forEach(function(t){if(t.match(/=/)){var e=t.split("="),n=e[0],o=e[1];return void(r[(0,a.default)(n)]=Number(o))}r[(0,a.default)(t)]=!0}),r):r},t._parseHeaders=function(e){var r={};return t._headerKeys.forEach(function(t){var n=e.get(t);if(n){var o=(0,a.default)(t);r[o]=n}}),r},t._setTTL=function(t){var e=t.maxAge,r=t.sMaxage,n=r||e;if(!(0,u.default)(n))return 1/0;var o=1e3*n;return Date.now()+o},Object.defineProperty(t.prototype,"metadata",{get:function(){return this._metadata},set:function(t){this._metadata=t},enumerable:!0,configurable:!0}),t.prototype.checkTTL=function(){if(!this._metadata||!this._metadata.ttl)throw new TypeError("checkTTL expected this._metadata.ttl to be a number.");return this._metadata.ttl>Date.now()},t.prototype.parseCacheControl=function(e){if(!(0,i.default)(e))throw new TypeError("parseCacheControl expected cacheControl to be a string.");var r=t._parseCacheControl(e);return this._metadata={cacheControl:r,ttl:t._setTTL(r)},this._metadata},t.prototype.parseHeaders=function(e){if(!(e instanceof Headers))throw new TypeError("parseHeaders expected headers to be an instance of Headers.");var r=t._parseHeaders(e),n=r.cacheControl,o=void 0===n?"":n,i=r.etag,u=t._parseCacheControl(o);return this._metadata={cacheControl:u,etag:i,ttl:t._setTTL(u)},this._metadata},t.prototype.printCacheControl=function(){if(!this._metadata||!this._metadata.cacheControl)throw new TypeError("printCacheControl expected this._metadata.cacheControl to be an object");var t=c({},this._metadata.cacheControl),e=this.checkTTL()&&this._metadata.ttl!==1/0?Math.round((this._metadata.ttl-Date.now())/1e3):0;t.sMaxage&&(t.sMaxage=e),t.maxAge&&(t.maxAge=e);var r=[];return Object.keys(t).forEach(function(e){if((0,s.default)(t[e]))return void r.push((0,o.default)(e));r.push((0,o.default)(e)+"="+t[e])}),r.join(", ")},t._headerKeys=["cache-control","etag"],t}(),p=l;e.default=p},function(t,e,r){r(10)("match",1,function(t,e,r){return[function(r){"use strict";var n=t(this),o=void 0==r?void 0:r[e];return void 0!==o?o.call(r,n):new RegExp(r)[e](String(n))},r]})},function(t,e,r){var n=r(25),o=r(26),i=r(28),u=Object.defineProperty;e.f=r(4)?Object.defineProperty:function(t,e,r){if(n(t),e=i(e,!0),n(r),o)try{return u(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var n=r(1);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){t.exports=!r(4)&&!r(2)(function(){return 7!=Object.defineProperty(r(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(1),o=r(0).document,i=n(o)&&n(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,r){var n=r(1);t.exports=function(t,e){if(!n(t))return t;var r,o;if(e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!n(o=r.call(t)))return o;if(!e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){r(10)("split",2,function(t,e,n){"use strict";var o=r(31),i=n,u=[].push,s="length";if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[s]||2!="ab".split(/(?:ab)*/)[s]||4!=".".split(/(.?)(.?)/)[s]||".".split(/()()/)[s]>1||"".split(/.?/)[s]){var a=void 0===/()??/.exec("")[1];n=function(t,e){var r=String(this);if(void 0===t&&0===e)return[];if(!o(t))return i.call(r,t,e);var n,f,c,l,p,h=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,v=void 0===e?4294967295:e>>>0,b=new RegExp(t.source,d+"g");for(a||(n=new RegExp("^"+b.source+"$(?!\\s)",d));(f=b.exec(r))&&!((c=f.index+f[0][s])>y&&(h.push(r.slice(y,f.index)),!a&&f[s]>1&&f[0].replace(n,function(){for(p=1;p<arguments[s]-2;p++)void 0===arguments[p]&&(f[p]=void 0)}),f[s]>1&&f.index<r[s]&&u.apply(h,f.slice(1)),l=f[0][s],y=c,h[s]>=v));)b.lastIndex===f.index&&b.lastIndex++;return y===r[s]?!l&&b.test("")||h.push(""):h.push(r.slice(y)),h[s]>v?h.slice(0,v):h}}else"0".split(void 0,0)[s]&&(n=function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)});return[function(r,o){var i=t(this),u=void 0==r?void 0:r[e];return void 0!==u?u.call(r,i,o):n.call(String(i),r,o)},n]})},function(t,e,r){var n=r(1),o=r(16),i=r(14)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,r){var n=r(33);n(n.S+n.F,"Object",{assign:r(36)})},function(t,e,r){var n=r(0),o=r(13),i=r(3),u=r(11),s=r(34),a=function(t,e,r){var f,c,l,p,h=t&a.F,d=t&a.G,y=t&a.S,v=t&a.P,b=t&a.B,x=d?n:y?n[e]||(n[e]={}):(n[e]||{}).prototype,m=d?o:o[e]||(o[e]={}),_=m.prototype||(m.prototype={});d&&(r=e);for(f in r)c=!h&&x&&void 0!==x[f],l=(c?x:r)[f],p=b&&c?s(l,n):v&&"function"==typeof l?s(Function.call,l):l,x&&u(x,f,l,t&a.U),m[f]!=l&&i(m,f,p),v&&_[f]!=l&&(_[f]=l)};n.core=o,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,r){var n=r(35);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,r){"use strict";var n=r(37),o=r(44),i=r(45),u=r(46),s=r(18),a=Object.assign;t.exports=!a||r(2)(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=a({},t)[r]||Object.keys(a({},e)).join("")!=n})?function(t,e){for(var r=u(t),a=arguments.length,f=1,c=o.f,l=i.f;a>f;)for(var p,h=s(arguments[f++]),d=c?n(h).concat(c(h)):n(h),y=d.length,v=0;y>v;)l.call(h,p=d[v++])&&(r[p]=h[p]);return r}:a},function(t,e,r){var n=r(38),o=r(43);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e,r){var n=r(12),o=r(17),i=r(39)(!1),u=r(42)("IE_PROTO");t.exports=function(t,e){var r,s=o(t),a=0,f=[];for(r in s)r!=u&&n(s,r)&&f.push(r);for(;e.length>a;)n(s,r=e[a++])&&(~i(f,r)||f.push(r));return f}},function(t,e,r){var n=r(17),o=r(40),i=r(41);t.exports=function(t){return function(e,r,u){var s,a=n(e),f=o(a.length),c=i(u,f);if(t&&r!=r){for(;f>c;)if((s=a[c++])!=s)return!0}else for(;f>c;c++)if((t||c in a)&&a[c]===r)return t||c||0;return!t&&-1}}},function(t,e,r){var n=r(19),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,r){var n=r(19),o=Math.max,i=Math.min;t.exports=function(t,e){return t=n(t),t<0?o(t+e,0):i(t,e)}},function(t,e,r){var n=r(15)("keys"),o=r(5);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){var n=r(6);t.exports=function(t){return Object(n(t))}},function(t,e,r){var n=r(20),o=n(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()});t.exports=o},function(t,e){function r(t,e,r,n){var o=-1,i=null==t?0:t.length;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}t.exports=r},function(t,e){function r(t){return t}t.exports=r},function(t,e,r){function n(t,e,r){return t=u(t),e=r?void 0:e,void 0===e?i(t)?s(t):o(t):t.match(e)||[]}var o=r(51),i=r(52),u=r(7),s=r(53);t.exports=n},function(t,e){function r(t){return t.match(n)||[]}var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;t.exports=r},function(t,e){function r(t){return n.test(t)}var n=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;t.exports=r},function(t,e){function r(t){return t.match(y)||[]}var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="["+n+"]",i="[a-z\\xdf-\\xf6\\xf8-\\xff]",u="[^\\ud800-\\udfff"+n+"\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",f="[A-Z\\xc0-\\xd6\\xd8-\\xde]",c="(?:"+i+"|"+u+")",l="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",p="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",s,a].join("|")+")[\\ufe0e\\ufe0f]?"+l+")*",h="[\\ufe0e\\ufe0f]?"+l+p,d="(?:"+["[\\u2700-\\u27bf]",s,a].join("|")+")"+h,y=RegExp([f+"?"+i+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[o,f,"$"].join("|")+")","(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[o,f+c,"$"].join("|")+")",f+"?"+c+"+(?:['’](?:d|ll|m|re|s|t|ve))?",f+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)","\\d+",d].join("|"),"g");t.exports=r},function(t,e,r){function n(t){return"string"==typeof t||!i(t)&&u(t)&&o(t)==s}var o=r(8),i=r(55),u=r(9),s="[object String]";t.exports=n},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){function n(t){return"number"==typeof t||i(t)&&o(t)==u}var o=r(8),i=r(9),u="[object Number]";t.exports=n},function(t,e,r){function n(t){return!0===t||!1===t||i(t)&&o(t)==u}var o=r(8),i=r(9),u="[object Boolean]";t.exports=n},function(t,e,r){var n=r(59),o=r(20),i=o(function(t,e,r){return e=e.toLowerCase(),t+(r?n(e):e)});t.exports=i},function(t,e,r){function n(t){return i(o(t).toLowerCase())}var o=r(7),i=r(60);t.exports=n},function(t,e,r){var n=r(61),o=n("toUpperCase");t.exports=o},function(t,e,r){function n(t){return function(e){e=s(e);var r=i(e)?u(e):void 0,n=r?r[0]:e.charAt(0),a=r?o(r,1).join(""):e.slice(1);return n[t]()+a}}var o=r(62),i=r(21),u=r(64),s=r(7);t.exports=n},function(t,e,r){function n(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:o(t,e,r)}var o=r(63);t.exports=n},function(t,e){function r(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}t.exports=r},function(t,e,r){function n(t){return i(t)?u(t):o(t)}var o=r(65),i=r(21),u=r(66);t.exports=n},function(t,e){function r(t){return t.split("")}t.exports=r},function(t,e){function r(t){return t.match(l)||[]}var n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",a="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",i,u].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*",f="[\\ufe0e\\ufe0f]?"+s+a,c="(?:"+["[^\\ud800-\\udfff]"+n+"?",n,i,u,"[\\ud800-\\udfff]"].join("|")+")",l=RegExp(o+"(?="+o+")|"+c+f,"g");t.exports=r},function(t,e,r){(function(e,n){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.

@@ -8,3 +8,3 @@ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)

*/
!function(e,r){t.exports=r()}(0,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function o(t){return"function"==typeof t}function i(t){G=t}function u(t){K=t}function s(){return void 0!==q?function(){q(f)}:a()}function a(){var t=setTimeout;return function(){return t(f,1)}}function f(){for(var t=0;t<Z;t+=2){(0,J[t])(J[t+1]),J[t]=void 0,J[t+1]=void 0}Z=0}function c(t,e){var r=arguments,n=this,o=new this.constructor(p);void 0===o[tt]&&C(o);var i=n._state;return i?function(){var t=r[i-1];K(function(){return S(i,o,t,n._result)})}():j(n,o,t,e),o}function l(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(p);return _(r,t),r}function p(){}function h(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function y(t){try{return t.then}catch(t){return ot.error=t,ot}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function b(t,e,r){K(function(t){var n=!1,o=v(r,e,function(r){n||(n=!0,e!==r?_(t,r):g(t,r))},function(e){n||(n=!0,T(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&o&&(n=!0,T(t,o))},t)}function x(t,e){e._state===rt?g(t,e._result):e._state===nt?T(t,e._result):j(e,void 0,function(e){return _(t,e)},function(e){return T(t,e)})}function m(t,e,r){e.constructor===t.constructor&&r===c&&e.constructor.resolve===l?x(t,e):r===ot?(T(t,ot.error),ot.error=null):void 0===r?g(t,e):o(r)?b(t,e,r):g(t,e)}function _(e,r){e===r?T(e,h()):t(r)?m(e,r,y(r)):g(e,r)}function w(t){t._onerror&&t._onerror(t._result),A(t)}function g(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&K(A,t))}function T(t,e){t._state===et&&(t._state=nt,t._result=e,K(w,t))}function j(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+rt]=r,o[i+nt]=n,0===i&&t._state&&K(A,t)}function A(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)n=e[u],o=e[u+r],n?S(r,n,o,i):o(i);t._subscribers.length=0}}function E(){this.error=null}function O(t,e){try{return t(e)}catch(t){return it.error=t,it}}function S(t,e,r,n){var i=o(r),u=void 0,s=void 0,a=void 0,f=void 0;if(i){if(u=O(r,n),u===it?(f=!0,s=u.error,u.error=null):a=!0,e===u)return void T(e,d())}else u=n,a=!0;e._state!==et||(i&&a?_(e,u):f?T(e,s):t===rt?g(e,u):t===nt&&T(e,u))}function P(t,e){try{e(function(e){_(t,e)},function(e){T(t,e)})}catch(e){T(t,e)}}function B(){return ut++}function C(t){t[tt]=ut++,t._state=void 0,t._result=void 0,t._subscribers=[]}function R(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[tt]||C(this.promise),N(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?g(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&g(this.promise,this._result))):T(this.promise,L())}function L(){return new Error("Array Methods must be provided an Array")}function M(t){return new R(this,t).promise}function U(t){var e=this;return new e(N(t)?function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function D(t){var e=this,r=new e(p);return T(r,t),r}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function I(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function k(t){this[tt]=B(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&F(),this instanceof k?P(this,t):I())}function H(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=k}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var N=z,Z=0,q=void 0,G=void 0,K=function(t,e){J[Z]=t,J[Z+1]=e,2===(Z+=2)&&(G?G(f):Q())},V="undefined"!=typeof window?window:void 0,$=V||{},Y=$.MutationObserver||$.WebKitMutationObserver,W="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),X="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3),Q=void 0;Q=W?function(){return function(){return e.nextTick(f)}}():Y?function(){var t=0,e=new Y(f),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():X?function(){var t=new MessageChannel;return t.port1.onmessage=f,function(){return t.port2.postMessage(0)}}():void 0===V?function(){try{var t=r(72);return q=t.runOnLoop||t.runOnContext,s()}catch(t){return a()}}():a();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,ot=new E,it=new E,ut=0;return R.prototype._enumerate=function(t){for(var e=0;this._state===et&&e<t.length;e++)this._eachEntry(t[e],e)},R.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===l){var o=y(t);if(o===c&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===k){var i=new r(p);m(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},R.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?T(n,r):this._result[e]=r),0===this._remaining&&g(n,this._result)},R.prototype._willSettleAt=function(t,e){var r=this;j(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},k.all=M,k.race=U,k.resolve=l,k.reject=D,k._setScheduler=i,k._setAsap=u,k._asap=K,k.prototype={constructor:k,then:c,catch:function(t){return this.then(null,t)}},k.polyfill=H,k.Promise=k,k})}).call(e,r(70),r(71))},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){y&&h&&(y=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!y){var t=o(u);y=!0;for(var e=d.length;e;){for(h=d,d=[];++v<e;)h&&h[v].run();v=-1,e=d.length}h=null,y=!1,i(t)}}function a(t,e){this.fun=t,this.array=e}function f(){}var c,l,p=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(t){c=r}try{l="function"==typeof clearTimeout?clearTimeout:n}catch(t){l=n}}();var h,d=[],y=!1,v=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new a(t,e)),1!==d.length||y||o(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=f,p.addListener=f,p.once=f,p.off=f,p.removeListener=f,p.removeAllListeners=f,p.emit=f,p.prependListener=f,p.prependOnceListener=f,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){},function(t,e,r){r(74),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function n(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return b.iterable&&(e[Symbol.iterator]=function(){return e}),e}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function u(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader,r=u(e);return e.readAsArrayBuffer(t),r}function a(t){var e=new FileReader,r=u(e);return e.readAsText(t),r}function f(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function c(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(b.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(b.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(b.arrayBuffer&&b.blob&&m(t))this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!b.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!_(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(t)}else 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):b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},b.blob&&(this.blob=function(){var t=i(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(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return a(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},b.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(t){var e=t.toUpperCase();return w.indexOf(e)>-1?e:t}function h(t,e){e=e||{};var r=e.body;if(t instanceof h){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=p(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function d(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function y(t){var e=new o;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}}),e}function v(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var b={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(b.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=function(t){return t&&DataView.prototype.isPrototypeOf(t)},_=ArrayBuffer.isView||function(t){return t&&x.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,n){t=e(t),n=r(n);var o=this.map[t];this.map[t]=o?o+","+n:n},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,n){this.map[e(t)]=r(n)},o.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),n(t)},o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),n(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),n(t)},b.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},l.call(h.prototype),l.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:0,statusText:""});return t.type="error",t};var g=[301,302,303,307,308];v.redirect=function(t,e){if(-1===g.indexOf(e))throw new RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=h,t.Response=v,t.fetch=function(t,e){return new Promise(function(r,n){var o=new h(t,e),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:y(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;r(new v(e,t))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&b.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}])});
!function(e,r){t.exports=r()}(0,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function o(t){return"function"==typeof t}function i(t){G=t}function u(t){K=t}function s(){return void 0!==q?function(){q(f)}:a()}function a(){var t=setTimeout;return function(){return t(f,1)}}function f(){for(var t=0;t<Z;t+=2){(0,J[t])(J[t+1]),J[t]=void 0,J[t+1]=void 0}Z=0}function c(t,e){var r=arguments,n=this,o=new this.constructor(p);void 0===o[tt]&&B(o);var i=n._state;return i?function(){var t=r[i-1];K(function(){return S(i,o,t,n._result)})}():A(n,o,t,e),o}function l(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(p);return _(r,t),r}function p(){}function h(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function y(t){try{return t.then}catch(t){return ot.error=t,ot}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function b(t,e,r){K(function(t){var n=!1,o=v(r,e,function(r){n||(n=!0,e!==r?_(t,r):g(t,r))},function(e){n||(n=!0,T(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&o&&(n=!0,T(t,o))},t)}function x(t,e){e._state===rt?g(t,e._result):e._state===nt?T(t,e._result):A(e,void 0,function(e){return _(t,e)},function(e){return T(t,e)})}function m(t,e,r){e.constructor===t.constructor&&r===c&&e.constructor.resolve===l?x(t,e):r===ot?(T(t,ot.error),ot.error=null):void 0===r?g(t,e):o(r)?b(t,e,r):g(t,e)}function _(e,r){e===r?T(e,h()):t(r)?m(e,r,y(r)):g(e,r)}function w(t){t._onerror&&t._onerror(t._result),E(t)}function g(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&K(E,t))}function T(t,e){t._state===et&&(t._state=nt,t._result=e,K(w,t))}function A(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+rt]=r,o[i+nt]=n,0===i&&t._state&&K(E,t)}function E(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)n=e[u],o=e[u+r],n?S(r,n,o,i):o(i);t._subscribers.length=0}}function j(){this.error=null}function O(t,e){try{return t(e)}catch(t){return it.error=t,it}}function S(t,e,r,n){var i=o(r),u=void 0,s=void 0,a=void 0,f=void 0;if(i){if(u=O(r,n),u===it?(f=!0,s=u.error,u.error=null):a=!0,e===u)return void T(e,d())}else u=n,a=!0;e._state!==et||(i&&a?_(e,u):f?T(e,s):t===rt?g(e,u):t===nt&&T(e,u))}function P(t,e){try{e(function(e){_(t,e)},function(e){T(t,e)})}catch(e){T(t,e)}}function C(){return ut++}function B(t){t[tt]=ut++,t._state=void 0,t._result=void 0,t._subscribers=[]}function R(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[tt]||B(this.promise),z(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?g(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&g(this.promise,this._result))):T(this.promise,L())}function L(){return new Error("Array Methods must be provided an Array")}function U(t){return new R(this,t).promise}function D(t){var e=this;return new e(z(t)?function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function M(t){var e=this,r=new e(p);return T(r,t),r}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function I(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function k(t){this[tt]=C(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&F(),this instanceof k?P(this,t):I())}function H(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=k}var N=void 0;N=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var z=N,Z=0,q=void 0,G=void 0,K=function(t,e){J[Z]=t,J[Z+1]=e,2===(Z+=2)&&(G?G(f):Q())},V="undefined"!=typeof window?window:void 0,$=V||{},Y=$.MutationObserver||$.WebKitMutationObserver,W="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),X="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3),Q=void 0;Q=W?function(){return function(){return e.nextTick(f)}}():Y?function(){var t=0,e=new Y(f),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():X?function(){var t=new MessageChannel;return t.port1.onmessage=f,function(){return t.port2.postMessage(0)}}():void 0===V?function(){try{var t=r(70);return q=t.runOnLoop||t.runOnContext,s()}catch(t){return a()}}():a();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,ot=new j,it=new j,ut=0;return R.prototype._enumerate=function(t){for(var e=0;this._state===et&&e<t.length;e++)this._eachEntry(t[e],e)},R.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===l){var o=y(t);if(o===c&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===k){var i=new r(p);m(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},R.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?T(n,r):this._result[e]=r),0===this._remaining&&g(n,this._result)},R.prototype._willSettleAt=function(t,e){var r=this;A(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},k.all=U,k.race=D,k.resolve=l,k.reject=M,k._setScheduler=i,k._setAsap=u,k._asap=K,k.prototype={constructor:k,then:c,catch:function(t){return this.then(null,t)}},k.polyfill=H,k.Promise=k,k})}).call(e,r(68),r(69))},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){y&&h&&(y=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!y){var t=o(u);y=!0;for(var e=d.length;e;){for(h=d,d=[];++v<e;)h&&h[v].run();v=-1,e=d.length}h=null,y=!1,i(t)}}function a(t,e){this.fun=t,this.array=e}function f(){}var c,l,p=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(t){c=r}try{l="function"==typeof clearTimeout?clearTimeout:n}catch(t){l=n}}();var h,d=[],y=!1,v=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new a(t,e)),1!==d.length||y||o(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=f,p.addListener=f,p.once=f,p.off=f,p.removeListener=f,p.removeAllListeners=f,p.emit=f,p.prependListener=f,p.prependOnceListener=f,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){},function(t,e,r){r(72),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function n(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return b.iterable&&(e[Symbol.iterator]=function(){return e}),e}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function u(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader,r=u(e);return e.readAsArrayBuffer(t),r}function a(t){var e=new FileReader,r=u(e);return e.readAsText(t),r}function f(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function c(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(b.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(b.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(b.arrayBuffer&&b.blob&&m(t))this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!b.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!_(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(t)}else 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):b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},b.blob&&(this.blob=function(){var t=i(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(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return a(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},b.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(t){var e=t.toUpperCase();return w.indexOf(e)>-1?e:t}function h(t,e){e=e||{};var r=e.body;if(t instanceof h){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=p(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function d(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function y(t){var e=new o;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}}),e}function v(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var b={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(b.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=function(t){return t&&DataView.prototype.isPrototypeOf(t)},_=ArrayBuffer.isView||function(t){return t&&x.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,n){t=e(t),n=r(n);var o=this.map[t];this.map[t]=o?o+","+n:n},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,n){this.map[e(t)]=r(n)},o.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),n(t)},o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),n(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),n(t)},b.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},l.call(h.prototype),l.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:0,statusText:""});return t.type="error",t};var g=[301,302,303,307,308];v.redirect=function(t,e){if(-1===g.indexOf(e))throw new RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=h,t.Response=v,t.fetch=function(t,e){return new Promise(function(r,n){var o=new h(t,e),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:y(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;r(new v(e,t))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&b.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}])});
//# sourceMappingURL=cacheability.min.js.map
import "isomorphic-fetch";
import { Metadata, ObjectStringMap } from "./types";
import { Metadata } from "./types";
export default class Cacheability {
private static _headerKeys;
private static _getDirectives(cacheControl);
private static _parseCacheControl(cacheControl?);
private static _setTTL(cacheControl?);
private _headerKeys;
private static _parseCacheControl(cacheControl);
private static _parseHeaders(headers);
private static _setTTL({maxAge, sMaxage});
private _metadata;
readonly metadata: Metadata;
metadata: Metadata;
checkTTL(): boolean;
parseCacheControl(cacheControl: string): Metadata;
parseHeaders(headers: Headers | ObjectStringMap): Metadata;
printCacheControl(): string | undefined;
setMetadata(metadata?: Metadata): void;
private _parseHeaders(headers);
parseHeaders(headers: Headers): Metadata;
printCacheControl(): string;
}

@@ -16,3 +16,3 @@ "use strict";

var _isPlainObject2 = _interopRequireDefault(require("lodash/isPlainObject"));
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));

@@ -35,7 +35,2 @@ var _isBoolean2 = _interopRequireDefault(require("lodash/isBoolean"));

let Cacheability = class Cacheability {
constructor() {
this._headerKeys = ["cache-control", "etag"];
this._metadata = {};
}
static _getDirectives(cacheControl) {

@@ -45,6 +40,8 @@ return cacheControl.split(", ");

static _parseCacheControl(cacheControl = "") {
static _parseCacheControl(cacheControl) {
const obj = {};
if (!cacheControl.length) return obj;
const directives = Cacheability._getDirectives(cacheControl);
const obj = {};
directives.forEach(dir => {

@@ -66,8 +63,21 @@ if (dir.match(/=/)) {

static _setTTL(cacheControl) {
if (!(0, _isPlainObject2.default)(cacheControl)) return undefined;
const maxAge = cacheControl.maxAge,
sMaxage = cacheControl.sMaxage;
static _parseHeaders(headers) {
const metadata = {};
Cacheability._headerKeys.forEach(key => {
const headerValue = headers.get(key);
if (!headerValue) return;
const metadataKey = (0, _camelCase2.default)(key);
metadata[metadataKey] = headerValue;
});
return metadata;
}
static _setTTL({
maxAge,
sMaxage
}) {
const sec = sMaxage || maxAge;
if (!sec) return undefined;
if (!(0, _isNumber2.default)(sec)) return Infinity;
const ms = sec * 1000;

@@ -81,4 +91,12 @@ return Date.now() + ms;

set metadata(metadata) {
this._metadata = metadata;
}
checkTTL() {
return !this._metadata.ttl ? true : this._metadata.ttl > Date.now();
if (!this._metadata || !this._metadata.ttl) {
throw new TypeError("checkTTL expected this._metadata.ttl to be a number.");
}
return this._metadata.ttl > Date.now();
}

@@ -88,10 +106,11 @@

if (!(0, _isString2.default)(cacheControl)) {
this._metadata = {};
return this._metadata;
throw new TypeError("parseCacheControl expected cacheControl to be a string.");
}
const parsedCacheControl = Cacheability._parseCacheControl(cacheControl);
this._metadata = {
cacheControl: Cacheability._parseCacheControl(cacheControl)
cacheControl: parsedCacheControl,
ttl: Cacheability._setTTL(parsedCacheControl)
};
this._metadata.ttl = Cacheability._setTTL(this._metadata.cacheControl);
return this._metadata;

@@ -101,17 +120,18 @@ }

parseHeaders(headers) {
if (!(headers instanceof Headers) && !(0, _isPlainObject2.default)(headers)) {
this._metadata = {};
return this._metadata;
if (!(headers instanceof Headers)) {
throw new TypeError("parseHeaders expected headers to be an instance of Headers.");
}
const metadata = headers instanceof Headers ? this._parseHeaders(headers) : headers;
const _Cacheability$_parseH = Cacheability._parseHeaders(headers),
_Cacheability$_parseH2 = _Cacheability$_parseH.cacheControl,
cacheControl = _Cacheability$_parseH2 === void 0 ? "" : _Cacheability$_parseH2,
etag = _Cacheability$_parseH.etag;
const cacheControl = Cacheability._parseCacheControl(metadata.cacheControl);
const parsedCacheControl = Cacheability._parseCacheControl(cacheControl);
const ttl = Cacheability._setTTL(cacheControl);
this._metadata = Object.assign({}, metadata, {
cacheControl,
ttl
});
this._metadata = {
cacheControl: parsedCacheControl,
etag,
ttl: Cacheability._setTTL(parsedCacheControl)
};
return this._metadata;

@@ -121,12 +141,8 @@ }

printCacheControl() {
if (!(0, _isPlainObject2.default)(this._metadata.cacheControl)) return undefined;
const cacheControl = Object.assign({}, this._metadata.cacheControl);
const ttl = this._metadata.ttl;
let maxAge = 0;
if (this.checkTTL()) {
const validTTL = ttl;
maxAge = Math.round((validTTL - Date.now()) / 1000);
if (!this._metadata || !this._metadata.cacheControl) {
throw new TypeError("printCacheControl expected this._metadata.cacheControl to be an object");
}
const cacheControl = Object.assign({}, this._metadata.cacheControl);
const maxAge = this.checkTTL() && this._metadata.ttl !== Infinity ? Math.round((this._metadata.ttl - Date.now()) / 1000) : 0;
if (cacheControl.sMaxage) cacheControl.sMaxage = maxAge;

@@ -146,22 +162,5 @@ if (cacheControl.maxAge) cacheControl.maxAge = maxAge;

setMetadata(metadata) {
let _metadata = metadata;
if (!(0, _isPlainObject2.default)(metadata)) _metadata = {};
this._metadata = _metadata;
}
_parseHeaders(headers) {
const metadata = {};
this._headerKeys.forEach(key => {
const headerValue = headers.get(key);
if (!headerValue) return;
metadata[(0, _camelCase2.default)(key)] = headerValue;
});
return metadata;
}
};
exports.default = Cacheability;
Cacheability._headerKeys = ["cache-control", "etag"];
//# sourceMappingURL=index.js.map

@@ -1,3 +0,4 @@

export interface ObjectStringMap {
[key: string]: string;
export interface ParsedHeaders {
cacheControl?: string;
etag?: string;
}

@@ -8,9 +9,9 @@

sMaxage?: number;
[key: string]: string | number | boolean | undefined;
[key: string]: string | number | boolean;
}
export interface Metadata {
cacheControl?: CacheControl;
cacheControl: CacheControl;
etag?: string;
ttl?: number;
ttl: number;
}
import "isomorphic-fetch";
import { Metadata, ObjectStringMap } from "./types";
import { Metadata } from "./types";
export default class Cacheability {
private static _headerKeys;
private static _getDirectives(cacheControl);
private static _parseCacheControl(cacheControl?);
private static _setTTL(cacheControl?);
private _headerKeys;
private static _parseCacheControl(cacheControl);
private static _parseHeaders(headers);
private static _setTTL({maxAge, sMaxage});
private _metadata;
readonly metadata: Metadata;
metadata: Metadata;
checkTTL(): boolean;
parseCacheControl(cacheControl: string): Metadata;
parseHeaders(headers: Headers | ObjectStringMap): Metadata;
printCacheControl(): string | undefined;
setMetadata(metadata?: Metadata): void;
private _parseHeaders(headers);
parseHeaders(headers: Headers): Metadata;
printCacheControl(): string;
}

@@ -5,3 +5,3 @@ import "core-js/modules/es6.symbol";

import _isString from "lodash/isString";
import _isPlainObject from "lodash/isPlainObject";
import _isNumber from "lodash/isNumber";
import _isBoolean from "lodash/isBoolean";

@@ -18,7 +18,2 @@ import _camelCase from "lodash/camelCase";

let Cacheability = class Cacheability {
constructor() {
this._headerKeys = ["cache-control", "etag"];
this._metadata = {};
}
static _getDirectives(cacheControl) {

@@ -28,6 +23,8 @@ return cacheControl.split(", ");

static _parseCacheControl(cacheControl = "") {
static _parseCacheControl(cacheControl) {
const obj = {};
if (!cacheControl.length) return obj;
const directives = Cacheability._getDirectives(cacheControl);
const obj = {};
directives.forEach(dir => {

@@ -49,8 +46,23 @@ if (dir.match(/=/)) {

static _setTTL(cacheControl) {
if (!_isPlainObject(cacheControl)) return undefined;
const maxAge = cacheControl.maxAge,
sMaxage = cacheControl.sMaxage;
static _parseHeaders(headers) {
const metadata = {};
Cacheability._headerKeys.forEach(key => {
const headerValue = headers.get(key);
if (!headerValue) return;
const metadataKey = _camelCase(key);
metadata[metadataKey] = headerValue;
});
return metadata;
}
static _setTTL({
maxAge,
sMaxage
}) {
const sec = sMaxage || maxAge;
if (!sec) return undefined;
if (!_isNumber(sec)) return Infinity;
const ms = sec * 1000;

@@ -64,4 +76,12 @@ return Date.now() + ms;

set metadata(metadata) {
this._metadata = metadata;
}
checkTTL() {
return !this._metadata.ttl ? true : this._metadata.ttl > Date.now();
if (!this._metadata || !this._metadata.ttl) {
throw new TypeError("checkTTL expected this._metadata.ttl to be a number.");
}
return this._metadata.ttl > Date.now();
}

@@ -71,10 +91,11 @@

if (!_isString(cacheControl)) {
this._metadata = {};
return this._metadata;
throw new TypeError("parseCacheControl expected cacheControl to be a string.");
}
const parsedCacheControl = Cacheability._parseCacheControl(cacheControl);
this._metadata = {
cacheControl: Cacheability._parseCacheControl(cacheControl)
cacheControl: parsedCacheControl,
ttl: Cacheability._setTTL(parsedCacheControl)
};
this._metadata.ttl = Cacheability._setTTL(this._metadata.cacheControl);
return this._metadata;

@@ -84,17 +105,18 @@ }

parseHeaders(headers) {
if (!(headers instanceof Headers) && !_isPlainObject(headers)) {
this._metadata = {};
return this._metadata;
if (!(headers instanceof Headers)) {
throw new TypeError("parseHeaders expected headers to be an instance of Headers.");
}
const metadata = headers instanceof Headers ? this._parseHeaders(headers) : headers;
const _Cacheability$_parseH = Cacheability._parseHeaders(headers),
_Cacheability$_parseH2 = _Cacheability$_parseH.cacheControl,
cacheControl = _Cacheability$_parseH2 === void 0 ? "" : _Cacheability$_parseH2,
etag = _Cacheability$_parseH.etag;
const cacheControl = Cacheability._parseCacheControl(metadata.cacheControl);
const parsedCacheControl = Cacheability._parseCacheControl(cacheControl);
const ttl = Cacheability._setTTL(cacheControl);
this._metadata = Object.assign({}, metadata, {
cacheControl,
ttl
});
this._metadata = {
cacheControl: parsedCacheControl,
etag,
ttl: Cacheability._setTTL(parsedCacheControl)
};
return this._metadata;

@@ -104,12 +126,8 @@ }

printCacheControl() {
if (!_isPlainObject(this._metadata.cacheControl)) return undefined;
const cacheControl = Object.assign({}, this._metadata.cacheControl);
const ttl = this._metadata.ttl;
let maxAge = 0;
if (this.checkTTL()) {
const validTTL = ttl;
maxAge = Math.round((validTTL - Date.now()) / 1000);
if (!this._metadata || !this._metadata.cacheControl) {
throw new TypeError("printCacheControl expected this._metadata.cacheControl to be an object");
}
const cacheControl = Object.assign({}, this._metadata.cacheControl);
const maxAge = this.checkTTL() && this._metadata.ttl !== Infinity ? Math.round((this._metadata.ttl - Date.now()) / 1000) : 0;
if (cacheControl.sMaxage) cacheControl.sMaxage = maxAge;

@@ -129,22 +147,5 @@ if (cacheControl.maxAge) cacheControl.maxAge = maxAge;

setMetadata(metadata) {
let _metadata = metadata;
if (!_isPlainObject(metadata)) _metadata = {};
this._metadata = _metadata;
}
_parseHeaders(headers) {
const metadata = {};
this._headerKeys.forEach(key => {
const headerValue = headers.get(key);
if (!headerValue) return;
metadata[_camelCase(key)] = headerValue;
});
return metadata;
}
};
export { Cacheability as default };
Cacheability._headerKeys = ["cache-control", "etag"];
//# sourceMappingURL=index.js.map

@@ -1,3 +0,4 @@

export interface ObjectStringMap {
[key: string]: string;
export interface ParsedHeaders {
cacheControl?: string;
etag?: string;
}

@@ -8,9 +9,9 @@

sMaxage?: number;
[key: string]: string | number | boolean | undefined;
[key: string]: string | number | boolean;
}
export interface Metadata {
cacheControl?: CacheControl;
cacheControl: CacheControl;
etag?: string;
ttl?: number;
ttl: number;
}
{
"name": "cacheability",
"version": "0.0.6",
"version": "0.0.7",
"description": "A utility class to parse, store and print http cache headers.",

@@ -5,0 +5,0 @@ "author": "Dylan Aubrey <dylanaubrey@gmail.com>",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc