/* eslint-disable */
'use strict';(function(m,q){"object"===typeof exports&&"undefined"!==typeof module?q(exports):"function"===typeof define&&define.amd?define(["exports"],q):(m=m||self,q(m.AmpToolboxCacheUrl={}))})(this,function(m){function q(a){try{return decodeURIComponent(a.replace(/\+/g," "))}catch(b){return null}}function t(a){return(a?a:"").toString().replace(N,"")}function z(a){var b=("undefined"!==typeof window?window:"undefined"!==typeof A?A:"undefined"!==typeof self?self:{}).location||{};a=a||b;b={};var d=
typeof a,c;if("blob:"===a.protocol)b=new k(unescape(a.pathname),{});else if("string"===d)for(c in b=new k(a,{}),B)delete b[c];else if("object"===d){for(c in a)c in B||(b[c]=a[c]);void 0===b.slashes&&(b.slashes=O.test(a.href))}return b}function C(a){a=t(a);a=P.exec(a);return{protocol:a[1]?a[1].toLowerCase():"",slashes:!!a[2],rest:a[3]}}function k(a,b,d){a=t(a);if(!(this instanceof k))return new k(a,b,d);var c=u.slice();var e=typeof b;var l=0;"object"!==e&&"string"!==e&&(d=b,b=null);d&&"function"!==
typeof d&&(d=r.parse);b=z(b);var f=C(a||"");e=!f.protocol&&!f.slashes;this.slashes=f.slashes||e&&b.slashes;this.protocol=f.protocol||b.protocol||"";a=f.rest;for(f.slashes||(c[3]=[/(.*)/,"pathname"]);l<c.length;l++)if(f=c[l],"function"===typeof f)a=f(a);else{var h=f[0];var g=f[1];if(h!==h)this[g]=a;else if("string"===typeof h)~(h=a.indexOf(h))&&("number"===typeof f[2]?(this[g]=a.slice(0,h),a=a.slice(h+f[2])):(this[g]=a.slice(h),a=a.slice(0,h)));else if(h=h.exec(a))this[g]=h[1],a=a.slice(0,h.index);
this[g]=this[g]||(e&&f[3]?b[g]||"":"");f[4]&&(this[g]=this[g].toLowerCase())}d&&(this.query=d(this.query));if(e&&b.slashes&&"/"!==this.pathname.charAt(0)&&(""!==this.pathname||""!==b.pathname)){a=this.pathname;b=b.pathname;if(""!==a){b=(b||"/").split("/").slice(0,-1).concat(a.split("/"));a=b.length;d=b[a-1];c=!1;for(l=0;a--;)"."===b[a]?b.splice(a,1):".."===b[a]?(b.splice(a,1),l++):l&&(0===a&&(c=!0),b.splice(a,1),l--);c&&b.unshift("");"."!==d&&".."!==d||b.push("");b=b.join("/")}this.pathname=b}D(this.port,
this.protocol)||(this.host=this.hostname,this.port="");this.username=this.password="";this.auth&&(f=this.auth.split(":"),this.username=f[0]||"",this.password=f[1]||"");this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null";this.href=this.toString()}function p(a){throw new RangeError(Q[a]);}function E(a,b){var d=a.split("@");let c="";1<d.length&&(c=d[0]+"@",a=d[1]);a=a.replace(R,".");{a=a.split(".");d=[];let c=a.length;for(;c--;)d[c]=b(a[c]);b=d}b=b.join(".");
return c+b}function F(a){let b=[],d=0,c=a.length;for(;d<c;){let e=a.charCodeAt(d++);if(55296<=e&&56319>=e&&d<c){let c=a.charCodeAt(d++);56320==(c&64512)?b.push(((e&1023)<<10)+(c&1023)+65536):(b.push(e),d--)}else b.push(e)}return b}function S(a){a=(new TextEncoder("utf-8")).encode(a);return window.crypto.subtle.digest("SHA-256",a).then(a=>{var b=[];a=new DataView(a);for(let c=0;c<a.byteLength;c+=4){let d=("00000000"+a.getUint32(c).toString(16)).slice(-8);b.push(d)}return b=b.join("")})}function v(a){a=
(new w(a)).hostname;if(G(a))var b=!1;else b=x.toUnicode(a),b=63>=a.length&&!(T.test(b)&&U.test(b))&&-1!=a.indexOf(".");if(b){b=x.toUnicode(a);b=b.split("-").join("--");b=b.split(".").join("-");b=x.toASCII(b).toLowerCase();if(63<b.length)return H(a);G(b)&&(b="0-".concat(b,"-0"));return Promise.resolve(b)}return H(a)}function H(a){a="undefined"!==typeof window?S(a):void 0;return a.then(a=>V("ffffffffff"+a+"000000").substr(8,Math.ceil(4*a.length/5)))}function V(a){let b=[];a.match(/.{1,2}/g).forEach((a,
c)=>{b[c]=parseInt(a,16)});var d=b.length%5,c=Math.floor(b.length/5);a=[];if(0!=d){for(var e=0;e<5-d;e++)b+="\x00";c+=1}for(e=0;e<c;e++)a.push("abcdefghijklmnopqrstuvwxyz234567".charAt(b[5*e]>>3)),a.push("abcdefghijklmnopqrstuvwxyz234567".charAt((b[5*e]&7)<<2|b[5*e+1]>>6)),a.push("abcdefghijklmnopqrstuvwxyz234567".charAt((b[5*e+1]&63)>>1)),a.push("abcdefghijklmnopqrstuvwxyz234567".charAt((b[5*e+1]&1)<<4|b[5*e+2]>>4)),a.push("abcdefghijklmnopqrstuvwxyz234567".charAt((b[5*e+2]&15)<<1|b[5*e+3]>>7)),
a.push("abcdefghijklmnopqrstuvwxyz234567".charAt((b[5*e+3]&127)>>2)),a.push("abcdefghijklmnopqrstuvwxyz234567".charAt((b[5*e+3]&3)<<3|b[5*e+4]>>5)),a.push("abcdefghijklmnopqrstuvwxyz234567".charAt(b[5*e+4]&31));c=0;1==d?c=6:2==d?c=4:3==d?c=3:4==d&&(c=1);for(d=0;d<c;d++)a.pop();for(d=0;d<c;d++)a.push("=");return a.join("")}function G(a){return"--"==a.slice(2,4)&&"xn"!=a.slice(0,2)}function I(a,b,d=null){let c=new w(b),e=W(c.pathname,d);e+="https:"===c.protocol?"/s/":"/";return v(c.toString()).then(d=>
{let f=new w(b);f.protocol="https";d=d+"."+a;f.host=d;f.hostname=d;f.pathname=e+c.hostname+c.pathname;return f.toString()})}function W(a,b=null){return X.isPathNameAnImage(a)?"/i":Y.isPathNameAFont(a)?"/r":b===Z.VIEWER?"/v":"/c"}let aa="ase art bmp blp cd5 cit cpt cr2 cut dds dib djvu egt exif gif gpl grf icns ico iff jng jpeg jpg jfif jp2 jps lbm max miff mng msp nitf ota pbm pc1 pc2 pc3 pcf pcx pdn pgm PI1 PI2 PI3 pict pct pnm pns ppm psb psd pdd psp px pxm pxr qfx raw rle sct sgi rgb int bw tga tiff tif vtf xbm xcf xpm 3dv amf ai awg cgm cdr cmx dxf e2d egt eps fs gbr odg svg stl vrml x3d sxd v2d vnd wmf emf art xar png webp jxr hdp wdp cur ecw iff lbm liff nrrd pam pcx pgf sgi rgb rgba bw int inta sid ras sun tga".split(" "),
X={isPathNameAnImage:a=>aa.some(b=>a.endsWith(b)?!0:!1)},ba="### #gf $on $tf 0b 8m 8u 12u 15u 64c 075 75 085 85 91 091 096 96 abf acfm acs afm afn afs all amfm apf asf aspf atm auf b30 bco bdf bepf bez bfn bmap bmf bx bzr cbtf cct cef cff cfn cga ch4 cha chm chr chx claf collection compositefont dfont dus dzk eft eot etx euf f00 f06 f08 f09 f3f f10 f11 f12 f13 f16 fd fdb ff ffil flf fli fn3 fnb fnn fnt fnta fo1 fo2 fog fon font fonts fot frf frs ftm fxr fyi gdr gf gft glf glif glyphs gsf gxf hbf ice intellifont lepf lft lwfn mcf mcf mfd mfm mft mgf mmm mrf mtf mvec nlq ntf odttf ofm okf otf pcf pcf pfa pfb pfm pft phf pk pkt prs pss qbf qfn r8? scr sfd sff sfi sfl sfn sfo sfp sfs sif snf spd spritefont sui suit svg sxs t1c t2 tb1 tb2 tdf tfm tmf tpf ttc tte ttf type ufm ufo usl usp us? vf vf1 vf3 vfb vfm vfont vlw vmf vnf w30 wfn wnf woff woff2 xfc xfn xfr xft zfi zsu _v".split(" "),
Y={isPathNameAFont:a=>ba.some(b=>a.endsWith(b)?!0:!1)};var A="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},D=function(a,b){b=b.split(":")[0];a=+a;if(!a)return!1;switch(b){case "http":case "ws":return 80!==a;case "https":case "wss":return 443!==a;case "ftp":return 21!==a;case "gopher":return 70!==a;case "file":return!1}return 0!==a},ca=Object.prototype.hasOwnProperty,r={stringify:function(a,b){b=b||
"";var d=[],c;"string"!==typeof b&&(b="?");for(e in a)if(ca.call(a,e)){(c=a[e])||null!==c&&void 0!==c&&!isNaN(c)||(c="");var e=encodeURIComponent(e);c=encodeURIComponent(c);null!==e&&null!==c&&d.push(e+"="+c)}return d.length?b+d.join("&"):""},parse:function(a){for(var b=/([^=?&]+)=?([^&]*)/g,d={},c;c=b.exec(a);){var e=q(c[1]);c=q(c[2]);null===e||null===c||e in d||(d[e]=c)}return d}},O=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,P=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,N=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,
u=[["#","hash"],["?","query"],function(a){return a.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],B={hash:1,query:1};k.prototype={set:function(a,b,d){switch(a){case "query":"string"===typeof b&&b.length&&(b=(d||r.parse)(b));this[a]=b;break;case "port":this[a]=b;D(b,this.protocol)?b&&(this.host=this.hostname+":"+b):(this.host=this.hostname,this[a]="");break;case "hostname":this[a]=b;this.port&&(b+=":"+this.port);this.host=
b;break;case "host":this[a]=b;/:\d+$/.test(b)?(b=b.split(":"),this.port=b.pop(),this.hostname=b.join(":")):(this.hostname=b,this.port="");break;case "protocol":this.protocol=b.toLowerCase();this.slashes=!d;break;case "pathname":case "hash":b?(d="pathname"===a?"/":"#",this[a]=b.charAt(0)!==d?d+b:b):this[a]=b;break;default:this[a]=b}for(a=0;a<u.length;a++)b=u[a],b[4]&&(this[b[1]]=this[b[1]].toLowerCase());this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null";
this.href=this.toString();return this},toString:function(a){a&&"function"===typeof a||(a=r.stringify);var b=this.protocol;b&&":"!==b.charAt(b.length-1)&&(b+=":");b+=this.slashes?"//":"";this.username&&(b+=this.username,this.password&&(b+=":"+this.password),b+="@");b+=this.host+this.pathname;(a="object"===typeof this.query?a(this.query):this.query)&&(b+="?"!==a.charAt(0)?"?"+a:a);this.hash&&(b+=this.hash);return b}};k.extractProtocol=C;k.location=z;k.trimLeft=t;k.qs=r;var w=k;let da=/^xn--/,ea=/[^\0-\x7E]/,
R=/[\x2E\u3002\uFF0E\uFF61]/g,Q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},n=Math.floor,y=String.fromCharCode,J=function(a,b){return a+22+75*(26>a)-((0!=b)<<5)},K=function(a,b,d){let c=0;a=d?n(a/700):a>>1;for(a+=n(a/b);455<a;c+=36)a=n(a/35);return n(c+36*a/(a+38))},L=function(a){const b=[],d=a.length;let c=0,e=128,l=72;var f=a.lastIndexOf("-");0>f&&(f=0);for(var h=0;h<f;++h)128<=a.charCodeAt(h)&&
p("not-basic"),b.push(a.charCodeAt(h));for(f=0<f?f+1:0;f<d;){h=c;for(let b=1,e=36;;e+=36){f>=d&&p("invalid-input");var g=a.charCodeAt(f++);g=10>g-48?g-22:26>g-65?g-65:26>g-97?g-97:36;(36<=g||g>n((2147483647-c)/b))&&p("overflow");c+=g*b;const h=e<=l?1:e>=l+26?26:e-l;if(g<h)break;g=36-h;b>n(2147483647/g)&&p("overflow");b*=g}g=b.length+1;l=K(c-h,g,0==h);n(c/g)>2147483647-e&&p("overflow");e+=n(c/g);c%=g;b.splice(c++,0,e)}return String.fromCodePoint(...b)},M=function(a){const b=[];a=F(a);let d=a.length,
c=128,e=0,l=72;for(var f of a)128>f&&b.push(y(f));let h=f=b.length;for(f&&b.push("-");h<d;){var g=2147483647;for(const b of a)b>=c&&b<g&&(g=b);const d=h+1;g-c>n((2147483647-e)/d)&&p("overflow");e+=(g-c)*d;c=g;for(const m of a)if(m<c&&2147483647<++e&&p("overflow"),m==c){var k=e;for(g=36;;g+=36){const a=g<=l?1:g>=l+26?26:g-l;if(k<a)break;k-=a;const c=36-a;b.push(y(J(a+k%c,0)));k=n(k/c)}b.push(y(J(k,0)));l=K(e,d,h==f);e=0;++h}++e;++c}return b.join("")},x={version:"2.1.0",ucs2:{decode:F,encode:a=>String.fromCodePoint(...a)},
decode:L,encode:M,toASCII:function(a){return E(a,function(a){return ea.test(a)?"xn--"+M(a):a})},toUnicode:function(a){return E(a,function(a){return da.test(a)?L(a.slice(4).toLowerCase()):a})}},T=/[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,U=/[\u0591-\u06ef\u06fa-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc]/,Z={CONTENT:"content",VIEWER:"viewer",WEB_PACKAGE:"web_package",CERTIFICATE:"certificate",IMAGE:"image"},fa={createCacheUrl:I,
createCurlsSubdomain:v};m.createCacheUrl=I;m.createCurlsSubdomain=v;m.default=fa;Object.defineProperty(m,"__esModule",{value:!0})})
