(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;npi,hasStandardBrowserEnv:()=>wi,hasStandardBrowserWebWorkerEnv:()=>gi,navigator:()=>yi,origin:()=>mi});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;O=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;re=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 J("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 J("".concat(n," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",o);return}throw J("".concat(n," must be a positive number"),"ERR_INVALID_ARG_VALUE",o)}catch(e){if(r)throw ce(e.message,r,o);throw e}}function pe(e,t,n,r){try{if("string"!=typeof e)throw J("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",r);if(0===e.length)throw J("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",r)}catch(e){if(n)throw ce(e.message,n,r);throw e}}function ye(e){!function(e,t){if(Me(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 ce(t,it,e)}(e,t)}(e,"application/json")}function we(){return ie(crypto.getRandomValues(new Uint8Array(32)))}function ge(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 ae("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 ae("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 ae("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 ae("unsupported CryptoKey algorithm name",{cause:e})}}function me(e){const t=null==e?void 0:e[q];return"number"==typeof t&&Number.isFinite(t)?t:0}function Ee(e){const t=null==e?void 0:e[z];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Ae(){return Math.floor(Date.now()/1e3)}function Se(e){if("object"!=typeof e||null===e)throw J('"as" must be an object',"ERR_INVALID_ARG_TYPE");pe(e.issuer,'"as.issuer"')}function ve(e){if("object"!=typeof e||null===e)throw J('"client" must be an object',"ERR_INVALID_ARG_TYPE");pe(e.client_id,'"client.client_id"')}function be(e){return pe(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function Re(e,t){const{key:n,kid:r}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&pe(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw J("".concat(t," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),"private"!==e.type)throw J("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}(n,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:ge(n),kid:r},u=function(e,t){const n=Ae()+me(t);return{jti:we(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[Z]||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 J('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const r="".concat(ie(ne(JSON.stringify(e))),".").concat(ie(ne(JSON.stringify(t)))),o=ie(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:wt(e)};case"RSA-PSS":switch(yt(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 ae("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return yt(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new ae("unsupported CryptoKey algorithm name",{cause:e})}(n),n,ne(r)));return"".concat(r,".").concat(o)}(c,u,n))}}const Te=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function Oe(e,t){if(t&&"https:"!==e.protocol)throw ce("only requests to HTTPS are allowed",st,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw ce("only HTTP and HTTPS requests are allowed",ct,e)}function _e(e,t,n,r){let o;if("string"!=typeof e||!Te(e))throw ce("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?ft:ht,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return Oe(o,r),o}function Ie(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?_e(e.mtls_endpoint_aliases[t],t,n,r):_e(e[t],t,n,r)}class Ne extends Error{constructor(e,t){var n;super(e,t),M(this,"cause",void 0),M(this,"code",void 0),M(this,"error",void 0),M(this,"status",void 0),M(this,"error_description",void 0),M(this,"response",void 0),this.name=this.constructor.name,this.code=et,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 Ce extends Error{constructor(e,t){var n,r;super(e,t),M(this,"cause",void 0),M(this,"code",void 0),M(this,"error",void 0),M(this,"error_description",void 0),this.name=this.constructor.name,this.code=nt,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 Le extends Error{constructor(e,t){var n;super(e,t),M(this,"cause",void 0),M(this,"code",void 0),M(this,"response",void 0),M(this,"status",void 0),this.name=this.constructor.name,this.code=Qe,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 Pe=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),ke=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),De=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),Ue=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function xe(e,t,n){if(e.status!==t){let t;var r;if(function(e){let t;if(function(e){if(!V(e,Response))throw J('"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(Pe);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(ke)){if([,n,o,r]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}u[n.toLowerCase()]=o}else{if(!r.match(De)){if(r.match(Ue)){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 Le("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){pt(e),ye(e);try{const t=await e.clone().json();if(ue(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 Ne("server responded with an error in the response body",{cause:t,response:e});throw ce('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),at,e)}}function Be(e){if(!Je.has(e))throw J('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function Me(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function He(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[$])||fetch)(r.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:de(r,null==a?void 0:a.signal)})}async function Ge(e,t,n,r,o,i){var a;const s=Ie(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[Y]));o.set("grant_type",r);const c=le(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(Be(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await He(e,t,n,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(u,s),u}const Ke=new WeakMap,We=new WeakMap;function Fe(e){if(!e.id_token)return;const t=Ke.get(e);if(!t)throw J('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function je(e,t,n,r,o,i){if(Se(e),ve(t),!V(n,Response))throw J('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await xe(n,200,"Token Endpoint"),pt(n);const a=await St(n);if(pe(a.access_token,'"response" body "access_token" property',ot,{body:a}),pe(a.token_type,'"response" body "token_type" property',ot,{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;he(e,!0,'"response" body "expires_in" property',ot,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&pe(a.refresh_token,'"response" body "refresh_token" property',ot,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw ce('"response" body "scope" property must be a string',ot,{body:a});if(void 0!==a.id_token){pe(a.id_token,'"response" body "id_token" property',ot,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(he(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 ae("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:u}=e.split("."))}if(3!==u)throw ce("Invalid JWT",ot,e);try{JSON.parse(ne(ie(s)))}catch(e){throw ce("failed to parse JWT Header body as base64url encoded JSON",rt,e)}if(!ue(i))throw ce("JWT Header must be a top level object",ot,e);if(t(i),void 0!==i.crit)throw new ae('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{JSON.parse(ne(ie(c)))}catch(e){throw ce("failed to parse JWT Payload body as base64url encoded JSON",rt,e)}if(!ue(a))throw ce("JWT Payload must be a top level object",ot,e);const l=Ae()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw ce('unexpected JWT "exp" (expiration time) claim type',ot,{claims:a});if(a.exp<=l-r)throw ce('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',ut,{claims:a,now:l,tolerance:r,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw ce('unexpected JWT "iat" (issued at) claim type',ot,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw ce('unexpected JWT "iss" (issuer) claim type',ot,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw ce('unexpected JWT "nbf" (not before) claim type',ot,{claims:a});if(a.nbf>l+r)throw ce('unexpected JWT "nbf" (not before) claim value',ut,{claims:a,now:l,tolerance:r,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw ce('unexpected JWT "aud" (audience) claim type',ot,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,gt.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),me(t),Ee(t),o).then(ze.bind(void 0,i)).then(Ve.bind(void 0,e)).then(Xe.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw ce('ID Token "aud" (audience) claim includes additional untrusted audiences',lt,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw ce('unexpected ID Token "azp" (authorized party) claim value',lt,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&he(s.auth_time,!0,'ID Token "auth_time" (authentication time)',ot,{claims:s}),We.set(n,c),Ke.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 ae("unsupported `token_type` value",{cause:{body:a}});return a}function Xe(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw ce('unexpected JWT "aud" (audience) claim value',lt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw ce('unexpected JWT "aud" (audience) claim value',lt,{expected:e,claims:t.claims,claim:"aud"});return t}function Ve(e,t){var n,r;const o=null!==(null===e[bt]||void 0===r?void 0:r.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw ce('unexpected JWT "iss" (issuer) claim value',lt,{expected:o,claims:t.claims,claim:"iss"});return t}const Je=new WeakSet,Ye=Symbol(),qe={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 ze(e,t){for(const n of e)if(void 0===t.claims[n])throw ce('JWT "'.concat(n,'" (').concat(qe[n],") claim missing"),ot,{claims:t.claims});return t}const $e=Symbol(),Ze=Symbol();const Qe="OAUTH_WWW_AUTHENTICATE_CHALLENGE",et="OAUTH_RESPONSE_BODY_ERROR",tt="OAUTH_UNSUPPORTED_OPERATION",nt="OAUTH_AUTHORIZATION_RESPONSE_ERROR",rt="OAUTH_PARSE_ERROR",ot="OAUTH_INVALID_RESPONSE",it="OAUTH_RESPONSE_IS_NOT_JSON",at="OAUTH_RESPONSE_IS_NOT_CONFORM",st="OAUTH_HTTP_REQUEST_FORBIDDEN",ct="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",ut="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",lt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",dt="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",ft="OAUTH_MISSING_SERVER_METADATA",ht="OAUTH_INVALID_SERVER_METADATA";function pt(e){if(e.bodyUsed)throw J('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function yt(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new ae("unsupported ".concat(t.name," modulusLength"),{cause:e})}function wt(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 ae("unsupported ECDSA namedCurve",{cause:e})}}function gt(e,t,n,r){if(void 0===e)if(Array.isArray(t)){if(!t.includes(r.alg))throw ce('unexpected JWT "alg" header parameter',ot,{header:r,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw ce('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 ce('unexpected JWT "alg" header parameter',ot,{header:r,expected:n,reason:"default value"})}else if("string"==typeof e?r.alg!==e:!e.includes(r.alg))throw ce('unexpected JWT "alg" header parameter',ot,{header:r,expected:e,reason:"client configuration"})}function mt(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw ce('"'.concat(t,'" parameter must be provided only once'),ot);return n}const Et=Symbol(),At=Symbol();async function St(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;try{await e.json()}catch(t){throw n(e),ce('failed to parse "response" body as JSON',rt,t)}if(!ue(t))throw ce('"response" body must be a top level object',ot,{body:t});return t}const vt=Symbol(),bt=Symbol(),Rt=new TextEncoder,Tt=new TextDecoder;function Ot(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 _t(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}}),M(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),M(this,"claim",void 0),M(this,"reason",void 0),M(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}M(Ct,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Lt extends Nt{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}}),M(this,"code","ERR_JWT_EXPIRED"),M(this,"claim",void 0),M(this,"reason",void 0),M(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}M(Lt,"code","ERR_JWT_EXPIRED");class Pt extends Nt{constructor(){super(...arguments),M(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}M(Pt,"code","ERR_JOSE_ALG_NOT_ALLOWED");class kt extends Nt{constructor(){super(...arguments),M(this,"code","ERR_JOSE_NOT_SUPPORTED")}}M(kt,"code","ERR_JOSE_NOT_SUPPORTED"),M(class extends Nt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),M(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),M(class extends Nt{constructor(){super(...arguments),M(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Dt extends Nt{constructor(){super(...arguments),M(this,"code","ERR_JWS_INVALID")}}M(Dt,"code","ERR_JWS_INVALID");class Ut extends Nt{constructor(){super(...arguments),M(this,"code","ERR_JWT_INVALID")}}M(Ut,"code","ERR_JWT_INVALID"),M(class extends Nt{constructor(){super(...arguments),M(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class xt extends Nt{constructor(){super(...arguments),M(this,"code","ERR_JWKS_INVALID")}}M(xt,"code","ERR_JWKS_INVALID");class Bt extends Nt{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),M(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}M(Bt,"code","ERR_JWKS_NO_MATCHING_KEY");class Mt extends Nt{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),M(this,Symbol.asyncIterator,void 0),M(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}M(Mt,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Ht extends Nt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),M(this,"code","ERR_JWKS_TIMEOUT")}}M(Ht,"code","ERR_JWKS_TIMEOUT");class Gt extends Nt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),M(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}M(Gt,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Kt=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))},Wt=(e,t)=>e.name===t;function Ft(e){return parseInt(e.name.slice(4),10)}function jt(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 Xt=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}},Jt=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),Yt=e=>Vt(e)||Jt(e);function qt(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 zt=(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)},Qt=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},en=(e,t,n)=>{var r;const o=(e=>_t(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){Zt(e,48,"Invalid PKCS#8 structure"),$t(e),Zt(e,2,"Expected version field");const t=$t(e);e.pos+=t,Zt(e,48,"Expected algorithm identifier");$t(e);e.pos}(t),(e=>{const t=(e=>{Zt(e,6,"Expected algorithm OID");const t=$t(e);return Qt(e,t)})(e);if(zt(t,[43,101,110]))return"X25519";if(!zt(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Zt(e,6,"Expected curve OID");const n=$t(e),r=Qt(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(zt(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 kt("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 kt('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 tn(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 kt('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 kt('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 kt('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 kt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new kt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),i=G({},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 nn=e=>qt(e)&&"string"==typeof e.kty;let rn;const on=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];rn||(rn=new WeakMap);let o=rn.get(e);if(null!=o&&o[n])return o[n];const i=await tn(G(G({},t),{},{alg:n}));return r&&Object.freeze(e),o?o[n]=i:rn.set(e,{[n]:i}),i};const an=e=>null==e?void 0:e[Symbol.toStringTag],sn=(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 cn,un;let ln,dn;if("undefined"==typeof navigator||null===(cn=navigator.userAgent)||void 0===cn||null===(un=cn.startsWith)||void 0===un||!un.call(cn,"Mozilla/5.0 ")){const e="v6.8.1";dn="".concat("openid-client","/").concat(e),ln={"user-agent":dn}}const fn=e=>hn.get(e);let hn,pn;function yn(e){return void 0!==e?be(e):(pn||(pn=new WeakMap),(e,t,n,r)=>{let o;return(o=pn.get(t))||(function(e,t){if("string"!=typeof e)throw En("".concat(t," must be a string"),mn);if(0===e.length)throw En("".concat(t," must not be empty"),gn)}(t.client_secret,'"metadata.client_secret"'),o=be(t.client_secret),pn.set(t,o)),o(e,t,n,r)})}const wn=$,gn="ERR_INVALID_ARG_VALUE",mn="ERR_INVALID_ARG_TYPE";function En(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}class An extends Error{constructor(e,t){var n;super(e,t),M(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 Sn(e,t,n){return new An(e,{cause:t,code:n})}function vn(e){if(e instanceof TypeError||e instanceof An||e instanceof Ne||e instanceof Ce||e instanceof Le)throw e;if(e instanceof se)switch(e.code){case st:throw Sn("only requests to HTTPS are allowed",e,e.code);case ct:throw Sn("only requests to HTTP or HTTPS are allowed",e,e.code);case at:throw Sn("unexpected HTTP response status code",e.cause,e.code);case it:throw Sn("unexpected response content-type",e.cause,e.code);case rt:throw Sn("parsing error occured",e,e.code);case ot:throw Sn("invalid response encountered",e,e.code);case lt:throw Sn("unexpected JWT claim value encountered",e,e.code);case dt:throw Sn("unexpected JSON attribute value encountered",e,e.code);case ut:throw Sn("JWT timestamp claim value failed validation",e,e.code);default:throw Sn(e.message,e,e.code)}if(e instanceof ae)throw Sn("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Sn("runtime operation error",e,tt);case"NotSupportedError":throw Sn("runtime unsupported operation",e,tt);case"TimeoutError":throw Sn("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Sn("operation aborted",e,"OAUTH_ABORT")}throw new An("something went wrong",{cause:e})}async function bn(e,t,n,r,o){const i=await async function(e,t){var n,r;if(!(e instanceof URL))throw En('"server" must be an instance of URL',mn);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 J('"'.concat("issuerIdentifier",'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");Oe(e,!0!==(null==r?void 0:r[Y]));const o=n(new URL(e.href)),i=le(null==r?void 0:r.headers);return i.set("accept","application/json"),((null==r?void 0:r[$])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:de(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=fe("".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=fe("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw J('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[$]:null==t?void 0:t[wn],[Y]:null==t||null===t.execute||void 0===r?void 0:r.includes(Ln),signal:a,headers:new Headers(ln)}):((null==t?void 0:t[wn])||fetch)((Oe(e,null==t||null===t.execute||void 0===c||!c.includes(Ln)),e.href),{headers:Object.fromEntries(new Headers(G({accept:"application/json"},ln)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==vt)throw J('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!V(t,Response))throw J('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(200!==t.status)throw ce('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',at,t);pt(t);const r=await St(t);if(pe(r.issuer,'"response" body "issuer" property',ot,{body:r}),n!==vt&&new URL(r.issuer).href!==n.href)throw ce('"response" body "issuer" property does not match the expected value',dt,{expected:n.href,body:r,attribute:"issuer"});return r}(vt,e)).catch(vn);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[Rn]=!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 An("discovered metadata issuer does not match the expected issuer",{code:dt,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new Tn(i,t,n,r);let s=fn(a);if(null!=o&&o[wn]&&(s.fetch=o[wn]),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 Rn=Symbol();class Tn{constructor(e,t,n,r){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw En('"clientId" must be a non-empty string',mn);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 En('"clientId" and "metadata.client_id" must be the same',gn);const u=G(G({},structuredClone(n)),{},{client_id:t});let l;u[q]=null!==(i=null===(a=n)||void 0===a?void 0:a[q])&&void 0!==i?i:0,u[z]=null!==(s=null===(c=n)||void 0===c?void 0:c[z])&&void 0!==s?s:30,l=r||("string"==typeof u.client_secret&&u.client_secret.length?yn(u.client_secret):(e,t,n,r)=>{n.set("client_id",t.client_id)});let d=Object.freeze(u);const f=structuredClone(e);Rn in e&&(f[bt]=t=>{let{claims:{tid:n}}=t;return e.issuer.replace("{tenantid}",n)});let h=Object.freeze(f);hn||(hn=new WeakMap),hn.set(this,{__proto__:null,as:h,c:d,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(fn(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(fn(this).c)}get timeout(){return fn(this).timeout}set timeout(e){fn(this).timeout=e}get[wn](){return fn(this).fetch}set[wn](e){fn(this).fetch=e}}function On(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 Fe(this)}catch(e){return}}}}}(e))}async function _n(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 se("invalid Retry-After header value",{cause:e});a>t&&await In(a-t,n)}function In(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 Nn(e,t){Bn(e);const{as:n,c:r,auth:o,fetch:i,tlsOnly:a,timeout:s}=fn(e);return async function(e,t,n,r,o){Se(e),ve(t);const i=Ie(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[Y])),a=new URLSearchParams(r);a.set("client_id",t.client_id);const s=le(null==o?void 0:o.headers);return s.set("accept","application/json"),He(e,t,n,i,a,s,o)}(n,r,o,t,{[$]:i,[Y]:!a,headers:new Headers(ln),signal:Mn(s)}).then(e=>async function(e,t,n){if(Se(e),ve(t),!V(n,Response))throw J('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await xe(n,200,"Backchannel Authentication Endpoint"),pt(n);const r=await St(n);pe(r.auth_req_id,'"response" body "auth_req_id" property',ot,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return he(o,!0,'"response" body "expires_in" property',ot,{body:r}),r.expires_in=o,void 0!==r.interval&&he(r.interval,!1,'"response" body "interval" property',ot,{body:r}),r}(n,r,e)).catch(vn)}async function Cn(e,t,n,r){var o,i;Bn(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 In(a,s)}catch(e){vn(e)}const{as:c,c:u,auth:l,fetch:d,tlsOnly:f,nonRepudiation:h,timeout:p,decrypt:y}=fn(e),w=(o,i)=>Cn(e,G(G({},t),{},{interval:o}),n,G(G({},r),{},{signal:s,flag:i})),g=await async function(e,t,n,r,o){Se(e),ve(t),pe(r,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",r),Ge(e,t,n,"urn:openid:params:grant-type:ciba",i,o)}(c,u,l,t.auth_req_id,{[$]:d,[Y]:!f,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(ln),signal:s.aborted?s:Mn(p)}).catch(vn);var m;if(503===g.status&&g.headers.has("retry-after"))return await _n(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 je(e,t,n,void 0,null==r?void 0:r[Q],null==r?void 0:r.recognizedTokenTypes)}(c,u,g,{[Q]:y});let A;try{await E}catch(e){if(Hn(e,r))return w(a,Gn);if(e instanceof Ne)switch(e.error){case"slow_down":0;case"authorization_pending":return await _n(e.response,a,s),w(a)}vn(e)}return A.id_token&&await(null==h?void 0:h(g)),On(A),A}function Ln(e){fn(e).tlsOnly=!1}async function Pn(e,t,n,r,o){if(Bn(e),!((null==o?void 0:o.flag)===Gn||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw En('"currentUrl" must be an instance of URL, or Request',mn);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}=fn(e);if((null==o?void 0:o.flag)===Gn)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 J("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if("application/x-www-form-urlencoded"!==Me(e))throw J("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 J("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 En("unexpected Request HTTP method",gn)}}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(Se(e),ve(t),n instanceof URL&&n.searchParams,!(n instanceof URLSearchParams))throw J('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(mt(n,"response"))throw ce('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',ot,{parameters:n});const o=mt(n,"iss"),i=mt(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw ce('response parameter "iss" (issuer) missing',ot,{parameters:n});if(o&&o!==e.issuer)throw ce('unexpected "iss" (issuer) response parameter value',ot,{expected:e.issuer,parameters:n});switch(r){case void 0:case At:if(void 0!==i)throw ce('unexpected "state" response parameter encountered',ot,{expected:void 0,parameters:n});break;case Et:break;default:if(pe(r,'"expectedState" argument'),i!==r)throw ce(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',ot,{expected:r,parameters:n})}if(mt(n,"error"))throw new Ce("authorization response from the server is an error",{cause:n});const a=mt(n,"id_token"),s=mt(n,"token");if(void 0!==a||void 0!==s)throw new ae("implicit and hybrid flows are not supported");return new URLSearchParams(n),Je.add(c),c;var c})(s,c,t.searchParams,null==n?void 0:n.expectedState)}catch(e){vn(e)}}}const m=await async function(e,t,n,r,o,i,a){if(Se(e),ve(t),!Je.has(r))throw J('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");pe(o,'"redirectUri"');const s=mt(r,"code");if(!s)throw ce('no authorization code in "callbackParameters"',ot);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==Ye&&(pe(i,'"codeVerifier"'),c.set("code_verifier",i)),Ge(e,t,n,"authorization_code",c,a)}(s,c,u,i,a,(null==n?void 0:n.pkceCodeVerifier)||Ye,{additionalParameters:r,[$]:l,[Y]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(ln),signal:Mn(y)}).catch(vn);"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 $e:break;default:pe(r,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case Ze:break;default:he(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await je(e,t,n,s,i,a);pe(c.id_token,'"response" body "id_token" property',ot,{body:c});const u=Fe(c);if(o!==Ze){const e=Ae()+me(t),n=Ee(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 je(e,t,n,void 0,null==r?void 0:r[Q],null==r?void 0:r.recognizedTokenTypes)}(o,i,e,{[Q]:l,recognizedTokenTypes:n})}).catch(vn);return On(d),d}async function Wn(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 kt('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)}(Dt,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 Dt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Dt('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 Pt('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new Dt("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Dt("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(nn(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&sn(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(!Yt(t))throw new TypeError(Xt(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(an(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(nn(t))switch(n){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&sn(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)&&sn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Yt(t))throw new TypeError(Xt(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(an(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw new TypeError("".concat(an(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(an(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw new TypeError("".concat(an(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(an(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?Ot(e.protected):new Uint8Array,Ot("."),"string"==typeof e.payload?a?Ot(e.payload):Rt.encode(e.payload):e.payload);let d;try{It(e.signature)}catch(e){throw new Dt("Failed to base64url decode the signature")}const f=await async function(e,t){if(e instanceof Uint8Array)return e;if(Vt(e))return e;if(Jt(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{rn||(rn=new WeakMap);let n=rn.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:rn.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return on(e,n,t)}if(nn(e))return e.k?It(e.k):on(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,n,r){const o=await Wn(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 kt("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 Gt;let h;if(a)try{It(e.payload)}catch(e){throw new Dt("Failed to base64url decode the payload")}else"string"==typeof e.payload?Rt.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?G(G({},p),{},{key:f}):p}const jn=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Xn(e){const t=jn.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 Vn=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());async function Jn(e,t,n){var r;const o=await async function(e,t,n){if(e instanceof Uint8Array&&Tt.decode(e),"string"!=typeof e)throw new Dt("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:i,length:a}=e.split(".");if(3!==a)throw new Dt("Invalid Compact JWS");const s=await Fn({payload:o,protected:r,signature:i},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?G(G({},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 Ut("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(Tt.decode(t))}catch(e){}if(!qt(n))throw new Ut("JWT Claims Set must be a top-level JSON object");const{typ:o}=r;if(o&&("string"!=typeof e.typ||Vn(e.typ)!==Vn(o)))throw new Ct('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 Ct('missing required "'.concat(e,'" claim'),n,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new Ct('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new Ct('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 Ct('unexpected "aud" claim value',n,"aud","check_failed");let d;switch(typeof r.clockTolerance){case"string":Xn(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 Ct('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new Ct('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>h+d)throw new Ct('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new Ct('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=h-d)throw new Lt('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){const e=h-n.iat;if(e-d>("number"==typeof u?u:Xn(u)))throw new Lt('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-d)throw new Ct('"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?G(G({},a),{},{key:o.key}):a}function Yn(e){return qt(e)}var qn,zn,$n=new WeakMap,Zn=new WeakMap;class Qn{constructor(e){if(x(this,$n,void 0),x(this,Zn,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Yn)}(e))throw new xt("JSON Web Key Set malformed");B($n,this,structuredClone(e))}jwks(){return U($n,this)}async getKey(e,t){const{alg:n,kid:r}=G(G({},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 kt('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=U($n,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 Bt;if(1!==s){const e=new Mt,t=U(Zn,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new W(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield k(er(t,e,n))}catch(e){}}),e}return er(U(Zn,this),a,n)}}async function er(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(!qt(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 It(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new kt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return tn(G(G({},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 tn(G(G({},e),{},{ext:n}));case"EC":case"OKP":return tn(G(G({},e),{},{alg:t,ext:n}));default:throw new kt('Unsupported "kty" (Key Type) Parameter value')}}(G(G({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new xt("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function tr(e){const t=new Qn(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 nr;if("undefined"==typeof navigator||null===(qn=navigator.userAgent)||void 0===qn||null===(zn=qn.startsWith)||void 0===zn||!zn.call(qn,"Mozilla/5.0 ")){const e="v6.1.3";nr="".concat("jose","/").concat(e)}const rr=Symbol(),or=Symbol();var ir=new WeakMap,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;class yr{constructor(e,t){if(x(this,ir,void 0),x(this,ar,void 0),x(this,sr,void 0),x(this,cr,void 0),x(this,ur,void 0),x(this,lr,void 0),x(this,dr,void 0),x(this,fr,void 0),x(this,hr,void 0),x(this,pr,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var n,r;B(ir,this,new URL(e.href)),B(ar,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),B(sr,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),B(cr,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),B(dr,this,new Headers(null==t?void 0:t.headers)),nr&&!U(dr,this).has("User-Agent")&&U(dr,this).set("User-Agent",nr),U(dr,this).has("accept")||(U(dr,this).set("accept","application/json"),U(dr,this).append("accept","application/jwk-set+json")),B(fr,this,null==t?void 0:t[rr]),void 0!==(null==t?void 0:t[or])&&(B(pr,this,null==t?void 0:t[or]),null==t?void 0:t[or],U(cr,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=r)&&"jwks"in n&&qt(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,qt)&&(B(ur,this,U(pr,this).uat),B(hr,this,tr(U(pr,this).jwks))))}pendingFetch(){return!!U(lr,this)}coolingDown(){return"number"==typeof U(ur,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 Ht;throw e});if(200!==o.status)throw new Nt("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new Nt("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(U(ir,this).href,U(dr,this),AbortSignal.timeout(U(ar,this)),U(fr,this)).then(e=>{B(hr,this,tr(e)),U(pr,this)&&(U(pr,this).uat=Date.now(),U(pr,this).jwks=e),B(ur,this,Date.now()),B(lr,this,void 0)}).catch(e=>{throw B(lr,this,void 0),e})),await U(lr,this)}}const wr=["mfaToken"],gr=["mfaToken"];var mr,Er,Ar,Sr,vr,br,Rr,Tr,Or=class extends Error{constructor(e,t){super(t),M(this,"code",void 0),this.name="NotSupportedError",this.code=e}},_r=class extends Error{constructor(e,t,n){super(t),M(this,"cause",void 0),M(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Ir=class extends _r{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Nr=class extends _r{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Cr=class extends _r{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Lr=class extends _r{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Pr=class extends _r{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},kr=class extends Error{constructor(e){super(e),M(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Dr=class extends _r{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),M(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},Ur=class extends _r{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},xr=class extends _r{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},Br=class extends _r{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},Mr=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),M(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function Hr(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>G(G({},e),{},{[t[0]]:t[1]}),{})}var Gr=class extends Error{constructor(e,t,n){super(t),M(this,"cause",void 0),M(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Kr=class extends Gr{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},Wr=class extends Gr{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},Fr=class extends Gr{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},jr=class extends Gr{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function Xr(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var Vr=(mr=new WeakMap,Er=new WeakMap,Ar=new WeakMap,class{constructor(e){var t;x(this,mr,void 0),x(this,Er,void 0),x(this,Ar,void 0),B(mr,this,"https://".concat(e.domain)),B(Er,this,e.clientId),B(Ar,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(U(mr,this),"/mfa/authenticators"),{mfaToken:n}=e,r=await U(Ar,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 Kr(e.error_description||"Failed to list authenticators",e)}return(await r.json()).map(Xr)}async enrollAuthenticator(e){const t="".concat(U(mr,this),"/mfa/associate"),{mfaToken:n}=e,r=K(e,wr),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 U(Ar,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 Wr(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(U(mr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await U(Ar,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 Fr(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(U(mr,this),"/mfa/challenge"),{mfaToken:n}=e,r=K(e,gr),o={mfa_token:n,client_id:U(Er,this),challenge_type:r.challengeType};r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const i=await U(Ar,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 jr(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())}}),Jr=class e{constructor(e,t,n,r,o,i,a){M(this,"accessToken",void 0),M(this,"idToken",void 0),M(this,"refreshToken",void 0),M(this,"expiresAt",void 0),M(this,"scope",void 0),M(this,"claims",void 0),M(this,"authorizationDetails",void 0),M(this,"tokenType",void 0),M(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}},Yr="openid profile email offline_access",qr=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 zr(e){if(null==e)throw new Pr("subject_token is required");if("string"!=typeof e)throw new Pr("subject_token must be a string");if(0===e.trim().length)throw new Pr("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Pr("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Pr("subject_token must not include the 'Bearer ' prefix")}function $r(e,t){if(t)for(const[n,r]of Object.entries(t))if(!qr.has(n))if(Array.isArray(r)){if(r.length>20)throw new Pr("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));r.forEach(t=>{e.append(n,t)})}else e.append(n,r)}Sr=new WeakMap,vr=new WeakMap,br=new WeakMap,Rr=new WeakMap,Tr=new WeakSet;async function Zr(){if(U(Sr,this)&&U(vr,this))return{configuration:U(Sr,this),serverMetadata:U(vr,this)};const e=await P(Tr,this,to).call(this);return B(Sr,this,await bn(new URL("https://".concat(U(br,this).domain)),U(br,this).clientId,{use_mtls_endpoint_aliases:U(br,this).useMtls},e,{[wn]:U(br,this).customFetch})),B(vr,this,U(Sr,this).serverMetadata()),U(Sr,this)[wn]=U(br,this).customFetch||fetch,{configuration:U(Sr,this),serverMetadata:U(vr,this)}}async function Qr(e){var t,n;const{configuration:r}=await P(Tr,this,Zr).call(this);if("audience"in e||"resource"in e)throw new Pr("audience and resource parameters are not supported for Token Vault exchanges");zr(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),$r(o,e.extra);try{const e=await Kn(r,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return Jr.fromTokenEndpointResponse(e)}catch(t){throw new Pr("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function eo(e){const{configuration:t}=await P(Tr,this,Zr).call(this);zr(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),$r(n,e.extra);try{const e=await Kn(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return Jr.fromTokenEndpointResponse(e)}catch(t){throw new Pr("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function to(){if(!U(br,this).clientSecret&&!U(br,this).clientAssertionSigningKey&&!U(br,this).useMtls)throw new Mr;if(U(br,this).useMtls)return(e,t,n,r)=>{n.set("client_id",t.client_id)};let e=U(br,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 en(e,t,void 0)}(e,U(br,this).clientAssertionSigningAlg||"RS256"),e?function(e){return Re(e,void 0)}(e):yn(U(br,this).clientSecret)}async function no(e){const{configuration:t}=await P(Tr,this,Zr).call(this),n=we(),r=await function(e){return async function(e){return pe(e,"codeVerifier"),ie(await crypto.subtle.digest("SHA-256",ne(e)))}(e)}(n),o=Hr(G(G({},U(br,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(G(G({scope:Yr},o),{},{client_id:U(br,this).clientId,code_challenge:r,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await xn(t,i):await Un(t,i),codeVerifier:n}}function ro(e,t){return function(){return e.apply(t,arguments)}}const{toString:oo}=Object.prototype,{getPrototypeOf:io}=Object,{iterator:ao,toStringTag:so}=Symbol,co=(uo=Object.create(null),e=>{const t=oo.call(e);return uo[t]||(uo[t]=t.slice(8,-1).toLowerCase())});var uo;const lo=e=>(e=e.toLowerCase(),t=>co(t)===e),fo=e=>t=>typeof t===e,{isArray:ho}=Array,po=fo("undefined");function yo(e){return null!==e&&!po(e)&&null!==e.constructor&&!po(e.constructor)&&mo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wo=lo("ArrayBuffer");const go=fo("string"),mo=fo("function"),Eo=fo("number"),Ao=e=>null!==e&&"object"==typeof e,So=e=>{if("object"!==co(e))return!1;const t=io(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||so in e||ao in e)},vo=lo("Date"),bo=lo("File"),Ro=lo("Blob"),To=lo("FileList");const Oo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},_o=void 0!==Oo.FormData?Oo.FormData:void 0,Io=lo("URLSearchParams"),[No,Co,Lo,Po]=["ReadableStream","Request","Response","Headers"].map(lo);function ko(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),ho(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Uo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,xo=e=>!po(e)&&e!==Uo;const Bo=(Mo="undefined"!=typeof Uint8Array&&io(Uint8Array),e=>Mo&&e instanceof Mo);var Mo;const Ho=lo("HTMLFormElement"),Go=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ko=lo("RegExp"),Wo=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ko(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Fo=lo("AsyncFunction"),jo=(Xo="function"==typeof setImmediate,Vo=mo(Uo.postMessage),Xo?setImmediate:Vo?(Jo=`axios@${Math.random()}`,Yo=[],Uo.addEventListener("message",({source:e,data:t})=>{e===Uo&&t===Jo&&Yo.length&&Yo.shift()()},!1),e=>{Yo.push(e),Uo.postMessage(Jo,"*")}):e=>setTimeout(e));var Xo,Vo,Jo,Yo;const qo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Uo):"undefined"!=typeof process&&process.nextTick||jo,zo={isArray:ho,isArrayBuffer:wo,isBuffer:yo,isFormData:e=>{let t;return e&&(_o&&e instanceof _o||mo(e.append)&&("formdata"===(t=co(e))||"object"===t&&mo(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&wo(e.buffer),t},isString:go,isNumber:Eo,isBoolean:e=>!0===e||!1===e,isObject:Ao,isPlainObject:So,isEmptyObject:e=>{if(!Ao(e)||yo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:No,isRequest:Co,isResponse:Lo,isHeaders:Po,isUndefined:po,isDate:vo,isFile:bo,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Ro,isRegExp:Ko,isFunction:mo,isStream:e=>Ao(e)&&mo(e.pipe),isURLSearchParams:Io,isTypedArray:Bo,isFileList:To,forEach:ko,merge:function e(){const{caseless:t,skipUndefined:n}=xo(this)&&this||{},r={},o=(o,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=t&&Do(r,i)||i;So(r[a])&&So(o)?r[a]=e(r[a],o):So(o)?r[a]=e({},o):ho(o)?r[a]=o.slice():n&&po(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(ko(t,(t,r)=>{n&&mo(t)?Object.defineProperty(e,r,{value:ro(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&&io(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:co,kindOfTest:lo,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(ho(e))return e;let t=e.length;if(!Eo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[ao]).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:Ho,hasOwnProperty:Go,hasOwnProp:Go,reduceDescriptors:Wo,freezeMethods:e=>{Wo(e,(t,n)=>{if(mo(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];mo(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 ho(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:Do,global:Uo,isContextDefined:xo,isSpecCompliantForm:function(e){return!!(e&&mo(e.append)&&"FormData"===e[so]&&e[ao])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Ao(e)){if(t.indexOf(e)>=0)return;if(yo(e))return e;if(!("toJSON"in e)){t[r]=e;const o=ho(e)?[]:{};return ko(e,(e,t)=>{const i=n(e,r+1);!po(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Fo,isThenable:e=>e&&(Ao(e)||mo(e))&&mo(e.then)&&mo(e.catch),setImmediate:jo,asap:qo,isIterable:e=>null!=e&&mo(e[ao])};class $o extends Error{static from(e,t,n,r,o,i){const a=new $o(e.message,t||e.code,n,r,o);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),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:zo.toJSONObject(this.config),code:this.code,status:this.status}}}$o.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",$o.ERR_BAD_OPTION="ERR_BAD_OPTION",$o.ECONNABORTED="ECONNABORTED",$o.ETIMEDOUT="ETIMEDOUT",$o.ERR_NETWORK="ERR_NETWORK",$o.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",$o.ERR_DEPRECATED="ERR_DEPRECATED",$o.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",$o.ERR_BAD_REQUEST="ERR_BAD_REQUEST",$o.ERR_CANCELED="ERR_CANCELED",$o.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",$o.ERR_INVALID_URL="ERR_INVALID_URL";const Zo=$o;var Qo=n(8287).hp;function ei(e){return zo.isPlainObject(e)||zo.isArray(e)}function ti(e){return zo.endsWith(e,"[]")?e.slice(0,-2):e}function ni(e,t,n){return e?e.concat(t).map(function(e,t){return e=ti(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ri=zo.toFlatObject(zo,{},null,function(e){return/^is[A-Z]/.test(e)});const oi=function(e,t,n){if(!zo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=zo.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!zo.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&zo.isSpecCompliantForm(t);if(!zo.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(zo.isDate(e))return e.toISOString();if(zo.isBoolean(e))return e.toString();if(!s&&zo.isBlob(e))throw new Zo("Blob is not supported. Use a Buffer instead.");return zo.isArrayBuffer(e)||zo.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Qo.from(e):e}function u(e,n,o){let s=e;if(zo.isReactNative(t)&&zo.isReactNativeBlob(e))return t.append(ni(o,n,i),c(e)),!1;if(e&&!o&&"object"==typeof e)if(zo.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(zo.isArray(e)&&function(e){return zo.isArray(e)&&!e.some(ei)}(e)||(zo.isFileList(e)||zo.endsWith(n,"[]"))&&(s=zo.toArray(e)))return n=ti(n),s.forEach(function(e,r){!zo.isUndefined(e)&&null!==e&&t.append(!0===a?ni([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!ei(e)||(t.append(ni(o,n,i),c(e)),!1)}const l=[],d=Object.assign(ri,{defaultVisitor:u,convertValue:c,isVisitable:ei});if(!zo.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!zo.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),zo.forEach(n,function(n,i){!0===(!(zo.isUndefined(n)||null===n)&&o.call(t,n,zo.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function ii(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ai(e,t){this._pairs=[],e&&oi(e,this,t)}const si=ai.prototype;si.append=function(e,t){this._pairs.push([e,t])},si.toString=function(e){const t=e?function(t){return e.call(this,t,ii)}:ii;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ci=ai;function ui(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function li(e,t,n){if(!t)return e;const r=n&&n.encode||ui,o=zo.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):zo.isURLSearchParams(t)?t.toString():new ci(t,o).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const di=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){zo.forEach(this.handlers,function(t){null!==t&&e(t)})}},fi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},hi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ci,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},pi="undefined"!=typeof window&&"undefined"!=typeof document,yi="object"==typeof navigator&&navigator||void 0,wi=pi&&(!yi||["ReactNative","NativeScript","NS"].indexOf(yi.product)<0),gi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mi=pi&&window.location.href||"http://localhost",Ei={...e,...hi};const Ai=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&&zo.isArray(r)?r.length:i,s)return zo.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&zo.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&zo.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 zo.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const Si={transitional:fi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=zo.isObject(e);o&&zo.isHTMLForm(e)&&(e=new FormData(e));if(zo.isFormData(e))return r?JSON.stringify(Ai(e)):e;if(zo.isArrayBuffer(e)||zo.isBuffer(e)||zo.isStream(e)||zo.isFile(e)||zo.isBlob(e)||zo.isReadableStream(e))return e;if(zo.isArrayBufferView(e))return e.buffer;if(zo.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 oi(e,new Ei.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ei.isNode&&zo.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=zo.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return oi(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(zo.isString(e))try{return(t||JSON.parse)(e),zo.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Si.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(zo.isResponse(e)||zo.isReadableStream(e))return e;if(e&&zo.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 Zo.from(e,Zo.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:Ei.classes.FormData,Blob:Ei.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};zo.forEach(["delete","get","head","post","put","patch"],e=>{Si.headers[e]={}});const vi=Si,bi=zo.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"]),Ri=Symbol("internals");function Ti(e){return e&&String(e).trim().toLowerCase()}function Oi(e){return!1===e||null==e?e:zo.isArray(e)?e.map(Oi):String(e)}function _i(e,t,n,r,o){return zo.isFunction(r)?r.call(this,t,n):(o&&(t=n),zo.isString(t)?zo.isString(r)?-1!==t.indexOf(r):zo.isRegExp(r)?r.test(t):void 0:void 0)}class Ii{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ti(t);if(!o)throw new Error("header name must be a non-empty string");const i=zo.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Oi(e))}const i=(e,t)=>zo.forEach(e,(e,n)=>o(e,n,t));if(zo.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(zo.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]&&bi[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(zo.isObject(e)&&zo.isIterable(e)){let n,r,o={};for(const t of e){if(!zo.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?zo.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=Ti(e)){const n=zo.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(zo.isFunction(t))return t.call(this,e,n);if(zo.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ti(e)){const n=zo.findKey(this,e);return!(!n||void 0===this[n]||t&&!_i(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ti(e)){const o=zo.findKey(n,e);!o||t&&!_i(0,n[o],o,t)||(delete n[o],r=!0)}}return zo.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&&!_i(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return zo.forEach(this,(r,o)=>{const i=zo.findKey(n,o);if(i)return t[i]=Oi(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]=Oi(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return zo.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&zo.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[Ri]=this[Ri]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ti(e);t[r]||(!function(e,t){const n=zo.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 zo.isArray(e)?e.forEach(r):r(e),this}}Ii.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),zo.reduceDescriptors(Ii.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),zo.freezeMethods(Ii);const Ni=Ii;function Ci(e,t){const n=this||vi,r=t||n,o=Ni.from(r.headers);let i=r.data;return zo.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Li(e){return!(!e||!e.__CANCEL__)}const Pi=class extends Zo{constructor(e,t,n){super(null==e?"canceled":e,Zo.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function ki(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Zo("Request failed with status code "+n.status,[Zo.ERR_BAD_REQUEST,Zo.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Di=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)]},xi=(e,t,n=3)=>{let r=0;const o=Di(50,250);return Ui(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)},Bi=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Mi=e=>(...t)=>zo.asap(()=>e(...t)),Hi=Ei.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ei.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ei.origin),Ei.navigator&&/(msie|trident)/i.test(Ei.navigator.userAgent)):()=>!0,Gi=Ei.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];zo.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),zo.isString(r)&&s.push(`path=${r}`),zo.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),zo.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 Ki(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Wi=e=>e instanceof Ni?{...e}:e;function Fi(e,t){t=t||{};const n={};function r(e,t,n,r){return zo.isPlainObject(e)&&zo.isPlainObject(t)?zo.merge.call({caseless:r},e,t):zo.isPlainObject(t)?zo.merge({},t):zo.isArray(t)?t.slice():t}function o(e,t,n,o){return zo.isUndefined(t)?zo.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!zo.isUndefined(t))return r(void 0,t)}function a(e,t){return zo.isUndefined(t)?zo.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(Wi(e),Wi(t),0,!0)};return zo.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=zo.hasOwnProp(c,r)?c[r]:o,a=i(e[r],t[r],r);zo.isUndefined(a)&&i!==s||(n[r]=a)}),n}const ji=e=>{const t=Fi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Ni.from(a),t.url=li(Ki(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),zo.isFormData(n))if(Ei.hasStandardBrowserEnv||Ei.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(zo.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(Ei.hasStandardBrowserEnv&&(r&&zo.isFunction(r)&&(r=r(t)),r||!1!==r&&Hi(t.url))){const e=o&&i&&Gi.read(i);e&&a.set(o,e)}return t},Xi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ji(e);let o=r.data;const i=Ni.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=Ni.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());ki(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 Zo("Request aborted",Zo.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new Zo(r,Zo.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||fi;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Zo(t,o.clarifyTimeoutError?Zo.ETIMEDOUT:Zo.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&zo.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),zo.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),h&&([c,l]=xi(h,!0),y.addEventListener("progress",c)),f&&y.upload&&([s,u]=xi(f),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Pi(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===Ei.protocols.indexOf(g)?n(new Zo("Unsupported protocol "+g+":",Zo.ERR_BAD_REQUEST,e)):y.send(o||null)})},Vi=(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 Zo?t:new Pi(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Zo(`timeout of ${t}ms exceeded`,Zo.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=()=>zo.asap(a),s}},Ji=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Yi(e))yield*Ji(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:zi}=zo,$i=(({Request:e,Response:t})=>({Request:e,Response:t}))(zo.global),{ReadableStream:Zi,TextEncoder:Qi}=zo.global,ea=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ta=e=>{e=zo.merge.call({skipUndefined:!0},$i,e);const{fetch:t,Request:n,Response:r}=e,o=t?zi(t):"function"==typeof fetch,i=zi(n),a=zi(r);if(!o)return!1;const s=o&&zi(Zi),c=o&&("function"==typeof Qi?(u=new Qi,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&ea(()=>{let e=!1;const t=new n(Ei.origin,{body:new Zi,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&ea(()=>zo.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 Zo(`Response type '${e}' is not supported`,Zo.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=zo.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(zo.isBlob(e))return e.size;if(zo.isSpecCompliantForm(e)){const t=new n(Ei.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return zo.isArrayBufferView(e)||zo.isArrayBuffer(e)?e.byteLength:(zo.isURLSearchParams(e)&&(e+=""),zo.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}=ji(e),S=t||fetch;g=g?(g+"").toLowerCase():"text";let v=Vi([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(zo.isFormData(s)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,n]=Bi(T,xi(Mi(w)));s=qi(t.body,65536,e,n)}}zo.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=zo.toFiniteNumber(u.headers.get("content-length")),[n,o]=y&&Bi(t,xi(Mi(y),!0))||[];u=new r(qi(u.body,65536,n,()=>{o&&o(),R&&R()}),e)}g=g||"text";let O=await f[zo.findKey(f,g)||"text"](u,e);return!p&&R&&R(),await new Promise((t,n)=>{ki(t,n,{data:O,headers:Ni.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 Zo("Network Error",Zo.ERR_NETWORK,e,b,t&&t.response),{cause:t.cause||t});throw Zo.from(t,t&&t.code,e,b,t&&t.response)}}},na=new Map,ra=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=na;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:ta(t)),u=s;return s},oa=(ra(),{http:null,xhr:Xi,fetch:{get:ra}});zo.forEach(oa,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const ia=e=>`- ${e}`,aa=e=>zo.isFunction(e)||null===e||!1===e;const sa={getAdapter:function(e,t){e=zo.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(ia).join("\n"):" "+ia(e[0]):"as no adapter specified";throw new Zo("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:oa};function ca(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pi(null,e)}function ua(e){ca(e),e.headers=Ni.from(e.headers),e.data=Ci.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return sa.getAdapter(e.adapter||vi.adapter,e)(e).then(function(t){return ca(e),t.data=Ci.call(e,e.transformResponse,t),t.headers=Ni.from(t.headers),t},function(t){return Li(t)||(ca(e),t&&t.response&&(t.response.data=Ci.call(e,e.transformResponse,t.response),t.response.headers=Ni.from(t.response.headers))),Promise.reject(t)})}const la="1.13.6",da={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{da[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const fa={};da.transitional=function(e,t,n){function r(e,t){return"[Axios v"+la+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Zo(r(o," has been removed"+(t?" in "+t:"")),Zo.ERR_DEPRECATED);return t&&!fa[o]&&(fa[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)}},da.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ha={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Zo("options must be an object",Zo.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 Zo("option "+i+" must be "+n,Zo.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Zo("Unknown option "+i,Zo.ERR_BAD_OPTION)}},validators:da},pa=ha.validators;class ya{constructor(e){this.defaults=e||{},this.interceptors={request:new di,response:new di}}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=Fi(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ha.assertOptions(n,{silentJSONParsing:pa.transitional(pa.boolean),forcedJSONParsing:pa.transitional(pa.boolean),clarifyTimeoutError:pa.transitional(pa.boolean),legacyInterceptorReqResOrdering:pa.transitional(pa.boolean)},!1),null!=r&&(zo.isFunction(r)?t.paramsSerializer={serialize:r}:ha.assertOptions(r,{encode:pa.function,serialize:pa.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ha.assertOptions(t,{baseUrl:pa.spelling("baseURL"),withXsrfToken:pa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&zo.merge(o.common,o[t.method]);o&&zo.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ni.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||fi;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(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=[ua.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 Pi(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 ga(function(t){e=t});return{token:t,cancel:e}}}const ma=ga;const Ea={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(Ea).forEach(([e,t])=>{Ea[t]=e});const Aa=Ea;const Sa=function e(t){const n=new wa(t),r=ro(wa.prototype.request,n);return zo.extend(r,wa.prototype,n,{allOwnKeys:!0}),zo.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Fi(t,n))},r}(vi);Sa.Axios=wa,Sa.CanceledError=Pi,Sa.CancelToken=ma,Sa.isCancel=Li,Sa.VERSION=la,Sa.toFormData=oi,Sa.AxiosError=Zo,Sa.Cancel=Sa.CanceledError,Sa.all=function(e){return Promise.all(e)},Sa.spread=function(e){return function(t){return e.apply(null,t)}},Sa.isAxiosError=function(e){return zo.isObject(e)&&!0===e.isAxiosError},Sa.mergeConfig=Fi,Sa.AxiosHeaders=Ni,Sa.formToJSON=e=>Ai(zo.isHTMLForm(e)?new FormData(e):e),Sa.getAdapter=sa.getAdapter,Sa.HttpStatusCode=Aa,Sa.default=Sa;var va=n(3612);const ba={log:function(){if(va.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)}})},Da=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,ka();case 1:return ba.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",ba.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return ba.log("Utils dataLayerLoop: look for this element ",e),e[t]?(ba.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(ba.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)}}(),Ua=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,Da(t);case 1:return n=e.sent,ba.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)}}(),xa=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(ba.log("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(ba.log("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};ba.log("utils | Event: authentication ready: ",r),e(r)}catch(e){ba.log(e),t(e)}},!1))})},Ba=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 va.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(ba.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,ba.log("Received entitlementsReady event:",r),e(r)}catch(e){ba.error("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(ba.log("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ma=function(e){ba.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 ba.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=Ma;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var 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]:"Content ID",e.next=1,Da(t);case 1:return n=e.sent,ba.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)}}(),Ga=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,Da(t);case 1:return n=e.sent,ba.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)}}(),Ka=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:_a({},o)}));case 1:return r.next=2,Ua();case 2:return s=r.sent,r.next=3,Da("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,Ba();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,ba.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:_a({},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:_a({},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=Ka);var Wa=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=La();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,Ba();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,Ga();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,Ua();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,ka();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,Ha();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:Ha});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