/*! For license information please see mng-digisubs.apple.bundle.js.LICENSE.txt */ (()=>{var e={7526(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],c=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,c)),u=0,d=c>0?a-4:a;for(r=0;r>16&255,l[u++]=t>>8&255,l[u++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[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 r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function l(e,t,r){for(var n,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,r){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 l(e,t,r)}function l(e,t,r){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 r=0|f(e,t);let n=s(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){const t=new Uint8Array(e);return m(t.buffer,t.byteOffset,t.byteLength)}return p(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(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer))return m(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return m(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||q(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(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,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(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 u(e),s(e<0?0:0|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(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 r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(o)return n?-1:X(e).length;t=(""+t).toLowerCase(),o=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-c),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(i=c));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=f,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;tr&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(z(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===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),l=this.slice(n,o),u=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return b(this,e,t,r);case"base64":return v(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).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,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,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 k(e,t,r,n,o){j(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function U(e,t,r,n,o){j(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function B(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||B(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function x(e,t,r,n,i){return t=+t,r>>>=0,i||B(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(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||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=$(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(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||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=$(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||D(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(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,r){return e=+e,t>>>=0,r||L(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,r){return e=+e,t>>>=0,r||L(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,r){return e=+e,t>>>=0,r||L(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=$(function(e,t=0){return k(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let o=r-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+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(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,r){return e=+e,t>>>=0,r||L(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=$(function(e,t=0){return k(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function j(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new H.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,o,i)}function W(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new H.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?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,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=F(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=F(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function $(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},251(e,t){t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,u=-7,d=r?o-1:0,p=r?-1:1,m=e[t+d];for(d+=p,i=m&(1<<-u)-1,m>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(m?-1:1);a+=Math.pow(2,n),i-=l}return(m?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,c,l=8*i-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,h=n?1:-1,f=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=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=u?(s=0,a=u):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[r+m]=255&s,m+=h,s/=256,o-=8);for(a=a<0;e[r+m]=255&a,m+=h,a/=256,l-=8);e[r+m-h]|=128*f}},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,r){var n=r(5546);function o(){var t,r,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 u?o:u,c=Object.create(s.prototype);return n(c,"_invoke",function(e,n,o){var i,a,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(e,r){return i=e,a=0,s=t,p.n=r,l}};function m(e,n){for(a=e,s=n,r=0;!d&&c&&!o&&r3?(o=h===n)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=m&&((o=e<2&&mn||n>h)&&(i[4]=e,i[5]=n,p.n=h,a=0))}if(o||e>1)return l;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,h),a=u,s=h;(r=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(p.n=-1),m(a,s)):p.n=s:p.v=s);try{if(c=2,i){if(a||(o="next"),r=i[o]){if(!(r=r.call(i,s)))throw TypeError("iterator result is not an object");if(!r.done)return r;s=r.value,a<2&&(a=0)}else 1===a&&(r=i.return)&&r.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((r=(d=p.n<0)?s:e.call(n,p))!==l)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:r,done:d}}}(e,i,a),!0),c}var l={};function u(){}function d(){}function p(){}r=Object.getPrototypeOf;var m=[][a]?r(r([][a]())):(n(r={},a,function(){return this}),r),h=p.prototype=u.prototype=Object.create(m);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return d.prototype=p,n(h,"constructor",p),n(p,"constructor",d),d.displayName="GeneratorFunction",n(p,s,"GeneratorFunction"),n(h),n(h,s,"Generator"),n(h,a,function(){return this}),n(h,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m:f}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,r){var n=r(887);e.exports=function(e,t,r,o,i){var a=n(e,t,r,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,r){var n=r(6993),o=r(1791);e.exports=function(e,t,r,i,a){return new o(n().w(e,t,r,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,r){var n=r(5172),o=r(5546);e.exports=function e(t,r){function i(e,o,a,s){try{var c=t[e](o),l=c.value;return l instanceof n?r.resolve(l.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):r.resolve(l).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,n){function o(){return new r(function(t,r){i(e,n,t,r)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(r,n,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){function i(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,r){var n=r(5172),o=r(6993),i=r(5869),a=r(887),s=r(1791),c=r(4373),l=r(579);function u(){"use strict";var t=o(),r=t.m(u),d=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var m={throw:1,return:2,break:3,continue:3};function h(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,m[e],t)},delegateYield:function(e,o,i){return t.resultName=o,r(n.d,l(e),i)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=u=function(){return{wrap:function(e,r,n,o){return t.w(h(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:s,async:function(e,t,r,n,o){return(p(t)?a:i)(h(e),t,r,n,o)},keys:c,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,r){var n=r(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(r){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(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,r){var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},3612(e,t,r){"use strict";var n,o,i,a,s;r.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===(n=window.authentication_config)||void 0===n?void 0:n.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 r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.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,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=e.apply(r,n);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)})}}r.r(e),r.d(e,{hasBrowserEnv:()=>pi,hasStandardBrowserEnv:()=>hi,hasStandardBrowserWebWorkerEnv:()=>fi,navigator:()=>mi,origin:()=>yi});var o=r(4756);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 r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;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,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return atob(t)}}u.prototype.name="InvalidTokenError","function"==typeof SuppressedError&&SuppressedError;var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},m={},h={};Object.defineProperty(h,"__esModule",{value:!0});var f=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,r){var n=e.locked.get(t);void 0===n?void 0===r?e.locked.set(t,[]):e.locked.set(t,[r]):void 0!==r&&(n.unshift(r),e.locked.set(t,n))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(r,n){e.isLocked(t)?e.addToLocked(t,r):(e.addToLocked(t),r())})},this.unlock=function(t){var r=e.locked.get(t);if(void 0!==r&&0!==r.length){var n=r.pop();e.locked.set(t,r),void 0!==n&&setTimeout(n,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();h.default=function(){return f.getInstance()};var y=p&&p.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,s)}c((n=n.apply(e,t||[])).next())})},g=p&&p.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&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(r,t):r(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))})];case 1:return r.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 y(this,void 0,void 0,function(){return g(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 y(this,void 0,void 0,function(){var r,n,o,i;return g(this,function(a){switch(a.label){case 0:return r=void 0===this.storageHandler?S:this.storageHandler,n="browser-tabs-lock-key-"+t,null===(o=r.getItemSync(n))?[2]:(i=JSON.parse(o)).id!==this.id?[3,2]:[4,w.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),r.removeItemSync(n),w.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var r=Date.now()-5e3,n=t,o=[],i=0;;){var a=n.keySync(i);if(null===a)break;o.push(a),i++}for(var s=!1,c=0;c(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;T=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const r=[];for(let n=0;n(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;ne=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const r=[];for(let n=0;n{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw X("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,"")),r=new Uint8Array(t.length);for(let e=0;e0)return;if(t){if(0!==e)throw X("".concat(r," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",o);return}throw X("".concat(r," must be a positive number"),"ERR_INVALID_ARG_VALUE",o)}catch(e){if(n)throw ce(e.message,n,o);throw e}}function he(e,t,r,n){try{if("string"!=typeof e)throw X("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",n);if(0===e.length)throw X("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",n)}catch(e){if(r)throw ce(e.message,r,n);throw e}}function fe(e){!function(e,t){if(xe(e)!==t)throw function(e){let t='"response" content-type must be ';for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o2){const e=n.pop();"".concat(n.join(", "),", or ").concat(e)}else 2===n.length?"".concat(n[0]," or ").concat(n[1]):n[0];return ce(t,it,e)}(e,t)}(e,"application/json")}function ye(){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 Ae(e){const t=null==e?void 0:e[J];return"number"==typeof t&&Number.isFinite(t)?t:0}function we(e){const t=null==e?void 0:e[z];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Se(){return Math.floor(Date.now()/1e3)}function Ee(e){if("object"!=typeof e||null===e)throw X('"as" must be an object',"ERR_INVALID_ARG_TYPE");he(e.issuer,'"as.issuer"')}function be(e){if("object"!=typeof e||null===e)throw X('"client" must be an object',"ERR_INVALID_ARG_TYPE");he(e.client_id,'"client.client_id"')}function ve(e){return he(e,'"clientSecret"'),(t,r,n,o)=>{n.set("client_id",r.client_id),n.set("client_secret",e)}}function Re(e,t){const{key:r,kid:n}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&he(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw X("".concat(t," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),"private"!==e.type)throw X("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}(r,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:ge(r),kid:n},l=function(e,t){const r=Se()+Ae(t);return{jti:ye(),aud:e.issuer,exp:r+60,iat:r,nbf:r,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[Z]||void 0===s||s.call(t,c,l),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,r){if(!r.usages.includes("sign"))throw X('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const n="".concat(ie(re(JSON.stringify(e))),".").concat(ie(re(JSON.stringify(t)))),o=ie(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:yt(e)};case"RSA-PSS":switch(ft(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 ft(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})}(r),r,re(n)));return"".concat(n,".").concat(o)}(c,l,r))}}const Te=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function Pe(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,r,n){let o;if("string"!=typeof e||!Te(e))throw ce("authorization server metadata does not contain a valid ".concat(r?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?pt:mt,{attribute:r?"mtls_endpoint_aliases.".concat(t):t});return Pe(o,n),o}function Ie(e,t,r,n){return r&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?_e(e.mtls_endpoint_aliases[t],t,r,n):_e(e[t],t,r,n)}class Oe extends Error{constructor(e,t){var r;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===r||r.call(Error,this,this.constructor)}}class Ne extends Error{constructor(e,t){var r,n;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=rt,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==t.cause.get("error_description")&&void 0!==r?r:void 0,null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}class Ce extends Error{constructor(e,t){var r;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===r||r.call(Error,this,this.constructor)}}const De=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),Le=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),ke=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 Be(e,t,r){if(e.status!==t){let t;var n;if(function(e){let t;if(function(e){if(!Y(e,Response))throw X('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");const t=e.headers.get("www-authenticate");if(null===t)return;const r=[];let n=t;for(;n;){var o;let t=n.match(De);const i=null===t||void 0===o?void 0:o[1].toLowerCase();if(!i)return;const a=n.substring(t[0].length);if(a&&!a.match(/^[\s,]/))return;const s=a.match(/^\s+(.*)$/),c=!!s;s?s[1]:void 0;const l={};let u;if(c)for(;n;){let r,o;if(n.match(Le)){if([,r,o,n]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}l[r.toLowerCase()]=o}else{if(!n.match(ke)){if(n.match(Ue)){if(Object.keys(l).length)break;[,u,n]=t;break}return}[,r,o,n]=t,l[r.toLowerCase()]=o}}else 0;const d={scheme:i,parameters:l};u&&(d.token68=u),r.push(d)}return r.length?r:void 0}(e))throw new Ce("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){ht(e),fe(e);try{const t=await e.clone().json();if(le(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===e.body||void 0===n?void 0:n.cancel()),new Oe("server responded with an error in the response body",{cause:t,response:e});throw ce('"response" is not a conform '.concat(r," response (unexpected HTTP status code)"),at,e)}}function Me(e){if(!Ve.has(e))throw X('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function xe(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function He(e,t,r,n,o,i,a){return await r(e,t,o,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[q])||fetch)(n.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:de(n,null==a?void 0:a.signal)})}async function Ge(e,t,r,n,o,i){var a;const s=Ie(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[V]));o.set("grant_type",n);const c=ue(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(Me(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const l=await He(e,t,r,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(l,s),l}const Fe=new WeakMap,je=new WeakMap;function We(e){if(!e.id_token)return;const t=Fe.get(e);if(!t)throw X('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function Ke(e,t,r,n,o,i){if(Ee(e),be(t),!Y(r,Response))throw X('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Be(r,200,"Token Endpoint"),ht(r);const a=await Et(r);if(he(a.access_token,'"response" body "access_token" property',ot,{body:a}),he(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;me(e,!0,'"response" body "expires_in" property',ot,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&he(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){he(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&&(me(t.default_max_age,!0,'"client.default_max_age"'),i.push("auth_time")),null!=n&&n.length&&i.push(...n);const{claims:s,jwt:c}=await async function(e,t,r,n,o){let i,a,{0:s,1:c,length:l}=e.split(".");if(5===l){if(void 0===o)throw new ae("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:l}=e.split("."))}if(3!==l)throw ce("Invalid JWT",ot,e);try{JSON.parse(re(ie(s)))}catch(e){throw ce("failed to parse JWT Header body as base64url encoded JSON",nt,e)}if(!le(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(re(ie(c)))}catch(e){throw ce("failed to parse JWT Payload body as base64url encoded JSON",nt,e)}if(!le(a))throw ce("JWT Payload must be a top level object",ot,e);const u=Se()+r;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<=u-n)throw ce('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',lt,{claims:a,now:u,tolerance:n,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>u+n)throw ce('unexpected JWT "nbf" (not before) claim value',lt,{claims:a,now:u,tolerance:n,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"),Ae(t),we(t),o).then(qe.bind(void 0,i)).then(Xe.bind(void 0,e)).then(Ye.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',ut,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw ce('unexpected ID Token "azp" (authorized party) claim value',ut,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&me(s.auth_time,!0,'ID Token "auth_time" (authentication time)',ot,{claims:s}),je.set(r,c),Fe.set(a,s)}if(void 0!==(null==i?void 0:i[a.token_type]))i[a.token_type](r,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new ae("unsupported `token_type` value",{cause:{body:a}});return a}function Ye(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw ce('unexpected JWT "aud" (audience) claim value',ut,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw ce('unexpected JWT "aud" (audience) claim value',ut,{expected:e,claims:t.claims,claim:"aud"});return t}function Xe(e,t){var r,n;const o=null!==(null===e[vt]||void 0===n?void 0:n.call(e,t))&&void 0!==r?r:e.issuer;if(t.claims.iss!==o)throw ce('unexpected JWT "iss" (issuer) claim value',ut,{expected:o,claims:t.claims,claim:"iss"});return t}const Ve=new WeakSet,Je=Symbol(),ze={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function qe(e,t){for(const r of e)if(void 0===t.claims[r])throw ce('JWT "'.concat(r,'" (').concat(ze[r],") claim missing"),ot,{claims:t.claims});return t}const Ze=Symbol(),$e=Symbol();const Qe="OAUTH_WWW_AUTHENTICATE_CHALLENGE",et="OAUTH_RESPONSE_BODY_ERROR",tt="OAUTH_UNSUPPORTED_OPERATION",rt="OAUTH_AUTHORIZATION_RESPONSE_ERROR",nt="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",lt="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",ut="OAUTH_JWT_CLAIM_COMPARISON_FAILED",dt="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",pt="OAUTH_MISSING_SERVER_METADATA",mt="OAUTH_INVALID_SERVER_METADATA";function ht(e){if(e.bodyUsed)throw X('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function ft(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new ae("unsupported ".concat(t.name," modulusLength"),{cause:e})}function yt(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,r,n){if(void 0===e)if(Array.isArray(t)){if(!t.includes(n.alg))throw ce('unexpected JWT "alg" header parameter',ot,{header:n,expected:t,reason:"authorization server metadata"})}else{if(void 0===r)throw ce('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:r});if("string"==typeof r?n.alg!==r:"function"==typeof r?!r(n.alg):!r.includes(n.alg))throw ce('unexpected JWT "alg" header parameter',ot,{header:n,expected:r,reason:"default value"})}else if("string"==typeof e?n.alg!==e:!e.includes(n.alg))throw ce('unexpected JWT "alg" header parameter',ot,{header:n,expected:e,reason:"client configuration"})}function At(e,t){const{0:r,length:n}=e.getAll(t);if(n>1)throw ce('"'.concat(t,'" parameter must be provided only once'),ot);return r}const wt=Symbol(),St=Symbol();async function Et(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe;try{await e.json()}catch(t){throw r(e),ce('failed to parse "response" body as JSON',nt,t)}if(!le(t))throw ce('"response" body must be a top level object',ot,{body:t});return t}const bt=Symbol(),vt=Symbol(),Rt=new TextEncoder,Tt=new TextDecoder;function Pt(e){const t=new Uint8Array(e.length);for(let r=0;r127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}function _t(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:"unspecified",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:n,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=r,this.reason=n,this.payload=t}}M(Nt,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Ct extends Ot{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:n,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=r,this.reason=n,this.payload=t}}M(Ct,"code","ERR_JWT_EXPIRED");class Dt extends Ot{constructor(){super(...arguments),M(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}M(Dt,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Lt extends Ot{constructor(){super(...arguments),M(this,"code","ERR_JOSE_NOT_SUPPORTED")}}M(Lt,"code","ERR_JOSE_NOT_SUPPORTED"),M(class extends Ot{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 Ot{constructor(){super(...arguments),M(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class kt extends Ot{constructor(){super(...arguments),M(this,"code","ERR_JWS_INVALID")}}M(kt,"code","ERR_JWS_INVALID");class Ut extends Ot{constructor(){super(...arguments),M(this,"code","ERR_JWT_INVALID")}}M(Ut,"code","ERR_JWT_INVALID"),M(class extends Ot{constructor(){super(...arguments),M(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Bt extends Ot{constructor(){super(...arguments),M(this,"code","ERR_JWKS_INVALID")}}M(Bt,"code","ERR_JWKS_INVALID");class Mt extends Ot{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(Mt,"code","ERR_JWKS_NO_MATCHING_KEY");class xt extends Ot{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(xt,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Ht extends Ot{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 Ot{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 Ft=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))},jt=(e,t)=>e.name===t;function Wt(e){return parseInt(e.name.slice(4),10)}function Kt(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o2){const t=n.pop();e+="one of type ".concat(n.join(", "),", or ").concat(t,".")}else 2===n.length?e+="one of type ".concat(n[0]," or ").concat(n[1],"."):e+="of type ".concat(n[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 Yt=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-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}},Vt=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),Jt=e=>Xt(e)||Vt(e);function zt(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const qt=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r{const t=e.data[e.pos++];if(128&t){const r=127&t;let n=0;for(let t=0;t{if(e.data[e.pos++]!==t)throw new Error(r)},Qt=(e,t)=>{const r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},er=(e,t,r)=>{var n;const o=(e=>_t(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);let i=r;return null!=t&&null!==(n=t.startsWith)&&void 0!==n&&n.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=e=>{const t={data:e,pos:0};return function(e){$t(e,48,"Invalid PKCS#8 structure"),Zt(e),$t(e,2,"Expected version field");const t=Zt(e);e.pos+=t,$t(e,48,"Expected algorithm identifier");Zt(e);e.pos}(t),(e=>{const t=(e=>{$t(e,6,"Expected algorithm OID");const t=Zt(e);return Qt(e,t)})(e);if(qt(t,[43,101,110]))return"X25519";if(!qt(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");$t(e,6,"Expected curve OID");const r=Zt(e),n=Qt(e,r);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(qt(n,t))return e;throw new Error("Unsupported named curve")})(t)}),(async(e,t,r,n)=>{var o;let i,a;const s="spki"===e,c=()=>s?["verify"]:["sign"];switch(r){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(r.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(r.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(r.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"}[r]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const e=n.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new Lt("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:r},a=c();break;default:throw new Lt('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,null!==(o=null==n?void 0:n.extractable)&&void 0!==o?o:!!s,a)})("pkcs8",o,t,i)};async function tr(e){var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:o}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new Lt('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))},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e.alg.slice(-3))},r=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)},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Lt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=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},r=e.d?["deriveBits"]:[];break;default:throw new Lt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Lt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Lt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),i=H({},e);return"AKP"!==i.kty&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,n,null!==(t=e.ext)&&void 0!==t?t:!e.d&&!e.priv,null!==(r=e.key_ops)&&void 0!==r?r:o)}const rr=e=>zt(e)&&"string"==typeof e.kty;let nr;const or=async function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];nr||(nr=new WeakMap);let o=nr.get(e);if(null!=o&&o[r])return o[r];const i=await tr(H(H({},t),{},{alg:r}));return n&&Object.freeze(e),o?o[r]=i:nr.set(e,{[r]:i}),i};const ir=e=>null==e?void 0:e[Symbol.toStringTag],ar=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){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 n,o;let i;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):i=r;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):i="wrapKey";break;case"decrypt"===r:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===(null===(n=t.key_ops)||void 0===n||null===(o=n.includes)||void 0===o?void 0:o.call(n,i)))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};var sr,cr;let lr,ur;if("undefined"==typeof navigator||null===(sr=navigator.userAgent)||void 0===sr||null===(cr=sr.startsWith)||void 0===cr||!cr.call(sr,"Mozilla/5.0 ")){const e="v6.8.1";ur="".concat("openid-client","/").concat(e),lr={"user-agent":ur}}const dr=e=>pr.get(e);let pr,mr;function hr(e){return void 0!==e?ve(e):(mr||(mr=new WeakMap),(e,t,r,n)=>{let o;return(o=mr.get(t))||(function(e,t){if("string"!=typeof e)throw Ar("".concat(t," must be a string"),gr);if(0===e.length)throw Ar("".concat(t," must not be empty"),yr)}(t.client_secret,'"metadata.client_secret"'),o=ve(t.client_secret),mr.set(t,o)),o(e,t,r,n)})}const fr=q,yr="ERR_INVALID_ARG_VALUE",gr="ERR_INVALID_ARG_TYPE";function Ar(e,t,r){const n=new TypeError(e,{cause:r});return Object.assign(n,{code:t}),n}class wr extends Error{constructor(e,t){var r;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===r||r.call(Error,this,this.constructor)}}function Sr(e,t,r){return new wr(e,{cause:t,code:r})}function Er(e){if(e instanceof TypeError||e instanceof wr||e instanceof Oe||e instanceof Ne||e instanceof Ce)throw e;if(e instanceof se)switch(e.code){case st:throw Sr("only requests to HTTPS are allowed",e,e.code);case ct:throw Sr("only requests to HTTP or HTTPS are allowed",e,e.code);case at:throw Sr("unexpected HTTP response status code",e.cause,e.code);case it:throw Sr("unexpected response content-type",e.cause,e.code);case nt:throw Sr("parsing error occured",e,e.code);case ot:throw Sr("invalid response encountered",e,e.code);case ut:throw Sr("unexpected JWT claim value encountered",e,e.code);case dt:throw Sr("unexpected JSON attribute value encountered",e,e.code);case lt:throw Sr("JWT timestamp claim value failed validation",e,e.code);default:throw Sr(e.message,e,e.code)}if(e instanceof ae)throw Sr("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Sr("runtime operation error",e,tt);case"NotSupportedError":throw Sr("runtime unsupported operation",e,tt);case"TimeoutError":throw Sr("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Sr("operation aborted",e,"OAUTH_ABORT")}throw new wr("something went wrong",{cause:e})}async function br(e,t,r,n,o){const i=await async function(e,t){var r,n;if(!(e instanceof URL))throw Ar('"server" must be an instance of URL',gr);const o=!e.href.includes("/.well-known/"),i=null!==(null==t?void 0:t.timeout)&&void 0!==r?r:30,a=AbortSignal.timeout(1e3*i),s=await(o?async function(e,t){return async function(e,t,r,n){if(!(e instanceof URL))throw X('"'.concat("issuerIdentifier",'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");Pe(e,!0!==(null==n?void 0:n[V]));const o=r(new URL(e.href)),i=ue(null==n?void 0:n.headers);return i.set("accept","application/json"),((null==n?void 0:n[q])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:de(o,null==n?void 0:n.signal)})}(e,0,e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":!function(e){e.pathname=pe("".concat(e.pathname,"/").concat(".well-known/openid-configuration"))}(e);break;case"oauth2":!function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=pe("".concat(t,"/").concat(r?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw X('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[q]:null==t?void 0:t[fr],[V]:null==t||null===t.execute||void 0===n?void 0:n.includes(Nr),signal:a,headers:new Headers(lr)}):((null==t?void 0:t[fr])||fetch)((Pe(e,null==t||null===t.execute||void 0===c||!c.includes(Nr)),e.href),{headers:Object.fromEntries(new Headers(H({accept:"application/json"},lr)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const r=e;if(!(r instanceof URL)&&r!==bt)throw X('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!Y(t,Response))throw X('"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);ht(t);const n=await Et(t);if(he(n.issuer,'"response" body "issuer" property',ot,{body:n}),r!==bt&&new URL(n.issuer).href!==r.href)throw ce('"response" body "issuer" property does not match the expected value',dt,{expected:r.href,body:n,attribute:"issuer"});return n}(bt,e)).catch(Er);var c;return o&&new URL(s.issuer).href!==e.href&&(function(e,t,r){return!("https://login.microsoftonline.com"!==e.origin||null!=r&&r.algorithm&&"oidc"!==r.algorithm||(t[vr]=!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 wr("discovered metadata issuer does not match the expected issuer",{code:dt,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new Rr(i,t,r,n);let s=dr(a);if(null!=o&&o[fr]&&(s.fetch=o[fr]),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 vr=Symbol();class Rr{constructor(e,t,r,n){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw Ar('"clientId" must be a non-empty string',gr);if("string"==typeof r&&(r={client_secret:r}),void 0!==(null===(o=r)||void 0===o?void 0:o.client_id)&&t!==r.client_id)throw Ar('"clientId" and "metadata.client_id" must be the same',yr);const l=H(H({},structuredClone(r)),{},{client_id:t});let u;l[J]=null!==(i=null===(a=r)||void 0===a?void 0:a[J])&&void 0!==i?i:0,l[z]=null!==(s=null===(c=r)||void 0===c?void 0:c[z])&&void 0!==s?s:30,u=n||("string"==typeof l.client_secret&&l.client_secret.length?hr(l.client_secret):(e,t,r,n)=>{r.set("client_id",t.client_id)});let d=Object.freeze(l);const p=structuredClone(e);vr in e&&(p[vt]=t=>{let{claims:{tid:r}}=t;return e.issuer.replace("{tenantid}",r)});let m=Object.freeze(p);pr||(pr=new WeakMap),pr.set(this,{__proto__:null,as:m,c:d,auth:u,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(dr(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){var t;let r=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(r))}}}}(e))}(e),e}clientMetadata(){return structuredClone(dr(this).c)}get timeout(){return dr(this).timeout}set timeout(e){dr(this).timeout=e}get[fr](){return dr(this).fetch}set[fr](e){dr(this).fetch=e}}function Tr(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 We(this)}catch(e){return}}}}}(e))}async function Pr(e,t,r){var n;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=null===e.headers.get("retry-after")||void 0===n?void 0:n.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,r=e.getTime()-t.getTime();r>0&&Math.ceil(r/1e3)}}if(o&&!Number.isFinite(a))throw new se("invalid Retry-After header value",{cause:e});a>t&&await _r(a-t,r)}function _r(e,t){return new Promise((r,n)=>{const o=e=>{try{t.throwIfAborted()}catch(e){return void n(e)}if(e<=0)return void r();const i=Math.min(e,5);setTimeout(()=>o(e-i),1e3*i)};o(e)})}async function Ir(e,t){Br(e);const{as:r,c:n,auth:o,fetch:i,tlsOnly:a,timeout:s}=dr(e);return async function(e,t,r,n,o){Ee(e),be(t);const i=Ie(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[V])),a=new URLSearchParams(n);a.set("client_id",t.client_id);const s=ue(null==o?void 0:o.headers);return s.set("accept","application/json"),He(e,t,r,i,a,s,o)}(r,n,o,t,{[q]:i,[V]:!a,headers:new Headers(lr),signal:Mr(s)}).then(e=>async function(e,t,r){if(Ee(e),be(t),!Y(r,Response))throw X('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Be(r,200,"Backchannel Authentication Endpoint"),ht(r);const n=await Et(r);he(n.auth_req_id,'"response" body "auth_req_id" property',ot,{body:n});let o="number"!=typeof n.expires_in?parseFloat(n.expires_in):n.expires_in;return me(o,!0,'"response" body "expires_in" property',ot,{body:n}),n.expires_in=o,void 0!==n.interval&&me(n.interval,!1,'"response" body "interval" property',ot,{body:n}),n}(r,n,e)).catch(Er)}async function Or(e,t,r,n){var o,i;Br(e),new URLSearchParams(r);let a=null!==t.interval&&void 0!==o?o:5;const s=null!==(null==n?void 0:n.signal)&&void 0!==i?i:AbortSignal.timeout(1e3*t.expires_in);try{await _r(a,s)}catch(e){Er(e)}const{as:c,c:l,auth:u,fetch:d,tlsOnly:p,nonRepudiation:m,timeout:h,decrypt:f}=dr(e),y=(o,i)=>Or(e,H(H({},t),{},{interval:o}),r,H(H({},n),{},{signal:s,flag:i})),g=await async function(e,t,r,n,o){Ee(e),be(t),he(n,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",n),Ge(e,t,r,"urn:openid:params:grant-type:ciba",i,o)}(c,l,u,t.auth_req_id,{[q]:d,[V]:!p,additionalParameters:r,DPoP:null==n?void 0:n.DPoP,headers:new Headers(lr),signal:s.aborted?s:Mr(h)}).catch(Er);var A;if(503===g.status&&g.headers.has("retry-after"))return await Pr(g,a,s,!0),await(null===g.body||void 0===A?void 0:A.cancel()),y(a);const w=async function(e,t,r,n){return Ke(e,t,r,void 0,null==n?void 0:n[Q],null==n?void 0:n.recognizedTokenTypes)}(c,l,g,{[Q]:f});let S;try{await w}catch(e){if(xr(e,n))return y(a,Hr);if(e instanceof Oe)switch(e.error){case"slow_down":0;case"authorization_pending":return await Pr(e.response,a,s),y(a)}Er(e)}return S.id_token&&await(null==m?void 0:m(g)),Tr(S),S}function Nr(e){dr(e).tlsOnly=!1}async function Cr(e,t,r,n,o){if(Br(e),!((null==o?void 0:o.flag)===Hr||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw Ar('"currentUrl" must be an instance of URL, or Request',gr);let i,a;const{as:s,c,auth:l,fetch:u,tlsOnly:d,jarm:p,hybrid:m,nonRepudiation:h,timeout:f,decrypt:y,implicit:g}=dr(e);if((null==o?void 0:o.flag)===Hr)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 r=new URLSearchParams(await async function(e){if("POST"!==e.method)throw X("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if("application/x-www-form-urlencoded"!==xe(e))throw X("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 X("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{cause:e});return e.text()}(e)}(e));if(m)t.hash=r.toString();else for(const[e,n]of r.entries())t.searchParams.append(e,n);break;default:throw Ar("unexpected Request HTTP method",yr)}}switch(function(e){return new URL(e).search="",e.hash="",e.href}(t),!0){case!!p:await p(t,null==r?void 0:r.expectedState);break;case!!m:await m(t,null==r?void 0:r.expectedNonce,null==r?void 0:r.expectedState,null==r?void 0:r.maxAge);break;case!!g:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{(function(e,t,r,n){if(Ee(e),be(t),r instanceof URL&&r.searchParams,!(r instanceof URLSearchParams))throw X('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(At(r,"response"))throw ce('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',ot,{parameters:r});const o=At(r,"iss"),i=At(r,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw ce('response parameter "iss" (issuer) missing',ot,{parameters:r});if(o&&o!==e.issuer)throw ce('unexpected "iss" (issuer) response parameter value',ot,{expected:e.issuer,parameters:r});switch(n){case void 0:case St:if(void 0!==i)throw ce('unexpected "state" response parameter encountered',ot,{expected:void 0,parameters:r});break;case wt:break;default:if(he(n,'"expectedState" argument'),i!==n)throw ce(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',ot,{expected:n,parameters:r})}if(At(r,"error"))throw new Ne("authorization response from the server is an error",{cause:r});const a=At(r,"id_token"),s=At(r,"token");if(void 0!==a||void 0!==s)throw new ae("implicit and hybrid flows are not supported");return new URLSearchParams(r),Ve.add(c),c;var c})(s,c,t.searchParams,null==r?void 0:r.expectedState)}catch(e){Er(e)}}}const A=await async function(e,t,r,n,o,i,a){if(Ee(e),be(t),!Ve.has(n))throw X('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");he(o,'"redirectUri"');const s=At(n,"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!==Je&&(he(i,'"codeVerifier"'),c.set("code_verifier",i)),Ge(e,t,r,"authorization_code",c,a)}(s,c,l,i,a,(null==r?void 0:r.pkceCodeVerifier)||Je,{additionalParameters:n,[q]:u,[V]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(lr),signal:Mr(f)}).catch(Er);"string"!=typeof(null==r?void 0:r.expectedNonce)&&"number"!=typeof(null==r?void 0:r.maxAge)||(r.idTokenExpected=!0);const w=async function(e,t,r,n){return"string"==typeof(null==n?void 0:n.expectedNonce)||"number"==typeof(null==n?void 0:n.maxAge)||null!=n&&n.requireIdToken?async function(e,t,r,n,o,i,a){const s=[];switch(n){case void 0:0;break;case Ze:break;default:he(n,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case $e:break;default:me(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await Ke(e,t,r,s,i,a);he(c.id_token,'"response" body "id_token" property',ot,{body:c});const l=We(c);if(o!==$e){const e=Se()+Ae(t),r=we(t);if(l.auth_time+o{let r;return"urn:ietf:params:oauth:grant-type:token-exchange"===t&&{n_a:()=>{}},async function(e,t,r,n){return Ke(e,t,r,void 0,null==n?void 0:n[Q],null==n?void 0:n.recognizedTokenTypes)}(o,i,e,{[Q]:u,recognizedTokenTypes:r})}).catch(Er);return Tr(d),d}async function Fr(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n"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!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!i.has(t))throw new Lt('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===n[t])throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return new Set(n.crit)}(kt,new Map([["b64",!0]]),null==r?void 0:r.crit,n,o);let a=!0;if(i.has("b64")&&(n.b64,"boolean"!=typeof a))throw new kt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new kt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&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,r.algorithms);if(c&&!c.has(s))throw new Dt('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new kt("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new kt("JWS Payload must be a string or an Uint8Array instance");let l=!1;"function"==typeof t&&(await t(n,e),!0),function(e,t,r){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if(rr(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&ar(e,t,r))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(!Jt(t))throw new TypeError(Yt(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(ir(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,r);break;default:((e,t,r)=>{if(rr(t))switch(r){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&ar(e,t,r))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)&&ar(e,t,r))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Jt(t))throw new TypeError(Yt(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(ir(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(r){case"sign":throw new TypeError("".concat(ir(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(ir(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(r){case"verify":throw new TypeError("".concat(ir(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(ir(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,r)}}(s,t,"verify");const u=function(){for(var e=arguments.length,t=new Array(e),r=0;r{let{length:r}=t;return e+r},0),o=new Uint8Array(n);let i=0;for(const e of t)o.set(e,i),e.length;return o}(void 0!==e.protected?Pt(e.protected):new Uint8Array,Pt("."),"string"==typeof e.payload?a?Pt(e.payload):Rt.encode(e.payload):e.payload);let d;try{It(e.signature)}catch(e){throw new kt("Failed to base64url decode the signature")}const p=await async function(e,t){if(e instanceof Uint8Array)return e;if(Xt(e))return e;if(Vt(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{nr||(nr=new WeakMap);let r=nr.get(e);if(null!=r&&r[t])return r[t];const n="public"===e.type,o=!!n;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,n?[]:["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,[n?"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,[n?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let r;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:r},o,n?["encrypt"]:["decrypt"]);e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:r},o,[n?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var a;const r=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null===e.asymmetricKeyDetails||void 0===a?void 0:a.namedCurve);if(!r)throw new TypeError("given KeyObject instance cannot be used for this algorithm");"ES256"===t&&"P-256"===r&&e.toCryptoKey({name:"ECDSA",namedCurve:r},o,[n?"verify":"sign"]),"ES384"===t&&"P-384"===r&&e.toCryptoKey({name:"ECDSA",namedCurve:r},o,[n?"verify":"sign"]),"ES512"===t&&"P-521"===r&&e.toCryptoKey({name:"ECDSA",namedCurve:r},o,[n?"verify":"sign"]),t.startsWith("ECDH-ES")&&e.toCryptoKey({name:"ECDH",namedCurve:r},o,n?[]:["deriveBits"])}if(!i)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return r?r[t]=i:nr.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return or(e,r,t)}if(rr(e))return e.k?It(e.k):or(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,r,n){const o=await Fr(e,t,"verify");!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}}(e,o);const i=function(e,t){const r="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,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 Lt("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}(e,o.algorithm);try{return await crypto.subtle.verify(i,o,r,n)}catch(e){return!1}}(s,p,d,u))throw new Gt;let m;if(a)try{It(e.payload)}catch(e){throw new kt("Failed to base64url decode the payload")}else"string"==typeof e.payload?Rt.encode(e.payload):e.payload;const h={payload:m};return void 0!==e.protected&&(h.protectedHeader=n),void 0!==e.header&&(h.unprotectedHeader=e.header),l?H(H({},h),{},{key:p}):h}const Wr=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Kr(e){const t=Wr.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const r=parseFloat(t[2]);let n;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":Math.round(60*r);break;case"hour":case"hours":case"hr":case"hrs":case"h":Math.round(3600*r);break;case"day":case"days":case"d":Math.round(86400*r);break;case"week":case"weeks":case"w":Math.round(604800*r);break;default:Math.round(31557600*r)}return"-"===t[1]||"ago"===t[4]?-n:n}const Yr=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());async function Xr(e,t,r){var n;const o=await async function(e,t,r){if(e instanceof Uint8Array&&Tt.decode(e),"string"!=typeof e)throw new kt("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:i,length:a}=e.split(".");if(3!==a)throw new kt("Invalid Compact JWS");const s=await jr({payload:o,protected:n,signature:i},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?H(H({},c),{},{key:s.key}):c}(e,t,r);if(null!==o.protectedHeader.crit&&void 0!==n&&n.includes("b64")&&!1===o.protectedHeader.b64)throw new Ut("JWTs MUST NOT use unencoded payload");const i=function(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{JSON.parse(Tt.decode(t))}catch(e){}if(!zt(r))throw new Ut("JWT Claims Set must be a top-level JSON object");const{typ:o}=n;if(o&&("string"!=typeof e.typ||Yr(e.typ)!==Yr(o)))throw new Nt('unexpected "typ" JWT header value',r,"typ","check_failed");const{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:l}=n,u=[...i];void 0!==l&&u.push("iat"),void 0!==c&&u.push("aud"),void 0!==s&&u.push("sub"),void 0!==a&&u.push("iss");for(const e of new Set(u.reverse()))if(!(e in r))throw new Nt('missing required "'.concat(e,'" claim'),r,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(r.iss))throw new Nt('unexpected "iss" claim value',r,"iss","check_failed");if(s&&r.sub!==s)throw new Nt('unexpected "sub" claim value',r,"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))))(r.aud,"string"==typeof c?[c]:c))throw new Nt('unexpected "aud" claim value',r,"aud","check_failed");let d;switch(typeof n.clockTolerance){case"string":Kr(n.clockTolerance);break;case"number":n.clockTolerance;break;case"undefined":0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:p}=n,m=(e=>Math.floor(e.getTime()/1e3))(p||new Date);if((void 0!==r.iat||l)&&"number"!=typeof r.iat)throw new Nt('"iat" claim must be a number',r,"iat","invalid");if(void 0!==r.nbf){if("number"!=typeof r.nbf)throw new Nt('"nbf" claim must be a number',r,"nbf","invalid");if(r.nbf>m+d)throw new Nt('"nbf" claim timestamp check failed',r,"nbf","check_failed")}if(void 0!==r.exp){if("number"!=typeof r.exp)throw new Nt('"exp" claim must be a number',r,"exp","invalid");if(r.exp<=m-d)throw new Ct('"exp" claim timestamp check failed',r,"exp","check_failed")}if(l){const e=m-r.iat;if(e-d>("number"==typeof l?l:Kr(l)))throw new Ct('"iat" claim timestamp check failed (too far in the past)',r,"iat","check_failed");if(e<0-d)throw new Nt('"iat" claim timestamp check failed (it should be in the past)',r,"iat","check_failed")}return r}(o.protectedHeader,o.payload,r),a={payload:i,protectedHeader:o.protectedHeader};return"function"==typeof t?H(H({},a),{},{key:o.key}):a}function Vr(e){return zt(e)}var Jr,zr,qr=new WeakMap,Zr=new WeakMap;class $r{constructor(e){if(U(this,qr,void 0),U(this,Zr,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Vr)}(e))throw new Bt("JSON Web Key Set malformed");B(qr,this,structuredClone(e))}jwks(){return k(qr,this)}async getKey(e,t){const{alg:r,kid:n}=H(H({},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 Lt('Unsupported "alg" value for a JSON Web Key Set')}}(r),i=k(qr,this).keys.filter(e=>{let t=o===e.kty;if(t&&"string"==typeof n&&n===e.kid,!t||"string"!=typeof e.alg&&"AKP"!==o||r===e.alg,t&&"string"==typeof e.use&&"sig"===e.use,t&&Array.isArray(e.key_ops)&&e.key_ops.includes("verify"),t)switch(r){case"ES256":"P-256"===e.crv;break;case"ES384":"P-384"===e.crv;break;case"ES512":"P-521"===e.crv;break;case"Ed25519":case"EdDSA":"Ed25519"===e.crv}return t}),{0:a,length:s}=i;if(0===s)throw new Mt;if(1!==s){const e=new xt,t=k(Zr,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new F(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield D(Qr(t,e,r))}catch(e){}}),e}return Qr(k(Zr,this),a,r)}}async function Qr(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await async function(e,t){if(!zt(e))throw new TypeError("JWK must be an object");let r;switch(null!=t||e.alg,null!=r||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 Lt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return tr(H(H({},e),{},{alg:t,ext:r}));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 tr(H(H({},e),{},{ext:r}));case"EC":case"OKP":return tr(H(H({},e),{},{alg:t,ext:r}));default:throw new Lt('Unsupported "kty" (Key Type) Parameter value')}}(H(H({},t),{},{ext:!0}),r);if(e instanceof Uint8Array||"public"!==e.type)throw new Bt("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function en(e){const t=new $r(e),r=async(e,r)=>t.getKey(e,r);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}let tn;if("undefined"==typeof navigator||null===(Jr=navigator.userAgent)||void 0===Jr||null===(zr=Jr.startsWith)||void 0===zr||!zr.call(Jr,"Mozilla/5.0 ")){const e="v6.1.3";tn="".concat("jose","/").concat(e)}const rn=Symbol(),nn=Symbol();var on=new WeakMap,an=new WeakMap,sn=new WeakMap,cn=new WeakMap,ln=new WeakMap,un=new WeakMap,dn=new WeakMap,pn=new WeakMap,mn=new WeakMap,hn=new WeakMap;class fn{constructor(e,t){if(U(this,on,void 0),U(this,an,void 0),U(this,sn,void 0),U(this,cn,void 0),U(this,ln,void 0),U(this,un,void 0),U(this,dn,void 0),U(this,pn,void 0),U(this,mn,void 0),U(this,hn,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var r,n;B(on,this,new URL(e.href)),B(an,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),B(sn,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),B(cn,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),B(dn,this,new Headers(null==t?void 0:t.headers)),tn&&!k(dn,this).has("User-Agent")&&k(dn,this).set("User-Agent",tn),k(dn,this).has("accept")||(k(dn,this).set("accept","application/json"),k(dn,this).append("accept","application/jwk-set+json")),B(pn,this,null==t?void 0:t[rn]),void 0!==(null==t?void 0:t[nn])&&(B(hn,this,null==t?void 0:t[nn]),null==t?void 0:t[nn],k(cn,this),"object"==typeof r&&null!==r&&"uat"in r&&"number"==typeof r.uat&&!(Date.now()-r.uat>=n)&&"jwks"in r&&zt(r.jwks)&&Array.isArray(r.jwks.keys)&&Array.prototype.every.call(r.jwks.keys,zt)&&(B(ln,this,k(hn,this).uat),B(mn,this,en(k(hn,this).jwks))))}pendingFetch(){return!!k(un,this)}coolingDown(){return"number"==typeof k(ln,this)&&Date.now()3&&void 0!==arguments[3]?arguments[3]:fetch;const o=await n(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new Ht;throw e});if(200!==o.status)throw new Ot("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new Ot("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(k(on,this).href,k(dn,this),AbortSignal.timeout(k(an,this)),k(pn,this)).then(e=>{B(mn,this,en(e)),k(hn,this)&&(k(hn,this).uat=Date.now(),k(hn,this).jwks=e),B(ln,this,Date.now()),B(un,this,void 0)}).catch(e=>{throw B(un,this,void 0),e})),await k(un,this)}}const yn=["mfaToken"],gn=["mfaToken"];var An,wn,Sn,En,bn,vn,Rn,Tn,Pn=class extends Error{constructor(e,t){super(t),M(this,"code",void 0),this.name="NotSupportedError",this.code=e}},_n=class extends Error{constructor(e,t,r){super(t),M(this,"cause",void 0),M(this,"code",void 0),this.code=e,this.cause=r&&{error:r.error,error_description:r.error_description,message:r.message}}},In=class extends _n{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},On=class extends _n{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Nn=class extends _n{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Cn=class extends _n{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Dn=class extends _n{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Ln=class extends Error{constructor(e){super(e),M(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},kn=class extends _n{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"}},Un=class extends _n{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},Bn=class extends _n{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},Mn=class extends _n{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},xn=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 Hn(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>H(H({},e),{},{[t[0]]:t[1]}),{})}var Gn=class extends Error{constructor(e,t,r){super(t),M(this,"cause",void 0),M(this,"code",void 0),this.code=e,this.cause=r&&{error:r.error,error_description:r.error_description,message:r.message}}},Fn=class extends Gn{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},jn=class extends Gn{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},Wn=class extends Gn{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},Kn=class extends Gn{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function Yn(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var Xn=(An=new WeakMap,wn=new WeakMap,Sn=new WeakMap,class{constructor(e){var t;U(this,An,void 0),U(this,wn,void 0),U(this,Sn,void 0),B(An,this,"https://".concat(e.domain)),B(wn,this,e.clientId),B(Sn,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(k(An,this),"/mfa/authenticators"),{mfaToken:r}=e,n=await k(Sn,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(!n.ok){const e=await n.json();throw new Fn(e.error_description||"Failed to list authenticators",e)}return(await n.json()).map(Yn)}async enrollAuthenticator(e){const t="".concat(k(An,this),"/mfa/associate"),{mfaToken:r}=e,n=G(e,yn),o={authenticator_types:n.authenticatorTypes};"oobChannels"in n&&(o.oob_channels=n.oobChannels),"phoneNumber"in n&&n.phoneNumber&&(o.phone_number=n.phoneNumber),"email"in n&&n.email&&(o.email=n.email);const i=await k(Sn,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new jn(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:r}=e,n="".concat(k(An,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await k(Sn,this).call(this,n,{method:"DELETE",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(!o.ok){const e=await o.json();throw new Wn(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(k(An,this),"/mfa/challenge"),{mfaToken:r}=e,n=G(e,gn),o={mfa_token:r,client_id:k(wn,this),challenge_type:n.challengeType};n.authenticatorId&&(o.authenticator_id=n.authenticatorId);const i=await k(Sn,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 Kn(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())}}),Vn=class e{constructor(e,t,r,n,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=r,this.refreshToken=n,this.expiresAt=t,this.scope=o,this.claims=i,this.authorizationDetails=a}static fromTokenEndpointResponse(t){const r=t.id_token?t.claims():void 0,n=new e(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,r,t.authorization_details);return n.tokenType=t.token_type,n.issuedTokenType=t.issued_token_type,n}},Jn="openid profile email offline_access",zn=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 qn(e){if(null==e)throw new Dn("subject_token is required");if("string"!=typeof e)throw new Dn("subject_token must be a string");if(0===e.trim().length)throw new Dn("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Dn("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Dn("subject_token must not include the 'Bearer ' prefix")}function Zn(e,t){if(t)for(const[r,n]of Object.entries(t))if(!zn.has(r))if(Array.isArray(n)){if(n.length>20)throw new Dn("Parameter '".concat(r,"' exceeds maximum array size of ").concat(20));n.forEach(t=>{e.append(r,t)})}else e.append(r,n)}En=new WeakMap,bn=new WeakMap,vn=new WeakMap,Rn=new WeakMap,Tn=new WeakSet;async function $n(){if(k(En,this)&&k(bn,this))return{configuration:k(En,this),serverMetadata:k(bn,this)};const e=await C(Tn,this,to).call(this);return B(En,this,await br(new URL("https://".concat(k(vn,this).domain)),k(vn,this).clientId,{use_mtls_endpoint_aliases:k(vn,this).useMtls},e,{[fr]:k(vn,this).customFetch})),B(bn,this,k(En,this).serverMetadata()),k(En,this)[fr]=k(vn,this).customFetch||fetch,{configuration:k(En,this),serverMetadata:k(bn,this)}}async function Qn(e){var t,r;const{configuration:n}=await C(Tn,this,$n).call(this);if("audience"in e||"resource"in e)throw new Dn("audience and resource parameters are not supported for Token Vault exchanges");qn(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!==r?r:"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),Zn(o,e.extra);try{const e=await Gr(n,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return Vn.fromTokenEndpointResponse(e)}catch(t){throw new Dn("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function eo(e){const{configuration:t}=await C(Tn,this,$n).call(this);qn(e.subjectToken);const r=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&r.append("audience",e.audience),e.scope&&r.append("scope",e.scope),e.requestedTokenType&&r.append("requested_token_type",e.requestedTokenType),e.organization&&r.append("organization",e.organization),Zn(r,e.extra);try{const e=await Gr(t,"urn:ietf:params:oauth:grant-type:token-exchange",r);return Vn.fromTokenEndpointResponse(e)}catch(t){throw new Dn("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function to(){if(!k(vn,this).clientSecret&&!k(vn,this).clientAssertionSigningKey&&!k(vn,this).useMtls)throw new xn;if(k(vn,this).useMtls)return(e,t,r,n)=>{r.set("client_id",t.client_id)};let e=k(vn,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 er(e,t,void 0)}(e,k(vn,this).clientAssertionSigningAlg||"RS256"),e?function(e){return Re(e,void 0)}(e):hr(k(vn,this).clientSecret)}async function ro(e){const{configuration:t}=await C(Tn,this,$n).call(this),r=ye(),n=await function(e){return async function(e){return he(e,"codeVerifier"),ie(await crypto.subtle.digest("SHA-256",re(e)))}(e)}(r),o=Hn(H(H({},k(vn,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(H(H({scope:Jn},o),{},{client_id:k(vn,this).clientId,code_challenge:n,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Ur(t,i):await kr(t,i),codeVerifier:r}}new R;function no(e,t){return function(){return e.apply(t,arguments)}}const{toString:oo}=Object.prototype,{getPrototypeOf:io}=Object,{iterator:ao,toStringTag:so}=Symbol,co=(lo=Object.create(null),e=>{const t=oo.call(e);return lo[t]||(lo[t]=t.slice(8,-1).toLowerCase())});var lo;const uo=e=>(e=e.toLowerCase(),t=>co(t)===e),po=e=>t=>typeof t===e,{isArray:mo}=Array,ho=po("undefined");function fo(e){return null!==e&&!ho(e)&&null!==e.constructor&&!ho(e.constructor)&&Ao(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const yo=uo("ArrayBuffer");const go=po("string"),Ao=po("function"),wo=po("number"),So=e=>null!==e&&"object"==typeof e,Eo=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)},bo=uo("Date"),vo=uo("File"),Ro=uo("Blob"),To=uo("FileList"),Po=uo("URLSearchParams"),[_o,Io,Oo,No]=["ReadableStream","Request","Response","Headers"].map(uo);function Co(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),mo(e))for(n=0,o=e.length;n0;)if(n=r[o],t===n.toLowerCase())return n;return null}const Lo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,ko=e=>!ho(e)&&e!==Lo;const Uo=(Bo="undefined"!=typeof Uint8Array&&io(Uint8Array),e=>Bo&&e instanceof Bo);var Bo;const Mo=uo("HTMLFormElement"),xo=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ho=uo("RegExp"),Go=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Co(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)};const Fo=uo("AsyncFunction"),jo=(Wo="function"==typeof setImmediate,Ko=Ao(Lo.postMessage),Wo?setImmediate:Ko?(Yo=`axios@${Math.random()}`,Xo=[],Lo.addEventListener("message",({source:e,data:t})=>{e===Lo&&t===Yo&&Xo.length&&Xo.shift()()},!1),e=>{Xo.push(e),Lo.postMessage(Yo,"*")}):e=>setTimeout(e));var Wo,Ko,Yo,Xo;const Vo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Lo):"undefined"!=typeof process&&process.nextTick||jo,Jo={isArray:mo,isArrayBuffer:yo,isBuffer:fo,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ao(e.append)&&("formdata"===(t=co(e))||"object"===t&&Ao(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&yo(e.buffer),t},isString:go,isNumber:wo,isBoolean:e=>!0===e||!1===e,isObject:So,isPlainObject:Eo,isEmptyObject:e=>{if(!So(e)||fo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:_o,isRequest:Io,isResponse:Oo,isHeaders:No,isUndefined:ho,isDate:bo,isFile:vo,isBlob:Ro,isRegExp:Ho,isFunction:Ao,isStream:e=>So(e)&&Ao(e.pipe),isURLSearchParams:Po,isTypedArray:Uo,isFileList:To,forEach:Co,merge:function e(){const{caseless:t,skipUndefined:r}=ko(this)&&this||{},n={},o=(o,i)=>{const a=t&&Do(n,i)||i;Eo(n[a])&&Eo(o)?n[a]=e(n[a],o):Eo(o)?n[a]=e({},o):mo(o)?n[a]=o.slice():r&&ho(o)||(n[a]=o)};for(let e=0,t=arguments.length;e(Co(t,(t,n)=>{r&&Ao(t)?Object.defineProperty(e,n,{value:no(t,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{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],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&io(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:co,kindOfTest:uo,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(mo(e))return e;let t=e.length;if(!wo(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[ao]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Mo,hasOwnProperty:xo,hasOwnProp:xo,reduceDescriptors:Go,freezeMethods:e=>{Go(e,(t,r)=>{if(Ao(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Ao(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return mo(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Do,global:Lo,isContextDefined:ko,isSpecCompliantForm:function(e){return!!(e&&Ao(e.append)&&"FormData"===e[so]&&e[ao])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(So(e)){if(t.indexOf(e)>=0)return;if(fo(e))return e;if(!("toJSON"in e)){t[n]=e;const o=mo(e)?[]:{};return Co(e,(e,t)=>{const i=r(e,n+1);!ho(i)&&(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:Fo,isThenable:e=>e&&(So(e)||Ao(e))&&Ao(e.then)&&Ao(e.catch),setImmediate:jo,asap:Vo,isIterable:e=>null!=e&&Ao(e[ao])};class zo extends Error{static from(e,t,r,n,o,i){const a=new zo(e.message,t||e.code,r,n,o);return a.cause=e,a.name=e.name,i&&Object.assign(a,i),a}constructor(e,t,r,n,o){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),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:Jo.toJSONObject(this.config),code:this.code,status:this.status}}}zo.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",zo.ERR_BAD_OPTION="ERR_BAD_OPTION",zo.ECONNABORTED="ECONNABORTED",zo.ETIMEDOUT="ETIMEDOUT",zo.ERR_NETWORK="ERR_NETWORK",zo.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",zo.ERR_DEPRECATED="ERR_DEPRECATED",zo.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",zo.ERR_BAD_REQUEST="ERR_BAD_REQUEST",zo.ERR_CANCELED="ERR_CANCELED",zo.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",zo.ERR_INVALID_URL="ERR_INVALID_URL";const qo=zo;var Zo=r(8287).hp;function $o(e){return Jo.isPlainObject(e)||Jo.isArray(e)}function Qo(e){return Jo.endsWith(e,"[]")?e.slice(0,-2):e}function ei(e,t,r){return e?e.concat(t).map(function(e,t){return e=Qo(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const ti=Jo.toFlatObject(Jo,{},null,function(e){return/^is[A-Z]/.test(e)});const ri=function(e,t,r){if(!Jo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Jo.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Jo.isUndefined(t[e])})).metaTokens,o=r.visitor||l,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Jo.isSpecCompliantForm(t);if(!Jo.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Jo.isDate(e))return e.toISOString();if(Jo.isBoolean(e))return e.toString();if(!s&&Jo.isBlob(e))throw new qo("Blob is not supported. Use a Buffer instead.");return Jo.isArrayBuffer(e)||Jo.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Zo.from(e):e}function l(e,r,o){let s=e;if(e&&!o&&"object"==typeof e)if(Jo.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Jo.isArray(e)&&function(e){return Jo.isArray(e)&&!e.some($o)}(e)||(Jo.isFileList(e)||Jo.endsWith(r,"[]"))&&(s=Jo.toArray(e)))return r=Qo(r),s.forEach(function(e,n){!Jo.isUndefined(e)&&null!==e&&t.append(!0===a?ei([r],n,i):null===a?r:r+"[]",c(e))}),!1;return!!$o(e)||(t.append(ei(o,r,i),c(e)),!1)}const u=[],d=Object.assign(ti,{defaultVisitor:l,convertValue:c,isVisitable:$o});if(!Jo.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Jo.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),Jo.forEach(r,function(r,i){!0===(!(Jo.isUndefined(r)||null===r)&&o.call(t,r,Jo.isString(i)?i.trim():i,n,d))&&e(r,n?n.concat(i):[i])}),u.pop()}}(e),t};function ni(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function oi(e,t){this._pairs=[],e&&ri(e,this,t)}const ii=oi.prototype;ii.append=function(e,t){this._pairs.push([e,t])},ii.toString=function(e){const t=e?function(t){return e.call(this,t,ni)}:ni;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ai=oi;function si(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ci(e,t,r){if(!t)return e;const n=r&&r.encode||si,o=Jo.isFunction(r)?{serialize:r}:r,i=o&&o.serialize;let a;if(a=i?i(t,o):Jo.isURLSearchParams(t)?t.toString():new ai(t,o).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const li=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Jo.forEach(this.handlers,function(t){null!==t&&e(t)})}},ui={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},di={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ai,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,mi="object"==typeof navigator&&navigator||void 0,hi=pi&&(!mi||["ReactNative","NativeScript","NS"].indexOf(mi.product)<0),fi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,yi=pi&&window.location.href||"http://localhost",gi={...e,...di};const Ai=function(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&Jo.isArray(n)?n.length:i,s)return Jo.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&Jo.isObject(n[i])||(n[i]=[]);return t(e,r,n[i],o)&&Jo.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n{t(function(e){return Jo.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null};const wi={transitional:ui,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Jo.isObject(e);o&&Jo.isHTMLForm(e)&&(e=new FormData(e));if(Jo.isFormData(e))return n?JSON.stringify(Ai(e)):e;if(Jo.isArrayBuffer(e)||Jo.isBuffer(e)||Jo.isStream(e)||Jo.isFile(e)||Jo.isBlob(e)||Jo.isReadableStream(e))return e;if(Jo.isArrayBufferView(e))return e.buffer;if(Jo.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ri(e,new gi.classes.URLSearchParams,{visitor:function(e,t,r,n){return gi.isNode&&Jo.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Jo.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ri(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(Jo.isString(e))try{return(t||JSON.parse)(e),Jo.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||wi.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Jo.isResponse(e)||Jo.isReadableStream(e))return e;if(e&&Jo.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw qo.from(e,qo.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:gi.classes.FormData,Blob:gi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Jo.forEach(["delete","get","head","post","put","patch"],e=>{wi.headers[e]={}});const Si=wi,Ei=Jo.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bi=Symbol("internals");function vi(e){return e&&String(e).trim().toLowerCase()}function Ri(e){return!1===e||null==e?e:Jo.isArray(e)?e.map(Ri):String(e)}function Ti(e,t,r,n,o){return Jo.isFunction(n)?n.call(this,t,r):(o&&(t=r),Jo.isString(t)?Jo.isString(n)?-1!==t.indexOf(n):Jo.isRegExp(n)?n.test(t):void 0:void 0)}class Pi{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=vi(t);if(!o)throw new Error("header name must be a non-empty string");const i=Jo.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=Ri(e))}const i=(e,t)=>Jo.forEach(e,(e,r)=>o(e,r,t));if(Jo.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Jo.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&Ei[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(Jo.isObject(e)&&Jo.isIterable(e)){let r,n,o={};for(const t of e){if(!Jo.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Jo.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=vi(e)){const r=Jo.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Jo.isFunction(t))return t.call(this,e,r);if(Jo.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=vi(e)){const r=Jo.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ti(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=vi(e)){const o=Jo.findKey(r,e);!o||t&&!Ti(0,r[o],o,t)||(delete r[o],n=!0)}}return Jo.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!Ti(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Jo.forEach(this,(n,o)=>{const i=Jo.findKey(r,o);if(i)return t[i]=Ri(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();a!==o&&delete t[o],t[a]=Ri(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Jo.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Jo.isArray(r)?r.join(", "):r)}),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 r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[bi]=this[bi]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=vi(e);t[n]||(!function(e,t){const r=Jo.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return Jo.isArray(e)?e.forEach(n):n(e),this}}Pi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Jo.reduceDescriptors(Pi.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),Jo.freezeMethods(Pi);const _i=Pi;function Ii(e,t){const r=this||Si,n=t||r,o=_i.from(n.headers);let i=n.data;return Jo.forEach(e,function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Oi(e){return!(!e||!e.__CANCEL__)}const Ni=class extends qo{constructor(e,t,r){super(null==e?"canceled":e,qo.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function Ci(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new qo("Request failed with status code "+r.status,[qo.ERR_BAD_REQUEST,qo.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Di=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=n[a];o||(o=c),r[i]=s,n[i]=c;let u=a,d=0;for(;u!==i;)d+=r[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{o=i,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},i-s)))},()=>r&&a(r)]},ki=(e,t,r=3)=>{let n=0;const o=Di(50,250);return Li(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=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:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},Ui=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Bi=e=>(...t)=>Jo.asap(()=>e(...t)),Mi=gi.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,gi.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(gi.origin),gi.navigator&&/(msie|trident)/i.test(gi.navigator.userAgent)):()=>!0,xi=gi.hasStandardBrowserEnv?{write(e,t,r,n,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Jo.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),Jo.isString(n)&&s.push(`path=${n}`),Jo.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Jo.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 Hi(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Gi=e=>e instanceof _i?{...e}:e;function Fi(e,t){t=t||{};const r={};function n(e,t,r,n){return Jo.isPlainObject(e)&&Jo.isPlainObject(t)?Jo.merge.call({caseless:n},e,t):Jo.isPlainObject(t)?Jo.merge({},t):Jo.isArray(t)?t.slice():t}function o(e,t,r,o){return Jo.isUndefined(t)?Jo.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Jo.isUndefined(t))return n(void 0,t)}function a(e,t){return Jo.isUndefined(t)?Jo.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):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,r)=>o(Gi(e),Gi(t),0,!0)};return Jo.forEach(Object.keys({...e,...t}),function(n){const i=c[n]||o,a=i(e[n],t[n],n);Jo.isUndefined(a)&&i!==s||(r[n]=a)}),r}const ji=e=>{const t=Fi({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=_i.from(a),t.url=ci(Hi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Jo.isFormData(r))if(gi.hasStandardBrowserEnv||gi.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Jo.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}if(gi.hasStandardBrowserEnv&&(n&&Jo.isFunction(n)&&(n=n(t)),n||!1!==n&&Mi(t.url))){const e=o&&i&&xi.read(i);e&&a.set(o,e)}return t},Wi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=ji(e);let o=n.data;const i=_i.from(n.headers).normalize();let a,s,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:m}=n;function h(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let f=new XMLHttpRequest;function y(){if(!f)return;const n=_i.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Ci(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:e,request:f}),f=null}f.open(n.method.toUpperCase(),n.url,!0),f.timeout=n.timeout,"onloadend"in f?f.onloadend=y:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(y)},f.onabort=function(){f&&(r(new qo("Request aborted",qo.ECONNABORTED,e,f)),f=null)},f.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new qo(n,qo.ERR_NETWORK,e,f);o.event=t||null,r(o),f=null},f.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ui;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new qo(t,o.clarifyTimeoutError?qo.ETIMEDOUT:qo.ECONNABORTED,e,f)),f=null},void 0===o&&i.setContentType(null),"setRequestHeader"in f&&Jo.forEach(i.toJSON(),function(e,t){f.setRequestHeader(t,e)}),Jo.isUndefined(n.withCredentials)||(f.withCredentials=!!n.withCredentials),d&&"json"!==d&&(f.responseType=n.responseType),m&&([c,u]=ki(m,!0),f.addEventListener("progress",c)),p&&f.upload&&([s,l]=ki(p),f.upload.addEventListener("progress",s),f.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(a=t=>{f&&(r(!t||t.type?new Ni(null,e,f):t),f.abort(),f=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===gi.protocols.indexOf(g)?r(new qo("Unsupported protocol "+g+":",qo.ERR_BAD_REQUEST,e)):f.send(o||null)})},Ki=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof qo?t:new Ni(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new qo(`timeout of ${t}ms exceeded`,qo.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}=n;return s.unsubscribe=()=>Jo.asap(a),s}},Yi=function*(e,t){let r=e.byteLength;if(!t||r{const o=async function*(e,t){for await(const r of Xi(e))yield*Yi(r,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return s(),void e.close();let i=n.byteLength;if(r){let e=a+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:Ji}=Jo,zi=(({Request:e,Response:t})=>({Request:e,Response:t}))(Jo.global),{ReadableStream:qi,TextEncoder:Zi}=Jo.global,$i=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Qi=e=>{e=Jo.merge.call({skipUndefined:!0},zi,e);const{fetch:t,Request:r,Response:n}=e,o=t?Ji(t):"function"==typeof fetch,i=Ji(r),a=Ji(n);if(!o)return!1;const s=o&&Ji(qi),c=o&&("function"==typeof Zi?(l=new Zi,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=i&&s&&$i(()=>{let e=!1;const t=new r(gi.origin,{body:new qi,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&$i(()=>Jo.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new qo(`Response type '${e}' is not supported`,qo.ERR_NOT_SUPPORT,r)})});const m=async(e,t)=>{const n=Jo.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Jo.isBlob(e))return e.size;if(Jo.isSpecCompliantForm(e)){const t=new r(gi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Jo.isArrayBufferView(e)||Jo.isArrayBuffer(e)?e.byteLength:(Jo.isURLSearchParams(e)&&(e+=""),Jo.isString(e)?(await c(e)).byteLength:void 0)})(t):n};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:l,timeout:h,onDownloadProgress:f,onUploadProgress:y,responseType:g,headers:A,withCredentials:w="same-origin",fetchOptions:S}=ji(e),E=t||fetch;g=g?(g+"").toLowerCase():"text";let b=Ki([c,l&&l.toAbortSignal()],h),v=null;const R=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let T;try{if(y&&u&&"get"!==a&&"head"!==a&&0!==(T=await m(A,s))){let e,t=new r(o,{method:"POST",body:s,duplex:"half"});if(Jo.isFormData(s)&&(e=t.headers.get("content-type"))&&A.setContentType(e),t.body){const[e,r]=Ui(T,ki(Bi(y)));s=Vi(t.body,65536,e,r)}}Jo.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in r.prototype,c={...S,signal:b,method:a.toUpperCase(),headers:A.normalize().toJSON(),body:s,duplex:"half",credentials:t?w:void 0};v=i&&new r(o,c);let l=await(i?E(v,S):E(o,c));const h=d&&("stream"===g||"response"===g);if(d&&(f||h&&R)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=Jo.toFiniteNumber(l.headers.get("content-length")),[r,o]=f&&Ui(t,ki(Bi(f),!0))||[];l=new n(Vi(l.body,65536,r,()=>{o&&o(),R&&R()}),e)}g=g||"text";let P=await p[Jo.findKey(p,g)||"text"](l,e);return!h&&R&&R(),await new Promise((t,r)=>{Ci(t,r,{data:P,headers:_i.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:v})})}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new qo("Network Error",qo.ERR_NETWORK,e,v),{cause:t.cause||t});throw qo.from(t,t&&t.code,e,v)}}},ea=new Map,ta=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let a,s,c=i.length,l=ea;for(;c--;)a=i[c],s=l.get(a),void 0===s&&l.set(a,s=c?new Map:Qi(t)),l=s;return s},ra=(ta(),{http:null,xhr:Wi,fetch:{get:ta}});Jo.forEach(ra,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const na=e=>`- ${e}`,oa=e=>Jo.isFunction(e)||null===e||!1===e;const ia={getAdapter:function(e,t){e=Jo.isArray(e)?e:[e];const{length:r}=e;let n,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=r?e.length>1?"since :\n"+e.map(na).join("\n"):" "+na(e[0]):"as no adapter specified";throw new qo("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:ra};function aa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ni(null,e)}function sa(e){aa(e),e.headers=_i.from(e.headers),e.data=Ii.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ia.getAdapter(e.adapter||Si.adapter,e)(e).then(function(t){return aa(e),t.data=Ii.call(e,e.transformResponse,t),t.headers=_i.from(t.headers),t},function(t){return Oi(t)||(aa(e),t&&t.response&&(t.response.data=Ii.call(e,e.transformResponse,t.response),t.response.headers=_i.from(t.response.headers))),Promise.reject(t)})}const ca="1.13.4",la={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{la[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ua={};la.transitional=function(e,t,r){function n(e,t){return"[Axios v"+ca+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new qo(n(o," has been removed"+(t?" in "+t:"")),qo.ERR_DEPRECATED);return t&&!ua[o]&&(ua[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},la.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const da={assertOptions:function(e,t,r){if("object"!=typeof e)throw new qo("options must be an object",qo.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],a=t[i];if(a){const t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new qo("option "+i+" must be "+r,qo.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new qo("Unknown option "+i,qo.ERR_BAD_OPTION)}},validators:la},pa=da.validators;class ma{constructor(e){this.defaults=e||{},this.interceptors={request:new li,response:new li}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fi(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&da.assertOptions(r,{silentJSONParsing:pa.transitional(pa.boolean),forcedJSONParsing:pa.transitional(pa.boolean),clarifyTimeoutError:pa.transitional(pa.boolean)},!1),null!=n&&(Jo.isFunction(n)?t.paramsSerializer={serialize:n}:da.assertOptions(n,{encode:pa.function,serialize:pa.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),da.assertOptions(t,{baseUrl:pa.spelling("baseURL"),withXsrfToken:pa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Jo.merge(o.common,o[t.method]);o&&Jo.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=_i.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[sa.bind(this),void 0];for(e.unshift(...a),e.push(...c),u=e.length,l=Promise.resolve(t);d{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new Ni(e,n,o),t(r.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 fa(function(t){e=t});return{token:t,cancel:e}}}const ya=fa;const ga={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(ga).forEach(([e,t])=>{ga[t]=e});const Aa=ga;const wa=function e(t){const r=new ha(t),n=no(ha.prototype.request,r);return Jo.extend(n,ha.prototype,r,{allOwnKeys:!0}),Jo.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Fi(t,r))},n}(Si);wa.Axios=ha,wa.CanceledError=Ni,wa.CancelToken=ya,wa.isCancel=Oi,wa.VERSION=ca,wa.toFormData=ri,wa.AxiosError=qo,wa.Cancel=wa.CanceledError,wa.all=function(e){return Promise.all(e)},wa.spread=function(e){return function(t){return e.apply(null,t)}},wa.isAxiosError=function(e){return Jo.isObject(e)&&!0===e.isAxiosError},wa.mergeConfig=Fi,wa.AxiosHeaders=_i,wa.formToJSON=e=>Ai(Jo.isHTMLForm(e)?new FormData(e):e),wa.getAdapter=ia.getAdapter,wa.HttpStatusCode=Aa,wa.default=wa;const Sa=wa;var Ea=r(3612);const ba=function(){if(Ea.A.debug){for(var e,t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=Na().hostname;if(e&&"string"==typeof e&&e.length>0&&(t=e,e.includes("vipdev.lndo.site")))return"".concat(e.split(".")[0],".com");var r=t.split(".");return"".concat(r[r.length-2],".").concat(r[r.length-1])},La=function(){var e=Da();return".".concat(e)},ka=function(e,t,r){var n="".concat(e,"=").concat(t,";");void 0!==r?(ba("Setting cookie with options: ",r),Object.entries(r).forEach(function(e){var t=l(e,2),r=t[0],o=t[1];if("expires"===r){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),n+="expires=".concat(i.toUTCString(),";")}else n+="".concat(r,"=").concat(o,";")})):n+="path=/;",document.cookie=n},Ua=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=Da(),i=[o,"www".concat(o),".www".concat(o)];r&&i.push(r),Object.entries(t).forEach(function(e){var t=l(e,2),r=t[0],o=t[1];n+="".concat(r,"=").concat(o,";")}),0===Object.keys(t).length&&(n+="path=/;"),document.cookie=n,i.forEach(function(e){document.cookie=n.concat("domain=",e,";")})},Ba=function(){return Na().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},Ma=function(e){return function(e,t){if("string"!=typeof e)throw new u("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new u(`Invalid token specified: missing part #${r+1}`);let o;try{o=d(n)}catch(e){throw new u(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new u(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e)},xa=function(){var e=Da();return["mcall.com","courant.com","sun-sentinel.com","orlandosentinel.com","growthspotter.com","dailypress.com","pilotonline.com","nydailynews.com","baltimoresun.com","capitalgazette.com","chicagotribune.com","trbdevcloud.com"].includes(e)},Ha=function(){return"complete"===document.readyState},Ga=function(){return new Promise(function(e){if(("interactive"===document.readyState||Ha())&&window.dataLayer)ba("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{ba("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(n(o.mark(function r(){return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:window.dataLayer&&window.dataLayer.length>2&&(clearInterval(t),e(!0));case 1:case"end":return r.stop()}},r)})),50)}})},Fa=function(){var e=n(o.mark(function e(t){var r,n,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Ga();case 1:return ba("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],r="",ba("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),n=function(e){return ba("Utils dataLayerLoop: look for this element ",e),e[t]?(ba("Utils dataLayerLoop: found ",e[t]),r=e[t],e[t]):(ba("Utils dataLayerLoop: dataLayer search ",!1),!1)},i=window.dataLayer.some(n),e.abrupt("return",i?r:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),ja=function(){var e=n(o.mark(function e(){var t,r,n=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:"Page Type",e.next=1,Fa(t);case 1:return r=e.sent,ba("utils | pageType: page type is ",r),e.abrupt("return",r);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Wa=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(ba("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(ba("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(r){try{var n=r.detail||{};ba("utils | Event: authentication ready: ",n),e(n)}catch(e){ba(e),t(e)}},!1))})},Ka=function(){var e=n(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){return Ea.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(ba("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(r){try{var n=r.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=n,ba("Received entitlementsReady event:",n),e(n)}catch(e){va("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(ba("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ya=function(){ba("Clearing entitlements...");try{Ua(Ra,{path:"/"})}catch(e){ba("Failed to delete legacy cookie: ",e)}try{Ua(Ra,{path:"/",domain:Da(),expires:365,secure:!0})}catch(e){ba("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(Ta)}catch(e){ba("Failed to remove local storage: ",e)}},Xa=function(e){ba("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(),r=["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("simpleEmailValidation: ","TLD search ".concat(r)),!1===r?{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=Xa;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Va=function(e){Ea.A.datadogEnabled&&window.DD_RUM.addTiming(e)},Ja=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,r){var i={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},a=function(){var a=n(o.mark(function n(){var a,s,c,l,u,d,p,m,h,f,y;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"1"!==(null===(a=window.sophi_config)||void 0===a?void 0:a.enableSophiSSPW)){n.next=1;break}if(!document.getElementById("server-paywall")){n.next=1;break}return i.sspw=!0,n.abrupt("return",t({paywall:!0,details:Oa({},i)}));case 1:return n.next=2,ja();case 2:return c=n.sent,n.next=3,Fa("Paywall_Level");case 3:if(l=n.sent,"article"===c&&"free"!==l){n.next=4;break}return n.abrupt("return",t({paywall:!1,details:"article"!==c?"Page type is not an article":"Free article"}));case 4:return n.next=5,Ka();case 5:if(!(u=n.sent)||!u.isEntitled){n.next=6;break}return n.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==l){n.next=7;break}return n.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(d=null===(s=window.ConnextUtils)||void 0===s?void 0:s.runningSophi,ba("checkPaywallStatus - Sophi is running: ",d),!d){n.next=8;break}window.ConnextUtils.connextAlreadyRan&&window.sophiWallConfig&&!window.sophiWallConfig.error&&"paywall"===window.sophiWallConfig.wallType?(i.sophiClient=!0,i.engageStatus=!0,i.engagePaywall=!0):window.addEventListener("onPaywallShown",function(){return"paywall"===window.sophiWallConfig.wallType&&(i.sophiClient=!0),t({paywall:!0,details:Oa({},i)})},{once:!0}),n.next=12;break;case 8:if(d){n.next=12;break}return p=window.ConnextUtils.connextReady("onPaywallShown",!1),m=new Promise(function(t,r){return setTimeout(function(){return r(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),n.prev=9,n.next=10,Promise.race([p,m]);case 10:!0===(h=n.sent)?(i.engagePaywall=!0,i.engageStatus="Engage paywall detected"):(i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(h)),n.next=12;break;case 11:n.prev=11,f=n.catch(9),i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(f);case 12:return n.abrupt("return",t({paywall:Object.values(i).some(function(e){return e}),details:Oa({},i)}));case 13:n.prev=13,y=n.catch(0),r(y);case 14:case"end":return n.stop()}},n,null,[[0,13],[9,11]])}));return function(){return a.apply(this,arguments)}}();a()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=Ja);function za(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"Apple";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.paymentSource=t,this.dynamicOfferCodeId="",this.siteName=Ba(),this.siteNameParsed=this.siteName.replace("www.","").replace("preprod.","").replace("develop.","").replace("local","com").replace("staging.",""),this.offerGroup=null,this.offerId=null,this.terms="",this.tokenReady=!1,this.paywayRequestToken=null,this.transactionName="",this.site=ss[this.siteNameParsed],this.siteCode=this.site.code,this.loggedInUserData=null,this.email="",this.uuid="",this.offerDetails=null,this.entitlementToken="",this.sourceId=0,this.serviceUrl="https://paywayws.com/PaywayWS/AccessTokens",this.billingUrl="https://paywayws.com/PaywayWS/CreditCards",this.safeURL=""},[{key:"queuePaywaySession",value:(i=n(o.mark(function e(t){var r,n,i,a,s,c,l,u;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return ba("APPLE PAY | queue session started"),r=document.querySelector(".apple-pay-button"),n=document.querySelector(".terms"),e.next=1,Fa("URL");case 1:if(this.safeURL=e.sent,this.safeURL.includes("staging")||this.safeURL.includes("develop")?(this.serviceUrl="https://paywaywsdev.com/PaywayWS/AccessTokens",this.billingUrl="https://paywaywsdev.com/PaywayWS/CreditCards",this.offerGroup=r.dataset.offergroup,this.offerId=r.dataset.offercode,this.terms=n.textContent):(this.offerGroup=r.dataset.offergroup,this.offerId=r.dataset.offercode,this.terms=n.textContent),this.sourceId=window.apple_config.sourceId?parseInt(window.apple_config.sourceId,10):0,this.offerDetails=this.getBillingDataLocallyWithOfferCode(this.offerGroup,this.offerId,this.sourceId),ba("APPLE PAY | offer ",this.offerDetails),r&&(r.style.cursor="not-allowed !important"),!window.MNGAuthentication){e.next=3;break}return e.next=2,MNGAuthentication.getUserInfo();case 2:this.loggedInUserData=e.sent,this.uuid=this.loggedInUserData.userId,this.email=this.loggedInUserData.email;case 3:return i="".concat(Ea.A.entitlementsEndpoint,"payway/queue_transaction"),e.prev=4,a=this.offerDetails.promo.amount.replace(".",""),s={amount:a,eciType:1,sourceId:this.sourceId,tax:"0",transactionNotes1:"",transactionNotes2:"",transactionNotes3:"",request:"queueSale"},ba("APPLE PAY | sending queue object "),e.next=5,fetch(i,{method:"POST",headers:{"X-Api-Key":Ea.A.entitlementsApiKey},body:JSON.stringify(s)});case 5:return c=e.sent,e.next=6,c.json();case 6:l=e.sent,ba("APPLE PAY |request token received from entitler"),this.paywayRequestToken=l.data.paywayRequestToken,this.transactionName=l.data.transactionName,l.data.paywayRequestToken&&(ba("APPLE PAY | queue session success, showing button "),r.style.display="block !important",r.addEventListener("click",this.thirdPartyPaymentButtonClicked.bind(this)),r.disabled=!1,ba("APPLE PAY | queue success "),this.entitlementToken=t,window.MG2DL.push({event:"g2i_action_shown",actionType:"paywall",actionName:"apple_pay"})),e.next=8;break;case 7:e.prev=7,u=e.catch(4),ba("APPLE PAY ERROR | queue failed category ",u.error.category),ba("APPLE PAY ERROR | queue failed custom status code ",u.error.customStatusCode),ba("APPLE PAY ERROR | queue failed message ",u.error.message),ba("APPLE PAY ERROR | queue failed message ",u.error.errCode),document.querySelector(".error").style.display="block";case 8:case"end":return e.stop()}},e,this,[[4,7]])})),function(e){return i.apply(this,arguments)})},{key:"getBillingDataLocallyWithOfferCode",value:function(e,t){var r={1852:{4638:{billingAgreement:'AUTOMATIC RENEWAL TERMS: After the 1-year $1.00 introductory rate, your payment method will be automatically charged $21.99 every Month. \n\t\t\t\t\tBy subscribing, you agree to the Automatic Renewal Terms of this offer, the Terms of Use, and Arbitration and Refund Terms. Your subscription will renew automatically, and you will be charged up to seven days in advance of your renewal date until you cancel. \n\t\t\t\t\tYou may cancel at any time by calling Subscriber Services at 570-628-5985 or by selecting "Cancel Subscription" in your account settings. \n\t\t\t\t\tThe cancellation goes into effect at the start of your following billing cycle.',offerId:4638,promoDuration:"1 year",paymentDescription:"$1.00 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",paymentTiming:"recurring"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"28"}}},2789:{21866:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}},21865:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}},21867:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}},21868:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}}},2889:{22798:{billingAgreement:this.terms,offerId:22798,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},22797:{billingAgreement:this.terms,offerId:22797,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},22799:{billingAgreement:this.terms,offerId:22799,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},22800:{billingAgreement:this.terms,offerId:22800,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}}},2965:{23494:{billingAgreement:this.terms,offerId:23494,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23495:{billingAgreement:this.terms,offerId:23495,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23496:{billingAgreement:this.terms,offerId:23496,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23497:{billingAgreement:this.terms,offerId:23497,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}}},2966:{23498:{billingAgreement:this.terms,offerId:23498,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23499:{billingAgreement:this.terms,offerId:23499,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23500:{billingAgreement:this.terms,offerId:23500,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23501:{billingAgreement:this.terms,offerId:23501,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}}}};if(r[e]&&r[e][t]){var n=r[e][t],o=n.promoDuration,i=this.getFutureDate(o);return n.regularBilling.recurringPaymentStartDate=i,n.trialIsRecurring&&(n.promo.recurringPaymentEndDate=i),n}return null}},{key:"getFutureDate",value:function(e){var t=l(e.split(" "),2),r=t[0],n=t[1],o=parseInt(r,10),i=new Date,a=n.toLowerCase();return a.startsWith("year")?i.setFullYear(i.getFullYear()+o):a.startsWith("month")?i.setMonth(i.getMonth()+o):a.startsWith("week")?i.setDate(i.getDate()+7*o):a.startsWith("day")&&i.setDate(i.getDate()+o),i.toISOString()}},{key:"thirdPartyPaymentButtonClicked",value:(r=n(o.mark(function e(){var t,r,n,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{ba("APPLE PAY | transaction button clicked - payment processing started"),t=xa()?"TribuneCEP":"MNG",r=this.paywayRequestToken,(new Date).toISOString(),n=[],console.log("rq apple offer details ",this.offerDetails),this.offerDetails.promo&&n.push(this.offerDetails.promo),n.push(this.offerDetails.regularBilling),i={requiredBillingContactFields:["postalAddress","phone"],countryCode:"US",currencyCode:"USD",merchantCapabilities:["supports3DS","supportsDebit","supportsCredit"],supportedNetworks:["visa","masterCard","amex","discover"],lineItems:n,recurringPaymentRequest:{paymentDescription:this.offerDetails.paymentDescription,regularBilling:this.offerDetails.regularBilling,trialBilling:this.offerDetails.promo,billingAgreement:this.offerDetails.billingAgreement,managementURL:"https://myaccount.".concat(this.siteNameParsed),tokenNotificationURL:"https://aws-mng-prod.subscriberconcierge.com/Webhooks/Apple/V2/".concat(t,"/").concat(this.siteCode,"/").concat(this.siteCode)},total:{label:this.offerDetails.promo.label,amount:this.offerDetails.promo.amount}},this.initApplePaySession(i,r)}catch(e){document.querySelector(".error").style.display="block",ba("APPLE PAY ERROR | Failed to initialize payment options",e)}case 1:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"initApplePaySession",value:(t=n(o.mark(function e(t,r){var i,a,s,c,l=this;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{ba("APPLE PAY | Apple Pay startign session with req object ",t),i=new ApplePaySession(1,t),a="".concat(Ea.A.entitlementsEndpoint,"payway/create_subscription"),s=new URL(this.safeURL),c=s.hostname,i.onvalidatemerchant=function(){var e=n(o.mark(function e(t){var n,a,s,u,d,p;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return ba("APPLE PAY | Apple Pay validating merchant ",t),e.prev=1,n={request:"getApplePaySession",url:t.validationURL,domain:c,merchantIdentifier:"merchant.com.payway.mng",paywayRequestToken:r},a=JSON.stringify(n),ba("APPLE PAY | Apple Pay validating merchant req body ",n),e.next=2,fetch(l.serviceUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:a});case 2:if((s=e.sent).ok){e.next=4;break}return e.next=3,s.text();case 3:return u=e.sent,document.querySelector(".error").style.display="block",ba("APPLE PAY ERROR | Merchant validation error: ".concat(s.status," ").concat(u)),e.abrupt("return");case 4:return e.next=5,s.text();case 5:d=e.sent,d=JSON.parse(d);try{i.completeMerchantValidation(JSON.parse(d.appleSessionToken))}catch(e){document.querySelector(".error").style.display="block",ba("APPLE PAY ERROR | Cannot init complete merch validation ",e)}e.next=7;break;case 6:e.prev=6,p=e.catch(1),document.querySelector(".error").style.display="block",ba("APPLE PAY ERROR | Apple Validation reply error: ".concat(p.message));case 7:case"end":return e.stop()}},e,null,[[1,6]])}));return function(t){return e.apply(this,arguments)}}(),i.onpaymentauthorized=function(){var e=n(o.mark(function e(t){var n,s,c,u,d,p,m,h,f,y,g,A,w,S,E,b,v,R,T,P,_;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return w={accountInputMode:"applePay",paywayRequestToken:l.paywayRequestToken,transactionName:l.transactionName,transactionSourceId:window.apple_config.sourceId?parseInt(window.apple_config.sourceId,10):"0",request:"sendQueuedTransaction",applePayToken:t.payment.token.paymentData,merchantIdentifier:"merchant.com.payway.mng",cardAccount:{firstName:(null===(n=t.payment.billingContact)||void 0===n?void 0:n.givenName)||"",lastName:(null===(s=t.payment.billingContact)||void 0===s?void 0:s.familyName)||"",address:(null===(c=t.payment.billingContact)||void 0===c||null===(c=c.addressLines)||void 0===c?void 0:c.join(" "))||"",city:(null===(u=t.payment.billingContact)||void 0===u?void 0:u.locality)||"",state:(null===(d=t.payment.billingContact)||void 0===d?void 0:d.administrativeArea)||"",zip:(null===(p=t.payment.billingContact)||void 0===p?void 0:p.postalCode)||"",email:l.loggedInUserData.email||"",phone:t.payment.billingContact.phoneNumber}},S={paywayRequestToken:r,applePayData:t.payment,firstName:(null===(m=t.payment.billingContact)||void 0===m?void 0:m.givenName)||"",lastName:(null===(h=t.payment.billingContact)||void 0===h?void 0:h.familyName)||"",address:(null===(f=t.payment.billingContact)||void 0===f||null===(f=f.addressLines)||void 0===f?void 0:f.join(" "))||"",city:(null===(y=t.payment.billingContact)||void 0===y?void 0:y.locality)||"",state:(null===(g=t.payment.billingContact)||void 0===g?void 0:g.administrativeArea)||"",zip:(null===(A=t.payment.billingContact)||void 0===A?void 0:A.postalCode)||"",email:l.email||"",offerId:l.offerId,offerGroupId:l.offerGroup,uuid:l.uuid||"",domain:l.siteNameParsed,paymentAmount:l.offerDetails.promo.amount,sourceId:l.sourceId,phone:t.payment.billingContact.phoneNumber?t.payment.billingContact.phoneNumber:""},e.prev=1,e.next=2,fetch(l.billingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});case 2:return E=e.sent,e.next=3,E.text();case 3:if(e.sent,ba("APPLE PAY | Response from Payway"),e.prev=4,ba("APPLE PAY | starting entitler req to naviga for new sub start"),!E.ok){e.next=11;break}return i.completePayment(ApplePaySession.STATUS_SUCCESS),e.next=5,fetch(a,{method:"POST",headers:{"X-Api-Key":Ea.A.entitlementsApiKey},body:JSON.stringify(S)});case 5:if((v=e.sent).ok){e.next=6;break}return ba("APPLE PAY | response from entitler NOT OK!!"),document.querySelector(".error").style.display="block",e.abrupt("return");case 6:return e.next=7,v.json();case 7:return e.sent,window.MG2DL.push({event:"g2i_subscription_success",payment_type:null===(b=l.offerDetails)||void 0===b||null===(b=b.regularBilling)||void 0===b?void 0:b.paymentTiming,sp_offerPlanName:"apple_pay"}),ba("APPLE PAY | response from entitler and refreshing token"),e.next=8,Wa();case 8:if(R=e.sent,ba("APPLE PAY | getting tokens auth data"),!R){e.next=10;break}return e.next=9,is({idToken:R.idToken});case 9:(T=e.sent)&&(ba("APPLE PAY | Created new token for new Apple subscriber user"),window.ConnextUtils.rerunConnextEntitlements(),as(T));case 10:e.next=12;break;case 11:document.querySelector(".error").style.display="block",i.completePayment(ApplePaySession.STATUS_FAILURE);case 12:e.next=14;break;case 13:e.prev=13,P=e.catch(4),document.querySelector(".error").style.display="block",ba("APPLE PAY ERROR | Naviga failed category ",P.error.category),ba("APPLE PAY ERROR | Naviga failed custom status code ",P.error.customStatusCode),ba("APPLE PAY ERROR | Naviga failed message ",P.error.message),ba("APPLE PAY ERROR | Naviga failed message ",P.error.errCode);case 14:e.next=16;break;case 15:e.prev=15,_=e.catch(1),ba("APPLE PAY ERROR | Payment error: ".concat(_));case 16:case"end":return e.stop()}},e,null,[[1,15],[4,13]])}));return function(t){return e.apply(this,arguments)}}(),i.oncancel=function(e){ba("APPLE PAY | User canceled Apple Pay session.")};try{i.begin()}catch(e){ba("APPLE PAY ERROR | Apple Pay session failed to start:",e)}}catch(e){ba("APPLE PAY ERROR | Apple Failed to process payment",e)}case 1:case"end":return e.stop()}},e,this)})),function(e,r){return t.apply(this,arguments)})},{key:"getBillingDataFromEntitlerWithOfferCode",value:(e=n(o.mark(function e(){var t,r,n,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(Ea.A.entitlementsEndpoint,"getNavigaoffer"),r={offerIdCode:this.offerCodeId,offerGroupCode:"1234"},e.next=1,fetch(t,{method:"POST",headers:{"X-Api-Key":Ea.A.entitlementsApiKey},body:JSON.stringify(r)});case 1:return n=e.sent,e.next=2,n.json();case 2:return i=e.sent,e.abrupt("return",i);case 3:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t,r,i}();const ls=cs;var us=!1;document.addEventListener("onPaywallShown",function(){var e=n(o.mark(function e(t){var r,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!us){e.next=1;break}return e.abrupt("return");case 1:if(us=!0,ba("APPLE PAY | Apple Pay script loaded - Paywall shown, check for apple pay button and hide"),document.querySelector(".error").style.display="none",(r=document.querySelector(".apple-pay-button")).style.display="none !important",!window.ApplePaySession){e.next=3;break}return ba("APPLE PAY | Apple Pay session exists on window, continue"),e.next=2,Ka();case 2:(n=e.sent)&&n.token?window.ApplePaySession.canMakePaymentsWithActiveCard("merchant.com.payway.mng")?(ba("APPLE PAY | User logged in and can make payments - show button"),new ls(".apple-pay-button","Apple").queuePaywaySession(n.token)):(ba("APPLE PAY | Apple pay pay not set up exit"),r.remove()):(ba("APPLE PAY | not logged in, exit"),r.remove(),window.MG2DL.push({event:"g2i_action_not_shown",actionType:"paywall",actionName:"apple_pay"})),e.next=4;break;case 3:ba("APPLE PAY | Apple Pay session NOT on window, exit"),r.remove(),window.MG2DL.push({event:"g2i_action_not_shown",actionType:"paywall",actionName:"apple_pay"});case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}())})()})(); //# sourceMappingURL=mng-digisubs.apple.bundle.js.map; /*! For license information please see mng-digisubs.articleShare.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 f(t.buffer,t.byteOffset,t.byteLength)}return h(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 f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return f(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):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(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 h(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 X(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:X(e).length;t=(""+t).toLowerCase(),o=!0}}function g(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 N(this,t,n);case"latin1":case"binary":return _(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 m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function w(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:A(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):A(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function A(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<=I)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 E(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return v(this,e,t,n);case"base64":return S(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 I=4096;function N(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 P(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 x(e,t,n,r,o){F(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){F(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 B(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 D(e,t,n,r,i){return t=+t,n>>>=0,i||B(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||B(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||k(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||k(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||k(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(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||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=$(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(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||W(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||k(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||k(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||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||k(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||k(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||k(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||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=$(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(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||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||k(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(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){P(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){P(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||P(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||P(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||P(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||P(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||P(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=$(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(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);P(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);P(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||P(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||P(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||P(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||P(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||P(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=$(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return D(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 F(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){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,o,i)}function j(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw j(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 V=/[^+/0-9A-Za-z-_]/g;function X(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(V,"")).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 Z=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 $(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,h=n?-1:1,f=e[t+d];for(d+=h,i=f&(1<<-l)-1,f>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),i-=u}return(f?-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,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=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?h/c:h*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+f]=255&s,f+=p,s/=256,o-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,u-=8);e[n+f-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,h={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return i=e,a=0,s=t,h.n=n,u}};function f(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]<=f&&((o=e<2&&fr||r>p)&&(i[4]=e,i[5]=r,h.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&&f(l,p),a=l,s=p;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(h.n=-1),f(a,s)):h.n=s:h.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=h.n<0)?s:e.call(r,h))!==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 h(){}n=Object.getPrototypeOf;var f=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=h.prototype=l.prototype=Object.create(f);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return d.prototype=h,r(p,"constructor",h),r(h,"constructor",d),d.displayName="GeneratorFunction",r(h,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 h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var f={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,f[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:h,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(h(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={};n.r(e),n.d(e,{hasBrowserEnv:()=>wi,hasStandardBrowserEnv:()=>Ei,hasStandardBrowserWebWorkerEnv:()=>bi,navigator:()=>Ai,origin:()=>vi});var t=n(3612);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return atob(t)}}g.prototype.name="InvalidTokenError","function"==typeof SuppressedError&&SuppressedError;var w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},A={},E={};Object.defineProperty(E,"__esModule",{value:!0});var b=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();E.default=function(){return b.getInstance()};var v=w&&w.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},S=w&&w.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&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 v(this,void 0,void 0,function(){return S(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 v(this,void 0,void 0,function(){var n,r,o,i;return S(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?O:this.storageHandler,r="browser-tabs-lock-key-"+t,null===(o=n.getItemSync(r))?[2]:(i=JSON.parse(o)).id!==this.id?[3,2]:[4,T.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(r),T.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;L=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;ue=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 Q("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 Q("".concat(n," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",o);return}throw Q("".concat(n," must be a positive number"),"ERR_INVALID_ARG_VALUE",o)}catch(e){if(r)throw pe(e.message,r,o);throw e}}function Ee(e,t,n,r){try{if("string"!=typeof e)throw Q("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",r);if(0===e.length)throw Q("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",r)}catch(e){if(n)throw pe(e.message,n,r);throw e}}function be(e){!function(e,t){if(We(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 pe(t,dt,e)}(e,t)}(e,"application/json")}function ve(){return de(crypto.getRandomValues(new Uint8Array(32)))}function Se(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 he("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 he("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 he("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 he("unsupported CryptoKey algorithm name",{cause:e})}}function Re(e){const t=null==e?void 0:e[te];return"number"==typeof t&&Number.isFinite(t)?t:0}function Te(e){const t=null==e?void 0:e[ne];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Oe(){return Math.floor(Date.now()/1e3)}function Ie(e){if("object"!=typeof e||null===e)throw Q('"as" must be an object',"ERR_INVALID_ARG_TYPE");Ee(e.issuer,'"as.issuer"')}function Ne(e){if("object"!=typeof e||null===e)throw Q('"client" must be an object',"ERR_INVALID_ARG_TYPE");Ee(e.client_id,'"client.client_id"')}function _e(e){return Ee(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function Ce(e,t){const{key:n,kid:r}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&Ee(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw Q("".concat(t," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),"private"!==e.type)throw Q("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}(n,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:Se(n),kid:r},u=function(e,t){const n=Oe()+Re(t);return{jti:ve(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[oe]||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 Q('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const r="".concat(de(ce(JSON.stringify(e))),".").concat(de(ce(JSON.stringify(t)))),o=de(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:vt(e)};case"RSA-PSS":switch(bt(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 he("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return bt(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new he("unsupported CryptoKey algorithm name",{cause:e})}(n),n,ce(r)));return"".concat(r,".").concat(o)}(c,u,n))}}const Le=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function ke(e,t){if(t&&"https:"!==e.protocol)throw pe("only requests to HTTPS are allowed",ft,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw pe("only HTTP and HTTPS requests are allowed",pt,e)}function Pe(e,t,n,r){let o;if("string"!=typeof e||!Le(e))throw pe("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?wt:At,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return ke(o,r),o}function xe(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Pe(e.mtls_endpoint_aliases[t],t,n,r):Pe(e[t],t,n,r)}class Ue extends Error{constructor(e,t){var n;super(e,t),j(this,"cause",void 0),j(this,"code",void 0),j(this,"error",void 0),j(this,"status",void 0),j(this,"error_description",void 0),j(this,"response",void 0),this.name=this.constructor.name,this.code=at,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 Be extends Error{constructor(e,t){var n,r;super(e,t),j(this,"cause",void 0),j(this,"code",void 0),j(this,"error",void 0),j(this,"error_description",void 0),this.name=this.constructor.name,this.code=ct,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 De extends Error{constructor(e,t){var n;super(e,t),j(this,"cause",void 0),j(this,"code",void 0),j(this,"response",void 0),j(this,"status",void 0),this.name=this.constructor.name,this.code=it,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 Me=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),He=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),Ge=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),Ke=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Fe(e,t,n){if(e.status!==t){let t;var r;if(function(e){let t;if(function(e){if(!Z(e,Response))throw Q('"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(Me);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(He)){if([,n,o,r]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}u[n.toLowerCase()]=o}else{if(!r.match(Ge)){if(r.match(Ke)){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 De("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){Et(e),be(e);try{const t=await e.clone().json();if(ye(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 Ue("server responded with an error in the response body",{cause:t,response:e});throw pe('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),ht,e)}}function je(e){if(!Qe.has(e))throw Q('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function We(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function Ve(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[re])||fetch)(r.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:me(r,null==a?void 0:a.signal)})}async function Xe(e,t,n,r,o,i){var a;const s=xe(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[ee]));o.set("grant_type",r);const c=ge(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(je(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await Ve(e,t,n,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(u,s),u}const Je=new WeakMap,Ye=new WeakMap;function qe(e){if(!e.id_token)return;const t=Je.get(e);if(!t)throw Q('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function ze(e,t,n,r,o,i){if(Ie(e),Ne(t),!Z(n,Response))throw Q('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Fe(n,200,"Token Endpoint"),Et(n);const a=await It(n);if(Ee(a.access_token,'"response" body "access_token" property',lt,{body:a}),Ee(a.token_type,'"response" body "token_type" property',lt,{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;Ae(e,!0,'"response" body "expires_in" property',lt,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&Ee(a.refresh_token,'"response" body "refresh_token" property',lt,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw pe('"response" body "scope" property must be a string',lt,{body:a});if(void 0!==a.id_token){Ee(a.id_token,'"response" body "id_token" property',lt,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(Ae(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 he("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:u}=e.split("."))}if(3!==u)throw pe("Invalid JWT",lt,e);try{JSON.parse(ce(de(s)))}catch(e){throw pe("failed to parse JWT Header body as base64url encoded JSON",ut,e)}if(!ye(i))throw pe("JWT Header must be a top level object",lt,e);if(t(i),void 0!==i.crit)throw new he('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{JSON.parse(ce(de(c)))}catch(e){throw pe("failed to parse JWT Payload body as base64url encoded JSON",ut,e)}if(!ye(a))throw pe("JWT Payload must be a top level object",lt,e);const l=Oe()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw pe('unexpected JWT "exp" (expiration time) claim type',lt,{claims:a});if(a.exp<=l-r)throw pe('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',yt,{claims:a,now:l,tolerance:r,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw pe('unexpected JWT "iat" (issued at) claim type',lt,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw pe('unexpected JWT "iss" (issuer) claim type',lt,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw pe('unexpected JWT "nbf" (not before) claim type',lt,{claims:a});if(a.nbf>l+r)throw pe('unexpected JWT "nbf" (not before) claim value',yt,{claims:a,now:l,tolerance:r,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw pe('unexpected JWT "aud" (audience) claim type',lt,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,St.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Re(t),Te(t),o).then(nt.bind(void 0,i)).then($e.bind(void 0,e)).then(Ze.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw pe('ID Token "aud" (audience) claim includes additional untrusted audiences',gt,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw pe('unexpected ID Token "azp" (authorized party) claim value',gt,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&Ae(s.auth_time,!0,'ID Token "auth_time" (authentication time)',lt,{claims:s}),Ye.set(n,c),Je.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 he("unsupported `token_type` value",{cause:{body:a}});return a}function Ze(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw pe('unexpected JWT "aud" (audience) claim value',gt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw pe('unexpected JWT "aud" (audience) claim value',gt,{expected:e,claims:t.claims,claim:"aud"});return t}function $e(e,t){var n,r;const o=null!==(null===e[_t]||void 0===r?void 0:r.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw pe('unexpected JWT "iss" (issuer) claim value',gt,{expected:o,claims:t.claims,claim:"iss"});return t}const Qe=new WeakSet,et=Symbol(),tt={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 nt(e,t){for(const n of e)if(void 0===t.claims[n])throw pe('JWT "'.concat(n,'" (').concat(tt[n],") claim missing"),lt,{claims:t.claims});return t}const rt=Symbol(),ot=Symbol();const it="OAUTH_WWW_AUTHENTICATE_CHALLENGE",at="OAUTH_RESPONSE_BODY_ERROR",st="OAUTH_UNSUPPORTED_OPERATION",ct="OAUTH_AUTHORIZATION_RESPONSE_ERROR",ut="OAUTH_PARSE_ERROR",lt="OAUTH_INVALID_RESPONSE",dt="OAUTH_RESPONSE_IS_NOT_JSON",ht="OAUTH_RESPONSE_IS_NOT_CONFORM",ft="OAUTH_HTTP_REQUEST_FORBIDDEN",pt="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",yt="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",gt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",mt="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",wt="OAUTH_MISSING_SERVER_METADATA",At="OAUTH_INVALID_SERVER_METADATA";function Et(e){if(e.bodyUsed)throw Q('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function bt(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new he("unsupported ".concat(t.name," modulusLength"),{cause:e})}function vt(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 he("unsupported ECDSA namedCurve",{cause:e})}}function St(e,t,n,r){if(void 0===e)if(Array.isArray(t)){if(!t.includes(r.alg))throw pe('unexpected JWT "alg" header parameter',lt,{header:r,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw pe('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 pe('unexpected JWT "alg" header parameter',lt,{header:r,expected:n,reason:"default value"})}else if("string"==typeof e?r.alg!==e:!e.includes(r.alg))throw pe('unexpected JWT "alg" header parameter',lt,{header:r,expected:e,reason:"client configuration"})}function Rt(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw pe('"'.concat(t,'" parameter must be provided only once'),lt);return n}const Tt=Symbol(),Ot=Symbol();async function It(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be;try{await e.json()}catch(t){throw n(e),pe('failed to parse "response" body as JSON',ut,t)}if(!ye(t))throw pe('"response" body must be a top level object',lt,{body:t});return t}const Nt=Symbol(),_t=Symbol(),Ct=new TextEncoder,Lt=new TextDecoder;function kt(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 Pt(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}}),j(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),j(this,"claim",void 0),j(this,"reason",void 0),j(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}j(Bt,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Dt extends Ut{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}}),j(this,"code","ERR_JWT_EXPIRED"),j(this,"claim",void 0),j(this,"reason",void 0),j(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}j(Dt,"code","ERR_JWT_EXPIRED");class Mt extends Ut{constructor(){super(...arguments),j(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}j(Mt,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Ht extends Ut{constructor(){super(...arguments),j(this,"code","ERR_JOSE_NOT_SUPPORTED")}}j(Ht,"code","ERR_JOSE_NOT_SUPPORTED"),j(class extends Ut{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),j(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),j(class extends Ut{constructor(){super(...arguments),j(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Gt extends Ut{constructor(){super(...arguments),j(this,"code","ERR_JWS_INVALID")}}j(Gt,"code","ERR_JWS_INVALID");class Kt extends Ut{constructor(){super(...arguments),j(this,"code","ERR_JWT_INVALID")}}j(Kt,"code","ERR_JWT_INVALID"),j(class extends Ut{constructor(){super(...arguments),j(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Ft extends Ut{constructor(){super(...arguments),j(this,"code","ERR_JWKS_INVALID")}}j(Ft,"code","ERR_JWKS_INVALID");class jt extends Ut{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),j(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}j(jt,"code","ERR_JWKS_NO_MATCHING_KEY");class Wt extends Ut{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),j(this,Symbol.asyncIterator,void 0),j(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}j(Wt,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Vt extends Ut{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),j(this,"code","ERR_JWKS_TIMEOUT")}}j(Vt,"code","ERR_JWKS_TIMEOUT");class Xt extends Ut{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),j(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}j(Xt,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Jt=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))},Yt=(e,t)=>e.name===t;function qt(e){return parseInt(e.name.slice(4),10)}function zt(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 Zt=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}},Qt=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),en=e=>$t(e)||Qt(e);function tn(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 nn=(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)},an=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},sn=(e,t,n)=>{var r;const o=(e=>Pt(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){on(e,48,"Invalid PKCS#8 structure"),rn(e),on(e,2,"Expected version field");const t=rn(e);e.pos+=t,on(e,48,"Expected algorithm identifier");rn(e);e.pos}(t),(e=>{const t=(e=>{on(e,6,"Expected algorithm OID");const t=rn(e);return an(e,t)})(e);if(nn(t,[43,101,110]))return"X25519";if(!nn(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");on(e,6,"Expected curve OID");const n=rn(e),r=an(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(nn(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 Ht("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 Ht('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 cn(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 Ht('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 Ht('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 Ht('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 Ht('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Ht('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),i=V({},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 un=e=>tn(e)&&"string"==typeof e.kty;let ln;const dn=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];ln||(ln=new WeakMap);let o=ln.get(e);if(null!=o&&o[n])return o[n];const i=await cn(V(V({},t),{},{alg:n}));return r&&Object.freeze(e),o?o[n]=i:ln.set(e,{[n]:i}),i};const hn=e=>null==e?void 0:e[Symbol.toStringTag],fn=(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 pn,yn;let gn,mn;if("undefined"==typeof navigator||null===(pn=navigator.userAgent)||void 0===pn||null===(yn=pn.startsWith)||void 0===yn||!yn.call(pn,"Mozilla/5.0 ")){const e="v6.8.1";mn="".concat("openid-client","/").concat(e),gn={"user-agent":mn}}const wn=e=>An.get(e);let An,En;function bn(e){return void 0!==e?_e(e):(En||(En=new WeakMap),(e,t,n,r)=>{let o;return(o=En.get(t))||(function(e,t){if("string"!=typeof e)throw Tn("".concat(t," must be a string"),Rn);if(0===e.length)throw Tn("".concat(t," must not be empty"),Sn)}(t.client_secret,'"metadata.client_secret"'),o=_e(t.client_secret),En.set(t,o)),o(e,t,n,r)})}const vn=re,Sn="ERR_INVALID_ARG_VALUE",Rn="ERR_INVALID_ARG_TYPE";function Tn(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}class On extends Error{constructor(e,t){var n;super(e,t),j(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 In(e,t,n){return new On(e,{cause:t,code:n})}function Nn(e){if(e instanceof TypeError||e instanceof On||e instanceof Ue||e instanceof Be||e instanceof De)throw e;if(e instanceof fe)switch(e.code){case ft:throw In("only requests to HTTPS are allowed",e,e.code);case pt:throw In("only requests to HTTP or HTTPS are allowed",e,e.code);case ht:throw In("unexpected HTTP response status code",e.cause,e.code);case dt:throw In("unexpected response content-type",e.cause,e.code);case ut:throw In("parsing error occured",e,e.code);case lt:throw In("invalid response encountered",e,e.code);case gt:throw In("unexpected JWT claim value encountered",e,e.code);case mt:throw In("unexpected JSON attribute value encountered",e,e.code);case yt:throw In("JWT timestamp claim value failed validation",e,e.code);default:throw In(e.message,e,e.code)}if(e instanceof he)throw In("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw In("runtime operation error",e,st);case"NotSupportedError":throw In("runtime unsupported operation",e,st);case"TimeoutError":throw In("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw In("operation aborted",e,"OAUTH_ABORT")}throw new On("something went wrong",{cause:e})}async function _n(e,t,n,r,o){const i=await async function(e,t){var n,r;if(!(e instanceof URL))throw Tn('"server" must be an instance of URL',Rn);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 Q('"'.concat("issuerIdentifier",'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");ke(e,!0!==(null==r?void 0:r[ee]));const o=n(new URL(e.href)),i=ge(null==r?void 0:r.headers);return i.set("accept","application/json"),((null==r?void 0:r[re])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:me(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=we("".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=we("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw Q('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[re]:null==t?void 0:t[vn],[ee]:null==t||null===t.execute||void 0===r?void 0:r.includes(Dn),signal:a,headers:new Headers(gn)}):((null==t?void 0:t[vn])||fetch)((ke(e,null==t||null===t.execute||void 0===c||!c.includes(Dn)),e.href),{headers:Object.fromEntries(new Headers(V({accept:"application/json"},gn)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==Nt)throw Q('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!Z(t,Response))throw Q('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(200!==t.status)throw pe('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',ht,t);Et(t);const r=await It(t);if(Ee(r.issuer,'"response" body "issuer" property',lt,{body:r}),n!==Nt&&new URL(r.issuer).href!==n.href)throw pe('"response" body "issuer" property does not match the expected value',mt,{expected:n.href,body:r,attribute:"issuer"});return r}(Nt,e)).catch(Nn);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[Cn]=!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 On("discovered metadata issuer does not match the expected issuer",{code:mt,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new Ln(i,t,n,r);let s=wn(a);if(null!=o&&o[vn]&&(s.fetch=o[vn]),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 Cn=Symbol();class Ln{constructor(e,t,n,r){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw Tn('"clientId" must be a non-empty string',Rn);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 Tn('"clientId" and "metadata.client_id" must be the same',Sn);const u=V(V({},structuredClone(n)),{},{client_id:t});let l;u[te]=null!==(i=null===(a=n)||void 0===a?void 0:a[te])&&void 0!==i?i:0,u[ne]=null!==(s=null===(c=n)||void 0===c?void 0:c[ne])&&void 0!==s?s:30,l=r||("string"==typeof u.client_secret&&u.client_secret.length?bn(u.client_secret):(e,t,n,r)=>{n.set("client_id",t.client_id)});let d=Object.freeze(u);const h=structuredClone(e);Cn in e&&(h[_t]=t=>{let{claims:{tid:n}}=t;return e.issuer.replace("{tenantid}",n)});let f=Object.freeze(h);An||(An=new WeakMap),An.set(this,{__proto__:null,as:f,c:d,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(wn(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(wn(this).c)}get timeout(){return wn(this).timeout}set timeout(e){wn(this).timeout=e}get[vn](){return wn(this).fetch}set[vn](e){wn(this).fetch=e}}function kn(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 qe(this)}catch(e){return}}}}}(e))}async function Pn(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 fe("invalid Retry-After header value",{cause:e});a>t&&await xn(a-t,n)}function xn(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 Un(e,t){jn(e);const{as:n,c:r,auth:o,fetch:i,tlsOnly:a,timeout:s}=wn(e);return async function(e,t,n,r,o){Ie(e),Ne(t);const i=xe(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[ee])),a=new URLSearchParams(r);a.set("client_id",t.client_id);const s=ge(null==o?void 0:o.headers);return s.set("accept","application/json"),Ve(e,t,n,i,a,s,o)}(n,r,o,t,{[re]:i,[ee]:!a,headers:new Headers(gn),signal:Wn(s)}).then(e=>async function(e,t,n){if(Ie(e),Ne(t),!Z(n,Response))throw Q('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Fe(n,200,"Backchannel Authentication Endpoint"),Et(n);const r=await It(n);Ee(r.auth_req_id,'"response" body "auth_req_id" property',lt,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return Ae(o,!0,'"response" body "expires_in" property',lt,{body:r}),r.expires_in=o,void 0!==r.interval&&Ae(r.interval,!1,'"response" body "interval" property',lt,{body:r}),r}(n,r,e)).catch(Nn)}async function Bn(e,t,n,r){var o,i;jn(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 xn(a,s)}catch(e){Nn(e)}const{as:c,c:u,auth:l,fetch:d,tlsOnly:h,nonRepudiation:f,timeout:p,decrypt:y}=wn(e),g=(o,i)=>Bn(e,V(V({},t),{},{interval:o}),n,V(V({},r),{},{signal:s,flag:i})),m=await async function(e,t,n,r,o){Ie(e),Ne(t),Ee(r,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",r),Xe(e,t,n,"urn:openid:params:grant-type:ciba",i,o)}(c,u,l,t.auth_req_id,{[re]:d,[ee]:!h,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(gn),signal:s.aborted?s:Wn(p)}).catch(Nn);var w;if(503===m.status&&m.headers.has("retry-after"))return await Pn(m,a,s,!0),await(null===m.body||void 0===w?void 0:w.cancel()),g(a);const A=async function(e,t,n,r){return ze(e,t,n,void 0,null==r?void 0:r[ie],null==r?void 0:r.recognizedTokenTypes)}(c,u,m,{[ie]:y});let E;try{await A}catch(e){if(Vn(e,r))return g(a,Xn);if(e instanceof Ue)switch(e.error){case"slow_down":0;case"authorization_pending":return await Pn(e.response,a,s),g(a)}Nn(e)}return E.id_token&&await(null==f?void 0:f(m)),kn(E),E}function Dn(e){wn(e).tlsOnly=!1}async function Mn(e,t,n,r,o){if(jn(e),!((null==o?void 0:o.flag)===Xn||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw Tn('"currentUrl" must be an instance of URL, or Request',Rn);let i,a;const{as:s,c,auth:u,fetch:l,tlsOnly:d,jarm:h,hybrid:f,nonRepudiation:p,timeout:y,decrypt:g,implicit:m}=wn(e);if((null==o?void 0:o.flag)===Xn)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 Q("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if("application/x-www-form-urlencoded"!==We(e))throw Q("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 Q("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{cause:e});return e.text()}(e)}(e));if(f)t.hash=n.toString();else for(const[e,r]of n.entries())t.searchParams.append(e,r);break;default:throw Tn("unexpected Request HTTP method",Sn)}}switch(function(e){return new URL(e).search="",e.hash="",e.href}(t),!0){case!!h:await h(t,null==n?void 0:n.expectedState);break;case!!f:await f(t,null==n?void 0:n.expectedNonce,null==n?void 0:n.expectedState,null==n?void 0:n.maxAge);break;case!!m:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{(function(e,t,n,r){if(Ie(e),Ne(t),n instanceof URL&&n.searchParams,!(n instanceof URLSearchParams))throw Q('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(Rt(n,"response"))throw pe('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',lt,{parameters:n});const o=Rt(n,"iss"),i=Rt(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw pe('response parameter "iss" (issuer) missing',lt,{parameters:n});if(o&&o!==e.issuer)throw pe('unexpected "iss" (issuer) response parameter value',lt,{expected:e.issuer,parameters:n});switch(r){case void 0:case Ot:if(void 0!==i)throw pe('unexpected "state" response parameter encountered',lt,{expected:void 0,parameters:n});break;case Tt:break;default:if(Ee(r,'"expectedState" argument'),i!==r)throw pe(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',lt,{expected:r,parameters:n})}if(Rt(n,"error"))throw new Be("authorization response from the server is an error",{cause:n});const a=Rt(n,"id_token"),s=Rt(n,"token");if(void 0!==a||void 0!==s)throw new he("implicit and hybrid flows are not supported");return new URLSearchParams(n),Qe.add(c),c;var c})(s,c,t.searchParams,null==n?void 0:n.expectedState)}catch(e){Nn(e)}}}const w=await async function(e,t,n,r,o,i,a){if(Ie(e),Ne(t),!Qe.has(r))throw Q('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");Ee(o,'"redirectUri"');const s=Rt(r,"code");if(!s)throw pe('no authorization code in "callbackParameters"',lt);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==et&&(Ee(i,'"codeVerifier"'),c.set("code_verifier",i)),Xe(e,t,n,"authorization_code",c,a)}(s,c,u,i,a,(null==n?void 0:n.pkceCodeVerifier)||et,{additionalParameters:r,[re]:l,[ee]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(gn),signal:Wn(y)}).catch(Nn);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);const A=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 rt:break;default:Ee(r,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case ot:break;default:Ae(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await ze(e,t,n,s,i,a);Ee(c.id_token,'"response" body "id_token" property',lt,{body:c});const u=qe(c);if(o!==ot){const e=Oe()+Re(t),n=Te(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 ze(e,t,n,void 0,null==r?void 0:r[ie],null==r?void 0:r.recognizedTokenTypes)}(o,i,e,{[ie]:l,recognizedTokenTypes:n})}).catch(Nn);return kn(d),d}async function Yn(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 Ht('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)}(Gt,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 Gt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Gt('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 Mt('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new Gt("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Gt("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(un(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&fn(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(!en(t))throw new TypeError(Zt(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(hn(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(un(t))switch(n){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&fn(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)&&fn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!en(t))throw new TypeError(Zt(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(hn(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw new TypeError("".concat(hn(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(hn(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw new TypeError("".concat(hn(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(hn(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?kt(e.protected):new Uint8Array,kt("."),"string"==typeof e.payload?a?kt(e.payload):Ct.encode(e.payload):e.payload);let d;try{xt(e.signature)}catch(e){throw new Gt("Failed to base64url decode the signature")}const h=await async function(e,t){if(e instanceof Uint8Array)return e;if($t(e))return e;if(Qt(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{ln||(ln=new WeakMap);let n=ln.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:ln.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return dn(e,n,t)}if(un(e))return e.k?xt(e.k):dn(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,n,r){const o=await Yn(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 Ht("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,h,d,l))throw new Xt;let f;if(a)try{xt(e.payload)}catch(e){throw new Gt("Failed to base64url decode the payload")}else"string"==typeof e.payload?Ct.encode(e.payload):e.payload;const p={payload:f};return void 0!==e.protected&&(p.protectedHeader=r),void 0!==e.header&&(p.unprotectedHeader=e.header),u?V(V({},p),{},{key:h}):p}const zn=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Zn(e){const t=zn.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 $n=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());async function Qn(e,t,n){var r;const o=await async function(e,t,n){if(e instanceof Uint8Array&&Lt.decode(e),"string"!=typeof e)throw new Gt("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:i,length:a}=e.split(".");if(3!==a)throw new Gt("Invalid Compact JWS");const s=await qn({payload:o,protected:r,signature:i},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?V(V({},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 Kt("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(Lt.decode(t))}catch(e){}if(!tn(n))throw new Kt("JWT Claims Set must be a top-level JSON object");const{typ:o}=r;if(o&&("string"!=typeof e.typ||$n(e.typ)!==$n(o)))throw new Bt('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 Bt('missing required "'.concat(e,'" claim'),n,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new Bt('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new Bt('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 Bt('unexpected "aud" claim value',n,"aud","check_failed");let d;switch(typeof r.clockTolerance){case"string":Zn(r.clockTolerance);break;case"number":r.clockTolerance;break;case"undefined":0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,f=(e=>Math.floor(e.getTime()/1e3))(h||new Date);if((void 0!==n.iat||u)&&"number"!=typeof n.iat)throw new Bt('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new Bt('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>f+d)throw new Bt('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new Bt('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=f-d)throw new Dt('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){const e=f-n.iat;if(e-d>("number"==typeof u?u:Zn(u)))throw new Dt('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-d)throw new Bt('"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?V(V({},a),{},{key:o.key}):a}function er(e){return tn(e)}var tr,nr,rr=new WeakMap,or=new WeakMap;class ir{constructor(e){if(K(this,rr,void 0),K(this,or,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(er)}(e))throw new Ft("JSON Web Key Set malformed");F(rr,this,structuredClone(e))}jwks(){return G(rr,this)}async getKey(e,t){const{alg:n,kid:r}=V(V({},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 Ht('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=G(rr,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 jt;if(1!==s){const e=new Wt,t=G(or,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new J(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield M(ar(t,e,n))}catch(e){}}),e}return ar(G(or,this),a,n)}}async function ar(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(!tn(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 xt(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new Ht('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return cn(V(V({},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 cn(V(V({},e),{},{ext:n}));case"EC":case"OKP":return cn(V(V({},e),{},{alg:t,ext:n}));default:throw new Ht('Unsupported "kty" (Key Type) Parameter value')}}(V(V({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new Ft("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function sr(e){const t=new ir(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 cr;if("undefined"==typeof navigator||null===(tr=navigator.userAgent)||void 0===tr||null===(nr=tr.startsWith)||void 0===nr||!nr.call(tr,"Mozilla/5.0 ")){const e="v6.1.3";cr="".concat("jose","/").concat(e)}const ur=Symbol(),lr=Symbol();var dr=new WeakMap,hr=new WeakMap,fr=new WeakMap,pr=new WeakMap,yr=new WeakMap,gr=new WeakMap,mr=new WeakMap,wr=new WeakMap,Ar=new WeakMap,Er=new WeakMap;class br{constructor(e,t){if(K(this,dr,void 0),K(this,hr,void 0),K(this,fr,void 0),K(this,pr,void 0),K(this,yr,void 0),K(this,gr,void 0),K(this,mr,void 0),K(this,wr,void 0),K(this,Ar,void 0),K(this,Er,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var n,r;F(dr,this,new URL(e.href)),F(hr,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),F(fr,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),F(pr,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),F(mr,this,new Headers(null==t?void 0:t.headers)),cr&&!G(mr,this).has("User-Agent")&&G(mr,this).set("User-Agent",cr),G(mr,this).has("accept")||(G(mr,this).set("accept","application/json"),G(mr,this).append("accept","application/jwk-set+json")),F(wr,this,null==t?void 0:t[ur]),void 0!==(null==t?void 0:t[lr])&&(F(Er,this,null==t?void 0:t[lr]),null==t?void 0:t[lr],G(pr,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=r)&&"jwks"in n&&tn(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,tn)&&(F(yr,this,G(Er,this).uat),F(Ar,this,sr(G(Er,this).jwks))))}pendingFetch(){return!!G(gr,this)}coolingDown(){return"number"==typeof G(yr,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 Vt;throw e});if(200!==o.status)throw new Ut("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new Ut("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(G(dr,this).href,G(mr,this),AbortSignal.timeout(G(hr,this)),G(wr,this)).then(e=>{F(Ar,this,sr(e)),G(Er,this)&&(G(Er,this).uat=Date.now(),G(Er,this).jwks=e),F(yr,this,Date.now()),F(gr,this,void 0)}).catch(e=>{throw F(gr,this,void 0),e})),await G(gr,this)}}const vr=["mfaToken"],Sr=["mfaToken"];var Rr,Tr,Or,Ir,Nr,_r,Cr,Lr,kr=class extends Error{constructor(e,t){super(t),j(this,"code",void 0),this.name="NotSupportedError",this.code=e}},Pr=class extends Error{constructor(e,t,n){super(t),j(this,"cause",void 0),j(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},xr=class extends Pr{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Ur=class extends Pr{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Br=class extends Pr{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Dr=class extends Pr{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Mr=class extends Pr{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Hr=class extends Error{constructor(e){super(e),j(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Gr=class extends Pr{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),j(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},Kr=class extends Pr{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},Fr=class extends Pr{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},jr=class extends Pr{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},Wr=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),j(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function Vr(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>V(V({},e),{},{[t[0]]:t[1]}),{})}var Xr=class extends Error{constructor(e,t,n){super(t),j(this,"cause",void 0),j(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Jr=class extends Xr{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},Yr=class extends Xr{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},qr=class extends Xr{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},zr=class extends Xr{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function Zr(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var $r=(Rr=new WeakMap,Tr=new WeakMap,Or=new WeakMap,class{constructor(e){var t;K(this,Rr,void 0),K(this,Tr,void 0),K(this,Or,void 0),F(Rr,this,"https://".concat(e.domain)),F(Tr,this,e.clientId),F(Or,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(G(Rr,this),"/mfa/authenticators"),{mfaToken:n}=e,r=await G(Or,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 Jr(e.error_description||"Failed to list authenticators",e)}return(await r.json()).map(Zr)}async enrollAuthenticator(e){const t="".concat(G(Rr,this),"/mfa/associate"),{mfaToken:n}=e,r=X(e,vr),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 G(Or,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 Yr(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(G(Rr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await G(Or,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 qr(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(G(Rr,this),"/mfa/challenge"),{mfaToken:n}=e,r=X(e,Sr),o={mfa_token:n,client_id:G(Tr,this),challenge_type:r.challengeType};r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const i=await G(Or,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 zr(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())}}),Qr=class e{constructor(e,t,n,r,o,i,a){j(this,"accessToken",void 0),j(this,"idToken",void 0),j(this,"refreshToken",void 0),j(this,"expiresAt",void 0),j(this,"scope",void 0),j(this,"claims",void 0),j(this,"authorizationDetails",void 0),j(this,"tokenType",void 0),j(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}},eo="openid profile email offline_access",to=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 no(e){if(null==e)throw new Mr("subject_token is required");if("string"!=typeof e)throw new Mr("subject_token must be a string");if(0===e.trim().length)throw new Mr("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Mr("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Mr("subject_token must not include the 'Bearer ' prefix")}function ro(e,t){if(t)for(const[n,r]of Object.entries(t))if(!to.has(n))if(Array.isArray(r)){if(r.length>20)throw new Mr("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));r.forEach(t=>{e.append(n,t)})}else e.append(n,r)}Ir=new WeakMap,Nr=new WeakMap,_r=new WeakMap,Cr=new WeakMap,Lr=new WeakSet;async function oo(){if(G(Ir,this)&&G(Nr,this))return{configuration:G(Ir,this),serverMetadata:G(Nr,this)};const e=await D(Lr,this,so).call(this);return F(Ir,this,await _n(new URL("https://".concat(G(_r,this).domain)),G(_r,this).clientId,{use_mtls_endpoint_aliases:G(_r,this).useMtls},e,{[vn]:G(_r,this).customFetch})),F(Nr,this,G(Ir,this).serverMetadata()),G(Ir,this)[vn]=G(_r,this).customFetch||fetch,{configuration:G(Ir,this),serverMetadata:G(Nr,this)}}async function io(e){var t,n;const{configuration:r}=await D(Lr,this,oo).call(this);if("audience"in e||"resource"in e)throw new Mr("audience and resource parameters are not supported for Token Vault exchanges");no(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),ro(o,e.extra);try{const e=await Jn(r,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return Qr.fromTokenEndpointResponse(e)}catch(t){throw new Mr("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function ao(e){const{configuration:t}=await D(Lr,this,oo).call(this);no(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),ro(n,e.extra);try{const e=await Jn(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return Qr.fromTokenEndpointResponse(e)}catch(t){throw new Mr("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function so(){if(!G(_r,this).clientSecret&&!G(_r,this).clientAssertionSigningKey&&!G(_r,this).useMtls)throw new Wr;if(G(_r,this).useMtls)return(e,t,n,r)=>{n.set("client_id",t.client_id)};let e=G(_r,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 sn(e,t,void 0)}(e,G(_r,this).clientAssertionSigningAlg||"RS256"),e?function(e){return Ce(e,void 0)}(e):bn(G(_r,this).clientSecret)}async function co(e){const{configuration:t}=await D(Lr,this,oo).call(this),n=ve(),r=await function(e){return async function(e){return Ee(e,"codeVerifier"),de(await crypto.subtle.digest("SHA-256",ce(e)))}(e)}(n),o=Vr(V(V({},G(_r,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(V(V({scope:eo},o),{},{client_id:G(_r,this).clientId,code_challenge:r,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Fn(t,i):await Kn(t,i),codeVerifier:n}}new C;function uo(e,t){return function(){return e.apply(t,arguments)}}const{toString:lo}=Object.prototype,{getPrototypeOf:ho}=Object,{iterator:fo,toStringTag:po}=Symbol,yo=(go=Object.create(null),e=>{const t=lo.call(e);return go[t]||(go[t]=t.slice(8,-1).toLowerCase())});var go;const mo=e=>(e=e.toLowerCase(),t=>yo(t)===e),wo=e=>t=>typeof t===e,{isArray:Ao}=Array,Eo=wo("undefined");function bo(e){return null!==e&&!Eo(e)&&null!==e.constructor&&!Eo(e.constructor)&&Ro(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vo=mo("ArrayBuffer");const So=wo("string"),Ro=wo("function"),To=wo("number"),Oo=e=>null!==e&&"object"==typeof e,Io=e=>{if("object"!==yo(e))return!1;const t=ho(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||po in e||fo in e)},No=mo("Date"),_o=mo("File"),Co=mo("Blob"),Lo=mo("FileList"),ko=mo("URLSearchParams"),[Po,xo,Uo,Bo]=["ReadableStream","Request","Response","Headers"].map(mo);function Do(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Ao(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Ho="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Go=e=>!Eo(e)&&e!==Ho;const Ko=(Fo="undefined"!=typeof Uint8Array&&ho(Uint8Array),e=>Fo&&e instanceof Fo);var Fo;const jo=mo("HTMLFormElement"),Wo=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vo=mo("RegExp"),Xo=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Do(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Jo=mo("AsyncFunction"),Yo=(qo="function"==typeof setImmediate,zo=Ro(Ho.postMessage),qo?setImmediate:zo?(Zo=`axios@${Math.random()}`,$o=[],Ho.addEventListener("message",({source:e,data:t})=>{e===Ho&&t===Zo&&$o.length&&$o.shift()()},!1),e=>{$o.push(e),Ho.postMessage(Zo,"*")}):e=>setTimeout(e));var qo,zo,Zo,$o;const Qo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ho):"undefined"!=typeof process&&process.nextTick||Yo,ei={isArray:Ao,isArrayBuffer:vo,isBuffer:bo,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ro(e.append)&&("formdata"===(t=yo(e))||"object"===t&&Ro(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&vo(e.buffer),t},isString:So,isNumber:To,isBoolean:e=>!0===e||!1===e,isObject:Oo,isPlainObject:Io,isEmptyObject:e=>{if(!Oo(e)||bo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Po,isRequest:xo,isResponse:Uo,isHeaders:Bo,isUndefined:Eo,isDate:No,isFile:_o,isBlob:Co,isRegExp:Vo,isFunction:Ro,isStream:e=>Oo(e)&&Ro(e.pipe),isURLSearchParams:ko,isTypedArray:Ko,isFileList:Lo,forEach:Do,merge:function e(){const{caseless:t,skipUndefined:n}=Go(this)&&this||{},r={},o=(o,i)=>{const a=t&&Mo(r,i)||i;Io(r[a])&&Io(o)?r[a]=e(r[a],o):Io(o)?r[a]=e({},o):Ao(o)?r[a]=o.slice():n&&Eo(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(Do(t,(t,r)=>{n&&Ro(t)?Object.defineProperty(e,r,{value:uo(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&&ho(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:yo,kindOfTest:mo,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(Ao(e))return e;let t=e.length;if(!To(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[fo]).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:jo,hasOwnProperty:Wo,hasOwnProp:Wo,reduceDescriptors:Xo,freezeMethods:e=>{Xo(e,(t,n)=>{if(Ro(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ro(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 Ao(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:Mo,global:Ho,isContextDefined:Go,isSpecCompliantForm:function(e){return!!(e&&Ro(e.append)&&"FormData"===e[po]&&e[fo])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Oo(e)){if(t.indexOf(e)>=0)return;if(bo(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Ao(e)?[]:{};return Do(e,(e,t)=>{const i=n(e,r+1);!Eo(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Jo,isThenable:e=>e&&(Oo(e)||Ro(e))&&Ro(e.then)&&Ro(e.catch),setImmediate:Yo,asap:Qo,isIterable:e=>null!=e&&Ro(e[fo])};class ti extends Error{static from(e,t,n,r,o,i){const a=new ti(e.message,t||e.code,n,r,o);return a.cause=e,a.name=e.name,i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ei.toJSONObject(this.config),code:this.code,status:this.status}}}ti.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ti.ERR_BAD_OPTION="ERR_BAD_OPTION",ti.ECONNABORTED="ECONNABORTED",ti.ETIMEDOUT="ETIMEDOUT",ti.ERR_NETWORK="ERR_NETWORK",ti.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ti.ERR_DEPRECATED="ERR_DEPRECATED",ti.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ti.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ti.ERR_CANCELED="ERR_CANCELED",ti.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ti.ERR_INVALID_URL="ERR_INVALID_URL";const ni=ti;var ri=n(8287).hp;function oi(e){return ei.isPlainObject(e)||ei.isArray(e)}function ii(e){return ei.endsWith(e,"[]")?e.slice(0,-2):e}function ai(e,t,n){return e?e.concat(t).map(function(e,t){return e=ii(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const si=ei.toFlatObject(ei,{},null,function(e){return/^is[A-Z]/.test(e)});const ci=function(e,t,n){if(!ei.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=ei.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ei.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ei.isSpecCompliantForm(t);if(!ei.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ei.isDate(e))return e.toISOString();if(ei.isBoolean(e))return e.toString();if(!s&&ei.isBlob(e))throw new ni("Blob is not supported. Use a Buffer instead.");return ei.isArrayBuffer(e)||ei.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):ri.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(ei.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(ei.isArray(e)&&function(e){return ei.isArray(e)&&!e.some(oi)}(e)||(ei.isFileList(e)||ei.endsWith(n,"[]"))&&(s=ei.toArray(e)))return n=ii(n),s.forEach(function(e,r){!ei.isUndefined(e)&&null!==e&&t.append(!0===a?ai([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!oi(e)||(t.append(ai(o,n,i),c(e)),!1)}const l=[],d=Object.assign(si,{defaultVisitor:u,convertValue:c,isVisitable:oi});if(!ei.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!ei.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),ei.forEach(n,function(n,i){!0===(!(ei.isUndefined(n)||null===n)&&o.call(t,n,ei.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function ui(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function li(e,t){this._pairs=[],e&&ci(e,this,t)}const di=li.prototype;di.append=function(e,t){this._pairs.push([e,t])},di.toString=function(e){const t=e?function(t){return e.call(this,t,ui)}:ui;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const hi=li;function fi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function pi(e,t,n){if(!t)return e;const r=n&&n.encode||fi,o=ei.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):ei.isURLSearchParams(t)?t.toString():new hi(t,o).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const yi=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){ei.forEach(this.handlers,function(t){null!==t&&e(t)})}},gi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:hi,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},wi="undefined"!=typeof window&&"undefined"!=typeof document,Ai="object"==typeof navigator&&navigator||void 0,Ei=wi&&(!Ai||["ReactNative","NativeScript","NS"].indexOf(Ai.product)<0),bi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,vi=wi&&window.location.href||"http://localhost",Si={...e,...mi};const Ri=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&&ei.isArray(r)?r.length:i,s)return ei.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&ei.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&ei.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 ei.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const Ti={transitional:gi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=ei.isObject(e);o&&ei.isHTMLForm(e)&&(e=new FormData(e));if(ei.isFormData(e))return r?JSON.stringify(Ri(e)):e;if(ei.isArrayBuffer(e)||ei.isBuffer(e)||ei.isStream(e)||ei.isFile(e)||ei.isBlob(e)||ei.isReadableStream(e))return e;if(ei.isArrayBufferView(e))return e.buffer;if(ei.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 ci(e,new Si.classes.URLSearchParams,{visitor:function(e,t,n,r){return Si.isNode&&ei.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=ei.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ci(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(ei.isString(e))try{return(t||JSON.parse)(e),ei.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ti.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(ei.isResponse(e)||ei.isReadableStream(e))return e;if(e&&ei.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 ni.from(e,ni.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:Si.classes.FormData,Blob:Si.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ei.forEach(["delete","get","head","post","put","patch"],e=>{Ti.headers[e]={}});const Oi=Ti,Ii=ei.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"]),Ni=Symbol("internals");function _i(e){return e&&String(e).trim().toLowerCase()}function Ci(e){return!1===e||null==e?e:ei.isArray(e)?e.map(Ci):String(e)}function Li(e,t,n,r,o){return ei.isFunction(r)?r.call(this,t,n):(o&&(t=n),ei.isString(t)?ei.isString(r)?-1!==t.indexOf(r):ei.isRegExp(r)?r.test(t):void 0:void 0)}class ki{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=_i(t);if(!o)throw new Error("header name must be a non-empty string");const i=ei.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ci(e))}const i=(e,t)=>ei.forEach(e,(e,n)=>o(e,n,t));if(ei.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(ei.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]&&Ii[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(ei.isObject(e)&&ei.isIterable(e)){let n,r,o={};for(const t of e){if(!ei.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?ei.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=_i(e)){const n=ei.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(ei.isFunction(t))return t.call(this,e,n);if(ei.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=_i(e)){const n=ei.findKey(this,e);return!(!n||void 0===this[n]||t&&!Li(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=_i(e)){const o=ei.findKey(n,e);!o||t&&!Li(0,n[o],o,t)||(delete n[o],r=!0)}}return ei.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&&!Li(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return ei.forEach(this,(r,o)=>{const i=ei.findKey(n,o);if(i)return t[i]=Ci(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]=Ci(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ei.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ei.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[Ni]=this[Ni]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=_i(e);t[r]||(!function(e,t){const n=ei.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 ei.isArray(e)?e.forEach(r):r(e),this}}ki.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ei.reduceDescriptors(ki.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),ei.freezeMethods(ki);const Pi=ki;function xi(e,t){const n=this||Oi,r=t||n,o=Pi.from(r.headers);let i=r.data;return ei.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ui(e){return!(!e||!e.__CANCEL__)}const Bi=class extends ni{constructor(e,t,n){super(null==e?"canceled":e,ni.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Di(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ni("Request failed with status code "+n.status,[ni.ERR_BAD_REQUEST,ni.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Mi=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)]},Gi=(e,t,n=3)=>{let r=0;const o=Mi(50,250);return Hi(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)},Ki=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fi=e=>(...t)=>ei.asap(()=>e(...t)),ji=Si.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Si.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Si.origin),Si.navigator&&/(msie|trident)/i.test(Si.navigator.userAgent)):()=>!0,Wi=Si.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];ei.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),ei.isString(r)&&s.push(`path=${r}`),ei.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),ei.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 Vi(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Xi=e=>e instanceof Pi?{...e}:e;function Ji(e,t){t=t||{};const n={};function r(e,t,n,r){return ei.isPlainObject(e)&&ei.isPlainObject(t)?ei.merge.call({caseless:r},e,t):ei.isPlainObject(t)?ei.merge({},t):ei.isArray(t)?t.slice():t}function o(e,t,n,o){return ei.isUndefined(t)?ei.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!ei.isUndefined(t))return r(void 0,t)}function a(e,t){return ei.isUndefined(t)?ei.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(Xi(e),Xi(t),0,!0)};return ei.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,a=i(e[r],t[r],r);ei.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Yi=e=>{const t=Ji({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Pi.from(a),t.url=pi(Vi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),ei.isFormData(n))if(Si.hasStandardBrowserEnv||Si.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(ei.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(Si.hasStandardBrowserEnv&&(r&&ei.isFunction(r)&&(r=r(t)),r||!1!==r&&ji(t.url))){const e=o&&i&&Wi.read(i);e&&a.set(o,e)}return t},qi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Yi(e);let o=r.data;const i=Pi.from(r.headers).normalize();let a,s,c,u,l,{responseType:d,onUploadProgress:h,onDownloadProgress:f}=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 g(){if(!y)return;const r=Pi.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Di(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=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(g)},y.onabort=function(){y&&(n(new ni("Request aborted",ni.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new ni(r,ni.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||gi;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ni(t,o.clarifyTimeoutError?ni.ETIMEDOUT:ni.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&ei.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),ei.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),f&&([c,l]=Gi(f,!0),y.addEventListener("progress",c)),h&&y.upload&&([s,u]=Gi(h),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Bi(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 m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===Si.protocols.indexOf(m)?n(new ni("Unsupported protocol "+m+":",ni.ERR_BAD_REQUEST,e)):y.send(o||null)})},zi=(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 ni?t:new Bi(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new ni(`timeout of ${t}ms exceeded`,ni.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=()=>ei.asap(a),s}},Zi=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of $i(e))yield*Zi(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:ea}=ei,ta=(({Request:e,Response:t})=>({Request:e,Response:t}))(ei.global),{ReadableStream:na,TextEncoder:ra}=ei.global,oa=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ia=e=>{e=ei.merge.call({skipUndefined:!0},ta,e);const{fetch:t,Request:n,Response:r}=e,o=t?ea(t):"function"==typeof fetch,i=ea(n),a=ea(r);if(!o)return!1;const s=o&&ea(na),c=o&&("function"==typeof ra?(u=new ra,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&oa(()=>{let e=!1;const t=new n(Si.origin,{body:new na,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&oa(()=>ei.isReadableStream(new r("").body)),h={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ni(`Response type '${e}' is not supported`,ni.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=ei.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(ei.isBlob(e))return e.size;if(ei.isSpecCompliantForm(e)){const t=new n(Si.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ei.isArrayBufferView(e)||ei.isArrayBuffer(e)?e.byteLength:(ei.isURLSearchParams(e)&&(e+=""),ei.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:g,responseType:m,headers:w,withCredentials:A="same-origin",fetchOptions:E}=Yi(e),b=t||fetch;m=m?(m+"").toLowerCase():"text";let v=zi([c,u&&u.toAbortSignal()],p),S=null;const R=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let T;try{if(g&&l&&"get"!==a&&"head"!==a&&0!==(T=await f(w,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(ei.isFormData(s)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=Ki(T,Gi(Fi(g)));s=Qi(t.body,65536,e,n)}}ei.isString(A)||(A=A?"include":"omit");const t=i&&"credentials"in n.prototype,c={...E,signal:v,method:a.toUpperCase(),headers:w.normalize().toJSON(),body:s,duplex:"half",credentials:t?A:void 0};S=i&&new n(o,c);let u=await(i?b(S,E):b(o,c));const p=d&&("stream"===m||"response"===m);if(d&&(y||p&&R)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=ei.toFiniteNumber(u.headers.get("content-length")),[n,o]=y&&Ki(t,Gi(Fi(y),!0))||[];u=new r(Qi(u.body,65536,n,()=>{o&&o(),R&&R()}),e)}m=m||"text";let O=await h[ei.findKey(h,m)||"text"](u,e);return!p&&R&&R(),await new Promise((t,n)=>{Di(t,n,{data:O,headers:Pi.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:S})})}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ni("Network Error",ni.ERR_NETWORK,e,S),{cause:t.cause||t});throw ni.from(t,t&&t.code,e,S)}}},aa=new Map,sa=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=aa;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:ia(t)),u=s;return s},ca=(sa(),{http:null,xhr:qi,fetch:{get:sa}});ei.forEach(ca,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const ua=e=>`- ${e}`,la=e=>ei.isFunction(e)||null===e||!1===e;const da={getAdapter:function(e,t){e=ei.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(ua).join("\n"):" "+ua(e[0]):"as no adapter specified";throw new ni("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:ca};function ha(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bi(null,e)}function fa(e){ha(e),e.headers=Pi.from(e.headers),e.data=xi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return da.getAdapter(e.adapter||Oi.adapter,e)(e).then(function(t){return ha(e),t.data=xi.call(e,e.transformResponse,t),t.headers=Pi.from(t.headers),t},function(t){return Ui(t)||(ha(e),t&&t.response&&(t.response.data=xi.call(e,e.transformResponse,t.response),t.response.headers=Pi.from(t.response.headers))),Promise.reject(t)})}const pa="1.13.4",ya={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ya[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ga={};ya.transitional=function(e,t,n){function r(e,t){return"[Axios v"+pa+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new ni(r(o," has been removed"+(t?" in "+t:"")),ni.ERR_DEPRECATED);return t&&!ga[o]&&(ga[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)}},ya.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ma={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ni("options must be an object",ni.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 ni("option "+i+" must be "+n,ni.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ni("Unknown option "+i,ni.ERR_BAD_OPTION)}},validators:ya},wa=ma.validators;class Aa{constructor(e){this.defaults=e||{},this.interceptors={request:new yi,response:new yi}}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=Ji(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ma.assertOptions(n,{silentJSONParsing:wa.transitional(wa.boolean),forcedJSONParsing:wa.transitional(wa.boolean),clarifyTimeoutError:wa.transitional(wa.boolean)},!1),null!=r&&(ei.isFunction(r)?t.paramsSerializer={serialize:r}:ma.assertOptions(r,{encode:wa.function,serialize:wa.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ma.assertOptions(t,{baseUrl:wa.spelling("baseURL"),withXsrfToken:wa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&ei.merge(o.common,o[t.method]);o&&ei.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Pi.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,d=0;if(!s){const e=[fa.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 Bi(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 ba(function(t){e=t});return{token:t,cancel:e}}}const va=ba;const Sa={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(Sa).forEach(([e,t])=>{Sa[t]=e});const Ra=Sa;const Ta=function e(t){const n=new Ea(t),r=uo(Ea.prototype.request,n);return ei.extend(r,Ea.prototype,n,{allOwnKeys:!0}),ei.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ji(t,n))},r}(Oi);Ta.Axios=Ea,Ta.CanceledError=Bi,Ta.CancelToken=va,Ta.isCancel=Ui,Ta.VERSION=pa,Ta.toFormData=ci,Ta.AxiosError=ni,Ta.Cancel=Ta.CanceledError,Ta.all=function(e){return Promise.all(e)},Ta.spread=function(e){return function(t){return e.apply(null,t)}},Ta.isAxiosError=function(e){return ei.isObject(e)&&!0===e.isAxiosError},Ta.mergeConfig=Ji,Ta.AxiosHeaders=Pi,Ta.formToJSON=e=>Ri(ei.isHTMLForm(e)?new FormData(e):e),Ta.getAdapter=da.getAdapter,Ta.HttpStatusCode=Ra,Ta.default=Ta;var Oa,Ia;function Na(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _a(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=Ca().hostname;if(e&&"string"==typeof e&&e.length>0&&(t=e,e.includes("vipdev.lndo.site")))return"".concat(e.split(".")[0],".com");var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},Pa=function(){return Ca().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},xa=function(e){return function(e,t){if("string"!=typeof e)throw new g("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new g(`Invalid token specified: missing part #${n+1}`);let o;try{o=m(r)}catch(e){throw new g(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new g(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},Ua=function(){var e=ka();return["mcall.com","courant.com","sun-sentinel.com","orlandosentinel.com","growthspotter.com","dailypress.com","pilotonline.com","nydailynews.com","baltimoresun.com","capitalgazette.com","chicagotribune.com","trbdevcloud.com"].includes(e)},Ba=function(){return"complete"===document.readyState},Da=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(Ba())t();else{u.log("UIHandler: ","Waiting for the body to load...");var r=setInterval(s(c.mark(function o(){return c.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:e&&(n=Ba()),document.querySelector("body")&&n&&(clearInterval(r),t(!0));case 1:case"end":return o.stop()}},o)})),200)}})},Ma=function(){return new Promise(function(e){if(("interactive"===document.readyState||Ba())&&window.dataLayer)u.log("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{u.log("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(s(c.mark(function n(){return c.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:window.dataLayer&&window.dataLayer.length>2&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),50)}})},Ha=function(){return new Promise(function(e){if(Ba())e();else{u.log("Utils digisubsMenuLoaded: ","Waiting for the digisubs dropdown to load...");var t=setInterval(s(c.mark(function n(){return c.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:document.getElementById("account-content")&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),200)}})},Ga=function(){var e=s(c.mark(function e(t){var n,r,o;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Ma();case 1:return u.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",u.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return u.log("Utils dataLayerLoop: look for this element ",e),e[t]?(u.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(u.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)}}(),Ka=function(){var e=s(c.mark(function e(){var t,n,r=arguments;return c.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,Ga(t);case 1:return n=e.sent,u.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)}}(),Fa=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(u.log("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(u.log("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};u.log("utils | Event: authentication ready: ",r),e(r)}catch(e){u.log(e),t(e)}},!1))})},ja=function(){var e=s(c.mark(function e(){return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){return t.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(u.log("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(t){try{var r=t.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,u.log("Received entitlementsReady event:",r),e(r)}catch(e){u.error("Error handling entitlementsReady event:",e),n(e)}},{once:!0}):(u.log("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Wa=function(e){u.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 u.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=Wa;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Va=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)};var Xa=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var r={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},o=function(){var o=s(c.mark(function o(){var i,a,s,l,d,h,f,p,y,g,m;return c.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,"1"!==(null===(i=window.sophi_config)||void 0===i?void 0:i.enableSophiSSPW)){o.next=1;break}if(!document.getElementById("server-paywall")){o.next=1;break}return r.sspw=!0,o.abrupt("return",t({paywall:!0,details:_a({},r)}));case 1:return o.next=2,Ka();case 2:return s=o.sent,o.next=3,Ga("Paywall_Level");case 3:if(l=o.sent,"article"===s&&"free"!==l){o.next=4;break}return o.abrupt("return",t({paywall:!1,details:"article"!==s?"Page type is not an article":"Free article"}));case 4:return o.next=5,ja();case 5:if(!(d=o.sent)||!d.isEntitled){o.next=6;break}return o.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==l){o.next=7;break}return o.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(h=null===(a=window.ConnextUtils)||void 0===a?void 0:a.runningSophi,u.log("checkPaywallStatus - Sophi is running: ",h),!h){o.next=8;break}window.ConnextUtils.connextAlreadyRan&&window.sophiWallConfig&&!window.sophiWallConfig.error&&"paywall"===window.sophiWallConfig.wallType?(r.sophiClient=!0,r.engageStatus=!0,r.engagePaywall=!0):window.addEventListener("onPaywallShown",function(){return"paywall"===window.sophiWallConfig.wallType&&(r.sophiClient=!0),t({paywall:!0,details:_a({},r)})},{once:!0}),o.next=12;break;case 8:if(h){o.next=12;break}return f=window.ConnextUtils.connextReady("onPaywallShown",!1),p=new Promise(function(t,n){return setTimeout(function(){return n(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),o.prev=9,o.next=10,Promise.race([f,p]);case 10:!0===(y=o.sent)?(r.engagePaywall=!0,r.engageStatus="Engage paywall detected"):(r.engagePaywall=!1,r.engageStatus="Engage response: ".concat(y)),o.next=12;break;case 11:o.prev=11,g=o.catch(9),r.engagePaywall=!1,r.engageStatus="Engage response: ".concat(g);case 12:return o.abrupt("return",t({paywall:Object.values(r).some(function(e){return e}),details:_a({},r)}));case 13:o.prev=13,m=o.catch(0),n(m);case 14:case"end":return o.stop()}},o,null,[[0,13],[9,11]])}));return function(){return o.apply(this,arguments)}}();o()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=Xa);var Ja=function(e){try{window.dataLayer.push({event:e}),u.log("ANALYTICS: ".concat(e," event")),u.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){u.log("ANALYTICS: Failed to send ".concat(e," event: "),t)}};var Ya="#main .article-share ul",qa=".dropdown-menu .account-settings",za=".nav-wrapper-secondary .article-share ul",Za=function(){return document.querySelectorAll(Ya)},$a=function(){return document.querySelector(qa)},Qa=function(){return document.querySelector(za)},es=n(8287).hp,ts=function(e){return es.from(e,"base64").toString("utf8")},ns=function(){var e=window.localStorage.getItem(h),t=e&&ts(e)&&JSON.parse(ts(e),function(e,t){return e?function(e){try{var t=parseInt(e,10);return Number.isNaN(t)?e:t}catch(t){return e}}(JSON.parse(ts(t))):t});return u.log("Got encoded object hash with a value of ".concat(JSON.stringify(t))),t},rs=function(e){var t=ns();return t&&t[e]},os=function(e,t){var n=ns()||{};n[e]=t,function(e){var t={};Object.keys(e).forEach(function(n){t[n]=es.from(JSON.stringify(e[n])).toString("base64")});var n=es.from(JSON.stringify(t)).toString("base64");window.localStorage.setItem("user-profile",n),u.log("Set encoded object hash for ".concat(e))}(n)};var is=function(e,t){var n=e,r=document.getElementById("article-share-copy-link-text".concat(t));"Link Copied"!==e&&"Link Updated"!==e&&(document.getElementById("article-share-copy-btn".concat(t)).disabled=!0);u.log("article sharing: user message inside share button: ",e,t),document.getElementById("articleCopyLinkSpinner".concat(t)).setAttribute("style","display:none"),document.getElementById("article-share-copy-btn".concat(t)).classList.remove("spinner-pad"),document.getElementById("articleCopyLinkSpinner".concat(t)).classList.remove("spring-spinner-mar"),document.getElementById("article-share-copy-link-text".concat(t)).setAttribute("style","display:flex;","align-items:center"),r.innerHTML="Link Copied"===e||"Link Updated"===e?'\n\t\n\t '.concat(n):e},as=function(){var e=s(c.mark(function e(){var t,n,r,o;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Fa();case 1:if(t=e.sent,!(n=t.idToken)){e.next=2;break}return r=xa(n),o={uuid:r.sub},u.log("Article sharing: get user UUID",o.uuid),e.abrupt("return",o);case 2:return e.abrupt("return",!1);case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ss=function(e){return u.log("Article sharing: updating article count everywhere with ",e),document.querySelectorAll(".article-share-count").forEach(function(t){u.log("article sharing: updated article count! ",t),t.innerHTML=e}),u.log("Article sharing: update finished, return true"),!0},cs=function(){u.log("Article sharing: User is being spoofed, retrieving uuid to check remaining articles");var e=JSON.parse(localStorage.getItem(l)).entitlementToken;u.log("Article sharing: spoofed jwtToken: ",e);var t=e?xa(e):"";return u.log("Article sharing: UUID: ",t.uuid),t},us=function(e){return new Promise(function(n){var r=t.A.entitlementsEndpoint,o=t.A.entitlementsApiKey,i="".concat(r,"articleSharing/checkRemaining");u.log("Article sharing: api data: ",o);var a=e.uuid;(u.log("Article sharing: callCheckRemainingEndpoint: check if user is spoofed"),window.localStorage.getItem("spoof-user"))&&(a=cs().uuid);var l,h,f={uid:a,entitlementsToken:La("mng-entitlements")};u.log("Article sharing: articles remaining api body: ",f),$.ajax({type:"POST",url:i,headers:{"X-Api-Key":t.A.entitlementsApiKey},data:JSON.stringify(f),success:(h=s(c.mark(function e(t){var r;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u.log("Article sharing: checkRemaining response: successful: ",t.remaining),r="10",r="This user does not exists in the database. Return 10 for sharesRemaining."===t.remaining?"10":t.remaining,os(d,r),n(r);case 1:case"end":return e.stop()}},e)})),function(e){return h.apply(this,arguments)}),error:(l=s(c.mark(function e(t,r,o){return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u.log("Article sharing: checkRemaining Failure: ",o),n(!1);case 1:case"end":return e.stop()}},e)})),function(e,t,n){return l.apply(this,arguments)})})})},ls=function(){var e=s(c.mark(function e(t){var n,r,o,i,a=arguments;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],r=rs(d),n||!r){e.next=1;break}return e.abrupt("return",r);case 1:return e.next=2,as(t);case 2:return o=e.sent,e.next=3,us(o);case 3:return i=e.sent,e.abrupt("return",i);case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),ds=function(){var e=s(c.mark(function e(n){var r,o,i,a,s,l,h,f,p,y,g,m,w,A;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=function(e){for(var t="",n=a.replace(/[^0-9a-zA-Z]+/gm,""),r=n.length,o=0;o?'),null==(s=document.querySelectorAll(".article-share-h6"))||s.forEach(function(e){e.insertAdjacentHTML("beforeend",a)}));case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ps=function(e){var t,n=document.getElementById("share-icon-position".concat(e));"rgba(0, 0, 0, 0)"===window.getComputedStyle(document.querySelector("li.share-article")).backgroundColor?(n.classList.add("article-share-icon-invert"),t=window.getComputedStyle(document.getElementById("page")).getPropertyValue("--primary")):t="white";var r='\n\t\t\n\t\t'),o=window.btoa(r),i="url(data:image/svg+xml;base64,".concat(o,")");return n.style.background=i,"url(data:image/svg+xml;base64,".concat(o,")")},ys=function(e){e.classList.contains("article-share-fixed")&&e.classList.remove("article-share-fixed")},gs=function(){var e=s(c.mark(function e(t){var n,r,o,a,l,d,h,f,p;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.log("Article sharing: build menu here"),e.next=1,Da();case 1:if(u.log(" Article Sharing: Build sharing menuz!"),n="",r=function(){var e=s(c.mark(function e(r){var o,i,a,s,l;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ja("articleshare-openui"),o=document.getElementById("share-box-position".concat(r)),u.log("Article Sharing: i clicked this ",o,r),i=document.getElementById(o.id),u.log("article sharing: look for this box: ",o),o.classList.contains("show-article-sharing")||(u.log("article sharing: box already open, do not show spinner"),document.getElementById("articleShareBtnSpinner".concat(r)).setAttribute("style","display:block"),document.getElementById("share-icon-position".concat(r)).setAttribute("style","display:none!important;")),a=!1,t&&!o.classList.contains("show-article-sharing")){e.next=1;break}a=!0,e.next=4;break;case 1:return e.prev=1,e.next=2,ls(r,!1);case 2:a=e.sent,ss(a),e.next=4;break;case 3:e.prev=3,e.catch(1),u.log("Article share article count api error");case 4:u.log("article sharing: api request done, show results ",a),document.getElementById("share-icon-position".concat(r)).setAttribute("style","background:".concat(n,"; display:block!important;")),document.getElementById("articleShareBtnSpinner".concat(r)).setAttribute("style","display:none"),o.classList.toggle("show-article-sharing"),i.classList.toggle("show"),0!==r&&(Va(o)||o.classList.add("article-share-fixed")),s=document.querySelector("#article-share-position".concat(r," .article-share-link")),u.log("article sharing: accessible ",s),l=i.classList.contains("show"),u.log("article sharing: box isOpen ",l),l||(i.setAttribute("aria-expanded","false"),s.setAttribute("aria-press","false")),l&&(i.setAttribute("aria-expanded","true"),s.setAttribute("aria-press","true")),a<=0&&(u.log("article share: user out of free views ",a),is("No more shares left",r));case 5:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),o='\n\t\n\t\n\t\n\tCopy The Shareable Link',a=function(e){var n=document.getElementById("share-box-position".concat(e)),i=document.getElementById("cancel-button-label".concat(e));if(i&&(i.childNodes[0].nodeValue="Cancel"),n&&n.classList.contains("show-article-sharing")){var a=document.getElementById("article-share-copy-link-text".concat(e));t&&a&&(a.innerHTML=o),r(e,"close"),0===e&&ys(n)}},l=function(e,t){t&&t.addEventListener("click",function(){a(e)})},window.addEventListener("click",function(e){var n=e.target,r=n.closest(".article-share-link");if(t){var o=n.closest("#share-box-position0");null===(o&&o.classList.contains("show-article-sharing"))&&null===r&&a(0)}var i=n.closest("#share-box-position1");null===(i&&i.classList.contains("show-article-sharing"))&&null===r&&a(1);var s=n.closest("#share-box-position2");null===(s&&s.classList.contains("show-article-sharing"))&&null===r&&a(2)}),d=function(){var e=s(c.mark(function e(i){var a;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Ga("Page Title");case 1:a=e.sent,i.map(function(e,i){u.log("Article sharing: create button for this: ",e,i);var s=document.createElement("li");s.className="share-article",s.id="article-share-position".concat(i),s.setAttribute("tabindex","0");var c=document.createElement("button");c.className="article-share-link",c.setAttribute("aria-pressed","false"),c.setAttribute("aria-controls","share-box-position".concat(i)),c.setAttribute("aria-label","Article Sharing Button"),c.setAttribute("tabindex","0"),s.append(c);var d=document.createElement("span");d.style.display="none",d.classList.add("spring-spinner"),d.id="articleShareBtnSpinner".concat(i),d.innerHTML='\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
';var h=document.querySelector("li.share-facebook"),f=window.getComputedStyle(h),p=document.createElement("span");u.log("article sharing: share icon color: ",f.backgroundColor),"rgba(0, 0, 0, 0)"===f.backgroundColor&&d.classList.add("spring-spinner-invert"),c.append(d),p.id="share-icon-position".concat(i),p.className="article-share-icon";var y=document.createElement("span");y.className="sharing-screen-reader-text",y.innerHTML="Click to share a free article with a friend",s.append(y),e.appendChild(s),c.append(p),n=ps(i);var g=document.createElement("div");g.id="share-box-position".concat(i),g.className="article-share-box share-box-position".concat(i);var m,w="GIFT THIS ARTICLE",A='You have '.concat("10"," gift articles remaining this month");m=a,u.log(m),u.log("article sharing article title: ",m);var E=document.location.host;if(!1===t){g.classList.add("no-share");var b=E.replace("www.","").replace("develop.","").replace("preprod.",""),v=Ua()?"https://subscription.".concat(b):"https://checkout.".concat(b);A='Subscibers get '.concat("10"," gift articles each month"),g.innerHTML='\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
').concat(w,"
\n\t\t\t\t\t
What is article sharing?
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t

Subscribers are entitled to 10 gift sharing articles each month. These can be shared with friends and family who are not subscribers.

\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t

Subscribe now! or Sign in to your account.

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t')}else g.innerHTML='\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
').concat(w,"
\n\t\t\t\t
").concat(A,"
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t

").concat(m,"

\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
Copy the link
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t');e.appendChild(g);var S=document.getElementById("article-share-position".concat(i));S.addEventListener("click",function(){r(i,"open")}),S.addEventListener("keydown",function(e){"q"===e.key&&r(i,"open")});var R=document.getElementById("article-share-close".concat(i));l(i,R);var T=document.getElementById("cancel-button".concat(i));return l(i,T),document.getElementById("article-share-copy-btn".concat(i)).addEventListener("click",function(){ms(i)}),"done"});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),h=[Qa()].concat(i(Za())),u.log("article sharing: target elements are ",h),h.filter(function(e){return null!==e}).length!==h.length){e.next=2;break}return e.next=2,d(h);case 2:if(u.log("Article Sharing: appending sticky nav too"),!t){e.next=4;break}return e.next=3,fs();case 3:(f=document.querySelectorAll("#article-share-dropdown-article-page"))&&f.forEach(function(e){e.addEventListener("click",function(){r(0,"open")})}),(p=document.querySelector(".border-container #push-account-content #article-share-dropdown-article-page"))&&p.addEventListener("click",function(){document.getElementById("digisubs-toggle").click()});case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),ms=function(){var e=s(c.mark(function e(t){var n,r,o,i,a,s;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,ds(t);case 1:return n=e.sent,e.next=2,Ga("URL");case 2:if(r=e.sent,u.log("Article sharing: check article endpoint response: successful: ",n),n.sharedCode&&"null"!==n.sharedCode&&void 0!==n.sharedCode){e.next=3;break}is("Network error, try again",t),e.next=11;break;case 3:if("Link Updated"===n.status?is("Link Updated",t):is("Link Copied",t),o="".concat(r,"?share=").concat(n.sharedCode),!document.hasFocus()){e.next=8;break}return e.prev=4,e.next=5,navigator.clipboard.writeText(o);case 5:u.log("Article sharing: Link Copied"),"Link Updated"===n.status?is("Link Updated",t):is("Link Copied",t),e.next=7;break;case 6:e.prev=6,s=e.catch(4),u.error("Clipboard write failed:",s),is("Copy failed. Try again.",t);case 7:e.next=9;break;case 8:u.warn("Clipboard copy blocked: document not focused"),is("Copy failed. Try again.",t);case 9:if((i=document.getElementById("cancel-button-label".concat(t)))&&(i.childNodes[0].nodeValue="Close"),"Link Updated"===n.status){e.next=11;break}return e.next=10,ls(t);case 10:a=e.sent,ss(a);case 11:case"end":return e.stop()}},e,null,[[4,6]])}));return function(t){return e.apply(this,arguments)}}(),ws=function(){var e=s(c.mark(function e(){var n,r,o,i,a,l,d,h,f;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.articleShareConvo=!1,window.MNGAuthentication.articleShare="",u.log("article sharing: code check: checking free article code"),n=window.location.search,r=new URLSearchParams(n),e.next=1,Ga("Content ID");case 1:if(o=e.sent,i=Pa(),u.log("article sharing: code check: url params array ",r.getAll("share")),0!==r.getAll("share").length){e.next=2;break}return u.log("No share search param"),e.abrupt("return",!1);case 2:return window.MNGAuthentication.articleShareConvo=!0,a=r.getAll("share"),Ja("articleshare-readingshare"),u.log("Article sharing: code check: check share code: ",a),l=t.A.entitlementsEndpoint,d=t.A.entitlementsApiKey,h="".concat(l,"articleSharing/checkArticleSharedLink"),f={articleName:o,publication:i,code:a[0]},e.abrupt("return",$.ajax({type:"POST",url:h,headers:{"X-Api-Key":d},data:JSON.stringify(f),success:function(e){if(u.log("Article sharing: code check: looking for valid share code: ",e),"nocodefound"===e)u.log("Article sharing: code check: code does not exist"),Ja("articleshare-readshare-codenotfound"),window.MNGAuthentication.articleShare="codenotfound";else{u.log("Article sharing: code check: time api timestamp response: ",e.sharedTimestamp);var t=new Date(e.sharedTimestamp),n=(t=t.setDate(t.getDate()+30))/1e3;u.log("Article sharing: code check: time api timestamp response expiration date ",n);var r=new Date;r=Math.floor(r.getTime()/1e3),u.log("Article sharing: code check: current unix time is, ",r),n0&&e.forEach(function(e){if(e&&e.classList.contains("show-article-sharing")){var t=window.scrollY,n=document.getElementById("sharing-bottom"),r=document.getElementById("sharing-top");if(n&&e.classList.contains("share-box-position2"))t/n.offsetTop*100>=93?ys(e):e.classList.contains("article-share-fixed")||e.classList.add("article-share-fixed");if(r&&e.classList.contains("share-box-position1"))window.scrollY/(document.documentElement.scrollHeight-window.innerHeight)*100>=11.5?ys(e):e.classList.contains("article-share-fixed")||e.classList.add("article-share-fixed")}})}),e.next=1,Fa();case 1:return t=e.sent,n=t.isAuthenticated,e.next=2,ja();case 2:if(r=e.sent,!0!==n||void 0===window.MNGAuthentication||"function"!=typeof window.MNGAuthentication.isUserSubscriber||!r.isEntitled){e.next=7;break}return u.log("article sharing: subscriber, show sharing tool"),e.next=3,Ka();case 3:if(o=e.sent,u.log("article sharing: page type is ",o),"article"!==o){e.next=5;break}return e.next=4,gs(!0);case 4:e.next=6;break;case 5:return e.next=6,fs();case 6:e.next=9;break;case 7:return u.log("article sharing: not a logged in or a subscriber, show marketing message and check for share code"),e.next=8,ws();case 8:return e.next=9,gs(!1);case 9:window.addEventListener("updateArticlesRemainingUI",function(e){ss(e.detail)});case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();var Es=function(e){var t;"rgba(0, 0, 0, 0)"===window.getComputedStyle(document.querySelector("li.share-article")).backgroundColor?(e.classList.add("article-share-icon-invert"),t=window.getComputedStyle(document.getElementById("page")).getPropertyValue("--primary")):t="white";var n='\n\t\t\n\t\t');return"url(data:image/svg+xml;base64,".concat(window.btoa(n),")")},bs=function(){var e=s(c.mark(function e(){var t,n,r;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.log("engage gifting: waiting for body to load"),e.next=1,Da();case 1:null===(t=document.querySelector("style#engage-ga-style"))&&((t=document.createElement("style")).id="engage-ga-style",t.textContent="\n\t\t\t.share-article .engage-ga-share-popup { box-sizing: border-box; }\n\t\t\t.share-article .engage-ga-generate-link { color: white; background-color: var(--primary); }\n\t\t\t.share-article .engage-ga-generate-link:hover { background-color: var(--primary-light); }\n\t\t\t.share-article .engage-ga-generate-link:visited { text-decoration: none; }\n\t\t",document.head.appendChild(t),u.log("engage gifting: engage CSS overrides appended to head:",t)),n=function(e,t){if(null!==e.closest("#sharing-bottom")){u.log("engage gifting: create button for location ".concat(t,":"),e);var n=document.createElement("li");n.className="share-article",n.id="article-share-position".concat(t),n.setAttribute("tabindex","0"),n.setAttribute("data-mg2-action","giftArticleLink"),n.style.display="none";var r=document.createElement("button");r.className="article-share-link",r.setAttribute("aria-label","Article Gifting Button"),r.setAttribute("tabindex","0");var o=document.createElement("span");o.id="share-icon-position".concat(t),o.className="article-share-icon";var i=document.createElement("span");i.className="sharing-screen-reader-text",i.textContent="Click to share a free article with a friend",r.append(o),n.append(r,i),e.appendChild(n),o.style.background=Es(o)}else u.log("engage gifting: skipping location ".concat(t,":"),e)},r=[Qa()].concat(i(Za())),u.log("engage gifting: target elements are ",r),r.filter(function(e){return null!==e}).length===r.length&&r.forEach(function(e,t){n(e,t)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),vs=function(){var e=s(c.mark(function e(){var t;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.log("engage gifting: building Engage gifting buttons"),e.next=1,Ka();case 1:if(t=e.sent,u.log("engage gifting: page type is",t),"article"!==t){e.next=2;break}return e.next=2,bs();case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();t.A.enableEngageArticleGifting?vs():As()})()})(); //# sourceMappingURL=mng-digisubs.articleShare.bundle.js.map;