(function(){({initialize:function(){this.initializeHsslCheck()},debug:function(){let i=!1;return typeof DFM_AD_MODS_DEBUG<"u"&&(i=!0),i},checkForBangPremiumOffer:function(){let i,e,o=window.blueConicClient.profile.getProfile();this.debug()&&console.log("DEBUG: blueconic profile = "+o);let l=["bang_accept_premium_offer","bang_accept_premium_offer_date"];this.debug()&&console.log("DEBUG: blueconic premium offer properties = "+l),o.loadValues(l,this,function(){if(i=o.getValue("bang_accept_premium_offer"),e=o.getValue("bang_accept_premium_offer_date"),i==="yes"&&e.length>0){const n=new Date(e),s=new Date,c=7200*60*1e3;s-n>c===!1?localStorage.setItem("hhsl","access"):localStorage.removeItem("hhsl")}})},initializeHsslCheck:function(){this.debug()&&console.log("DEBUG: initializeHsslCheck success");let i=!1,e=this,t;typeof DFM_AD_MODS_LEVEL<"u"&&(t=parseInt(DFM_AD_MODS_LEVEL[0])),this.debug()&&console.log("DEBUG: hhslFromOptions "+t),document.addEventListener("onLoginSuccess",function(o){i=!0,e.debug()&&console.log("DEBUG: onLoginSuccess is true")}),typeof window.blueConicClient<"u"&&typeof window.blueConicClient.event<"u"&&typeof window.blueConicClient.event.subscribe<"u"?(e.debug()&&console.log("DEBUG: blueconic detected and not undefined; running checkForBangPremiumOffer"),e.checkForBangPremiumOffer()):(e.debug()&&console.log("DEBUG: blueconic not loaded, adding event listener"),window.addEventListener("onBlueConicLoaded",function(){e.checkForBangPremiumOffer()},!1)),document.addEventListener("onHasAccess",function(o){e.debug()&&console.log("DEBUG: onHasAccess event listener hit");let l=[];typeof t<"u"&&l.push(t),e.debug()&&console.log("DEBUG: hhsl level is "+l);let n,s=o.detail.MG2AccountData.DigitalAccess.Subscription.HouseHoldSubscriptionLevel;e.debug()&&console.log("DEBUG: hhsl level is "+s),typeof s<"u"&&l.includes(s)?n=!0:n=!1,e.debug()&&console.log("DEBUG: hhslAccess "+n),n===!0?(localStorage.setItem("hhsl","access"),e.debug()&&console.log("DEBUG: setting localStorage item for hhsl")):(localStorage.removeItem("hhsl"),e.debug()&&console.log("DEBUG: removing localStorage item for hhsl")),i&&n===!0&&window.location.reload()})}}).initialize()})(); ; let domainToNumberMap={"dailypress.com":"197837618","courant.com":"197837617","mcall.com":"197837616","orlandosentinel.com":"197837614","sun-sentinel.com":"197837613","pilotonline.com":"197837701","bostonherald.com":"239876507","advocate-news.com":"239876509","chicoer.com":"239876509","dailydemocrat.com":"239876509","marinij.com":"239876509","mendocinobeacon.com":"239876509","montereyherald.com":"239876509","orovillemr.com":"239876509","paradisepost.com":"239876509","record-bee.com":"239876509","redbluffdailynews.com":"239876509","santacruzsentinel.com":"239876509","thereporter.com":"239876509","timesheraldonline.com":"239876509","times-standard.com":"239876509","ukiahdailyjournal.com":"239876509","willitsnews.com":"239876509","morningjournal.com":"239876511","news-herald.com":"239876511","dailylocal.com":"239876512","delcotimes.com":"239876512","mainlinemedianews.com":"239876512","pottsmerc.com":"239876512","readingeagle.com":"239876512","thereporteronline.com":"239876512","timesherald.com":"239876512","trentonian.com":"239876512","twincities.com":"239876515","denverpost.com":"239876503","lowellsun.com":"239876505","nashobavalleyvoice.com":"239876505","sentinelandenterprise.com":"239876505","dailytribune.com":"239876508","macombdaily.com":"239876508","pressandguide.com":"239876508","themorningsun.com":"239876508","thenewsherald.com":"239876508","theoaklandpress.com":"239876508","voicenews.com":"239876508","dailyfreeman.com":"239876510","oneidadispatch.com":"239876510","saratogian.com":"239876510","troyrecord.com":"239876510","eastbaytimes.com":"239876506","mercurynews.com":"239876506","siliconvalley.com":"239876506","coloradohometownweekly.com":"239876513","dailycamera.com":"239876513","timescall.com":"239876513","bocopreps.com":"239876513","broomfieldenterprise.com":"239876513","buffzone.com":"239876513","canoncitydailyrecord.com":"239876513","eptrail.com":"239876513","lamarledger.com":"239876513","reporterherald.com":"239876513","akronnewsreporter.com":"239876513","brushnewstribune.com":"239876513","julesburgadvocate.com":"239876513","fortmorgantimes.com":"239876513","burlington-record.com":"239876513","southplattesentinel.com":"239876513","journal-advocate.com":"239876513","greeleytribune.com":"239876513","dailybreeze.com":"239876514","dailybulletin.com":"239876514","nydailynews.com":"197837700","excelsiorcalifornia.com":"239876514","ocregister.com":"239876514","pasadenastarnews.com":"239876514","pressenterprise.com":"239876514","presstelegram.com":"239876514","redlandsdailyfacts.com":"239876514","sbsun.com":"239876514","sgvtribune.com":"239876514","whittierdailynews.com":"239876514","dailynews.com":"239876514","baltimoresun.com":"197837615","capitalgazette.com":"197837619","chicagotribune.com":"197837611","sandiegouniontribune.com":"239876514","republicanherald.com":"239876516","standardspeaker.com":"239876516","citizensvoice.com":"239876516","thetimes-tribune.com":"239876516","wcexaminer.com":"239876516","petalumanews.com":"239876517","pressdemocrat.com":"239876517","sonomanews.com":"239876517"};let currentDomain=window.location.hostname.toLowerCase().replace(/^(www\.|preprod\.|staging\.|develop\.)/,'');let TRIB_DOMAINS=['mcall.com','courant.com','sun-sentinel.com','orlandosentinel.com','growthspotter.com','dailypress.com','pilotonline.com','nydailynews.com','baltimoresun.com','capitalgazette.com','chicagotribune.com'];const isTrib=TRIB_DOMAINS.includes(currentDomain);let gtmId=isTrib?"ma89701":"ma23578";let matherId=domainToNumberMap[currentDomain]||null;(function(cid,mkt,config,domain){var ml=document.createElement('script');var s=document.getElementsByTagName('script')[0]||document.head;var cb;try{if(!(cb=localStorage._matherVer)){throw false;}}catch(e){cb=Math.round(new Date()/1.0368e9);}ml.type='text/javascript';ml.async=true;ml.defer=true;ml.id='_mljs';ml.src=('https:'==window.location.protocol?'https':'http')+'://'+(domain||'js.matheranalytics.com/s')+'/'+cid+'/'+mkt+'/'+(config?config+'/': '')+'ml.js?cb='+cb;s.parentNode.insertBefore(ml,s);})(gtmId,matherId,'wp'); ; /*! For license information please see mng-digisubs.sophi.bundle.js.LICENSE.txt */ (()=>{var e={7526(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,d=c>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;sc?c:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;ia)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|y(e,t);let r=s(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||z(e.length)?s(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),s(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(o)return r?-1:V(e).length;t=(""+t).toLowerCase(),o=!0}}function w(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;ro&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return A(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return v(this,e,t,n);case"base64":return b(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;or)&&(n=r);let o="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function D(e,t,n,r,o){W(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function U(e,t,n,r,o){W(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function x(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,i){return t=+t,n>>>=0,i||x(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return t=+t,n>>>=0,i||x(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Z(function(e){F(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||P(e,t,this.length);let r=this[e],o=1,i=0;for(;++i=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Z(function(e){F(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){k(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,!r){k(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Z(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Z(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);k(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!r){const r=Math.pow(2,8*n-1);k(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Z(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Z(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function W(e,t,n,r,o,i){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new H.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||j(t,e.length-(n+1))}(r,o,i)}function F(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function j(e,t,n){if(Math.floor(e)!==e)throw F(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=K(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=K(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function V(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function J(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}const $=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},251(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*y}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},6993(e,t,n){var r=n(5546);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function c(e,o,i,a){var s=o&&o.prototype instanceof l?o:l,c=Object.create(s.prototype);return r(c,"_invoke",function(e,r,o){var i,a,s,c=0,l=o||[],d=!1,f={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,f.n=n,u}};function h(e,r){for(a=e,s=r,n=0;!d&&c&&!o&&n3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=e<2&&hr||r>p)&&(i[4]=e,i[5]=r,f.n=p,a=0))}if(o||e>1)return u;throw d=!0,r}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&h(l,p),a=l,s=p;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.v=s);try{if(c=2,i){if(a||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((n=(d=f.n<0)?s:e.call(r,f))!==u)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:n,done:d}}}(e,i,a),!0),c}var u={};function l(){}function d(){}function f(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=f.prototype=l.prototype=Object.create(h);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return d.prototype=f,r(p,"constructor",f),r(f,"constructor",d),d.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,a,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m:y}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,n){var r=n(887);e.exports=function(e,t,n,o,i){var a=r(e,t,n,o,i);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,n){var r=n(6993),o=n(1791);e.exports=function(e,t,n,i,a){return new o(r().w(e,t,n,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,n){var r=n(5172),o=n(5546);e.exports=function e(t,n){function i(e,o,a,s){try{var c=t[e](o),u=c.value;return u instanceof r?n.resolve(u.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):n.resolve(u).then(function(e){c.value=e,a(c)},function(e){return i("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(n,r,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,n){var r=n(5172),o=n(6993),i=n(5869),a=n(887),s=n(1791),c=n(4373),u=n(579);function l(){"use strict";var t=o(),n=t.m(l),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var h={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,h[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,u(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,o){return t.w(p(e),n,r,o&&o.reverse())},isGeneratorFunction:f,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(f(t)?a:i)(p(e),t,n,r,o)},keys:c,values:u}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,n){var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},3612(e,t,n){"use strict";var r,o,i,a,s;n.d(t,{A:()=>c}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const c={debug:!!window.authentication_config.debug,sessionServer:window.authentication_config?window.authentication_config.sessionServer:"",entitlementsEnabled:!!window.authentication_config&&"1"===window.authentication_config.entitlementsEnabled,dropdownEnabled:!!window.authentication_config&&"1"===window.authentication_config.dropdownEnabled,enableReaderDashboardLink:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardLink,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,enableDashboardBenefitHub:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardBenefitHub,enableEngageArticleGifting:"1"===(null===(r=window.authentication_config)||void 0===r?void 0:r.articleSharingEnabled)&&"1"===(null===(o=window.authentication_config)||void 0===o?void 0:o.isEngageArticleSharing),enableGiftedArticlesLink:"1"===(null===(i=window.authentication_config)||void 0===i?void 0:i.articleSharingEnabled)&&"1"!==(null===(a=window.authentication_config)||void 0===a?void 0:a.isEngageArticleSharing),enableSavedArticlesLink:"1"===(null===(s=window.authentication_config)||void 0===s?void 0:s.articleSavingEnabled),prosperstackClientid:window.authentication_config?window.authentication_config.prosperstackClientid:"",enableUpgradeSubscription:!!window.authentication_config&&"1"===window.authentication_config.enableUpgradeSubscription,oneTapEnabled:!!window.authentication_config&&"1"===window.authentication_config.oneTapEnabled,useTribMainGoogle:!!window.authentication_config&&"1"===window.authentication_config.useTribMainGoogle,isAdfreeArticle:!!window.authentication_config&&"1"===window.authentication_config.isAdfreeArticle,auth0Domain:window.authentication_config?window.authentication_config.auth0Domain:"",auth0ClientId:window.authentication_config?window.authentication_config.auth0ClientId:"",entitlementsEndpoint:window.authentication_config?window.authentication_config.entitlementsEndpoint:"",entitlementsApiKey:window.authentication_config?window.authentication_config.entitlementsAPIKey:"",linaCheckOnArticles:!!window.authentication_config&&window.authentication_config.linaCheckOnArticles,serverEntitlements:!!window.authentication_config&&window.authentication_config.serverEntitlements,googleClientId:window.authentication_config?window.authentication_config.googleClientId:"",newsletterId:window.authentication_config?window.authentication_config.newsletterId:0,connextStorageKey:"",auth0SubKey:"auth0_sub",auth0Authenticated:"auth0.is.authenticated",secret:window.authentication_config?window.authentication_config.pluginSecret:"",newslettersEnabled:!!window.authentication_config&&"1"===window.authentication_config.newslettersEnabled,bcLowaSegements:!!window.authentication_config.bcLowaSegements&&"1"===window.authentication_config.bcLowaSegements,blueconicEnabled:!!window.authentication_config.blueconicEnabled&&"1"===window.authentication_config.blueconicEnabled,datadogEnabled:!!window.authentication_config.enableDatadog&&"1"===window.authentication_config.enableDatadog}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};function t(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,c,"next",e)}function c(e){t(a,o,i,s,c,"throw",e)}s(void 0)})}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function s(e,t){for(var n=0;nhi,hasStandardBrowserEnv:()=>yi,hasStandardBrowserWebWorkerEnv:()=>wi,navigator:()=>pi,origin:()=>gi});var l=n(4756);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?setTimeout(n,t):n(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return m(this,void 0,void 0,function(){return E(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return m(this,void 0,void 0,function(){var n,r,o,i;return E(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?v:this.storageHandler,r="browser-tabs-lock-key-"+t,null===(o=n.getItemSync(r))?[2]:(i=JSON.parse(o)).id!==this.id?[3,2]:[4,S.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(r),S.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],i=0;;){var a=r.keySync(i);if(null===a)break;o.push(a),i++}for(var s=!1,c=0;c(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;_=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;oe=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw Y("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",e)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let e=0;e0)return;if(t){if(0!==e)throw Y("".concat(n," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",o);return}throw Y("".concat(n," must be a positive number"),"ERR_INVALID_ARG_VALUE",o)}catch(e){if(r)throw ue(e.message,r,o);throw e}}function ye(e,t,n,r){try{if("string"!=typeof e)throw Y("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",r);if(0===e.length)throw Y("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",r)}catch(e){if(n)throw ue(e.message,n,r);throw e}}function we(e){!function(e,t){if(He(e)!==t)throw function(e){let t='"response" content-type must be ';for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2){const e=r.pop();"".concat(r.join(", "),", or ").concat(e)}else 2===r.length?"".concat(r[0]," or ").concat(r[1]):r[0];return ue(t,at,e)}(e,t)}(e,"application/json")}function ge(){return ae(crypto.getRandomValues(new Uint8Array(32)))}function me(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new se("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"RSASSA-PKCS1-v1_5":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new se("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"ECDSA":return function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new se("unsupported EcKeyAlgorithm namedCurve",{cause:e})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new se("unsupported CryptoKey algorithm name",{cause:e})}}function Ee(e){const t=null==e?void 0:e[z];return"number"==typeof t&&Number.isFinite(t)?t:0}function Ae(e){const t=null==e?void 0:e[$];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Se(){return Math.floor(Date.now()/1e3)}function ve(e){if("object"!=typeof e||null===e)throw Y('"as" must be an object',"ERR_INVALID_ARG_TYPE");ye(e.issuer,'"as.issuer"')}function be(e){if("object"!=typeof e||null===e)throw Y('"client" must be an object',"ERR_INVALID_ARG_TYPE");ye(e.client_id,'"client.client_id"')}function Re(e){return ye(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function Te(e,t){const{key:n,kid:r}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&ye(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw Y("".concat(t," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),"private"!==e.type)throw Y("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}(n,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:me(n),kid:r},u=function(e,t){const n=Se()+Ee(t);return{jti:ge(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[Q]||void 0===s||s.call(t,c,u),i.set("client_id",o.client_id),i.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),i.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw Y('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const r="".concat(ae(re(JSON.stringify(e))),".").concat(ae(re(JSON.stringify(t)))),o=ae(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:gt(e)};case"RSA-PSS":switch(wt(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new se("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return wt(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new se("unsupported CryptoKey algorithm name",{cause:e})}(n),n,re(r)));return"".concat(r,".").concat(o)}(c,u,n))}}const Oe=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function _e(e,t){if(t&&"https:"!==e.protocol)throw ue("only requests to HTTPS are allowed",ct,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw ue("only HTTP and HTTPS requests are allowed",ut,e)}function Ie(e,t,n,r){let o;if("string"!=typeof e||!Oe(e))throw ue("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?ht:pt,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return _e(o,r),o}function Ne(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Ie(e.mtls_endpoint_aliases[t],t,n,r):Ie(e[t],t,n,r)}class Ce extends Error{constructor(e,t){var n;super(e,t),H(this,"cause",void 0),H(this,"code",void 0),H(this,"error",void 0),H(this,"status",void 0),H(this,"error_description",void 0),H(this,"response",void 0),this.name=this.constructor.name,this.code=tt,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}class Le extends Error{constructor(e,t){var n,r;super(e,t),H(this,"cause",void 0),H(this,"code",void 0),H(this,"error",void 0),H(this,"error_description",void 0),this.name=this.constructor.name,this.code=rt,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==t.cause.get("error_description")&&void 0!==n?n:void 0,null===Error.captureStackTrace||void 0===r||r.call(Error,this,this.constructor)}}class Pe extends Error{constructor(e,t){var n;super(e,t),H(this,"cause",void 0),H(this,"code",void 0),H(this,"response",void 0),H(this,"status",void 0),this.name=this.constructor.name,this.code=et,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}const ke=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),De=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),Ue=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),xe=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Be(e,t,n){if(e.status!==t){let t;var r;if(function(e){let t;if(function(e){if(!J(e,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let r=t;for(;r;){var o;let t=r.match(ke);const i=null===t||void 0===o?void 0:o[1].toLowerCase();if(!i)return;const a=r.substring(t[0].length);if(a&&!a.match(/^[\s,]/))return;const s=a.match(/^\s+(.*)$/),c=!!s;s?s[1]:void 0;const u={};let l;if(c)for(;r;){let n,o;if(r.match(De)){if([,n,o,r]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}u[n.toLowerCase()]=o}else{if(!r.match(Ue)){if(r.match(xe)){if(Object.keys(u).length)break;[,l,r]=t;break}return}[,n,o,r]=t,u[n.toLowerCase()]=o}}else 0;const d={scheme:i,parameters:u};l&&(d.token68=l),n.push(d)}return n.length?n:void 0}(e))throw new Pe("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}(e),await async function(e){if(e.status>399&&e.status<500){yt(e),we(e);try{const t=await e.clone().json();if(le(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===e.body||void 0===r?void 0:r.cancel()),new Ce("server responded with an error in the response body",{cause:t,response:e});throw ue('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),st,e)}}function Me(e){if(!Ye.has(e))throw Y('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function He(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function Ge(e,t,n,r,o,i,a){return await n(e,t,o,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[Z])||fetch)(r.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:fe(r,null==a?void 0:a.signal)})}async function Ke(e,t,n,r,o,i){var a;const s=Ne(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[q]));o.set("grant_type",r);const c=de(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(Me(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await Ge(e,t,n,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(u,s),u}const We=new WeakMap,Fe=new WeakMap;function je(e){if(!e.id_token)return;const t=We.get(e);if(!t)throw Y('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function Xe(e,t,n,r,o,i){if(ve(e),be(t),!J(n,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Be(n,200,"Token Endpoint"),yt(n);const a=await vt(n);if(ye(a.access_token,'"response" body "access_token" property',it,{body:a}),ye(a.token_type,'"response" body "token_type" property',it,{body:a}),a.token_type=a.token_type.toLowerCase(),void 0!==a.expires_in){let e="number"!=typeof a.expires_in?parseFloat(a.expires_in):a.expires_in;pe(e,!0,'"response" body "expires_in" property',it,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&ye(a.refresh_token,'"response" body "refresh_token" property',it,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw ue('"response" body "scope" property must be a string',it,{body:a});if(void 0!==a.id_token){ye(a.id_token,'"response" body "id_token" property',it,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(pe(t.default_max_age,!0,'"client.default_max_age"'),i.push("auth_time")),null!=r&&r.length&&i.push(...r);const{claims:s,jwt:c}=await async function(e,t,n,r,o){let i,a,{0:s,1:c,length:u}=e.split(".");if(5===u){if(void 0===o)throw new se("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:u}=e.split("."))}if(3!==u)throw ue("Invalid JWT",it,e);try{JSON.parse(re(ae(s)))}catch(e){throw ue("failed to parse JWT Header body as base64url encoded JSON",ot,e)}if(!le(i))throw ue("JWT Header must be a top level object",it,e);if(t(i),void 0!==i.crit)throw new se('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{JSON.parse(re(ae(c)))}catch(e){throw ue("failed to parse JWT Payload body as base64url encoded JSON",ot,e)}if(!le(a))throw ue("JWT Payload must be a top level object",it,e);const l=Se()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw ue('unexpected JWT "exp" (expiration time) claim type',it,{claims:a});if(a.exp<=l-r)throw ue('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',lt,{claims:a,now:l,tolerance:r,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw ue('unexpected JWT "iat" (issued at) claim type',it,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw ue('unexpected JWT "iss" (issuer) claim type',it,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw ue('unexpected JWT "nbf" (not before) claim type',it,{claims:a});if(a.nbf>l+r)throw ue('unexpected JWT "nbf" (not before) claim value',lt,{claims:a,now:l,tolerance:r,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw ue('unexpected JWT "aud" (audience) claim type',it,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,mt.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Ee(t),Ae(t),o).then($e.bind(void 0,i)).then(Je.bind(void 0,e)).then(Ve.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw ue('ID Token "aud" (audience) claim includes additional untrusted audiences',dt,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw ue('unexpected ID Token "azp" (authorized party) claim value',dt,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&pe(s.auth_time,!0,'ID Token "auth_time" (authentication time)',it,{claims:s}),Fe.set(n,c),We.set(a,s)}if(void 0!==(null==i?void 0:i[a.token_type]))i[a.token_type](n,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new se("unsupported `token_type` value",{cause:{body:a}});return a}function Ve(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw ue('unexpected JWT "aud" (audience) claim value',dt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw ue('unexpected JWT "aud" (audience) claim value',dt,{expected:e,claims:t.claims,claim:"aud"});return t}function Je(e,t){var n,r;const o=null!==(null===e[Rt]||void 0===r?void 0:r.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw ue('unexpected JWT "iss" (issuer) claim value',dt,{expected:o,claims:t.claims,claim:"iss"});return t}const Ye=new WeakSet,qe=Symbol(),ze={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function $e(e,t){for(const n of e)if(void 0===t.claims[n])throw ue('JWT "'.concat(n,'" (').concat(ze[n],") claim missing"),it,{claims:t.claims});return t}const Ze=Symbol(),Qe=Symbol();const et="OAUTH_WWW_AUTHENTICATE_CHALLENGE",tt="OAUTH_RESPONSE_BODY_ERROR",nt="OAUTH_UNSUPPORTED_OPERATION",rt="OAUTH_AUTHORIZATION_RESPONSE_ERROR",ot="OAUTH_PARSE_ERROR",it="OAUTH_INVALID_RESPONSE",at="OAUTH_RESPONSE_IS_NOT_JSON",st="OAUTH_RESPONSE_IS_NOT_CONFORM",ct="OAUTH_HTTP_REQUEST_FORBIDDEN",ut="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",lt="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",dt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",ft="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",ht="OAUTH_MISSING_SERVER_METADATA",pt="OAUTH_INVALID_SERVER_METADATA";function yt(e){if(e.bodyUsed)throw Y('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function wt(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new se("unsupported ".concat(t.name," modulusLength"),{cause:e})}function gt(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new se("unsupported ECDSA namedCurve",{cause:e})}}function mt(e,t,n,r){if(void 0===e)if(Array.isArray(t)){if(!t.includes(r.alg))throw ue('unexpected JWT "alg" header parameter',it,{header:r,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw ue('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if("string"==typeof n?r.alg!==n:"function"==typeof n?!n(r.alg):!n.includes(r.alg))throw ue('unexpected JWT "alg" header parameter',it,{header:r,expected:n,reason:"default value"})}else if("string"==typeof e?r.alg!==e:!e.includes(r.alg))throw ue('unexpected JWT "alg" header parameter',it,{header:r,expected:e,reason:"client configuration"})}function Et(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw ue('"'.concat(t,'" parameter must be provided only once'),it);return n}const At=Symbol(),St=Symbol();async function vt(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:we;try{await e.json()}catch(t){throw n(e),ue('failed to parse "response" body as JSON',ot,t)}if(!le(t))throw ue('"response" body must be a top level object',it,{body:t});return t}const bt=Symbol(),Rt=Symbol(),Tt=new TextEncoder,Ot=new TextDecoder;function _t(e){const t=new Uint8Array(e.length);for(let n=0;n127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=r}return t}function It(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),H(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),H(this,"claim",void 0),H(this,"reason",void 0),H(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}H(Lt,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Pt extends Ct{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),H(this,"code","ERR_JWT_EXPIRED"),H(this,"claim",void 0),H(this,"reason",void 0),H(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}H(Pt,"code","ERR_JWT_EXPIRED");class kt extends Ct{constructor(){super(...arguments),H(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}H(kt,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Dt extends Ct{constructor(){super(...arguments),H(this,"code","ERR_JOSE_NOT_SUPPORTED")}}H(Dt,"code","ERR_JOSE_NOT_SUPPORTED"),H(class extends Ct{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),H(class extends Ct{constructor(){super(...arguments),H(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Ut extends Ct{constructor(){super(...arguments),H(this,"code","ERR_JWS_INVALID")}}H(Ut,"code","ERR_JWS_INVALID");class xt extends Ct{constructor(){super(...arguments),H(this,"code","ERR_JWT_INVALID")}}H(xt,"code","ERR_JWT_INVALID"),H(class extends Ct{constructor(){super(...arguments),H(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Bt extends Ct{constructor(){super(...arguments),H(this,"code","ERR_JWKS_INVALID")}}H(Bt,"code","ERR_JWKS_INVALID");class Mt extends Ct{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}H(Mt,"code","ERR_JWKS_NO_MATCHING_KEY");class Ht extends Ct{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),H(this,Symbol.asyncIterator,void 0),H(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}H(Ht,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Gt extends Ct{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWKS_TIMEOUT")}}H(Gt,"code","ERR_JWKS_TIMEOUT");class Kt extends Ct{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}H(Kt,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Wt=function(e){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"," must be ").concat(e))},Ft=(e,t)=>e.name===t;function jt(e){return parseInt(e.name.slice(4),10)}function Xt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o2){const t=r.pop();e+="one of type ".concat(r.join(", "),", or ").concat(t,".")}else 2===r.length?e+="one of type ".concat(r[0]," or ").concat(r[1],"."):e+="of type ".concat(r[0],".");if(null==t)e+=" Received ".concat(t);else if("function"==typeof t&&t.name)e+=" Received function ".concat(t.name);else if("object"==typeof t&&null!=t){var i;null!==(i=t.constructor)&&void 0!==i&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const Vt=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},Yt=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),qt=e=>Jt(e)||Yt(e);function zt(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const $t=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n{const t=e.data[e.pos++];if(128&t){const n=127&t;let r=0;for(let t=0;t{if(e.data[e.pos++]!==t)throw new Error(n)},en=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},tn=(e,t,n)=>{var r;const o=(e=>It(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);let i=n;return null!=t&&null!==(r=t.startsWith)&&void 0!==r&&r.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=e=>{const t={data:e,pos:0};return function(e){Qt(e,48,"Invalid PKCS#8 structure"),Zt(e),Qt(e,2,"Expected version field");const t=Zt(e);e.pos+=t,Qt(e,48,"Expected algorithm identifier");Zt(e);e.pos}(t),(e=>{const t=(e=>{Qt(e,6,"Expected algorithm OID");const t=Zt(e);return en(e,t)})(e);if($t(t,[43,101,110]))return"X25519";if(!$t(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Qt(e,6,"Expected curve OID");const n=Zt(e),r=en(e,n);for(const{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if($t(r,t))return e;throw new Error("Unsupported named curve")})(t)}),(async(e,t,n,r)=>{var o;let i,a;const s="spki"===e,c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const e=r.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new Dt("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new Dt('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,null!==(o=null==r?void 0:r.extractable)&&void 0!==o?o:!!s,a)})("pkcs8",o,t,i)};async function nn(e){var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:r,keyUsages:o}=function(e){let t,n;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},n=e.priv?["sign"]:["verify"];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:"SHA-".concat(e.alg.slice(-3))},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e.alg.slice(-3))},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(e.alg.slice(-3),10)||1)},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Dt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),i=K({},e);return"AKP"!==i.kty&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,null!==(t=e.ext)&&void 0!==t?t:!e.d&&!e.priv,null!==(n=e.key_ops)&&void 0!==n?n:o)}const rn=e=>zt(e)&&"string"==typeof e.kty;let on;const an=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];on||(on=new WeakMap);let o=on.get(e);if(null!=o&&o[n])return o[n];const i=await nn(K(K({},t),{},{alg:n}));return r&&Object.freeze(e),o?o[n]=i:on.set(e,{[n]:i}),i};const sn=e=>null==e?void 0:e[Symbol.toStringTag],cn=(e,t,n)=>{if(void 0!==t.use){let e;switch(n){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(e,'" when present'))}if(void 0!==t.alg&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var r,o;let i;switch(!0){case"sign"===n||"verify"===n:case"dir"===e:case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===n?"wrapKey":"unwrapKey":n;break;case"encrypt"===n&&e.startsWith("RSA"):i="wrapKey";break;case"decrypt"===n:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===(null===(r=t.key_ops)||void 0===r||null===(o=r.includes)||void 0===o?void 0:o.call(r,i)))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};var un,ln;let dn,fn;if("undefined"==typeof navigator||null===(un=navigator.userAgent)||void 0===un||null===(ln=un.startsWith)||void 0===ln||!ln.call(un,"Mozilla/5.0 ")){const e="v6.8.1";fn="".concat("openid-client","/").concat(e),dn={"user-agent":fn}}const hn=e=>pn.get(e);let pn,yn;function wn(e){return void 0!==e?Re(e):(yn||(yn=new WeakMap),(e,t,n,r)=>{let o;return(o=yn.get(t))||(function(e,t){if("string"!=typeof e)throw An("".concat(t," must be a string"),En);if(0===e.length)throw An("".concat(t," must not be empty"),mn)}(t.client_secret,'"metadata.client_secret"'),o=Re(t.client_secret),yn.set(t,o)),o(e,t,n,r)})}const gn=Z,mn="ERR_INVALID_ARG_VALUE",En="ERR_INVALID_ARG_TYPE";function An(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}class Sn extends Error{constructor(e,t){var n;super(e,t),H(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}function vn(e,t,n){return new Sn(e,{cause:t,code:n})}function bn(e){if(e instanceof TypeError||e instanceof Sn||e instanceof Ce||e instanceof Le||e instanceof Pe)throw e;if(e instanceof ce)switch(e.code){case ct:throw vn("only requests to HTTPS are allowed",e,e.code);case ut:throw vn("only requests to HTTP or HTTPS are allowed",e,e.code);case st:throw vn("unexpected HTTP response status code",e.cause,e.code);case at:throw vn("unexpected response content-type",e.cause,e.code);case ot:throw vn("parsing error occured",e,e.code);case it:throw vn("invalid response encountered",e,e.code);case dt:throw vn("unexpected JWT claim value encountered",e,e.code);case ft:throw vn("unexpected JSON attribute value encountered",e,e.code);case lt:throw vn("JWT timestamp claim value failed validation",e,e.code);default:throw vn(e.message,e,e.code)}if(e instanceof se)throw vn("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw vn("runtime operation error",e,nt);case"NotSupportedError":throw vn("runtime unsupported operation",e,nt);case"TimeoutError":throw vn("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw vn("operation aborted",e,"OAUTH_ABORT")}throw new Sn("something went wrong",{cause:e})}async function Rn(e,t,n,r,o){const i=await async function(e,t){var n,r;if(!(e instanceof URL))throw An('"server" must be an instance of URL',En);const o=!e.href.includes("/.well-known/"),i=null!==(null==t?void 0:t.timeout)&&void 0!==n?n:30,a=AbortSignal.timeout(1e3*i),s=await(o?async function(e,t){return async function(e,t,n,r){if(!(e instanceof URL))throw Y('"'.concat("issuerIdentifier",'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");_e(e,!0!==(null==r?void 0:r[q]));const o=n(new URL(e.href)),i=de(null==r?void 0:r.headers);return i.set("accept","application/json"),((null==r?void 0:r[Z])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:fe(o,null==r?void 0:r.signal)})}(e,0,e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":!function(e){e.pathname=he("".concat(e.pathname,"/").concat(".well-known/openid-configuration"))}(e);break;case"oauth2":!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=he("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw Y('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[Z]:null==t?void 0:t[gn],[q]:null==t||null===t.execute||void 0===r?void 0:r.includes(Pn),signal:a,headers:new Headers(dn)}):((null==t?void 0:t[gn])||fetch)((_e(e,null==t||null===t.execute||void 0===c||!c.includes(Pn)),e.href),{headers:Object.fromEntries(new Headers(K({accept:"application/json"},dn)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==bt)throw Y('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!J(t,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(200!==t.status)throw ue('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',st,t);yt(t);const r=await vt(t);if(ye(r.issuer,'"response" body "issuer" property',it,{body:r}),n!==bt&&new URL(r.issuer).href!==n.href)throw ue('"response" body "issuer" property does not match the expected value',ft,{expected:n.href,body:r,attribute:"issuer"});return r}(bt,e)).catch(bn);var c;return o&&new URL(s.issuer).href!==e.href&&(function(e,t,n){return!("https://login.microsoftonline.com"!==e.origin||null!=n&&n.algorithm&&"oidc"!==n.algorithm||(t[Tn]=!0,0))}(e,s,t)||function(e,t){return!(!e.hostname.endsWith(".b2clogin.com")||null!=t&&t.algorithm&&"oidc"!==t.algorithm)}(e,t)||(()=>{throw new Sn("discovered metadata issuer does not match the expected issuer",{code:ft,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new On(i,t,n,r);let s=hn(a);if(null!=o&&o[gn]&&(s.fetch=o[gn]),null!=o&&o.timeout&&(s.timeout=o.timeout),null!=o&&o.execute)for(const e of o.execute)e(a);return a}new TextDecoder;const Tn=Symbol();class On{constructor(e,t,n,r){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw An('"clientId" must be a non-empty string',En);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null===(o=n)||void 0===o?void 0:o.client_id)&&t!==n.client_id)throw An('"clientId" and "metadata.client_id" must be the same',mn);const u=K(K({},structuredClone(n)),{},{client_id:t});let l;u[z]=null!==(i=null===(a=n)||void 0===a?void 0:a[z])&&void 0!==i?i:0,u[$]=null!==(s=null===(c=n)||void 0===c?void 0:c[$])&&void 0!==s?s:30,l=r||("string"==typeof u.client_secret&&u.client_secret.length?wn(u.client_secret):(e,t,n,r)=>{n.set("client_id",t.client_id)});let d=Object.freeze(u);const f=structuredClone(e);Tn in e&&(f[Rt]=t=>{let{claims:{tid:n}}=t;return e.issuer.replace("{tenantid}",n)});let h=Object.freeze(f);pn||(pn=new WeakMap),pn.set(this,{__proto__:null,as:h,c:d,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(hn(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){var t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"S256";return!0===(null===(t=e.code_challenge_methods_supported)||void 0===t?void 0:t.includes(n))}}}}(e))}(e),e}clientMetadata(){return structuredClone(hn(this).c)}get timeout(){return hn(this).timeout}set timeout(e){hn(this).timeout=e}get[gn](){return hn(this).fetch}set[gn](e){hn(this).fetch=e}}function _n(e){Object.defineProperties(e,function(e){let t;if(void 0!==e.expires_in){const t=new Date;t.setSeconds(t.getSeconds()+e.expires_in),t.getTime()}return{expiresIn:{__proto__:null,value(){if(t){const e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return je(this)}catch(e){return}}}}}(e))}async function In(e,t,n){var r;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=null===e.headers.get("retry-after")||void 0===r?void 0:r.trim();if(void 0===i)return;let a;if(/^\d+$/.test(i))parseInt(i,10);else{const e=new Date(i);if(Number.isFinite(e.getTime())){const t=new Date,n=e.getTime()-t.getTime();n>0&&Math.ceil(n/1e3)}}if(o&&!Number.isFinite(a))throw new ce("invalid Retry-After header value",{cause:e});a>t&&await Nn(a-t,n)}function Nn(e,t){return new Promise((n,r)=>{const o=e=>{try{t.throwIfAborted()}catch(e){return void r(e)}if(e<=0)return void n();const i=Math.min(e,5);setTimeout(()=>o(e-i),1e3*i)};o(e)})}async function Cn(e,t){Mn(e);const{as:n,c:r,auth:o,fetch:i,tlsOnly:a,timeout:s}=hn(e);return async function(e,t,n,r,o){ve(e),be(t);const i=Ne(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[q])),a=new URLSearchParams(r);a.set("client_id",t.client_id);const s=de(null==o?void 0:o.headers);return s.set("accept","application/json"),Ge(e,t,n,i,a,s,o)}(n,r,o,t,{[Z]:i,[q]:!a,headers:new Headers(dn),signal:Hn(s)}).then(e=>async function(e,t,n){if(ve(e),be(t),!J(n,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Be(n,200,"Backchannel Authentication Endpoint"),yt(n);const r=await vt(n);ye(r.auth_req_id,'"response" body "auth_req_id" property',it,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return pe(o,!0,'"response" body "expires_in" property',it,{body:r}),r.expires_in=o,void 0!==r.interval&&pe(r.interval,!1,'"response" body "interval" property',it,{body:r}),r}(n,r,e)).catch(bn)}async function Ln(e,t,n,r){var o,i;Mn(e),new URLSearchParams(n);let a=null!==t.interval&&void 0!==o?o:5;const s=null!==(null==r?void 0:r.signal)&&void 0!==i?i:AbortSignal.timeout(1e3*t.expires_in);try{await Nn(a,s)}catch(e){bn(e)}const{as:c,c:u,auth:l,fetch:d,tlsOnly:f,nonRepudiation:h,timeout:p,decrypt:y}=hn(e),w=(o,i)=>Ln(e,K(K({},t),{},{interval:o}),n,K(K({},r),{},{signal:s,flag:i})),g=await async function(e,t,n,r,o){ve(e),be(t),ye(r,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",r),Ke(e,t,n,"urn:openid:params:grant-type:ciba",i,o)}(c,u,l,t.auth_req_id,{[Z]:d,[q]:!f,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(dn),signal:s.aborted?s:Hn(p)}).catch(bn);var m;if(503===g.status&&g.headers.has("retry-after"))return await In(g,a,s,!0),await(null===g.body||void 0===m?void 0:m.cancel()),w(a);const E=async function(e,t,n,r){return Xe(e,t,n,void 0,null==r?void 0:r[ee],null==r?void 0:r.recognizedTokenTypes)}(c,u,g,{[ee]:y});let A;try{await E}catch(e){if(Gn(e,r))return w(a,Kn);if(e instanceof Ce)switch(e.error){case"slow_down":0;case"authorization_pending":return await In(e.response,a,s),w(a)}bn(e)}return A.id_token&&await(null==h?void 0:h(g)),_n(A),A}function Pn(e){hn(e).tlsOnly=!1}async function kn(e,t,n,r,o){if(Mn(e),!((null==o?void 0:o.flag)===Kn||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw An('"currentUrl" must be an instance of URL, or Request',En);let i,a;const{as:s,c,auth:u,fetch:l,tlsOnly:d,jarm:f,hybrid:h,nonRepudiation:p,timeout:y,decrypt:w,implicit:g}=hn(e);if((null==o?void 0:o.flag)===Kn)o.authResponse,o.redirectUri;else{if(!(t instanceof URL)){const e=t;switch(new URL(t.url),e.method){case"GET":break;case"POST":const n=new URLSearchParams(await async function(e){if("POST"!==e.method)throw Y("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if("application/x-www-form-urlencoded"!==He(e))throw Y("form_post responses are expected to use the application/x-www-form-urlencoded content-type","ERR_INVALID_ARG_VALUE",{cause:e});return async function(e){if(e.bodyUsed)throw Y("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{cause:e});return e.text()}(e)}(e));if(h)t.hash=n.toString();else for(const[e,r]of n.entries())t.searchParams.append(e,r);break;default:throw An("unexpected Request HTTP method",mn)}}switch(function(e){return new URL(e).search="",e.hash="",e.href}(t),!0){case!!f:await f(t,null==n?void 0:n.expectedState);break;case!!h:await h(t,null==n?void 0:n.expectedNonce,null==n?void 0:n.expectedState,null==n?void 0:n.maxAge);break;case!!g:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{(function(e,t,n,r){if(ve(e),be(t),n instanceof URL&&n.searchParams,!(n instanceof URLSearchParams))throw Y('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(Et(n,"response"))throw ue('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',it,{parameters:n});const o=Et(n,"iss"),i=Et(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw ue('response parameter "iss" (issuer) missing',it,{parameters:n});if(o&&o!==e.issuer)throw ue('unexpected "iss" (issuer) response parameter value',it,{expected:e.issuer,parameters:n});switch(r){case void 0:case St:if(void 0!==i)throw ue('unexpected "state" response parameter encountered',it,{expected:void 0,parameters:n});break;case At:break;default:if(ye(r,'"expectedState" argument'),i!==r)throw ue(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',it,{expected:r,parameters:n})}if(Et(n,"error"))throw new Le("authorization response from the server is an error",{cause:n});const a=Et(n,"id_token"),s=Et(n,"token");if(void 0!==a||void 0!==s)throw new se("implicit and hybrid flows are not supported");return new URLSearchParams(n),Ye.add(c),c;var c})(s,c,t.searchParams,null==n?void 0:n.expectedState)}catch(e){bn(e)}}}const m=await async function(e,t,n,r,o,i,a){if(ve(e),be(t),!Ye.has(r))throw Y('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");ye(o,'"redirectUri"');const s=Et(r,"code");if(!s)throw ue('no authorization code in "callbackParameters"',it);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==qe&&(ye(i,'"codeVerifier"'),c.set("code_verifier",i)),Ke(e,t,n,"authorization_code",c,a)}(s,c,u,i,a,(null==n?void 0:n.pkceCodeVerifier)||qe,{additionalParameters:r,[Z]:l,[q]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(dn),signal:Hn(y)}).catch(bn);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);const E=async function(e,t,n,r){return"string"==typeof(null==r?void 0:r.expectedNonce)||"number"==typeof(null==r?void 0:r.maxAge)||null!=r&&r.requireIdToken?async function(e,t,n,r,o,i,a){const s=[];switch(r){case void 0:0;break;case Ze:break;default:ye(r,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case Qe:break;default:pe(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await Xe(e,t,n,s,i,a);ye(c.id_token,'"response" body "id_token" property',it,{body:c});const u=je(c);if(o!==Qe){const e=Se()+Ee(t),n=Ae(t);if(u.auth_time+o{let n;return"urn:ietf:params:oauth:grant-type:token-exchange"===t&&{n_a:()=>{}},async function(e,t,n,r){return Xe(e,t,n,void 0,null==r?void 0:r[ee],null==r?void 0:r.recognizedTokenTypes)}(o,i,e,{[ee]:l,recognizedTokenTypes:n})}).catch(bn);return _n(d),d}async function Fn(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;void 0!==n?new Map([...Object.entries(n),...t.entries()]):t;for(const t of r.crit){if(!i.has(t))throw new Dt('Extension Header Parameter "'.concat(t,'" is not recognized'));if(void 0===o[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(i.get(t)&&void 0===r[t])throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return new Set(r.crit)}(Ut,new Map([["b64",!0]]),null==n?void 0:n.crit,r,o);let a=!0;if(i.has("b64")&&(r.b64,"boolean"!=typeof a))throw new Ut('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Ut('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError('"'.concat("algorithms",'" option must be an array of strings'));if(t)return new Set(t)}(0,n.algorithms);if(c&&!c.has(s))throw new kt('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new Ut("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Ut("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(await t(r,e),!0),function(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,n)=>{if(!(t instanceof Uint8Array)){if(rn(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&cn(e,t,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!qt(t))throw new TypeError(Vt(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(sn(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(rn(t))switch(n){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&cn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((e=>"oct"!==e.kty&&void 0===e.d&&void 0===e.priv)(t)&&cn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!qt(t))throw new TypeError(Vt(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(sn(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw new TypeError("".concat(sn(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(sn(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw new TypeError("".concat(sn(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(sn(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}(s,t,"verify");const l=function(){for(var e=arguments.length,t=new Array(e),n=0;n{let{length:n}=t;return e+n},0),o=new Uint8Array(r);let i=0;for(const e of t)o.set(e,i),e.length;return o}(void 0!==e.protected?_t(e.protected):new Uint8Array,_t("."),"string"==typeof e.payload?a?_t(e.payload):Tt.encode(e.payload):e.payload);let d;try{Nt(e.signature)}catch(e){throw new Ut("Failed to base64url decode the signature")}const f=await async function(e,t){if(e instanceof Uint8Array)return e;if(Jt(e))return e;if(Yt(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{on||(on=new WeakMap);let n=on.get(e);if(null!=n&&n[t])return n[t];const r="public"===e.type,o=!!r;let i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}e.toCryptoKey(e.asymmetricKeyType,o,r?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError("given KeyObject instance cannot be used for this algorithm");e.toCryptoKey(e.asymmetricKeyType,o,[r?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");e.toCryptoKey(e.asymmetricKeyType,o,[r?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let n;switch(t){case"RSA-OAEP":0;break;case"RS256":case"PS256":case"RSA-OAEP-256":0;break;case"RS384":case"PS384":case"RSA-OAEP-384":0;break;case"RS512":case"PS512":case"RSA-OAEP-512":0;break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:n},o,r?["encrypt"]:["decrypt"]);e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},o,[r?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var a;const n=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null===e.asymmetricKeyDetails||void 0===a?void 0:a.namedCurve);if(!n)throw new TypeError("given KeyObject instance cannot be used for this algorithm");"ES256"===t&&"P-256"===n&&e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[r?"verify":"sign"]),"ES384"===t&&"P-384"===n&&e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[r?"verify":"sign"]),"ES512"===t&&"P-521"===n&&e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[r?"verify":"sign"]),t.startsWith("ECDH-ES")&&e.toCryptoKey({name:"ECDH",namedCurve:n},o,r?[]:["deriveBits"])}if(!i)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return n?n[t]=i:on.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return an(e,n,t)}if(rn(e))return e.k?Nt(e.k):an(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,n,r){const o=await Fn(e,t,"verify");!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if("number"!=typeof n||n<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}}(e,o);const i=function(e,t){const n="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new Dt("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}(e,o.algorithm);try{return await crypto.subtle.verify(i,o,n,r)}catch(e){return!1}}(s,f,d,l))throw new Kt;let h;if(a)try{Nt(e.payload)}catch(e){throw new Ut("Failed to base64url decode the payload")}else"string"==typeof e.payload?Tt.encode(e.payload):e.payload;const p={payload:h};return void 0!==e.protected&&(p.protectedHeader=r),void 0!==e.header&&(p.unprotectedHeader=e.header),u?K(K({},p),{},{key:f}):p}const Xn=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Vn(e){const t=Xn.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let r;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":Math.round(3600*n);break;case"day":case"days":case"d":Math.round(86400*n);break;case"week":case"weeks":case"w":Math.round(604800*n);break;default:Math.round(31557600*n)}return"-"===t[1]||"ago"===t[4]?-r:r}const Jn=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());async function Yn(e,t,n){var r;const o=await async function(e,t,n){if(e instanceof Uint8Array&&Ot.decode(e),"string"!=typeof e)throw new Ut("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:i,length:a}=e.split(".");if(3!==a)throw new Ut("Invalid Compact JWS");const s=await jn({payload:o,protected:r,signature:i},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?K(K({},c),{},{key:s.key}):c}(e,t,n);if(null!==o.protectedHeader.crit&&void 0!==r&&r.includes("b64")&&!1===o.protectedHeader.b64)throw new xt("JWTs MUST NOT use unencoded payload");const i=function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{JSON.parse(Ot.decode(t))}catch(e){}if(!zt(n))throw new xt("JWT Claims Set must be a top-level JSON object");const{typ:o}=r;if(o&&("string"!=typeof e.typ||Jn(e.typ)!==Jn(o)))throw new Lt('unexpected "typ" JWT header value',n,"typ","check_failed");const{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:u}=r,l=[...i];void 0!==u&&l.push("iat"),void 0!==c&&l.push("aud"),void 0!==s&&l.push("sub"),void 0!==a&&l.push("iss");for(const e of new Set(l.reverse()))if(!(e in n))throw new Lt('missing required "'.concat(e,'" claim'),n,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new Lt('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new Lt('unexpected "sub" claim value',n,"sub","check_failed");if(c&&!((e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e))))(n.aud,"string"==typeof c?[c]:c))throw new Lt('unexpected "aud" claim value',n,"aud","check_failed");let d;switch(typeof r.clockTolerance){case"string":Vn(r.clockTolerance);break;case"number":r.clockTolerance;break;case"undefined":0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:f}=r,h=(e=>Math.floor(e.getTime()/1e3))(f||new Date);if((void 0!==n.iat||u)&&"number"!=typeof n.iat)throw new Lt('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new Lt('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>h+d)throw new Lt('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new Lt('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=h-d)throw new Pt('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){const e=h-n.iat;if(e-d>("number"==typeof u?u:Vn(u)))throw new Pt('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-d)throw new Lt('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}(o.protectedHeader,o.payload,n),a={payload:i,protectedHeader:o.protectedHeader};return"function"==typeof t?K(K({},a),{},{key:o.key}):a}function qn(e){return zt(e)}var zn,$n,Zn=new WeakMap,Qn=new WeakMap;class er{constructor(e){if(B(this,Zn,void 0),B(this,Qn,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(qn)}(e))throw new Bt("JSON Web Key Set malformed");M(Zn,this,structuredClone(e))}jwks(){return x(Zn,this)}async getKey(e,t){const{alg:n,kid:r}=K(K({},e),null==t?void 0:t.header),o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new Dt('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=x(Zn,this).keys.filter(e=>{let t=o===e.kty;if(t&&"string"==typeof r&&r===e.kid,!t||"string"!=typeof e.alg&&"AKP"!==o||n===e.alg,t&&"string"==typeof e.use&&"sig"===e.use,t&&Array.isArray(e.key_ops)&&e.key_ops.includes("verify"),t)switch(n){case"ES256":"P-256"===e.crv;break;case"ES384":"P-384"===e.crv;break;case"ES512":"P-521"===e.crv;break;case"Ed25519":case"EdDSA":"Ed25519"===e.crv}return t}),{0:a,length:s}=i;if(0===s)throw new Mt;if(1!==s){const e=new Ht,t=x(Qn,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new F(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield D(tr(t,e,n))}catch(e){}}),e}return tr(x(Qn,this),a,n)}}async function tr(e,t,n){const r=e.get(t)||e.set(t,{}).get(t);if(void 0===r[n]){const e=await async function(e,t){if(!zt(e))throw new TypeError("JWK must be an object");let n;switch(null!=t||e.alg,null!=n||e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Nt(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new Dt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return nn(K(K({},e),{},{alg:t,ext:n}));case"AKP":if("string"!=typeof e.alg||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return nn(K(K({},e),{},{ext:n}));case"EC":case"OKP":return nn(K(K({},e),{},{alg:t,ext:n}));default:throw new Dt('Unsupported "kty" (Key Type) Parameter value')}}(K(K({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new Bt("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function nr(e){const t=new er(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let rr;if("undefined"==typeof navigator||null===(zn=navigator.userAgent)||void 0===zn||null===($n=zn.startsWith)||void 0===$n||!$n.call(zn,"Mozilla/5.0 ")){const e="v6.1.3";rr="".concat("jose","/").concat(e)}const or=Symbol(),ir=Symbol();var ar=new WeakMap,sr=new WeakMap,cr=new WeakMap,ur=new WeakMap,lr=new WeakMap,dr=new WeakMap,fr=new WeakMap,hr=new WeakMap,pr=new WeakMap,yr=new WeakMap;class wr{constructor(e,t){if(B(this,ar,void 0),B(this,sr,void 0),B(this,cr,void 0),B(this,ur,void 0),B(this,lr,void 0),B(this,dr,void 0),B(this,fr,void 0),B(this,hr,void 0),B(this,pr,void 0),B(this,yr,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var n,r;M(ar,this,new URL(e.href)),M(sr,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),M(cr,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),M(ur,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),M(fr,this,new Headers(null==t?void 0:t.headers)),rr&&!x(fr,this).has("User-Agent")&&x(fr,this).set("User-Agent",rr),x(fr,this).has("accept")||(x(fr,this).set("accept","application/json"),x(fr,this).append("accept","application/jwk-set+json")),M(hr,this,null==t?void 0:t[or]),void 0!==(null==t?void 0:t[ir])&&(M(yr,this,null==t?void 0:t[ir]),null==t?void 0:t[ir],x(ur,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=r)&&"jwks"in n&&zt(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,zt)&&(M(lr,this,x(yr,this).uat),M(pr,this,nr(x(yr,this).jwks))))}pendingFetch(){return!!x(dr,this)}coolingDown(){return"number"==typeof x(lr,this)&&Date.now()3&&void 0!==arguments[3]?arguments[3]:fetch;const o=await r(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new Gt;throw e});if(200!==o.status)throw new Ct("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new Ct("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(x(ar,this).href,x(fr,this),AbortSignal.timeout(x(sr,this)),x(hr,this)).then(e=>{M(pr,this,nr(e)),x(yr,this)&&(x(yr,this).uat=Date.now(),x(yr,this).jwks=e),M(lr,this,Date.now()),M(dr,this,void 0)}).catch(e=>{throw M(dr,this,void 0),e})),await x(dr,this)}}const gr=["mfaToken"],mr=["mfaToken"];var Er,Ar,Sr,vr,br,Rr,Tr,Or,_r=class extends Error{constructor(e,t){super(t),H(this,"code",void 0),this.name="NotSupportedError",this.code=e}},Ir=class extends Error{constructor(e,t,n){super(t),H(this,"cause",void 0),H(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Nr=class extends Ir{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Cr=class extends Ir{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Lr=class extends Ir{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Pr=class extends Ir{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},kr=class extends Ir{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Dr=class extends Error{constructor(e){super(e),H(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Ur=class extends Ir{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),H(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},xr=class extends Ir{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},Br=class extends Ir{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},Mr=class extends Ir{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},Hr=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),H(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function Gr(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>K(K({},e),{},{[t[0]]:t[1]}),{})}var Kr=class extends Error{constructor(e,t,n){super(t),H(this,"cause",void 0),H(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Wr=class extends Kr{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},Fr=class extends Kr{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},jr=class extends Kr{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},Xr=class extends Kr{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function Vr(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var Jr=(Er=new WeakMap,Ar=new WeakMap,Sr=new WeakMap,class{constructor(e){var t;B(this,Er,void 0),B(this,Ar,void 0),B(this,Sr,void 0),M(Er,this,"https://".concat(e.domain)),M(Ar,this,e.clientId),M(Sr,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(x(Er,this),"/mfa/authenticators"),{mfaToken:n}=e,r=await x(Sr,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const e=await r.json();throw new Wr(e.error_description||"Failed to list authenticators",e)}return(await r.json()).map(Vr)}async enrollAuthenticator(e){const t="".concat(x(Er,this),"/mfa/associate"),{mfaToken:n}=e,r=W(e,gr),o={authenticator_types:r.authenticatorTypes};"oobChannels"in r&&(o.oob_channels=r.oobChannels),"phoneNumber"in r&&r.phoneNumber&&(o.phone_number=r.phoneNumber),"email"in r&&r.email&&(o.email=r.email);const i=await x(Sr,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new Fr(e.error_description||"Failed to enroll authenticator",e)}return function(e){if("otp"===e.authenticator_type)return{authenticatorType:"otp",secret:e.secret,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes,id:e.id};if("oob"===e.authenticator_type)return{authenticatorType:"oob",oobChannel:e.oob_channel,oobCode:e.oob_code,bindingMethod:e.binding_method,id:e.id};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,r="".concat(x(Er,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await x(Sr,this).call(this,r,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const e=await o.json();throw new jr(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(x(Er,this),"/mfa/challenge"),{mfaToken:n}=e,r=W(e,mr),o={mfa_token:n,client_id:x(Ar,this),challenge_type:r.challengeType};r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const i=await x(Sr,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new Xr(e.error_description||"Failed to challenge authenticator",e)}return function(e){const t={challengeType:e.challenge_type};return void 0!==e.oob_code&&(t.oobCode=e.oob_code),void 0!==e.binding_method&&(t.bindingMethod=e.binding_method),t}(await i.json())}}),Yr=class e{constructor(e,t,n,r,o,i,a){H(this,"accessToken",void 0),H(this,"idToken",void 0),H(this,"refreshToken",void 0),H(this,"expiresAt",void 0),H(this,"scope",void 0),H(this,"claims",void 0),H(this,"authorizationDetails",void 0),H(this,"tokenType",void 0),H(this,"issuedTokenType",void 0),this.accessToken=e,this.idToken=n,this.refreshToken=r,this.expiresAt=t,this.scope=o,this.claims=i,this.authorizationDetails=a}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,r=new e(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return r.tokenType=t.token_type,r.issuedTokenType=t.issued_token_type,r}},qr="openid profile email offline_access",zr=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function $r(e){if(null==e)throw new kr("subject_token is required");if("string"!=typeof e)throw new kr("subject_token must be a string");if(0===e.trim().length)throw new kr("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new kr("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new kr("subject_token must not include the 'Bearer ' prefix")}function Zr(e,t){if(t)for(const[n,r]of Object.entries(t))if(!zr.has(n))if(Array.isArray(r)){if(r.length>20)throw new kr("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));r.forEach(t=>{e.append(n,t)})}else e.append(n,r)}vr=new WeakMap,br=new WeakMap,Rr=new WeakMap,Tr=new WeakMap,Or=new WeakSet;async function Qr(){if(x(vr,this)&&x(br,this))return{configuration:x(vr,this),serverMetadata:x(br,this)};const e=await k(Or,this,no).call(this);return M(vr,this,await Rn(new URL("https://".concat(x(Rr,this).domain)),x(Rr,this).clientId,{use_mtls_endpoint_aliases:x(Rr,this).useMtls},e,{[gn]:x(Rr,this).customFetch})),M(br,this,x(vr,this).serverMetadata()),x(vr,this)[gn]=x(Rr,this).customFetch||fetch,{configuration:x(vr,this),serverMetadata:x(br,this)}}async function eo(e){var t,n;const{configuration:r}=await k(Or,this,Qr).call(this);if("audience"in e||"resource"in e)throw new kr("audience and resource parameters are not supported for Token Vault exchanges");$r(e.subjectToken);const o=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==e.subjectTokenType&&void 0!==t?t:"urn:ietf:params:oauth:token-type:access_token",requested_token_type:null!==e.requestedTokenType&&void 0!==n?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&o.append("login_hint",e.loginHint),e.scope&&o.append("scope",e.scope),Zr(o,e.extra);try{const e=await Wn(r,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return Yr.fromTokenEndpointResponse(e)}catch(t){throw new kr("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function to(e){const{configuration:t}=await k(Or,this,Qr).call(this);$r(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),Zr(n,e.extra);try{const e=await Wn(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return Yr.fromTokenEndpointResponse(e)}catch(t){throw new kr("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function no(){if(!x(Rr,this).clientSecret&&!x(Rr,this).clientAssertionSigningKey&&!x(Rr,this).useMtls)throw new Hr;if(x(Rr,this).useMtls)return(e,t,n,r)=>{n.set("client_id",t.client_id)};let e=x(Rr,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||await async function(e,t){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return tn(e,t,void 0)}(e,x(Rr,this).clientAssertionSigningAlg||"RS256"),e?function(e){return Te(e,void 0)}(e):wn(x(Rr,this).clientSecret)}async function ro(e){const{configuration:t}=await k(Or,this,Qr).call(this),n=ge(),r=await function(e){return async function(e){return ye(e,"codeVerifier"),ae(await crypto.subtle.digest("SHA-256",re(e)))}(e)}(n),o=Gr(K(K({},x(Rr,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(K(K({scope:qr},o),{},{client_id:x(Rr,this).clientId,code_challenge:r,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Bn(t,i):await xn(t,i),codeVerifier:n}}new O;function oo(e,t){return function(){return e.apply(t,arguments)}}const{toString:io}=Object.prototype,{getPrototypeOf:ao}=Object,{iterator:so,toStringTag:co}=Symbol,uo=(lo=Object.create(null),e=>{const t=io.call(e);return lo[t]||(lo[t]=t.slice(8,-1).toLowerCase())});var lo;const fo=e=>(e=e.toLowerCase(),t=>uo(t)===e),ho=e=>t=>typeof t===e,{isArray:po}=Array,yo=ho("undefined");function wo(e){return null!==e&&!yo(e)&&null!==e.constructor&&!yo(e.constructor)&&Eo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const go=fo("ArrayBuffer");const mo=ho("string"),Eo=ho("function"),Ao=ho("number"),So=e=>null!==e&&"object"==typeof e,vo=e=>{if("object"!==uo(e))return!1;const t=ao(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||co in e||so in e)},bo=fo("Date"),Ro=fo("File"),To=fo("Blob"),Oo=fo("FileList"),_o=fo("URLSearchParams"),[Io,No,Co,Lo]=["ReadableStream","Request","Response","Headers"].map(fo);function Po(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),po(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Do="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Uo=e=>!yo(e)&&e!==Do;const xo=(Bo="undefined"!=typeof Uint8Array&&ao(Uint8Array),e=>Bo&&e instanceof Bo);var Bo;const Mo=fo("HTMLFormElement"),Ho=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Go=fo("RegExp"),Ko=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Po(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Wo=fo("AsyncFunction"),Fo=(jo="function"==typeof setImmediate,Xo=Eo(Do.postMessage),jo?setImmediate:Xo?(Vo=`axios@${Math.random()}`,Jo=[],Do.addEventListener("message",({source:e,data:t})=>{e===Do&&t===Vo&&Jo.length&&Jo.shift()()},!1),e=>{Jo.push(e),Do.postMessage(Vo,"*")}):e=>setTimeout(e));var jo,Xo,Vo,Jo;const Yo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Do):"undefined"!=typeof process&&process.nextTick||Fo,qo={isArray:po,isArrayBuffer:go,isBuffer:wo,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Eo(e.append)&&("formdata"===(t=uo(e))||"object"===t&&Eo(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&go(e.buffer),t},isString:mo,isNumber:Ao,isBoolean:e=>!0===e||!1===e,isObject:So,isPlainObject:vo,isEmptyObject:e=>{if(!So(e)||wo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Io,isRequest:No,isResponse:Co,isHeaders:Lo,isUndefined:yo,isDate:bo,isFile:Ro,isBlob:To,isRegExp:Go,isFunction:Eo,isStream:e=>So(e)&&Eo(e.pipe),isURLSearchParams:_o,isTypedArray:xo,isFileList:Oo,forEach:Po,merge:function e(){const{caseless:t,skipUndefined:n}=Uo(this)&&this||{},r={},o=(o,i)=>{const a=t&&ko(r,i)||i;vo(r[a])&&vo(o)?r[a]=e(r[a],o):vo(o)?r[a]=e({},o):po(o)?r[a]=o.slice():n&&yo(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(Po(t,(t,r)=>{n&&Eo(t)?Object.defineProperty(e,r,{value:oo(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&ao(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:uo,kindOfTest:fo,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(po(e))return e;let t=e.length;if(!Ao(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[so]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Mo,hasOwnProperty:Ho,hasOwnProp:Ho,reduceDescriptors:Ko,freezeMethods:e=>{Ko(e,(t,n)=>{if(Eo(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Eo(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return po(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ko,global:Do,isContextDefined:Uo,isSpecCompliantForm:function(e){return!!(e&&Eo(e.append)&&"FormData"===e[co]&&e[so])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(So(e)){if(t.indexOf(e)>=0)return;if(wo(e))return e;if(!("toJSON"in e)){t[r]=e;const o=po(e)?[]:{};return Po(e,(e,t)=>{const i=n(e,r+1);!yo(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Wo,isThenable:e=>e&&(So(e)||Eo(e))&&Eo(e.then)&&Eo(e.catch),setImmediate:Fo,asap:Yo,isIterable:e=>null!=e&&Eo(e[so])};class zo extends Error{static from(e,t,n,r,o,i){const a=new zo(e.message,t||e.code,n,r,o);return a.cause=e,a.name=e.name,i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:qo.toJSONObject(this.config),code:this.code,status:this.status}}}zo.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",zo.ERR_BAD_OPTION="ERR_BAD_OPTION",zo.ECONNABORTED="ECONNABORTED",zo.ETIMEDOUT="ETIMEDOUT",zo.ERR_NETWORK="ERR_NETWORK",zo.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",zo.ERR_DEPRECATED="ERR_DEPRECATED",zo.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",zo.ERR_BAD_REQUEST="ERR_BAD_REQUEST",zo.ERR_CANCELED="ERR_CANCELED",zo.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",zo.ERR_INVALID_URL="ERR_INVALID_URL";const $o=zo;var Zo=n(8287).hp;function Qo(e){return qo.isPlainObject(e)||qo.isArray(e)}function ei(e){return qo.endsWith(e,"[]")?e.slice(0,-2):e}function ti(e,t,n){return e?e.concat(t).map(function(e,t){return e=ei(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ni=qo.toFlatObject(qo,{},null,function(e){return/^is[A-Z]/.test(e)});const ri=function(e,t,n){if(!qo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=qo.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!qo.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&qo.isSpecCompliantForm(t);if(!qo.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(qo.isDate(e))return e.toISOString();if(qo.isBoolean(e))return e.toString();if(!s&&qo.isBlob(e))throw new $o("Blob is not supported. Use a Buffer instead.");return qo.isArrayBuffer(e)||qo.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Zo.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(qo.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(qo.isArray(e)&&function(e){return qo.isArray(e)&&!e.some(Qo)}(e)||(qo.isFileList(e)||qo.endsWith(n,"[]"))&&(s=qo.toArray(e)))return n=ei(n),s.forEach(function(e,r){!qo.isUndefined(e)&&null!==e&&t.append(!0===a?ti([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!Qo(e)||(t.append(ti(o,n,i),c(e)),!1)}const l=[],d=Object.assign(ni,{defaultVisitor:u,convertValue:c,isVisitable:Qo});if(!qo.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!qo.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),qo.forEach(n,function(n,i){!0===(!(qo.isUndefined(n)||null===n)&&o.call(t,n,qo.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function oi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ii(e,t){this._pairs=[],e&&ri(e,this,t)}const ai=ii.prototype;ai.append=function(e,t){this._pairs.push([e,t])},ai.toString=function(e){const t=e?function(t){return e.call(this,t,oi)}:oi;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const si=ii;function ci(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ui(e,t,n){if(!t)return e;const r=n&&n.encode||ci,o=qo.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):qo.isURLSearchParams(t)?t.toString():new si(t,o).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const li=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){qo.forEach(this.handlers,function(t){null!==t&&e(t)})}},di={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:si,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},hi="undefined"!=typeof window&&"undefined"!=typeof document,pi="object"==typeof navigator&&navigator||void 0,yi=hi&&(!pi||["ReactNative","NativeScript","NS"].indexOf(pi.product)<0),wi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,gi=hi&&window.location.href||"http://localhost",mi={...e,...fi};const Ei=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&qo.isArray(r)?r.length:i,s)return qo.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&qo.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&qo.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return qo.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const Ai={transitional:di,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=qo.isObject(e);o&&qo.isHTMLForm(e)&&(e=new FormData(e));if(qo.isFormData(e))return r?JSON.stringify(Ei(e)):e;if(qo.isArrayBuffer(e)||qo.isBuffer(e)||qo.isStream(e)||qo.isFile(e)||qo.isBlob(e)||qo.isReadableStream(e))return e;if(qo.isArrayBufferView(e))return e.buffer;if(qo.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ri(e,new mi.classes.URLSearchParams,{visitor:function(e,t,n,r){return mi.isNode&&qo.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=qo.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ri(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(qo.isString(e))try{return(t||JSON.parse)(e),qo.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ai.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(qo.isResponse(e)||qo.isReadableStream(e))return e;if(e&&qo.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw $o.from(e,$o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mi.classes.FormData,Blob:mi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};qo.forEach(["delete","get","head","post","put","patch"],e=>{Ai.headers[e]={}});const Si=Ai,vi=qo.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bi=Symbol("internals");function Ri(e){return e&&String(e).trim().toLowerCase()}function Ti(e){return!1===e||null==e?e:qo.isArray(e)?e.map(Ti):String(e)}function Oi(e,t,n,r,o){return qo.isFunction(r)?r.call(this,t,n):(o&&(t=n),qo.isString(t)?qo.isString(r)?-1!==t.indexOf(r):qo.isRegExp(r)?r.test(t):void 0:void 0)}class _i{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ri(t);if(!o)throw new Error("header name must be a non-empty string");const i=qo.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ti(e))}const i=(e,t)=>qo.forEach(e,(e,n)=>o(e,n,t));if(qo.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(qo.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&vi[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(qo.isObject(e)&&qo.isIterable(e)){let n,r,o={};for(const t of e){if(!qo.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?qo.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Ri(e)){const n=qo.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(qo.isFunction(t))return t.call(this,e,n);if(qo.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ri(e)){const n=qo.findKey(this,e);return!(!n||void 0===this[n]||t&&!Oi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ri(e)){const o=qo.findKey(n,e);!o||t&&!Oi(0,n[o],o,t)||(delete n[o],r=!0)}}return qo.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Oi(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return qo.forEach(this,(r,o)=>{const i=qo.findKey(n,o);if(i)return t[i]=Ti(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=Ti(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return qo.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&qo.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[bi]=this[bi]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ri(e);t[r]||(!function(e,t){const n=qo.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return qo.isArray(e)?e.forEach(r):r(e),this}}_i.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),qo.reduceDescriptors(_i.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),qo.freezeMethods(_i);const Ii=_i;function Ni(e,t){const n=this||Si,r=t||n,o=Ii.from(r.headers);let i=r.data;return qo.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ci(e){return!(!e||!e.__CANCEL__)}const Li=class extends $o{constructor(e,t,n){super(null==e?"canceled":e,$o.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Pi(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new $o("Request failed with status code "+n.status,[$o.ERR_BAD_REQUEST,$o.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const ki=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[a];o||(o=c),n[i]=s,r[i]=c;let l=a,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]},Ui=(e,t,n=3)=>{let r=0;const o=ki(50,250);return Di(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,c=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},xi=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Bi=e=>(...t)=>qo.asap(()=>e(...t)),Mi=mi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,mi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(mi.origin),mi.navigator&&/(msie|trident)/i.test(mi.navigator.userAgent)):()=>!0,Hi=mi.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];qo.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),qo.isString(r)&&s.push(`path=${r}`),qo.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),qo.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Gi(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ki=e=>e instanceof Ii?{...e}:e;function Wi(e,t){t=t||{};const n={};function r(e,t,n,r){return qo.isPlainObject(e)&&qo.isPlainObject(t)?qo.merge.call({caseless:r},e,t):qo.isPlainObject(t)?qo.merge({},t):qo.isArray(t)?t.slice():t}function o(e,t,n,o){return qo.isUndefined(t)?qo.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!qo.isUndefined(t))return r(void 0,t)}function a(e,t){return qo.isUndefined(t)?qo.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(Ki(e),Ki(t),0,!0)};return qo.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,a=i(e[r],t[r],r);qo.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Fi=e=>{const t=Wi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Ii.from(a),t.url=ui(Gi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),qo.isFormData(n))if(mi.hasStandardBrowserEnv||mi.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(qo.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(mi.hasStandardBrowserEnv&&(r&&qo.isFunction(r)&&(r=r(t)),r||!1!==r&&Mi(t.url))){const e=o&&i&&Hi.read(i);e&&a.set(o,e)}return t},ji="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Fi(e);let o=r.data;const i=Ii.from(r.headers).normalize();let a,s,c,u,l,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function w(){if(!y)return;const r=Ii.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Pi(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(w)},y.onabort=function(){y&&(n(new $o("Request aborted",$o.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new $o(r,$o.ERR_NETWORK,e,y);o.event=t||null,n(o),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||di;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new $o(t,o.clarifyTimeoutError?$o.ETIMEDOUT:$o.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&qo.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),qo.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),h&&([c,l]=Ui(h,!0),y.addEventListener("progress",c)),f&&y.upload&&([s,u]=Ui(f),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Li(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===mi.protocols.indexOf(g)?n(new $o("Unsupported protocol "+g+":",$o.ERR_BAD_REQUEST,e)):y.send(o||null)})},Xi=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof $o?t:new Li(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new $o(`timeout of ${t}ms exceeded`,$o.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>qo.asap(a),s}},Vi=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Ji(e))yield*Vi(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:qi}=qo,zi=(({Request:e,Response:t})=>({Request:e,Response:t}))(qo.global),{ReadableStream:$i,TextEncoder:Zi}=qo.global,Qi=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ea=e=>{e=qo.merge.call({skipUndefined:!0},zi,e);const{fetch:t,Request:n,Response:r}=e,o=t?qi(t):"function"==typeof fetch,i=qi(n),a=qi(r);if(!o)return!1;const s=o&&qi($i),c=o&&("function"==typeof Zi?(u=new Zi,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Qi(()=>{let e=!1;const t=new n(mi.origin,{body:new $i,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&Qi(()=>qo.isReadableStream(new r("").body)),f={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new $o(`Response type '${e}' is not supported`,$o.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=qo.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(qo.isBlob(e))return e.size;if(qo.isSpecCompliantForm(e)){const t=new n(mi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return qo.isArrayBufferView(e)||qo.isArrayBuffer(e)?e.byteLength:(qo.isURLSearchParams(e)&&(e+=""),qo.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:u,timeout:p,onDownloadProgress:y,onUploadProgress:w,responseType:g,headers:m,withCredentials:E="same-origin",fetchOptions:A}=Fi(e),S=t||fetch;g=g?(g+"").toLowerCase():"text";let v=Xi([c,u&&u.toAbortSignal()],p),b=null;const R=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let T;try{if(w&&l&&"get"!==a&&"head"!==a&&0!==(T=await h(m,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(qo.isFormData(s)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,n]=xi(T,Ui(Bi(w)));s=Yi(t.body,65536,e,n)}}qo.isString(E)||(E=E?"include":"omit");const t=i&&"credentials"in n.prototype,c={...A,signal:v,method:a.toUpperCase(),headers:m.normalize().toJSON(),body:s,duplex:"half",credentials:t?E:void 0};b=i&&new n(o,c);let u=await(i?S(b,A):S(o,c));const p=d&&("stream"===g||"response"===g);if(d&&(y||p&&R)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=qo.toFiniteNumber(u.headers.get("content-length")),[n,o]=y&&xi(t,Ui(Bi(y),!0))||[];u=new r(Yi(u.body,65536,n,()=>{o&&o(),R&&R()}),e)}g=g||"text";let O=await f[qo.findKey(f,g)||"text"](u,e);return!p&&R&&R(),await new Promise((t,n)=>{Pi(t,n,{data:O,headers:Ii.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:b})})}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $o("Network Error",$o.ERR_NETWORK,e,b),{cause:t.cause||t});throw $o.from(t,t&&t.code,e,b)}}},ta=new Map,na=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,c=i.length,u=ta;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:ea(t)),u=s;return s},ra=(na(),{http:null,xhr:ji,fetch:{get:na}});qo.forEach(ra,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const oa=e=>`- ${e}`,ia=e=>qo.isFunction(e)||null===e||!1===e;const aa={getAdapter:function(e,t){e=qo.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(oa).join("\n"):" "+oa(e[0]):"as no adapter specified";throw new $o("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:ra};function sa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Li(null,e)}function ca(e){sa(e),e.headers=Ii.from(e.headers),e.data=Ni.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return aa.getAdapter(e.adapter||Si.adapter,e)(e).then(function(t){return sa(e),t.data=Ni.call(e,e.transformResponse,t),t.headers=Ii.from(t.headers),t},function(t){return Ci(t)||(sa(e),t&&t.response&&(t.response.data=Ni.call(e,e.transformResponse,t.response),t.response.headers=Ii.from(t.response.headers))),Promise.reject(t)})}const ua="1.13.4",la={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{la[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const da={};la.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ua+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new $o(r(o," has been removed"+(t?" in "+t:"")),$o.ERR_DEPRECATED);return t&&!da[o]&&(da[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},la.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const fa={assertOptions:function(e,t,n){if("object"!=typeof e)throw new $o("options must be an object",$o.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new $o("option "+i+" must be "+n,$o.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new $o("Unknown option "+i,$o.ERR_BAD_OPTION)}},validators:la},ha=fa.validators;class pa{constructor(e){this.defaults=e||{},this.interceptors={request:new li,response:new li}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Wi(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&fa.assertOptions(n,{silentJSONParsing:ha.transitional(ha.boolean),forcedJSONParsing:ha.transitional(ha.boolean),clarifyTimeoutError:ha.transitional(ha.boolean)},!1),null!=r&&(qo.isFunction(r)?t.paramsSerializer={serialize:r}:fa.assertOptions(r,{encode:ha.function,serialize:ha.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),fa.assertOptions(t,{baseUrl:ha.spelling("baseURL"),withXsrfToken:ha.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&qo.merge(o.common,o[t.method]);o&&qo.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ii.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,d=0;if(!s){const e=[ca.bind(this),void 0];for(e.unshift(...a),e.push(...c),l=e.length,u=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Li(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new wa(function(t){e=t});return{token:t,cancel:e}}}const ga=wa;const ma={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ma).forEach(([e,t])=>{ma[t]=e});const Ea=ma;const Aa=function e(t){const n=new ya(t),r=oo(ya.prototype.request,n);return qo.extend(r,ya.prototype,n,{allOwnKeys:!0}),qo.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Wi(t,n))},r}(Si);Aa.Axios=ya,Aa.CanceledError=Li,Aa.CancelToken=ga,Aa.isCancel=Ci,Aa.VERSION=ua,Aa.toFormData=ri,Aa.AxiosError=$o,Aa.Cancel=Aa.CanceledError,Aa.all=function(e){return Promise.all(e)},Aa.spread=function(e){return function(t){return e.apply(null,t)}},Aa.isAxiosError=function(e){return qo.isObject(e)&&!0===e.isAxiosError},Aa.mergeConfig=Wi,Aa.AxiosHeaders=Ii,Aa.formToJSON=e=>Ei(qo.isHTMLForm(e)?new FormData(e):e),Aa.getAdapter=aa.getAdapter,Aa.HttpStatusCode=Ea,Aa.default=Aa;var Sa=n(3612);const va={log:function(){if(Sa.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),50)}})},ka=function(){var e=r(l.mark(function e(t){var n,r,o;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Pa();case 1:return va.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",va.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return va.log("Utils dataLayerLoop: look for this element ",e),e[t]?(va.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(va.log("Utils dataLayerLoop: dataLayer search ",!1),!1)},o=window.dataLayer.some(r),e.abrupt("return",o?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Da=function(){var e=r(l.mark(function e(){var t,n,r=arguments;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Page Type",e.next=1,ka(t);case 1:return n=e.sent,va.log("utils | pageType: page type is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ua=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(va.log("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(va.log("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};va.log("utils | Event: authentication ready: ",r),e(r)}catch(e){va.log(e),t(e)}},!1))})},xa=function(){var e=r(l.mark(function e(){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){return Sa.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(va.log("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(n){try{var r=n.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,va.log("Received entitlementsReady event:",r),e(r)}catch(e){va.error("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(va.log("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ba=function(e){va.log("starting simpleEmailValidation");if(!e)return{valid:!1,message:"Please enter an email."};if(!/^(([^<>()[\]\\.,;:\s@']+(\.[^<>()[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(e))return{valid:!1,message:"Please enter a valid email."};var t=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),n=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(t);return va.log("simpleEmailValidation: ","TLD search ".concat(n)),!1===n?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex(function(t){return t===e.split("@")[1]})?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=Ba;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Ma=function(){var e=r(l.mark(function e(){var t,n,r=arguments;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Content ID",e.next=1,ka(t);case 1:return n=e.sent,va.log("utils | contentId: Content ID is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ha=function(){var e=r(l.mark(function e(){var t,n,r=arguments;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Section",e.next=1,ka(t);case 1:return n=e.sent,va.log("utils | section: Section is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ga=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var o={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},i=function(){var i=r(l.mark(function r(){var i,a,s,c,u,d,f,h,p,y,w;return l.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"1"!==(null===(i=window.sophi_config)||void 0===i?void 0:i.enableSophiSSPW)){r.next=1;break}if(!document.getElementById("server-paywall")){r.next=1;break}return o.sspw=!0,r.abrupt("return",t({paywall:!0,details:Oa({},o)}));case 1:return r.next=2,Da();case 2:return s=r.sent,r.next=3,ka("Paywall_Level");case 3:if(c=r.sent,"article"===s&&"free"!==c){r.next=4;break}return r.abrupt("return",t({paywall:!1,details:"article"!==s?"Page type is not an article":"Free article"}));case 4:return r.next=5,xa();case 5:if(!(u=r.sent)||!u.isEntitled){r.next=6;break}return r.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==c){r.next=7;break}return r.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(d=null===(a=window.ConnextUtils)||void 0===a?void 0:a.runningSophi,va.log("checkPaywallStatus - Sophi is running: ",d),!d){r.next=8;break}window.ConnextUtils.connextAlreadyRan&&window.sophiWallConfig&&!window.sophiWallConfig.error&&"paywall"===window.sophiWallConfig.wallType?(o.sophiClient=!0,o.engageStatus=!0,o.engagePaywall=!0):window.addEventListener("onPaywallShown",function(){return"paywall"===window.sophiWallConfig.wallType&&(o.sophiClient=!0),t({paywall:!0,details:Oa({},o)})},{once:!0}),r.next=12;break;case 8:if(d){r.next=12;break}return f=window.ConnextUtils.connextReady("onPaywallShown",!1),h=new Promise(function(t,n){return setTimeout(function(){return n(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),r.prev=9,r.next=10,Promise.race([f,h]);case 10:!0===(p=r.sent)?(o.engagePaywall=!0,o.engageStatus="Engage paywall detected"):(o.engagePaywall=!1,o.engageStatus="Engage response: ".concat(p)),r.next=12;break;case 11:r.prev=11,y=r.catch(9),o.engagePaywall=!1,o.engageStatus="Engage response: ".concat(y);case 12:return r.abrupt("return",t({paywall:Object.values(o).some(function(e){return e}),details:Oa({},o)}));case 13:r.prev=13,w=r.catch(0),n(w);case 14:case"end":return r.stop()}},r,null,[[0,13],[9,11]])}));return function(){return i.apply(this,arguments)}}();i()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=Ga);var Ka=function(){return c(function e(){var t,n,r,i,a,s;o(this,e),u(this,"simpleHostname",void 0),u(this,"sophiHostname",void 0),u(this,"sophiCallStartTime",void 0),u(this,"section",void 0),u(this,"contentId",void 0),u(this,"visitorType",void 0),this.simpleHostname=Ca();var c=window.location.hostname;""!==window.sophi_config.sophiHostname?this.sophiHostname=window.sophi_config.sophiHostname:this.sophiHostname=c,this.onDeviceEnabled=!(null===(t=window.authentication_config)||void 0===t||!t.sophiOnDevice)&&"1"===(null===(n=window.authentication_config)||void 0===n?void 0:n.sophiOnDevice),this.sdkEnabled=!(null===(r=window.authentication_config)||void 0===r||!r.sophiSDKEnabled)&&"1"===(null===(i=window.authentication_config)||void 0===i?void 0:i.sophiSDKEnabled),this.useEventListener=!(null===(a=window.sophi_config)||void 0===a||!a.useEventListener)&&(this.sdkEnabled&&"1"===(null===(s=window.sophi_config)||void 0===s?void 0:s.useEventListener)),this.log("site settings: onDeviceEnabled = ".concat(this.onDeviceEnabled,", sdkEnabled = ").concat(this.sdkEnabled))},[{key:"init",value:(s=r(l.mark(function e(){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.log("Starting normal SDK flow."),this.sdkEnabled){e.next=1;break}return e.abrupt("return");case 1:return e.next=2,this.setupSophiDecision();case 2:if(!e.sent){e.next=3;break}return e.next=3,this.makeSophiCall();case 3:case"end":return e.stop()}},e,this)})),function(){return s.apply(this,arguments)})},{key:"waitForSophiReady",value:(a=r(l.mark(function e(){var t=this;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.useEventListener){e.next=1;break}return this.log("Not using AB test listener, will call Sophi decision directly."),e.abrupt("return",!1);case 1:return e.abrupt("return",new Promise(function(e){window.addEventListener("sophi.abTests:ready",r(l.mark(function n(){var r,o;return l.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(null===(r=window.sophi)||void 0===r||!r.abTests||"function"!=typeof window.sophi.abTests.getAllExperiments){n.next=2;break}return n.next=1,window.sophi.abTests.getAllExperiments();case 1:o=n.sent,e(o);case 2:t.log("AB Tests loaded successfully!"),e(!1);case 3:case"end":return n.stop()}},n)}))),t.log("Added A/B test listener...")}));case 2:case"end":return e.stop()}},e,this)})),function(){return a.apply(this,arguments)})},{key:"getVisitorType",value:(i=r(l.mark(function e(){var t,n,r;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t="anonymous",e.prev=1,e.next=2,xa();case 2:"isEntitled"in(n=e.sent)&&(t=n.isEntitled?"subscriber":"registered"),"yes"===window.localStorage.getItem("sophiRegiliteUser")&&"anonymous"===t&&(this.log("User is regilite and anonymous. Setting to registered."),t="registered"),e.next=4;break;case 3:e.prev=3,r=e.catch(1),this.error("Unable to determine visitorType Using",t,r);case 4:return window.sophiUserType=t,this.log("visitorType is",t),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"setupSophiDecision",value:(n=r(l.mark(function e(){var t,n,r,o,i,a,s,c=this;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!0,n=!1,e.prev=1,!this.useEventListener){e.next=5;break}return e.next=2,this.waitForSophiReady();case 2:if(t=e.sent,!(!this.onDeviceEnabled&&!t||t&&t.length<1)){e.next=3;break}return this.log("experiments variable was not in the expected format.",t),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 3:if(t){e.next=4;break}return this.log("window.sophi.abTests.getAllExperiments is not available"),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 4:n=null===(r=t[0])||void 0===r?void 0:r.assignedGroup,this.log("onSuccess callback:",n);case 5:if(o=function(e){console.error("onError callback, rerunning Connext if silent:",e),c.rerunConnextIfIsSilent()},i=this.section){e.next=7;break}return e.next=6,Ha();case 6:i=e.sent;case 7:return this.section=i,e.prev=8,e.next=9,this.getVisitorType();case 9:if(this.visitorType=e.sent,!(this.useEventListener&&"control"===n||"subscriber"===this.visitorType)){e.next=10;break}return this.log("User is in ".concat(n,", and is ").concat(this.visitorType,". Ending sophi flow.")),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 10:return e.next=11,Da();case 11:if("article"===e.sent){e.next=12;break}return this.log("Page type was not article, returning."),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 12:return e.next=13,Pa();case 13:return this.useEventListener&&(window.dataLayer.push({event:"sophi_cookie",sophi_type:"".concat(this.simpleHostname,"UserIsInVariantOrHoldout"),sophi_cookie_val:n}),window.sophiCookie=n),e.next=14,Ma();case 14:return this.contentId=e.sent,this.log("Content ID ",this.contentId),e.abrupt("return",!0);case 15:return e.prev=15,a=e.catch(8),o(a),e.abrupt("return",!1);case 16:return e.prev=16,s=e.catch(1),this.log("Event listener",s),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 17:case"end":return e.stop()}},e,this,[[1,16],[8,15]])})),function(){return n.apply(this,arguments)})},{key:"rerunConnextIfIsSilent",value:(t=r(l.mark(function e(){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.log("About to call rerunConnextEntitlements."),e.next=1,window.ConnextUtils.rerunConnextEntitlements(!1,!1);case 1:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"handleSophiResponse",value:function(e){var t=Date.now()-this.sophiCallStartTime;this.log("response with response time of ".concat(t," ms: "),e),delete e.trace;var n="";this.useEventListener||(n=window.sophi.dataLayer.assignedGroup,window.sophiCookie=n),(!this.useEventListener&&"variant"===n||this.useEventListener)&&(window.dataLayer.push({event:"sophi_decision",sophi_type:"getDecision",sophi_time:t,sophi_response:JSON.stringify(e)}),window.sophiWallConfig=e),this.rerunConnextIfIsSilent()}},{key:"makeSophiCall",value:(e=r(l.mark(function e(){var t=this;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){var n;try{var r=window.sophi.paywall.init({hostname:t.sophiHostname,getContentId:Ma});if(t.log("2.0 SDK init complete: ",r),!window.sophi.paywall)return t.log("window.sophi.paywall was undefined. About to run Connext"),void t.rerunConnextIfIsSilent();t.useEventListener&&(window.dataLayer.push({event:"sophi_cookie",sophi_type:"beforeSDKCall",sophi_cookie_val:window.sophiCookie}),t.log("about to call SDK, cookie is ".concat(window.sophiCookie))),t.sophiCallStartTime=Date.now()}catch(e){t.log("logic error 1",e),t.rerunConnextIfIsSilent()}var o=4e3;""!==(null===(n=window.sophi_config)||void 0===n?void 0:n.sophiGetDesicionTimer)&&"number"!=typeof window.sophi_config.sophiGetDesicionTimer&&(o=parseInt(window.sophi_config.sophiGetDesicionTimer,10)),t.log("timer is equal to: ",o),window.sophi.paywall.getDecision({contentId:t.contentId,section:t.section,visitor:t.visitorType,timeout:o}).then(function(n){t.handleSophiResponse(n),e()}).catch(function(n){var r=Date.now()-t.sophiCallStartTime;t.log("error sdk, response time of ".concat(r," ms: "),n),window.dataLayer.push({event:"sophi_error",sophi_time:r,sophi_err_msg:n}),t.rerunConnextIfIsSilent(),e()})}));case 1:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)})},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n