@eyepop.ai/eyepop 3.20.1 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eyepop.index.d.mts +51 -9
- package/dist/eyepop.index.d.ts +51 -9
- package/dist/eyepop.index.js +82 -12
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +80 -12
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +1 -1
package/dist/eyepop.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see eyepop.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.EyePopSdk=t():e.EyePopSdk=t()}(self,()=>(()=>{var e={262(e,t,i){"use strict";function n(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(i[n[a]]=e[n[a]])}return i}function a(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function o(e,t,i,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,i):a?a.value=i:t.set(e,i),i}function s(e,t){this.v=e,this.k=t}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function c(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}function p(e){return new s(e,0)}function l(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function u(e,t){return e.get(c(e,t))}function d(e,t,i){l(e,t),t.set(e,i)}function h(e,t,i){return e.set(c(e,t),i),i}function m(e,t){l(e,t),t.add(e)}function f(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function g(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach(function(t){f(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function b(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,a,o,s,r=[],c=!0,p=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;c=!1}else for(;!(c=(n=o.call(i)).done)&&(r.push(n.value),r.length!==t);c=!0);}catch(e){p=!0,a=e}finally{try{if(!c&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(p)throw a}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e){var t,i;function n(t,i){try{var o=e[t](i),r=o.value,c=r instanceof s;Promise.resolve(c?r.v:r).then(function(i){if(c){var s="return"===t&&r.k?t:"next";if(!r.k||i.done)return n(s,i);i=e[s](i).value}a(!!o.done,i)},function(e){n("throw",e)})}catch(e){a(2,e)}}function a(e,a){2===e?t.reject(a):t.resolve({value:a,done:e}),(t=t.next)?n(t.key,t.arg):i=null}this._invoke=function(e,a){return new Promise(function(o,s){var r={key:e,arg:a,resolve:o,reject:s,next:null};i?i=i.next=r:(t=i=r,n(e,a))})},"function"!=typeof e.return&&(this.return=void 0)}i.r(t),i.d(t,{Auth0Client:()=>Lr,AuthenticationError:()=>I,CacheKey:()=>ze,ConnectError:()=>O,GenericError:()=>A,InMemoryCache:()=>Me,InvalidConfigurationError:()=>j,LocalStorageCache:()=>Ne,MfaApiClient:()=>Er,MfaChallengeError:()=>_r,MfaEnrollmentError:()=>xr,MfaEnrollmentFactorsError:()=>Sr,MfaError:()=>yr,MfaListAuthenticatorsError:()=>wr,MfaRequiredError:()=>z,MfaVerifyError:()=>kr,MissingRefreshTokenError:()=>N,MissingScopesError:()=>M,MyAccountApiClient:()=>ht,MyAccountApiError:()=>mt,PasskeyApiClient:()=>Ar,PasskeyChallengeError:()=>Cs,PasskeyError:()=>Pr,PasskeyGetTokenError:()=>Us,PasskeyRegisterError:()=>Os,PopupCancelledError:()=>R,PopupOpenError:()=>L,PopupTimeoutError:()=>U,RefreshTokenMode:()=>Ye,ResponseType:()=>Qe,TimeoutError:()=>C,UseDpopNonceError:()=>W,User:()=>et,createAuth0Client:()=>zr}),"function"==typeof SuppressedError&&SuppressedError,w.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},w.prototype.next=function(e){return this._invoke("next",e)},w.prototype.throw=function(e){return this._invoke("throw",e)},w.prototype.return=function(e){return this._invoke("return",e)};const x={timeoutInSeconds:60},_=1e4,k="memory",S="online_access",T={name:"auth0-spa-js",version:"2.24.1"},E=()=>Date.now(),P="default";class A extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,A.prototype)}static fromPayload(e){let t=e.error,i=e.error_description;return new A(t,i)}}class j extends A{constructor(e,t){super("invalid_configuration","".concat(e," ").concat(t)),this.suggestion=t,Object.setPrototypeOf(this,j.prototype)}}class I extends A{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super(e,t),this.state=i,this.appState=n,Object.setPrototypeOf(this,I.prototype)}}class O extends A{constructor(e,t,i,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(e,t),this.connection=i,this.state=n,this.appState=a,Object.setPrototypeOf(this,O.prototype)}}class C extends A{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,C.prototype)}}class U extends C{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,U.prototype)}}class R extends A{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,R.prototype)}}class L extends A{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,L.prototype)}}class z extends A{constructor(e,t,i,n){super(e,t),this.mfa_token=i,this.mfa_requirements=n,Object.setPrototypeOf(this,z.prototype)}}class N extends A{constructor(e,t){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(D(e,["default"]),"', scope: '").concat(D(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,N.prototype)}}class M extends A{constructor(e,t){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(D(e,["default"]),"', missing scope: '").concat(D(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,M.prototype)}}class W extends A{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,W.prototype)}}function D(e){return e&&!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).includes(e)?e:""}const q=()=>window.crypto,J=()=>{let e="";for(;e.length<43;){const t=q().getRandomValues(new Uint8Array(43-e.length));for(const i of t)e.length<43&&i<198&&(e+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~."[i%66])}return e},$=e=>btoa(e),H=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],K=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(e).reduce((i,n)=>{if(t&&"env"===n)return i;const a=H.find(e=>e.key===n);return a&&a.type.includes(typeof e[n])&&(i[n]=e[n]),i},{})},F=e=>{var t=e.clientId,i=n(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter(t=>void 0!==e[t]).reduce((t,i)=>Object.assign(Object.assign({},t),{[i]:e[i]}),{}))(Object.assign({client_id:t},i))).toString()},V=async e=>{const t=q().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},Z=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),B=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))};var G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},X={},Y={};Object.defineProperty(Y,"__esModule",{value:!0});var Q=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,i){var n=e.locked.get(t);void 0===n?void 0===i?e.locked.set(t,[]):e.locked.set(t,[i]):void 0!==i&&(n.unshift(i),e.locked.set(t,n))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(i,n){e.isLocked(t)?e.addToLocked(t,i):(e.addToLocked(t),i())})},this.unlock=function(t){var i=e.locked.get(t);if(void 0!==i&&0!==i.length){var n=i.pop();e.locked.set(t,i),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}();Y.default=function(){return Q.getInstance()};var ee=G&&G.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(a,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function r(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?a(e.value):new i(function(t){t(e.value)}).then(s,r)}c((n=n.apply(e,t||[])).next())})},te=G&&G.__generator||function(e,t){var i,n,a,o,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((a=(a=s.trys).length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){s.label=o[1];break}if(6===o[0]&&s.label<a[1]){s.label=a[1],a=o;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(o);break}a[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,r])}}},ie=G;Object.defineProperty(X,"__esModule",{value:!0});var ne=Y,ae="browser-tabs-lock-key",oe={key:function(e){return ee(ie,void 0,void 0,function(){return te(this,function(e){throw new Error("Unsupported")})})},getItem:function(e){return ee(ie,void 0,void 0,function(){return te(this,function(e){throw new Error("Unsupported")})})},clear:function(){return ee(ie,void 0,void 0,function(){return te(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return ee(ie,void 0,void 0,function(){return te(this,function(e){throw new Error("Unsupported")})})},setItem:function(e,t){return ee(ie,void 0,void 0,function(){return te(this,function(e){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function se(e){return new Promise(function(t){return setTimeout(t,e)})}function re(e){for(var t="",i=0;i<e;i++)t+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"[Math.floor(61*Math.random())];return t}var ce=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+re(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,i){return void 0===i&&(i=5e3),ee(this,void 0,void 0,function(){var n,a,o,s,r,c,p;return te(this,function(l){switch(l.label){case 0:n=Date.now()+re(4),a=Date.now()+i,o=ae+"-"+t,s=void 0===this.storageHandler?oe:this.storageHandler,l.label=1;case 1:return Date.now()<a?[4,se(30)]:[3,8];case 2:return l.sent(),null!==s.getItemSync(o)?[3,5]:(r=this.id+"-"+t+"-"+n,[4,se(Math.floor(25*Math.random()))]);case 3:return l.sent(),s.setItemSync(o,JSON.stringify({id:this.id,iat:n,timeoutKey:r,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,se(30)];case 4:return l.sent(),null!==(c=s.getItemSync(o))&&(p=JSON.parse(c)).id===this.id&&p.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(o,n),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?oe:this.storageHandler),[4,this.waitForSomethingToChange(a)];case 6:l.sent(),l.label=7;case 7:return n=Date.now()+re(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return ee(this,void 0,void 0,function(){var i=this;return te(this,function(n){return setTimeout(function(){return ee(i,void 0,void 0,function(){var i,n,a;return te(this,function(o){switch(o.label){case 0:return[4,ne.default().lock(t)];case 1:return o.sent(),this.acquiredIatSet.has(t)?(i=void 0===this.storageHandler?oe:this.storageHandler,null===(n=i.getItemSync(e))?(ne.default().unlock(t),[2]):((a=JSON.parse(n)).timeRefreshed=Date.now(),i.setItemSync(e,JSON.stringify(a)),ne.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(ne.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return ee(this,void 0,void 0,function(){return te(this,function(i){switch(i.label){case 0:return[4,new Promise(function(i){var n=!1,a=Date.now(),o=!1;function s(){if(o||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(r),o=!0),!n){n=!0;var t=50-(Date.now()-a);t>0?setTimeout(i,t):i(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var r=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return i.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 ee(this,void 0,void 0,function(){return te(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 ee(this,void 0,void 0,function(){var i,n,a,o;return te(this,function(s){switch(s.label){case 0:return i=void 0===this.storageHandler?oe:this.storageHandler,n=ae+"-"+t,null===(a=i.getItemSync(n))?[2]:(o=JSON.parse(a)).id!==this.id?[3,2]:[4,ne.default().lock(o.iat)];case 1:s.sent(),this.acquiredIatSet.delete(o.iat),i.removeItemSync(n),ne.default().unlock(o.iat),e.notifyWaiters(),s.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var i=Date.now()-5e3,n=t,a=[],o=0;;){var s=n.keySync(o);if(null===s)break;a.push(s),o++}for(var r=!1,c=0;c<a.length;c++){var p=a[c];if(p.includes(ae)){var l=n.getItemSync(p);if(null!==l){var u=JSON.parse(l);(void 0===u.timeRefreshed&&u.timeAcquired<i||void 0!==u.timeRefreshed&&u.timeRefreshed<i)&&(n.removeItemSync(p),r=!0)}}}r&&e.notifyWaiters()},e.waiters=void 0,e}(),pe=X.default=ce;class le{async runWithLock(e,t,i){const n=new AbortController,a=setTimeout(()=>n.abort(),t);try{return await navigator.locks.request(e,{mode:"exclusive",signal:n.signal},async e=>{if(clearTimeout(a),!e)throw new Error("Lock not available");return await i()})}catch(e){if(clearTimeout(a),"AbortError"===(null==e?void 0:e.name))throw new C;throw e}}}class ue{constructor(){this.activeLocks=new Set,this.lock=new pe,this.pagehideHandler=()=>{this.activeLocks.forEach(e=>this.lock.releaseLock(e)),this.activeLocks.clear()}}async runWithLock(e,t,i){let n=!1;for(let i=0;i<10&&!n;i++)n=await this.lock.acquireLock(e,t);if(!n)throw new C;this.activeLocks.add(e),1===this.activeLocks.size&&"undefined"!=typeof window&&window.addEventListener("pagehide",this.pagehideHandler);try{return await i()}finally{this.activeLocks.delete(e),await this.lock.releaseLock(e),0===this.activeLocks.size&&"undefined"!=typeof window&&window.removeEventListener("pagehide",this.pagehideHandler)}}}let de=null;const he=new TextEncoder,me=new TextDecoder;function fe(e){return"string"==typeof e?he.encode(e):me.decode(e)}function ve(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new we(`${e.name} modulusLength must be at least 2048 bits`)}let ge;if(Uint8Array.prototype.toBase64)ge=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;ge=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const i=[];for(let n=0;n<t.byteLength;n+=e)i.push(String.fromCharCode.apply(null,t.subarray(n,n+e)));return btoa(i.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function be(e){return ge(e)}class ye extends Error{constructor(e){var t;super(null!=e?e:"operation not supported"),this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class we extends Error{constructor(e){var t;super(e),this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}function xe(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){if("SHA-256"===e.algorithm.hash.name)return"PS256";throw new ye("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(e){if("SHA-256"===e.algorithm.hash.name)return"RS256";throw new ye("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(e){if("P-256"===e.algorithm.namedCurve)return"ES256";throw new ye("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new ye("unsupported CryptoKey algorithm name")}}function _e(e){return e instanceof CryptoKey}function ke(e){return _e(e)&&"public"===e.type}async function Se(e){const{kty:t,e:i,n,x:a,y:o,crv:s}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:s,e:i,n,x:a,y:o}}const Te="dpop-nonce",Ee=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","urn:okta:params:oauth:grant-type:webauthn","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"],Pe=(e,t)=>new Promise(function(i,n){const a=new MessageChannel;a.port1.onmessage=function(e){e.data.error?n(new Error(e.data.error)):i(e.data),a.port1.close()},t.postMessage(e,[a.port2])}),Ae=(e,t,i)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([fetch(e,t),new Promise((e,t)=>{a=setTimeout(()=>{n.abort(),t(new Error("Timeout when executing 'fetch'"))},i)})]).finally(()=>{clearTimeout(a)})},je=async function(e,t,i,n,a,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:_;return a?(async(e,t,i,n,a,o,s,r,c,p)=>Pe({type:"refresh",auth:{audience:t,scope:i},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:s,useMrrt:r,skipTokenStorage:c,preserveRefreshToken:p},o))(e,t,i,n,s,a,o,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0,arguments.length>9?arguments[9]:void 0):(async(e,t,i)=>{const n=await Ae(e,t,i);return{ok:n.ok,json:await n.json(),headers:(a=n.headers,[...a].reduce((e,t)=>{let i=y(t,2),n=i[0],a=i[1];return e[n]=a,e},{}))};var a})(e,n,s)};async function Ie(e,t,i,a,o,s,r,c,p,l,u,d){if(p){const t=await p.generateProof({url:e,method:o.method||"GET",nonce:await p.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let h,m=null;for(let n=0;n<3;n++)try{h=await je(e,i,a,o,s,r,t,c,u,d),m=null;break}catch(e){m=e}if(m)throw m;const f=h.json,v=f.error,g=f.error_description,b=n(f,["error","error_description"]),y=h,w=y.headers,x=y.ok;let _;if(p&&(_=w[Te],_&&await p.setNonce(_)),!x){const n=g||"HTTP error. Unable to fetch ".concat(e);if("mfa_required"===v)throw new z(v,n,b.mfa_token,b.mfa_requirements);if("missing_refresh_token"===v)throw new N(i,a);if("use_dpop_nonce"===v){if(!p||!_||l)throw new W(_);return Ie(e,t,i,a,o,s,r,c,p,!0,u,d)}throw new A(v||"request_error",n)}return b}async function Oe(e,t,i){var a=e.baseUrl,o=e.timeout,s=e.audience,r=e.scope,c=e.auth0Client,p=e.useFormData,l=e.useMrrt,u=e.dpop,d=e.preserveRefreshToken,h=n(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop","preserveRefreshToken"]);const m="urn:ietf:params:oauth:grant-type:token-exchange"===h.grant_type,f="urn:okta:params:oauth:grant-type:webauthn"===h.grant_type,v="refresh_token"===h.grant_type&&l,g=m||f||v,b=Object.assign(Object.assign(Object.assign({},h),g&&s&&{audience:s}),g&&r&&{scope:r}),y=f||!p,w=y?JSON.stringify(b):F(b),x=(_=h.grant_type,Ee.includes(_));var _;return await Ie("".concat(a,"/oauth/token"),o,s||P,r,{method:"POST",body:w,headers:{"Content-Type":y?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(K(c||T)))}},t,p,l,x?u:void 0,void 0,i,d)}const Ce=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return(n=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(n))).join(" ");var n},Ue=(e,t,i)=>{let n;return i&&(n=e[i]),n||(n=e[P]),Ce(n,t)},Re="@@auth0spajs@@",Le="@@user@@";class ze{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Re,i=arguments.length>2?arguments[2]:void 0;this.prefix=t,this.suffix=i,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const t=y(e.split("::"),4),i=t[0],n=t[1],a=t[2],o=t[3];return new ze({clientId:n,scope:o,audience:a},i)}static fromCacheEntry(e){const t=e.scope,i=e.audience,n=e.client_id;return new ze({scope:t,audience:i,clientId:n})}}class Ne{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith(Re))}}class Me{constructor(){this.enclosedCache=function(){let e={};return{set(t,i){e[t]=i},get(t){const i=e[t];if(i)return i},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class We{constructor(e,t,i){this.cache=e,this.keyManifest=t,this.nowProvider=i||E}async setIdToken(e,t,i){var n;const a=this.getIdTokenCacheKey(e);await this.cache.set(a,{id_token:t,decodedToken:i}),await(null===(n=this.keyManifest)||void 0===n?void 0:n.add(a))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;var a;let o=await this.cache.get(e.toKey()),s=e;if(!o){const t=await this.getCacheKeys();if(!t)return;const a=this.matchExistingCacheKey(e,t);if(a&&(o=await this.cache.get(a),s=ze.fromKey(a)),!o&&i&&"cache-only"!==n)return this.getEntryWithRefreshToken(e,t)}if(!o)return;const r=await this.nowProvider(),c=Math.floor(r/1e3);return o.expiresAt-t<c?o.body.refresh_token?this.modifiedCachedEntry(o,s):(await this.cache.remove(s.toKey()),void await(null===(a=this.keyManifest)||void 0===a?void 0:a.remove(s.toKey()))):o.body}async modifiedCachedEntry(e,t){const i={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},n={body:i,expiresAt:e.expiresAt};return await this.cache.set(t.toKey(),n),{refresh_token:i.refresh_token,audience:i.audience,scope:i.scope}}async set(e){var t;const i=new ze({clientId:e.client_id,scope:e.scope,audience:e.audience}),n=await this.wrapCacheEntry(e);await this.cache.set(i.toKey(),n),await(null===(t=this.keyManifest)||void 0===t?void 0:t.add(i.toKey()))}async remove(e,t,i){const n=new ze({clientId:e,scope:i,audience:t});await this.cache.remove(n.toKey())}async stripRefreshToken(e){var t;const i=await this.getCacheKeys();if(i)for(const n of i){const i=await this.cache.get(n);(null===(t=null==i?void 0:i.body)||void 0===t?void 0:t.refresh_token)===e&&(delete i.body.refresh_token,await this.cache.set(n,i))}}async clear(e){var t;const i=await this.getCacheKeys();i&&(await i.filter(t=>!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new ze({clientId:e},Re,Le).toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var i;const n=ze.fromKey(t),a=new Set(n.scope&&n.scope.split(" ")),o=(null===(i=e.scope)||void 0===i?void 0:i.split(" "))||[],s=n.scope&&o.reduce((e,t)=>e&&a.has(t),!0);return n.prefix===Re&&n.clientId===e.clientId&&n.audience===e.audience&&s})[0]}async getEntryWithRefreshToken(e,t){var i;for(const n of t){const t=ze.fromKey(n);if(t.prefix===Re&&t.clientId===e.clientId){const e=await this.cache.get(n);if(null===(i=null==e?void 0:e.body)||void 0===i?void 0:i.refresh_token)return{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}}}async getRefreshTokensByAudience(e,t){var i;const n=await this.getCacheKeys();if(!n)return[];const a=new Set;for(const o of n){const n=ze.fromKey(o);if(n.prefix===Re&&n.clientId===t&&n.audience===e){const e=await this.cache.get(o);(null===(i=null==e?void 0:e.body)||void 0===i?void 0:i.refresh_token)&&a.add(e.body.refresh_token)}}return Array.from(a)}async updateEntry(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=await this.getCacheKeys();if(a)for(const o of a){if(ze.fromKey(o).clientId!==i)continue;const a=await this.cache.get(o);if(!(null==a?void 0:a.body))continue;const s=a.body.refresh_token;s&&(n||s===e)&&(a.body.refresh_token=t,await this.cache.set(o,a))}}}class De{constructor(e,t,i){this.storage=e,this.clientId=t,this.cookieDomain=i,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const qe=e=>"number"==typeof e,Je=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var $e=G&&G.__assign||function(){return $e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var a in t=arguments[i])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},$e.apply(this,arguments)};function He(e,t){if(!t)return"";var i="; "+e;return!0===t?i:i+"="+t}function Ke(e,t,i){document.cookie=function(e,t,i){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return He("Expires",e.expires?e.expires.toUTCString():"")+He("Domain",e.domain)+He("Path",e.path)+He("Secure",e.secure)+He("SameSite",e.sameSite)}(i)}(e,t,$e({path:"/"},i))}var Fe=Ke,Ve=function(e,t){Ke(e,"",$e($e({},t),{expires:-1}))};const Ze={get(e){const t=function(e){return function(e){for(var t={},i=e?e.split("; "):[],n=/(%[\dA-F]{2})+/gi,a=0;a<i.length;a++){var o=i[a].split("="),s=o.slice(1).join("=");'"'===s.charAt(0)&&(s=s.slice(1,-1));try{t[o[0].replace(n,decodeURIComponent)]=s.replace(n,decodeURIComponent)}catch(e){}}return t}(document.cookie)[e]}(e);if(void 0!==t)return JSON.parse(t)},save(e,t,i){let n={};"https:"===window.location.protocol&&(n={secure:!0,sameSite:"none"}),(null==i?void 0:i.daysUntilExpire)&&(n.expires=i.daysUntilExpire),(null==i?void 0:i.cookieDomain)&&(n.domain=i.cookieDomain),Fe(e,JSON.stringify(t),n)},remove(e,t){let i={};(null==t?void 0:t.cookieDomain)&&(i.domain=t.cookieDomain),Ve(e,i)}},Be="_legacy_",Ge={get:e=>Ze.get(e)||Ze.get("".concat(Be).concat(e)),save(e,t,i){let n={};"https:"===window.location.protocol&&(n={secure:!0}),(null==i?void 0:i.daysUntilExpire)&&(n.expires=i.daysUntilExpire),(null==i?void 0:i.cookieDomain)&&(n.domain=i.cookieDomain),Fe("".concat(Be).concat(e),JSON.stringify(t),n),Ze.save(e,t,i)},remove(e,t){let i={};(null==t?void 0:t.cookieDomain)&&(i.domain=t.cookieDomain),Ve(e,i),Ze.remove(e,t),Ze.remove("".concat(Be).concat(e),t)}},Xe={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}},Ye={Offline:"offline",Online:"online"};var Qe;!function(e){e.Code="code",e.ConnectCode="connect_code"}(Qe||(Qe={}));class et{}var tt,it=function(e){return tt=tt||function(){var e=function(e){var t=atob(e);return t}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxpLGE9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihhLnB1c2goby52YWx1ZSksYS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoaT1yLnJldHVybigpLE9iamVjdChpKSE9PWkpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGF9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKHQpLHRoaXMuZXJyb3I9ZSx0aGlzLmVycm9yX2Rlc2NyaXB0aW9uPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsci5wcm90b3R5cGUpfXN0YXRpYyBmcm9tUGF5bG9hZChlKXtsZXQgdD1lLmVycm9yLG89ZS5lcnJvcl9kZXNjcmlwdGlvbjtyZXR1cm4gbmV3IHIodCxvKX19Y2xhc3MgbyBleHRlbmRzIHJ7Y29uc3RydWN0b3IoZSx0KXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIiwiTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyIuY29uY2F0KG4oZSxbImRlZmF1bHQiXSksIicsIHNjb3BlOiAnIikuY29uY2F0KG4odCksIicpIikpLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsby5wcm90b3R5cGUpfX1mdW5jdGlvbiBuKGUpe3JldHVybiBlJiYhKGFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTpbXSkuaW5jbHVkZXMoZSk/ZToiIn0iZnVuY3Rpb24iPT10eXBlb2YgU3VwcHJlc3NlZEVycm9yJiZTdXBwcmVzc2VkRXJyb3I7Y29uc3Qgcz1lPT57dmFyIHQ9ZS5jbGllbnRJZCxyPWZ1bmN0aW9uKGUsdCl7dmFyIHI9e307Zm9yKHZhciBvIGluIGUpT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKGUsbykmJnQuaW5kZXhPZihvKTwwJiYocltvXT1lW29dKTtpZihudWxsIT1lJiYiZnVuY3Rpb24iPT10eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyl7dmFyIG49MDtmb3Iobz1PYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKGUpO248by5sZW5ndGg7bisrKXQuaW5kZXhPZihvW25dKTwwJiZPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLmNhbGwoZSxvW25dKSYmKHJbb1tuXV09ZVtvW25dXSl9cmV0dXJuIHJ9KGUsWyJjbGllbnRJZCJdKTtyZXR1cm4gbmV3IFVSTFNlYXJjaFBhcmFtcygoZT0+T2JqZWN0LmtleXMoZSkuZmlsdGVyKHQ9PnZvaWQgMCE9PWVbdF0pLnJlZHVjZSgodCxyKT0+T2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHQpLHtbcl06ZVtyXX0pLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IGk9e30sYT1udWxsO2NvbnN0IGM9KGUsdCk9PiIiLmNvbmNhdChlLCJ8IikuY29uY2F0KHQpLGw9KGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSx1PWU9PntPYmplY3QuZW50cmllcyhpKS5mb3JFYWNoKHI9PntsZXQgbz10KHIsMiksbj1vWzBdO29bMV09PT1lJiZkZWxldGUgaVtuXX0pfSxmPWU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKChlLHQpPT57clt0XT1lfSkscn0saD1hc3luYyBlPT57bGV0IHIsbixhPWUuZGF0YSx1PWEudGltZW91dCxoPWEuYXV0aCxkPWEuZmV0Y2hVcmwscD1hLmZldGNoT3B0aW9ucyx5PWEudXNlRm9ybURhdGEsZz1hLnVzZU1ycnQsYj1hLnNraXBUb2tlblN0b3JhZ2UsTz1hLnByZXNlcnZlUmVmcmVzaFRva2VuLGs9dChlLnBvcnRzLDEpWzBdLG09e307Y29uc3Qgaj1ofHx7fSx2PWouYXVkaWVuY2UsXz1qLnNjb3BlO3RyeXtjb25zdCBlPXk/ZihwLmJvZHkpOkpTT04ucGFyc2UocC5ib2R5KTtpZighZS5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1lLmdyYW50X3R5cGUpe2lmKG49KChlLHQpPT5pW2MoZSx0KV0pKHYsXyksIW4mJmcpe2NvbnN0IGU9aS5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+ISFPYmplY3Qua2V5cyhpKS5maW5kKHI9PntpZigibGF0ZXN0X3JlZnJlc2hfdG9rZW4iIT09cil7Y29uc3Qgbz1sKHQsciksbj1yLnNwbGl0KCJ8IilbMV0uc3BsaXQoIiAiKSxzPWUuc3BsaXQoIiAiKS5ldmVyeShlPT5uLmluY2x1ZGVzKGUpKTtyZXR1cm4gbyYmc319KSkoXyx2KTtlJiYhdCYmKG49ZSl9aWYoIW4pdGhyb3cgbmV3IG8odixfKTtwLmJvZHk9eT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpfWxldCBhLGg7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGE9bmV3IEFib3J0Q29udHJvbGxlcixwLnNpZ25hbD1hLnNpZ25hbCk7dHJ5e2g9YXdhaXQgUHJvbWlzZS5yYWNlKFsoVT11LG5ldyBQcm9taXNlKGU9PnNldFRpbWVvdXQoZSxVKSkpLGZldGNoKGQsT2JqZWN0LmFzc2lnbih7fSxwKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBrLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighaClyZXR1cm4gYSYmYS5hYm9ydCgpLHZvaWQgay5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZihNPWguaGVhZGVycyxtPVsuLi5NXS5yZWR1Y2UoKGUscik9PntsZXQgbz10KHIsMiksbj1vWzBdLHM9b1sxXTtyZXR1cm4gZVtuXT1zLGV9LHt9KSxyPWF3YWl0IGguanNvbigpLGIpcmV0dXJuIGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4sdm9pZCBrLnBvc3RNZXNzYWdlKHtvazpoLm9rLGpzb246cixoZWFkZXJzOm19KTtyLnJlZnJlc2hfdG9rZW4/KGcmJihpLmxhdGVzdF9yZWZyZXNoX3Rva2VuPXIucmVmcmVzaF90b2tlbix3PW4sUz1yLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMoaSkuZm9yRWFjaChlPT57bGV0IHI9dChlLDIpLG89clswXTtyWzFdPT09dyYmKGlbb109Uyl9KSksKChlLHQscik9PntpW2ModCxyKV09ZX0pKHIucmVmcmVzaF90b2tlbix2LF8pLGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4pOk98fCgoZSx0KT0+e2RlbGV0ZSBpW2MoZSx0KV19KSh2LF8pLGsucG9zdE1lc3NhZ2Uoe29rOmgub2ssanNvbjpyLGhlYWRlcnM6bX0pfWNhdGNoKGUpe2sucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOm19KX12YXIgdyxTLE0sVX0sZD1hc3luYyBlPT57bGV0IHI9ZS5kYXRhLG89ci50aW1lb3V0LG49ci5hdXRoLGE9ci5mZXRjaFVybCxjPXIuZmV0Y2hPcHRpb25zLGg9ci51c2VGb3JtRGF0YSxkPXQoZS5wb3J0cywxKVswXTtjb25zdCBwPShufHx7fSkuYXVkaWVuY2U7dHJ5e2NvbnN0IGU9KGU9Pntjb25zdCByPW5ldyBTZXQ7cmV0dXJuIE9iamVjdC5lbnRyaWVzKGkpLmZvckVhY2gobz0+e2xldCBuPXQobywyKSxzPW5bMF0saT1uWzFdO2woZSxzKSYmci5hZGQoaSl9KSxBcnJheS5mcm9tKHIpfSkocCk7aWYoMD09PWUubGVuZ3RoKXJldHVybiB2b2lkIGQucG9zdE1lc3NhZ2Uoe29rOiEwfSk7Y29uc3Qgcj1oP2YoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7Zm9yKGNvbnN0IHQgb2YgZSl7Y29uc3QgZT1oP3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7dG9rZW46dH0pKTtsZXQgbixpLGwsZjsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYobj1uZXcgQWJvcnRDb250cm9sbGVyLGk9bi5zaWduYWwpO3RyeXtmPWF3YWl0IFByb21pc2UucmFjZShbbmV3IFByb21pc2UoZT0+e2w9c2V0VGltZW91dChlLG8pfSksZmV0Y2goYSxPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sYykse2JvZHk6ZSxzaWduYWw6aX0pKV0pLmZpbmFsbHkoKCk9PmNsZWFyVGltZW91dChsKSl9Y2F0Y2goZSl7cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfSl9aWYoIWYpcmV0dXJuIG4mJm4uYWJvcnQoKSx2b2lkIGQucG9zdE1lc3NhZ2Uoe2Vycm9yOiJUaW1lb3V0IHdoZW4gZXhlY3V0aW5nICdmZXRjaCcifSk7aWYoIWYub2spe2xldCBlO3RyeXtjb25zdCB0PUpTT04ucGFyc2UoYXdhaXQgZi50ZXh0KCkpO2U9dC5lcnJvcl9kZXNjcmlwdGlvbn1jYXRjaChlKXt9cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZXx8IkhUVFAgZXJyb3IgIi5jb25jYXQoZi5zdGF0dXMpfSl9dSh0KX1kLnBvc3RNZXNzYWdlKHtvazohMH0pfWNhdGNoKGUpe2QucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZXx8IlVua25vd24gZXJyb3IgZHVyaW5nIHRva2VuIHJldm9jYXRpb24ifSl9fSxwPShlLHQpPT57aWYoIWEpcmV0dXJuITE7dHJ5e2NvbnN0IHI9bmV3IFVSTChhKS5vcmlnaW4sbz1uZXcgVVJMKGUuZmV0Y2hVcmwpO3JldHVybiBvLm9yaWdpbj09PXImJm8ucGF0aG5hbWU9PT10fWNhdGNoKGUpe3JldHVybiExfX07YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZT0+e2NvbnN0IHI9ZS5kYXRhLG89dChlLnBvcnRzLDEpWzBdO2lmKCEoInR5cGUiaW4gcil8fCJpbml0IiE9PXIudHlwZSlyZXR1cm4idHlwZSJpbiByJiYiY2xlYXIiPT09ci50eXBlPyhpPXt9LHZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITB9KSkpOiJ0eXBlImluIHImJiJyZXZva2UiPT09ci50eXBlP3AociwiL29hdXRoL3Jldm9rZSIpP3ZvaWQgZChlKTp2b2lkKG51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpOnZvaWQoImZldGNoVXJsImluIHImJnAociwiL29hdXRoL3Rva2VuIik/aChlKTpudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjoiaW52YWxpZF9mZXRjaF91cmwiLGVycm9yX2Rlc2NyaXB0aW9uOiJVbmF1dGhvcml6ZWQgZmV0Y2ggVVJMIn0saGVhZGVyczp7fX0pKTtpZihudWxsPT09YSl0cnl7bmV3IFVSTChyLmFsbG93ZWRCYXNlVXJsKSxhPXIuYWxsb3dlZEJhc2VVcmx9Y2F0Y2goZSl7cmV0dXJufX0pfSgpOwoK"),t=e.indexOf("\n",10)+1,i=e.substring(t)+"",n=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(n)}(),new Worker(tt,e)};class nt{constructor(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var t;const i=new Set((null===(t=await this.cache.get(this.manifestKey))||void 0===t?void 0:t.keys)||[]);i.add(e),await this.cache.set(this.manifestKey,{keys:[...i]})}async remove(e){const t=await this.cache.get(this.manifestKey);if(t){const i=new Set(t.keys);return i.delete(e),i.size>0?await this.cache.set(this.manifestKey,{keys:[...i]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return"".concat(Re,"::").concat(e)}}const at="auth0.is.authenticated",ot={memory:()=>(new Me).enclosedCache,localstorage:()=>new Ne},st=e=>ot[e],rt=e=>{const t=e.openUrl,i=e.onRedirect,a=n(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},a),{openUrl:!1===t||t?t:i})},ct={NONCE:"nonce",KEYPAIR:"keypair"};class pt{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,i)=>{e.onupgradeneeded=()=>Object.values(ct).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>i(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,i){const n=i((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}buildKey(e){const t=e?"_".concat(e):"auth0";return"".concat(this.clientId,"::").concat(t)}setNonce(e,t){return this.save(ct.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(ct.KEYPAIR,this.buildKey(),e)}async save(e,t,i){await this.executeDbRequest(e,"readwrite",e=>e.put(i,t))}findNonce(e){return this.find(ct.NONCE,this.buildKey(e))}findKeyPair(){return this.find(ct.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const i=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());await Promise.all((null==i?void 0:i.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t))))||[])}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith("".concat(t,"::")))}clearNonces(){return this.deleteByClientId(ct.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(ct.KEYPAIR,this.clientId)}}class lt{constructor(e){this.storage=new pt(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var i;let n;return n={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(n,null!==(i=null==t?void 0:t.extractable)&&void 0!==i&&i,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function(e){let t=e.keyPair,i=e.url,n=e.method,a=e.nonce,o=e.accessToken;const s=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(i);return async function(e,t,i,n,a,o){const s=null==e?void 0:e.privateKey,r=null==e?void 0:e.publicKey;if(!_e(c=s)||"private"!==c.type)throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!ke(r))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(!0!==r.extractable)throw new TypeError('"keypair.publicKey.extractable" must be true');if("string"!=typeof t)throw new TypeError('"htu" must be a string');if("string"!=typeof i)throw new TypeError('"htm" must be a string');if(void 0!==n&&"string"!=typeof n)throw new TypeError('"nonce" must be a string or undefined');if(void 0!==a&&"string"!=typeof a)throw new TypeError('"accessToken" must be a string or undefined');if(void 0!==o&&("object"!=typeof o||null===o||Array.isArray(o)))throw new TypeError('"additional" must be an object');return async function(e,t,i){if(!1===i.usages.includes("sign"))throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const n=`${be(fe(JSON.stringify(e)))}.${be(fe(JSON.stringify(t)))}`;return`${n}.${be(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return ve(e.algorithm),{name:e.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return ve(e.algorithm),{name:e.algorithm.name};case"Ed25519":return{name:e.algorithm.name}}throw new ye}(i),i,fe(n)))}`}({alg:xe(s),typ:"dpop+jwt",jwk:await Se(r)},Object.assign(Object.assign({},o),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:i,nonce:n,htu:t,ath:a?be(await crypto.subtle.digest("SHA-256",fe(a))):void 0}),s)}(t,s,n,a,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!ke(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await Se(e);let i;switch(t.kty){case"EC":i={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":i={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":i={e:t.e,kty:t.kty,n:t.n};break;default:throw new ye("unsupported JWK kty")}return be(await crypto.subtle.digest({name:"SHA-256"},fe(JSON.stringify(i))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var ut;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(ut||(ut={}));class dt{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return"".concat(e.replace(/\/?\/$/,""),"/").concat(t.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const i=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),n=e instanceof Request?new Request(i,e):i;return new Request(n,t)}setAuthorizationHeader(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ut.Bearer;e.headers.set("authorization","".concat(i," ").concat(t))}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const i=await this.hooks.getDpopNonce(),n=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:i,url:e.url});e.headers.set("dpop",n)}async prepareRequest(e,t){const i=await this.getAccessToken(t);let n,a;"string"==typeof i?(n=this.config.dpopNonceId?ut.DPoP:ut.Bearer,a=i):(n=i.token_type,a=i.access_token),this.setAuthorizationHeader(e,a,n),n===ut.DPoP&&await this.setDpopProofHeader(e,a)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const i=this.getHeader(e.headers,Te);if(i&&await this.hooks.setDpopNonce(i),!this.hasUseDpopNonceError(e))return e;if(!i||!t.onUseDpopNonceError)throw new W(i);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,i,n){const a=this.buildBaseRequest(e,t);await this.prepareRequest(a,n);const o=await this.config.fetch(a);return this.handleResponse(o,i)}fetchWithAuth(e,t,i){const n={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},n),{onUseDpopNonceError:void 0}),i)};return this.internalFetchWithAuth(e,t,n,i)}}class ht{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(t)}async getFactors(){const e=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/factors"),{method:"GET"},{scope:["read:me:factors"]});return(await this._handleResponse(e)).factors}async getAuthenticationMethods(e){const t=e?"?".concat(new URLSearchParams({type:e})):"",i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods").concat(t),{method:"GET"},{scope:["read:me:authentication_methods"]});return(await this._handleResponse(i)).authentication_methods}async getAuthenticationMethod(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"GET"},{scope:["read:me:authentication_methods"]});return this._handleResponse(t)}async deleteAuthenticationMethod(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"DELETE"},{scope:["delete:me:authentication_methods"]});t.ok||await this._handleResponse(t)}async updateAuthenticationMethod(e,t){const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},{scope:["update:me:authentication_methods"]});return this._handleResponse(i)}async enrollmentChallenge(e){var t;const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:authentication_methods"]}),n=await this._handleResponse(i),a=null!==(t=i.headers.get("location"))&&void 0!==t?t:"",o=decodeURIComponent(a.split("/").pop()||"");return Object.assign(Object.assign({},n),{id:o,location:a})}async enrollmentVerify(e){const t=e,i=t.location;t.type;const a=n(t,["location","type"]),o=await this.myAccountFetcher.fetchWithAuth("".concat(i,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},{scope:["create:me:authentication_methods"]});return this._handleResponse(o)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(i){throw new mt({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(i)})}if(e.ok)return t;throw new mt(t)}}class mt extends Error{constructor(e){let t=e.type,i=e.status,n=e.title,a=e.detail,o=e.validation_errors;super(a),this.name="MyAccountApiError",this.type=t,this.status=i,this.title=n,this.detail=a,this.validation_errors=o,Object.setPrototypeOf(this,mt.prototype)}}const ft={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}};var vt,gt;let bt;if("undefined"==typeof navigator||null===(vt=navigator.userAgent)||void 0===vt||null===(gt=vt.startsWith)||void 0===gt||!gt.call(vt,"Mozilla/5.0 ")){const e="v3.8.6";bt="".concat("oauth4webapi","/").concat(e)}function yt(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch(e){return!1}}const wt="ERR_INVALID_ARG_VALUE",xt="ERR_INVALID_ARG_TYPE";function _t(e,t,i){const n=new TypeError(e,{cause:i});return Object.assign(n,{code:t}),n}const kt=Symbol(),St=Symbol(),Tt=Symbol(),Et=Symbol(),Pt=Symbol(),At=Symbol(),jt=new TextEncoder,It=new TextDecoder;function Ot(e){return"string"==typeof e?jt.encode(e):It.decode(e)}let Ct,Ut;if(Uint8Array.prototype.toBase64)Ct=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;Ct=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const i=[];for(let n=0;n<t.byteLength;n+=e)i.push(String.fromCharCode.apply(null,t.subarray(n,n+e)));return btoa(i.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function Rt(e){return"string"==typeof e?Ut(e):Ct(e)}Ut=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw _t("The input to be decoded is not correctly encoded.",wt,e)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}catch(e){throw _t("The input to be decoded is not correctly encoded.",wt,e)}};class Lt extends Error{constructor(e,t){var i;super(e,t),f(this,"code",void 0),this.name=this.constructor.name,this.code=Ci,null===(i=Error.captureStackTrace)||void 0===i||i.call(Error,this,this.constructor)}}class zt extends Error{constructor(e,t){var i;super(e,t),f(this,"code",void 0),this.name=this.constructor.name,null!=t&&t.code&&(this.code=null==t?void 0:t.code),null===(i=Error.captureStackTrace)||void 0===i||i.call(Error,this,this.constructor)}}function Nt(e,t,i){return new zt(e,{code:t,cause:i})}function Mt(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Wt(e){yt(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(null!=e?e:{});if(bt&&!t.has("user-agent")&&t.set("user-agent",bt),t.has("authorization"))throw _t('"options.headers" must not include the "authorization" header name',wt);return t}function Dt(e,t){if(void 0!==t){if("function"==typeof t&&(t=t(e.href)),!(t instanceof AbortSignal))throw _t('"options.signal" must return or be an instance of AbortSignal',xt);return t}}function qt(e){return e.includes("//")?e.replace("//","/"):e}function Jt(e,t,i,n,a){try{if("number"!=typeof e||!Number.isFinite(e))throw _t("".concat(i," must be a number"),xt,a);if(e>0)return;if(t){if(0!==e)throw _t("".concat(i," must be a non-negative number"),wt,a);return}throw _t("".concat(i," must be a positive number"),wt,a)}catch(e){if(n)throw Nt(e.message,n,a);throw e}}function $t(e,t,i,n){try{if("string"!=typeof e)throw _t("".concat(t," must be a string"),xt,n);if(0===e.length)throw _t("".concat(t," must not be empty"),wt,n)}catch(e){if(i)throw Nt(e.message,i,n);throw e}}function Ht(e){!function(e,t){if(fi(e)!==t)throw function(e){let t='"response" content-type must be ';for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];if(n.length>2){const e=n.pop();t+="".concat(n.join(", "),", or ").concat(e)}else 2===n.length?t+="".concat(n[0]," or ").concat(n[1]):t+=n[0];return Nt(t,zi,e)}(e,t)}(e,"application/json")}function Kt(){return Rt(crypto.getRandomValues(new Uint8Array(32)))}function Ft(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 Lt("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 Lt("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 Lt("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 Lt("unsupported CryptoKey algorithm name",{cause:e})}}function Vt(e){const t=null==e?void 0:e[St];return"number"==typeof t&&Number.isFinite(t)?t:0}function Zt(e){const t=null==e?void 0:e[Tt];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Bt(){return Math.floor(Date.now()/1e3)}function Gt(e){if("object"!=typeof e||null===e)throw _t('"as" must be an object',xt);$t(e.issuer,'"as.issuer"')}function Xt(e){if("object"!=typeof e||null===e)throw _t('"client" must be an object',xt);$t(e.client_id,'"client.client_id"')}function Yt(e){return $t(e,'"clientSecret"'),(t,i,n,a)=>{n.set("client_id",i.client_id),n.set("client_secret",e)}}const Qt=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function ei(e,t){if(t&&"https:"!==e.protocol)throw Nt("only requests to HTTPS are allowed",Mi,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw Nt("only HTTP and HTTPS requests are allowed",Wi,e)}function ti(e,t,i,n){let a;if("string"!=typeof e||!(a=Qt(e)))throw Nt("authorization server metadata does not contain a valid ".concat(i?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?$i:Hi,{attribute:i?"mtls_endpoint_aliases.".concat(t):t});return ei(a,n),a}function ii(e,t,i,n){return i&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?ti(e.mtls_endpoint_aliases[t],t,i,n):ti(e[t],t,i,n)}class ni extends Error{constructor(e,t){var i;super(e,t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"error",void 0),f(this,"status",void 0),f(this,"error_description",void 0),f(this,"response",void 0),this.name=this.constructor.name,this.code=Oi,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===(i=Error.captureStackTrace)||void 0===i||i.call(Error,this,this.constructor)}}class ai extends Error{constructor(e,t){var i,n;super(e,t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"error",void 0),f(this,"error_description",void 0),this.name=this.constructor.name,this.code=Ui,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==(i=t.cause.get("error_description"))&&void 0!==i?i:void 0,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}class oi extends Error{constructor(e,t){var i;super(e,t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"response",void 0),f(this,"status",void 0),this.name=this.constructor.name,this.code=Ii,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null===(i=Error.captureStackTrace)||void 0===i||i.call(Error,this,this.constructor)}}const si="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",ri="("+si+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',ci="("+si+")\\s*=\\s*("+si+")",pi=new RegExp("^[,\\s]*("+si+")"),li=new RegExp("^[,\\s]*"+ri+"[,\\s]*(.*)"),ui=new RegExp("^[,\\s]*"+ci+"[,\\s]*(.*)"),di=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function hi(e,t,i){if(e.status!==t){let t;var n;if(function(e){let t;if(t=function(e){if(!yt(e,Response))throw _t('"response" must be an instance of Response',xt);const t=e.headers.get("www-authenticate");if(null===t)return;const i=[];let n=t;for(;n;){var a;let t=n.match(pi);const c=null===(a=t)||void 0===a?void 0:a[1].toLowerCase();if(!c)return;const p=n.substring(t[0].length);if(p&&!p.match(/^[\s,]/))return;const l=p.match(/^\s+(.*)$/),u=!!l;n=l?l[1]:void 0;const d={};let h;if(u)for(;n;){let i,a;if(t=n.match(li)){var o=y(t,4);if(i=o[1],a=o[2],n=o[3],a.includes("\\"))try{a=JSON.parse('"'.concat(a,'"'))}catch(e){}d[i.toLowerCase()]=a}else{if(!(t=n.match(ui))){if(t=n.match(di)){if(Object.keys(d).length)break;var s=y(t,3);h=s[1],n=s[2];break}return}var r=y(t,4);i=r[1],a=r[2],n=r[3],d[i.toLowerCase()]=a}}else n=p||void 0;const m={scheme:c,parameters:d};h&&(m.token68=h),i.push(m)}return i.length?i:void 0}(e))throw new oi("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}(e),t=await async function(e){if(e.status>399&&e.status<500){Fi(e),Ht(e);try{const t=await e.clone().json();if(Mt(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===(n=e.body)||void 0===n?void 0:n.cancel()),new ni("server responded with an error in the response body",{cause:t,response:e});throw Nt('"response" is not a conform '.concat(i," response (unexpected HTTP status code)"),Ni,e)}}function mi(e){if(!Si.has(e))throw _t('"options.DPoP" is not a valid DPoPHandle',wt)}function fi(e){var t;return null===(t=e.headers.get("content-type"))||void 0===t?void 0:t.split(";")[0]}async function vi(e,t,i,n,a,o,s){return await i(e,t,a,o),o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==s?void 0:s[Et])||fetch)(n.href,{body:a,headers:Object.fromEntries(o.entries()),method:"POST",redirect:"manual",signal:Dt(n,null==s?void 0:s.signal)})}async function gi(e,t,i,n,a,o){var s;const r=ii(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[kt]));a.set("grant_type",n);const c=Wt(null==o?void 0:o.headers);c.set("accept","application/json"),void 0!==(null==o?void 0:o.DPoP)&&(mi(o.DPoP),await o.DPoP.addProof(r,c,"POST"));const p=await vi(e,t,i,r,a,c,o);return null==o||null===(s=o.DPoP)||void 0===s||s.cacheNonce(p,r),p}const bi=new WeakMap,yi=new WeakMap;function wi(e){if(!e.id_token)return;const t=bi.get(e);if(!t)throw _t('"ref" was already garbage collected or did not resolve from the proper sources',wt);return t}async function xi(e,t,i,n,a,o){if(Gt(e),Xt(t),!yt(i,Response))throw _t('"response" must be an instance of Response',xt);await hi(i,200,"Token Endpoint"),Fi(i);const s=await Qi(i);if($t(s.access_token,'"response" body "access_token" property',Li,{body:s}),$t(s.token_type,'"response" body "token_type" property',Li,{body:s}),s.token_type=s.token_type.toLowerCase(),void 0!==s.expires_in){let e="number"!=typeof s.expires_in?parseFloat(s.expires_in):s.expires_in;Jt(e,!0,'"response" body "expires_in" property',Li,{body:s}),s.expires_in=e}if(void 0!==s.refresh_token&&$t(s.refresh_token,'"response" body "refresh_token" property',Li,{body:s}),void 0!==s.scope&&"string"!=typeof s.scope)throw Nt('"response" body "scope" property must be a string',Li,{body:s});if(void 0!==s.id_token){$t(s.id_token,'"response" body "id_token" property',Li,{body:s});const o=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&o.push("auth_time"),void 0!==t.default_max_age&&(Jt(t.default_max_age,!0,'"client.default_max_age"'),o.push("auth_time")),null!=n&&n.length&&o.push(...n);const r=await async function(e,t,i,n,a){let o,s,r=e.split("."),c=r[0],p=r[1],l=r.length;if(5===l){if(void 0===a)throw new Lt("JWE decryption is not configured",{cause:e});var u=(e=await a(e)).split(".");c=u[0],p=u[1],l=u.length}if(3!==l)throw Nt("Invalid JWT",Li,e);try{o=JSON.parse(Ot(Rt(c)))}catch(e){throw Nt("failed to parse JWT Header body as base64url encoded JSON",Ri,e)}if(!Mt(o))throw Nt("JWT Header must be a top level object",Li,e);if(t(o),void 0!==o.crit)throw new Lt('no JWT "crit" header parameter extensions are supported',{cause:{header:o}});try{s=JSON.parse(Ot(Rt(p)))}catch(e){throw Nt("failed to parse JWT Payload body as base64url encoded JSON",Ri,e)}if(!Mt(s))throw Nt("JWT Payload must be a top level object",Li,e);const d=Bt()+i;if(void 0!==s.exp){if("number"!=typeof s.exp)throw Nt('unexpected JWT "exp" (expiration time) claim type',Li,{claims:s});if(s.exp<=d-n)throw Nt('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Di,{claims:s,now:d,tolerance:n,claim:"exp"})}if(void 0!==s.iat&&"number"!=typeof s.iat)throw Nt('unexpected JWT "iat" (issued at) claim type',Li,{claims:s});if(void 0!==s.iss&&"string"!=typeof s.iss)throw Nt('unexpected JWT "iss" (issuer) claim type',Li,{claims:s});if(void 0!==s.nbf){if("number"!=typeof s.nbf)throw Nt('unexpected JWT "nbf" (not before) claim type',Li,{claims:s});if(s.nbf>d+n)throw Nt('unexpected JWT "nbf" (not before) claim value',Di,{claims:s,now:d,tolerance:n,claim:"nbf"})}if(void 0!==s.aud&&"string"!=typeof s.aud&&!Array.isArray(s.aud))throw Nt('unexpected JWT "aud" (audience) claim type',Li,{claims:s});return{header:o,claims:s,jwt:e}}(s.id_token,Bi.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Vt(t),Zt(t),a).then(Pi.bind(void 0,o)).then(ki.bind(void 0,e)).then(_i.bind(void 0,t.client_id)),c=r.claims,p=r.jwt;if(Array.isArray(c.aud)&&1!==c.aud.length){if(void 0===c.azp)throw Nt('ID Token "aud" (audience) claim includes additional untrusted audiences',qi,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw Nt('unexpected ID Token "azp" (authorized party) claim value',qi,{expected:t.client_id,claims:c,claim:"azp"})}void 0!==c.auth_time&&Jt(c.auth_time,!0,'ID Token "auth_time" (authentication time)',Li,{claims:c}),yi.set(i,p),bi.set(s,c)}if(void 0!==(null==o?void 0:o[s.token_type]))o[s.token_type](i,s);else if("dpop"!==s.token_type&&"bearer"!==s.token_type)throw new Lt("unsupported `token_type` value",{cause:{body:s}});return s}function _i(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw Nt('unexpected JWT "aud" (audience) claim value',qi,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw Nt('unexpected JWT "aud" (audience) claim value',qi,{expected:e,claims:t.claims,claim:"aud"});return t}function ki(e,t){var i,n;const a=null!==(i=null===(n=e[tn])||void 0===n?void 0:n.call(e,t))&&void 0!==i?i:e.issuer;if(t.claims.iss!==a)throw Nt('unexpected JWT "iss" (issuer) claim value',qi,{expected:a,claims:t.claims,claim:"iss"});return t}const Si=new WeakSet,Ti=Symbol(),Ei={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 Pi(e,t){for(const i of e)if(void 0===t.claims[i])throw Nt('JWT "'.concat(i,'" (').concat(Ei[i],") claim missing"),Li,{claims:t.claims});return t}const Ai=Symbol(),ji=Symbol(),Ii="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Oi="OAUTH_RESPONSE_BODY_ERROR",Ci="OAUTH_UNSUPPORTED_OPERATION",Ui="OAUTH_AUTHORIZATION_RESPONSE_ERROR",Ri="OAUTH_PARSE_ERROR",Li="OAUTH_INVALID_RESPONSE",zi="OAUTH_RESPONSE_IS_NOT_JSON",Ni="OAUTH_RESPONSE_IS_NOT_CONFORM",Mi="OAUTH_HTTP_REQUEST_FORBIDDEN",Wi="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Di="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",qi="OAUTH_JWT_CLAIM_COMPARISON_FAILED",Ji="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",$i="OAUTH_MISSING_SERVER_METADATA",Hi="OAUTH_INVALID_SERVER_METADATA";async function Ki(e){if(!yt(e,Response))throw _t('"response" must be an instance of Response',xt);await hi(e,200,"Revocation Endpoint")}function Fi(e){if(e.bodyUsed)throw _t('"response" body has been used already',wt)}function Vi(e){const t=e.algorithm;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new Lt("unsupported ".concat(t.name," modulusLength"),{cause:e})}function Zi(e){switch(e.algorithm.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Lt("unsupported ECDSA namedCurve",{cause:e})}}function Bi(e,t,i,n){if(void 0===e)if(Array.isArray(t)){if(!t.includes(n.alg))throw Nt('unexpected JWT "alg" header parameter',Li,{header:n,expected:t,reason:"authorization server metadata"})}else{if(void 0===i)throw Nt('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:i});if("string"==typeof i?n.alg!==i:"function"==typeof i?!i(n.alg):!i.includes(n.alg))throw Nt('unexpected JWT "alg" header parameter',Li,{header:n,expected:i,reason:"default value"})}else if("string"==typeof e?n.alg!==e:!e.includes(n.alg))throw Nt('unexpected JWT "alg" header parameter',Li,{header:n,expected:e,reason:"client configuration"})}function Gi(e,t){const i=e.getAll(t),n=i[0];if(i.length>1)throw Nt('"'.concat(t,'" parameter must be provided only once'),Li);return n}const Xi=Symbol(),Yi=Symbol();async function Qi(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ht;try{t=await e.json()}catch(t){throw i(e),Nt('failed to parse "response" body as JSON',Ri,t)}if(!Mt(t))throw Nt('"response" body must be a top level object',Li,{body:t});return t}const en=Symbol(),tn=Symbol(),nn=new TextEncoder,an=new TextDecoder;function on(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.reduce((e,t)=>e+t.length,0),a=new Uint8Array(n);let o=0;for(const e of t)a.set(e,o),o+=e.length;return a}function sn(e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);if(n>127)throw new TypeError("non-ASCII string encountered in encode()");t[i]=n}return t}function rn(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}function cn(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:an.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=an.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return rn(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}}function pn(e){let t=e;return"string"==typeof t&&(t=nn.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();const t=[];for(let i=0;i<e.length;i+=32768)t.push(String.fromCharCode.apply(null,e.subarray(i,i+32768)));return btoa(t.join(""))}(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}const ln=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))},un=(e,t)=>e.name===t;function dn(e,t){var i;if(i=e.hash,parseInt(i.name.slice(4),10)!==t)throw ln("SHA-".concat(t),"algorithm.hash")}function hn(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];if((n=n.filter(Boolean)).length>2){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 o;null!==(o=t.constructor)&&void 0!==o&&o.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const mn=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];return hn("Key for the ".concat(e," algorithm must be "),t,...n)};class fn extends Error{constructor(e,t){var i;super(e,t),f(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,null===(i=Error.captureStackTrace)||void 0===i||i.call(Error,this,this.constructor)}}f(fn,"code","ERR_JOSE_GENERIC");class vn extends fn{constructor(e,t){let i=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:i,reason:n,payload:t}}),f(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),f(this,"claim",void 0),f(this,"reason",void 0),f(this,"payload",void 0),this.claim=i,this.reason=n,this.payload=t}}f(vn,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class gn extends fn{constructor(e,t){let i=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:i,reason:n,payload:t}}),f(this,"code","ERR_JWT_EXPIRED"),f(this,"claim",void 0),f(this,"reason",void 0),f(this,"payload",void 0),this.claim=i,this.reason=n,this.payload=t}}f(gn,"code","ERR_JWT_EXPIRED");class bn extends fn{constructor(){super(...arguments),f(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}f(bn,"code","ERR_JOSE_ALG_NOT_ALLOWED");class yn extends fn{constructor(){super(...arguments),f(this,"code","ERR_JOSE_NOT_SUPPORTED")}}f(yn,"code","ERR_JOSE_NOT_SUPPORTED"),f(class extends fn{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),f(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),f(class extends fn{constructor(){super(...arguments),f(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class wn extends fn{constructor(){super(...arguments),f(this,"code","ERR_JWS_INVALID")}}f(wn,"code","ERR_JWS_INVALID");class xn extends fn{constructor(){super(...arguments),f(this,"code","ERR_JWT_INVALID")}}f(xn,"code","ERR_JWT_INVALID"),f(class extends fn{constructor(){super(...arguments),f(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class _n extends fn{constructor(){super(...arguments),f(this,"code","ERR_JWKS_INVALID")}}f(_n,"code","ERR_JWKS_INVALID");class kn extends fn{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),f(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}f(kn,"code","ERR_JWKS_NO_MATCHING_KEY");class Sn extends fn{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),f(this,Symbol.asyncIterator,void 0),f(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}f(Sn,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Tn extends fn{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),f(this,"code","ERR_JWKS_TIMEOUT")}}f(Tn,"code","ERR_JWKS_TIMEOUT");class En extends fn{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),f(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}f(En,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Pn=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},An=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),jn=e=>Pn(e)||An(e);function In(e,t){if(e)throw new TypeError("".concat(t," can only be called once"))}function On(e,t,i){try{return cn(e)}catch(e){throw new i("Failed to base64url decode the ".concat(t))}}function Cn(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 i=e;for(;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(e)===i}function Un(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.filter(Boolean);if(0===n.length||1===n.length)return!0;let a;for(const e of n){const t=Object.keys(e);if(a&&0!==a.size)for(const e of t){if(a.has(e))return!1;a.add(e)}else a=new Set(t)}return!0}const Rn=e=>Cn(e)&&"string"==typeof e.kty;function Ln(e,t){if(e.startsWith("RS")||e.startsWith("PS")){const i=t.algorithm.modulusLength;if("number"!=typeof i||i<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}}function zn(e,t){const i="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:i,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:i,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:i,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:i,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 yn("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}async function Nn(e,t,i){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return hn("Key must be ",e,...i)}(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:"SHA-".concat(e.slice(-3)),name:"HMAC"},!1,[i])}return function(e,t,i){switch(t){case"HS256":case"HS384":case"HS512":if(!un(e.algorithm,"HMAC"))throw ln("HMAC");dn(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if(!un(e.algorithm,"RSASSA-PKCS1-v1_5"))throw ln("RSASSA-PKCS1-v1_5");dn(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if(!un(e.algorithm,"RSA-PSS"))throw ln("RSA-PSS");dn(e.algorithm,parseInt(t.slice(2),10));break;case"Ed25519":case"EdDSA":if(!un(e.algorithm,"Ed25519"))throw ln("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!un(e.algorithm,t))throw ln(t);break;case"ES256":case"ES384":case"ES512":{if(!un(e.algorithm,"ECDSA"))throw ln("ECDSA");const i=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==i)throw ln(i,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(t&&!e.usages.includes(t))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(t,"."))}(e,i)}(t,e,i),t}const Mn='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function Wn(e){var t,i;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const n=function(e){let t,i;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},i=e.priv?["sign"]:["verify"];break;default:throw new yn(Mn)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:"SHA-".concat(e.alg.slice(-3))},i=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e.alg.slice(-3))},i=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)},i=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new yn(Mn)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[e.alg]},i=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},i=e.d?["deriveBits"]:[];break;default:throw new yn(Mn)}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},i=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},i=e.d?["deriveBits"]:[];break;default:throw new yn(Mn)}break;default:throw new yn('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:i}}(e),a=n.algorithm,o=n.keyUsages,s=g({},e);return"AKP"!==s.kty&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,a,null!==(t=e.ext)&&void 0!==t?t:!e.d&&!e.priv,null!==(i=e.key_ops)&&void 0!==i?i:o)}const Dn="given KeyObject instance cannot be used for this algorithm";let qn;const Jn=async function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];qn||(qn=new WeakMap);let a=qn.get(e);if(null!=a&&a[i])return a[i];const o=await Wn(g(g({},t),{},{alg:i}));return n&&Object.freeze(e),a?a[i]=o:qn.set(e,{[i]:o}),o};async function $n(e,t){if(e instanceof Uint8Array)return e;if(Pn(e))return e;if(An(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{qn||(qn=new WeakMap);let i=qn.get(e);if(null!=i&&i[t])return i[t];const n="public"===e.type,a=!!n;let o;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(Dn)}o=e.toCryptoKey(e.asymmetricKeyType,a,n?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError(Dn);o=e.toCryptoKey(e.asymmetricKeyType,a,[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(Dn);o=e.toCryptoKey(e.asymmetricKeyType,a,[n?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let i;switch(t){case"RSA-OAEP":i="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":i="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":i="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":i="SHA-512";break;default:throw new TypeError(Dn)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:i},a,n?["encrypt"]:["decrypt"]);o=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:i},a,[n?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var s;const i=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null===(s=e.asymmetricKeyDetails)||void 0===s?void 0:s.namedCurve);if(!i)throw new TypeError(Dn);const r={ES256:"P-256",ES384:"P-384",ES512:"P-521"};r[t]&&i===r[t]&&(o=e.toCryptoKey({name:"ECDSA",namedCurve:i},a,[n?"verify":"sign"])),t.startsWith("ECDH-ES")&&(o=e.toCryptoKey({name:"ECDH",namedCurve:i},a,n?[]:["deriveBits"]))}if(!o)throw new TypeError(Dn);return i?i[t]=o:qn.set(e,{[t]:o}),o})(e,t)}catch(e){if(e instanceof TypeError)throw e}let i=e.export({format:"jwk"});return Jn(e,i,t)}if(Rn(e))return e.k?cn(e.k):Jn(e,e,t,!0);throw new Error("unreachable")}const Hn=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let i=0;i<e.byteLength;i++)if(e[i]!==t[i])return!1;return!0},Kn=e=>{const t=e.data[e.pos++];if(128&t){const i=127&t;let n=0;for(let t=0;t<i;t++)n=n<<8|e.data[e.pos++];return n}return t},Fn=(e,t,i)=>{if(e.data[e.pos++]!==t)throw new Error(i)},Vn=(e,t)=>{const i=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,i};async function Zn(e,t,i){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return((e,t,i)=>{var n;const a=(e=>rn(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);let o=i;return null!=t&&null!==(n=t.startsWith)&&void 0!==n&&n.call(t,"ECDH-ES")&&(o||(o={}),o.getNamedCurve=e=>{const t={data:e,pos:0};return function(e){Fn(e,48,"Invalid PKCS#8 structure"),Kn(e),Fn(e,2,"Expected version field");const t=Kn(e);e.pos+=t,Fn(e,48,"Expected algorithm identifier"),Kn(e),e.pos}(t),(e=>{const t=(e=>{Fn(e,6,"Expected algorithm OID");const t=Kn(e);return Vn(e,t)})(e);if(Hn(t,[43,101,110]))return"X25519";if(!Hn(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Fn(e,6,"Expected curve OID");const i=Kn(e),n=Vn(e,i);for(const e 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]}]){const t=e.name,i=e.oid;if(Hn(n,i))return t}throw new Error("Unsupported named curve")})(t)}),(async(e,t,i,n)=>{var a;let o,s;switch(i){case"PS256":case"PS384":case"PS512":o={name:"RSA-PSS",hash:"SHA-".concat(i.slice(-3))},s=["sign"];break;case"RS256":case"RS384":case"RS512":o={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(i.slice(-3))},s=["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":o={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(i.slice(-3),10)||1)},s=["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":o={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[i]},s=["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const e=n.getNamedCurve(t);o="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new yn("Invalid or unsupported key format")}s=["deriveBits"];break;case"Ed25519":case"EdDSA":o={name:"Ed25519"},s=["sign"];break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":o={name:i},s=["sign"];break;default:throw new yn('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,o,null!==(a=null==n?void 0:n.extractable)&&void 0!==a&&a,s)})("pkcs8",a,t,o)})(e,t,i)}function Bn(e,t,i,n,a){if(void 0!==a.crit&&void 0===(null==n?void 0:n.crit))throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==i?new Map([...Object.entries(i),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new yn('Extension Header Parameter "'.concat(t,'" is not recognized'));if(void 0===a[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(o.get(t)&&void 0===n[t])throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return new Set(n.crit)}const Gn=e=>null==e?void 0:e[Symbol.toStringTag],Xn=(e,t,i)=>{if(void 0!==t.use){let e;switch(i){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,a;let o;switch(!0){case"sign"===i||"verify"===i:case"dir"===e:case e.includes("CBC-HS"):o=i;break;case e.startsWith("PBES2"):o="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):o=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===i?"wrapKey":"unwrapKey":i;break;case"encrypt"===i&&e.startsWith("RSA"):o="wrapKey";break;case"decrypt"===i:o=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(o&&!1===(null===(n=t.key_ops)||void 0===n||null===(a=n.includes)||void 0===a?void 0:a.call(n,o)))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(o,'" when present'))}return!0};function Yn(e,t,i){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,i)=>{if(!(t instanceof Uint8Array)){if(Rn(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&Xn(e,t,i))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(!jn(t))throw new TypeError(mn(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(Gn(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,i);break;default:((e,t,i)=>{if(Rn(t))switch(i){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&Xn(e,t,i))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)&&Xn(e,t,i))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!jn(t))throw new TypeError(mn(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(Gn(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(i){case"sign":throw new TypeError("".concat(Gn(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(Gn(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(i){case"verify":throw new TypeError("".concat(Gn(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(Gn(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,i)}}var Qn,ea;let ta,ia;if("undefined"==typeof navigator||null===(Qn=navigator.userAgent)||void 0===Qn||null===(ea=Qn.startsWith)||void 0===ea||!ea.call(Qn,"Mozilla/5.0 ")){const e="v6.8.4";ia="".concat("openid-client","/").concat(e),ta={"user-agent":ia}}const na=e=>aa.get(e);let aa,oa;function sa(e){return void 0!==e?Yt(e):(oa||(oa=new WeakMap),(e,t,i,n)=>{let a;return(a=oa.get(t))||(function(e,t){if("string"!=typeof e)throw la("".concat(t," must be a string"),pa);if(0===e.length)throw la("".concat(t," must not be empty"),ca)}(t.client_secret,'"metadata.client_secret"'),a=Yt(t.client_secret),oa.set(t,a)),a(e,t,i,n)})}const ra=Et,ca="ERR_INVALID_ARG_VALUE",pa="ERR_INVALID_ARG_TYPE";function la(e,t,i){const n=new TypeError(e,{cause:i});return Object.assign(n,{code:t}),n}class ua extends Error{constructor(e,t){var i;super(e,t),f(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null===(i=Error.captureStackTrace)||void 0===i||i.call(Error,this,this.constructor)}}function da(e,t,i){return new ua(e,{cause:t,code:i})}function ha(e){if(e instanceof TypeError||e instanceof ua||e instanceof ni||e instanceof ai||e instanceof oi)throw e;if(e instanceof zt)switch(e.code){case Mi:throw da("only requests to HTTPS are allowed",e,e.code);case Wi:throw da("only requests to HTTP or HTTPS are allowed",e,e.code);case Ni:throw da("unexpected HTTP response status code",e.cause,e.code);case zi:throw da("unexpected response content-type",e.cause,e.code);case Ri:throw da("parsing error occured",e,e.code);case Li:throw da("invalid response encountered",e,e.code);case qi:throw da("unexpected JWT claim value encountered",e,e.code);case Ji:throw da("unexpected JSON attribute value encountered",e,e.code);case Di:throw da("JWT timestamp claim value failed validation",e,e.code);default:throw da(e.message,e,e.code)}if(e instanceof Lt)throw da("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw da("runtime operation error",e,Ci);case"NotSupportedError":throw da("runtime unsupported operation",e,Ci);case"TimeoutError":throw da("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw da("operation aborted",e,"OAUTH_ABORT")}throw new ua("something went wrong",{cause:e})}new TextDecoder;const ma=Symbol();class fa{constructor(e,t,i,n){var a,o,s,r,c;if("string"!=typeof t||!t.length)throw la('"clientId" must be a non-empty string',pa);if("string"==typeof i&&(i={client_secret:i}),void 0!==(null===(a=i)||void 0===a?void 0:a.client_id)&&t!==i.client_id)throw la('"clientId" and "metadata.client_id" must be the same',ca);const p=g(g({},structuredClone(i)),{},{client_id:t});let l;p[St]=null!==(o=null===(s=i)||void 0===s?void 0:s[St])&&void 0!==o?o:0,p[Tt]=null!==(r=null===(c=i)||void 0===c?void 0:c[Tt])&&void 0!==r?r:30,l=n||("string"==typeof p.client_secret&&p.client_secret.length?sa(p.client_secret):(e,t,i,n)=>{i.set("client_id",t.client_id)});let u=Object.freeze(p);const d=structuredClone(e);ma in e&&(d[tn]=t=>{let i=t.claims.tid;return e.issuer.replace("{tenantid}",i)});let h=Object.freeze(d);aa||(aa=new WeakMap),aa.set(this,{__proto__:null,as:h,c:u,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(na(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){var t;let i=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(i))}}}}(e))}(e),e}clientMetadata(){return structuredClone(na(this).c)}get timeout(){return na(this).timeout}set timeout(e){na(this).timeout=e}get[ra](){return na(this).fetch}set[ra](e){na(this).fetch=e}}function va(e){Object.defineProperties(e,function(e){let t;if(void 0!==e.expires_in){const i=new Date;i.setSeconds(i.getSeconds()+e.expires_in),t=i.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 wi(this)}catch(e){return}}}}}(e))}async function ga(e,t,i){var n;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=null===(n=e.headers.get("retry-after"))||void 0===n?void 0:n.trim();if(void 0===o)return;let s;if(/^\d+$/.test(o))s=parseInt(o,10);else{const e=new Date(o);if(Number.isFinite(e.getTime())){const t=new Date,i=e.getTime()-t.getTime();i>0&&(s=Math.ceil(i/1e3))}}if(a&&!Number.isFinite(s))throw new zt("invalid Retry-After header value",{cause:e});s>t&&await ba(s-t,i)}function ba(e,t){return new Promise((i,n)=>{const a=e=>{try{t.throwIfAborted()}catch(e){return void n(e)}if(e<=0)return void i();const o=Math.min(e,5);setTimeout(()=>a(e-o),1e3*o)};a(e)})}async function ya(e,t){Pa(e);const i=na(e),n=i.as,a=i.c,o=i.auth,s=i.fetch,r=i.tlsOnly,c=i.timeout;return async function(e,t,i,n,a){Gt(e),Xt(t);const o=ii(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==a?void 0:a[kt])),s=new URLSearchParams(n);s.set("client_id",t.client_id);const r=Wt(null==a?void 0:a.headers);return r.set("accept","application/json"),vi(e,t,i,o,s,r,a)}(n,a,o,t,{[Et]:s,[kt]:!r,headers:new Headers(ta),signal:Aa(c)}).then(e=>async function(e,t,i){if(Gt(e),Xt(t),!yt(i,Response))throw _t('"response" must be an instance of Response',xt);await hi(i,200,"Backchannel Authentication Endpoint"),Fi(i);const n=await Qi(i);$t(n.auth_req_id,'"response" body "auth_req_id" property',Li,{body:n});let a="number"!=typeof n.expires_in?parseFloat(n.expires_in):n.expires_in;return Jt(a,!0,'"response" body "expires_in" property',Li,{body:n}),n.expires_in=a,void 0!==n.interval&&Jt(n.interval,!1,'"response" body "interval" property',Li,{body:n}),n}(n,a,e)).catch(ha)}async function wa(e,t,i,n){var a,o;Pa(e),i=new URLSearchParams(i);let s=null!==(a=t.interval)&&void 0!==a?a:5;const r=null!==(o=null==n?void 0:n.signal)&&void 0!==o?o:AbortSignal.timeout(1e3*t.expires_in);try{await ba(s,r)}catch(e){ha(e)}const c=na(e),p=c.as,l=c.c,u=c.auth,d=c.fetch,h=c.tlsOnly,m=c.nonRepudiation,f=c.timeout,v=c.decrypt,b=(a,o)=>wa(e,g(g({},t),{},{interval:a}),i,g(g({},n),{},{signal:r,flag:o})),y=function(e,t){const i=Aa(t);if(!i)return{signal:e,cleanup(){}};const n=new AbortController,a=e=>{const t=e.target;n.abort(t.reason)};return e.aborted?n.abort(e.reason):i.aborted?n.abort(i.reason):(e.addEventListener("abort",a,{once:!0}),i.addEventListener("abort",a,{once:!0})),{signal:n.signal,cleanup(){e.removeEventListener("abort",a),i.removeEventListener("abort",a)}}}(r,f),w=await async function(e,t,i,n,a){Gt(e),Xt(t),$t(n,'"authReqId"');const o=new URLSearchParams(null==a?void 0:a.additionalParameters);return o.set("auth_req_id",n),gi(e,t,i,"urn:openid:params:grant-type:ciba",o,a)}(p,l,u,t.auth_req_id,{[Et]:d,[kt]:!h,additionalParameters:i,DPoP:null==n?void 0:n.DPoP,headers:new Headers(ta),signal:y.signal}).catch(ha).finally(y.cleanup);var x;if(503===w.status&&w.headers.has("retry-after"))return await ga(w,s,r,!0),await(null===(x=w.body)||void 0===x?void 0:x.cancel()),b(s);const _=async function(e,t,i,n){return xi(e,t,i,void 0,null==n?void 0:n[At],null==n?void 0:n.recognizedTokenTypes)}(p,l,w,{[At]:v});let k;try{k=await _}catch(e){if(ja(e,n))return b(s,Ia);if(e instanceof ni)switch(e.error){case"slow_down":s+=5;case"authorization_pending":return await ga(e.response,s,r),b(s)}ha(e)}return k.id_token&&await(null==m?void 0:m(w)),va(k),k}function xa(e){na(e).tlsOnly=!1}async function _a(e,t,i,n,a){if(Pa(e),!((null==a?void 0:a.flag)===Ia||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw la('"currentUrl" must be an instance of URL, or Request',pa);let o,s;const r=na(e),c=r.as,p=r.c,l=r.auth,u=r.fetch,d=r.tlsOnly,h=r.jarm,m=r.hybrid,f=r.nonRepudiation,v=r.timeout,b=r.decrypt,w=r.implicit;if((null==a?void 0:a.flag)===Ia)o=a.authResponse,s=a.redirectUri;else{if(!(t instanceof URL)){const e=t;switch(t=new URL(t.url),e.method){case"GET":break;case"POST":const i=new URLSearchParams(await async function(e){if("POST"!==e.method)throw _t("form_post responses are expected to use the POST method",wt,{cause:e});if("application/x-www-form-urlencoded"!==fi(e))throw _t("form_post responses are expected to use the application/x-www-form-urlencoded content-type",wt,{cause:e});return async function(e){if(e.bodyUsed)throw _t("form_post Request instances must contain a readable body",wt,{cause:e});return e.text()}(e)}(e));if(m)t.hash=i.toString();else for(const e of i.entries()){var x=y(e,2);const i=x[0],n=x[1];t.searchParams.append(i,n)}break;default:throw la("unexpected Request HTTP method",ca)}}switch(s=function(e){return(e=new URL(e)).search="",e.hash="",e.href}(t),!0){case!!h:o=await h(t,null==i?void 0:i.expectedState);break;case!!m:o=await m(t,null==i?void 0:i.expectedNonce,null==i?void 0:i.expectedState,null==i?void 0:i.maxAge);break;case!!w:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{o=function(e,t,i,n){if(Gt(e),Xt(t),i instanceof URL&&(i=i.searchParams),!(i instanceof URLSearchParams))throw _t('"parameters" must be an instance of URLSearchParams, or URL',xt);if(Gi(i,"response"))throw Nt('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Li,{parameters:i});const a=Gi(i,"iss"),o=Gi(i,"state");if(!a&&e.authorization_response_iss_parameter_supported)throw Nt('response parameter "iss" (issuer) missing',Li,{parameters:i});if(a&&a!==e.issuer)throw Nt('unexpected "iss" (issuer) response parameter value',Li,{expected:e.issuer,parameters:i});switch(n){case void 0:case Yi:if(void 0!==o)throw Nt('unexpected "state" response parameter encountered',Li,{expected:void 0,parameters:i});break;case Xi:break;default:if($t(n,'"expectedState" argument'),o!==n)throw Nt(void 0===o?'response parameter "state" missing':'unexpected "state" response parameter value',Li,{expected:n,parameters:i})}if(Gi(i,"error"))throw new ai("authorization response from the server is an error",{cause:i});const s=Gi(i,"id_token"),r=Gi(i,"token");if(void 0!==s||void 0!==r)throw new Lt("implicit and hybrid flows are not supported");return c=new URLSearchParams(i),Si.add(c),c;var c}(c,p,t.searchParams,null==i?void 0:i.expectedState)}catch(e){ha(e)}}}const _=await async function(e,t,i,n,a,o,s){if(Gt(e),Xt(t),!Si.has(n))throw _t('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',wt);$t(a,'"redirectUri"');const r=Gi(n,"code");if(!r)throw Nt('no authorization code in "callbackParameters"',Li);const c=new URLSearchParams(null==s?void 0:s.additionalParameters);return c.set("redirect_uri",a),c.set("code",r),o!==Ti&&($t(o,'"codeVerifier"'),c.set("code_verifier",o)),gi(e,t,i,"authorization_code",c,s)}(c,p,l,o,s,(null==i?void 0:i.pkceCodeVerifier)||Ti,{additionalParameters:n,[Et]:u,[kt]:!d,DPoP:null==a?void 0:a.DPoP,headers:new Headers(ta),signal:Aa(v)}).catch(ha);"string"!=typeof(null==i?void 0:i.expectedNonce)&&"number"!=typeof(null==i?void 0:i.maxAge)||(i.idTokenExpected=!0);const k=async function(e,t,i,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,i,n,a,o,s){const r=[];switch(n){case void 0:n=Ai;break;case Ai:break;default:$t(n,'"expectedNonce" argument'),r.push("nonce")}switch(null!=a||(a=t.default_max_age),a){case void 0:a=ji;break;case ji:break;default:Jt(a,!0,'"maxAge" argument'),r.push("auth_time")}const c=await xi(e,t,i,r,o,s);$t(c.id_token,'"response" body "id_token" property',Li,{body:c});const p=wi(c);if(a!==ji){const e=Bt()+Vt(t),i=Zt(t);if(p.auth_time+a<e-i)throw Nt("too much time has elapsed since the last End-User authentication",Di,{claims:p,now:e,tolerance:i,claim:"auth_time"})}if(n===Ai){if(void 0!==p.nonce)throw Nt('unexpected ID Token "nonce" claim value',qi,{expected:void 0,claims:p,claim:"nonce"})}else if(p.nonce!==n)throw Nt('unexpected ID Token "nonce" claim value',qi,{expected:n,claims:p,claim:"nonce"});return c}(e,t,i,n.expectedNonce,n.maxAge,n[At],n.recognizedTokenTypes):async function(e,t,i,n,a){const o=await xi(e,t,i,void 0,n,a),s=wi(o);if(s){if(void 0!==t.default_max_age){Jt(t.default_max_age,!0,'"client.default_max_age"');const e=Bt()+Vt(t),i=Zt(t);if(s.auth_time+t.default_max_age<e-i)throw Nt("too much time has elapsed since the last End-User authentication",Di,{claims:s,now:e,tolerance:i,claim:"auth_time"})}if(void 0!==s.nonce)throw Nt('unexpected ID Token "nonce" claim value',qi,{expected:void 0,claims:s,claim:"nonce"})}return o}(e,t,i,null==n?void 0:n[At],null==n?void 0:n.recognizedTokenTypes)}(c,p,_,{expectedNonce:null==i?void 0:i.expectedNonce,maxAge:null==i?void 0:i.maxAge,requireIdToken:null==i?void 0:i.idTokenExpected,[At]:b});let S;try{S=await k}catch(t){if(ja(t,a))return _a(e,void 0,i,n,g(g({},a),{},{flag:Ia,authResponse:o,redirectUri:s}));ha(t)}return S.id_token&&await(null==f?void 0:f(_)),va(S),S}async function ka(e,t,i,n){Pa(e),i=new URLSearchParams(i);const a=na(e),o=a.as,s=a.c,r=a.auth,c=a.fetch,p=a.tlsOnly,l=a.nonRepudiation,u=a.timeout,d=a.decrypt,h=await async function(e,t,i,n,a){Gt(e),Xt(t),$t(n,'"refreshToken"');const o=new URLSearchParams(null==a?void 0:a.additionalParameters);return o.set("refresh_token",n),gi(e,t,i,"refresh_token",o,a)}(o,s,r,t,{[Et]:c,[kt]:!p,additionalParameters:i,DPoP:null==n?void 0:n.DPoP,headers:new Headers(ta),signal:Aa(u)}).catch(ha),m=async function(e,t,i,n){return xi(e,t,i,void 0,null==n?void 0:n[At],null==n?void 0:n.recognizedTokenTypes)}(o,s,h,{[At]:d});let f;try{f=await m}catch(a){if(ja(a,n))return ka(e,t,i,g(g({},n),{},{flag:Ia}));ha(a)}return f.id_token&&await(null==l?void 0:l(h)),va(f),f}async function Sa(e,t,i){Pa(e),t=new URLSearchParams(t);const n=na(e),a=n.as,o=n.c,s=n.auth,r=n.fetch,c=n.tlsOnly,p=n.timeout,l=await async function(e,t,i,n,a){return Gt(e),Xt(t),gi(e,t,i,"client_credentials",new URLSearchParams(n),a)}(a,o,s,t,{[Et]:r,[kt]:!c,DPoP:null==i?void 0:i.DPoP,headers:new Headers(ta),signal:Aa(p)}).catch(ha),u=async function(e,t,i){return xi(e,t,i,void 0,void 0,void 0)}(a,o,l);let d;try{d=await u}catch(n){if(ja(n,i))return Sa(e,t,g(g({},i),{},{flag:Ia}));ha(n)}return va(d),d}function Ta(e,t){Pa(e);const i=na(e),n=i.as,a=i.c,o=i.tlsOnly,s=i.hybrid,r=i.jarm,c=i.implicit,p=ii(n,"authorization_endpoint",!1,o);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",a.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",s?"code id_token":c?"id_token":"code"),c&&!t.has("nonce"))throw la("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",ca);r&&t.set("response_mode","jwt")}for(const e of t.entries()){var l=y(e,2);const t=l[0],i=l[1];p.searchParams.append(t,i)}return p}async function Ea(e,t,i){Pa(e);const n=Ta(e,t),a=na(e),o=a.as,s=a.c,r=a.auth,c=a.fetch,p=a.tlsOnly,l=a.timeout,u=await async function(e,t,i,n,a){var o;Gt(e),Xt(t);const s=ii(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==a?void 0:a[kt])),r=new URLSearchParams(n);r.set("client_id",t.client_id);const c=Wt(null==a?void 0:a.headers);c.set("accept","application/json"),void 0!==(null==a?void 0:a.DPoP)&&(mi(a.DPoP),await a.DPoP.addProof(s,c,"POST"));const p=await vi(e,t,i,s,r,c,a);return null==a||null===(o=a.DPoP)||void 0===o||o.cacheNonce(p,s),p}(o,s,r,n.searchParams,{[Et]:c,[kt]:!p,DPoP:null==i?void 0:i.DPoP,headers:new Headers(ta),signal:Aa(l)}).catch(ha),d=async function(e,t,i){if(Gt(e),Xt(t),!yt(i,Response))throw _t('"response" must be an instance of Response',xt);await hi(i,201,"Pushed Authorization Request Endpoint"),Fi(i);const n=await Qi(i);$t(n.request_uri,'"response" body "request_uri" property',Li,{body:n});let a="number"!=typeof n.expires_in?parseFloat(n.expires_in):n.expires_in;return Jt(a,!0,'"response" body "expires_in" property',Li,{body:n}),n.expires_in=a,n}(o,s,u);let h;try{h=await d}catch(n){if(ja(n,i))return Ea(e,t,g(g({},i),{},{flag:Ia}));ha(n)}return Ta(e,{request_uri:h.request_uri})}function Pa(e){if(!(e instanceof fa))throw la('"config" must be an instance of Configuration',pa);if(Object.getPrototypeOf(e)!==fa.prototype)throw la("subclassing Configuration is not allowed",ca)}function Aa(e){return e?AbortSignal.timeout(1e3*e):void 0}function ja(e,t){return!(null==t||!t.DPoP||t.flag===Ia)&&function(e){if(e instanceof oi){const t=e.cause,i=t[0];return 1===t.length&&"dpop"===i.scheme&&"use_dpop_nonce"===i.parameters.error}return e instanceof ni&&"use_dpop_nonce"===e.error}(e)}Object.freeze(fa.prototype);const Ia=Symbol();async function Oa(e,t,i,n){Pa(e);const a=na(e),o=a.as,s=a.c,r=a.auth,c=a.fetch,p=a.tlsOnly,l=a.timeout,u=a.decrypt,d=a.nonRepudiation,h=await async function(e,t,i,n,a,o){return Gt(e),Xt(t),$t(n,'"grantType"'),gi(e,t,i,n,new URLSearchParams(a),o)}(o,s,r,t,new URLSearchParams(i),{[Et]:c,[kt]:!p,DPoP:null==n?void 0:n.DPoP,headers:new Headers(ta),signal:Aa(l)}).catch(ha);let m;"urn:ietf:params:oauth:grant-type:token-exchange"===t&&(m={n_a:()=>{}});const f=async function(e,t,i,n){return xi(e,t,i,void 0,null==n?void 0:n[At],null==n?void 0:n.recognizedTokenTypes)}(o,s,h,{[At]:u,recognizedTokenTypes:m});let v;try{v=await f}catch(a){if(ja(a,n))return Oa(e,t,i,g(g({},n),{},{flag:Ia}));ha(a)}return v.id_token&&await(null==d?void 0:d(h)),va(v),v}const Ca=e=>Math.floor(e.getTime()/1e3),Ua=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Ra(e){const t=Ua.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const i=parseFloat(t[2]);let n;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(i);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(60*i);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(3600*i);break;case"day":case"days":case"d":n=Math.round(86400*i);break;case"week":case"weeks":case"w":n=Math.round(604800*i);break;default:n=Math.round(31557600*i)}return"-"===t[1]||"ago"===t[4]?-n:n}function La(e,t){if(!Number.isFinite(t))throw new TypeError("Invalid ".concat(e," input"));return t}const za=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());function Na(e,t){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{i=JSON.parse(an.decode(t))}catch(e){}if(!Cn(i))throw new xn("JWT Claims Set must be a top-level JSON object");const a=n.typ;if(a&&("string"!=typeof e.typ||za(e.typ)!==za(a)))throw new vn('unexpected "typ" JWT header value',i,"typ","check_failed");const o=n.requiredClaims,s=void 0===o?[]:o,r=n.issuer,c=n.subject,p=n.audience,l=n.maxTokenAge,u=[...s];void 0!==l&&u.push("iat"),void 0!==p&&u.push("aud"),void 0!==c&&u.push("sub"),void 0!==r&&u.push("iss");for(const e of new Set(u.reverse()))if(!(e in i))throw new vn('missing required "'.concat(e,'" claim'),i,e,"missing");if(r&&!(Array.isArray(r)?r:[r]).includes(i.iss))throw new vn('unexpected "iss" claim value',i,"iss","check_failed");if(c&&i.sub!==c)throw new vn('unexpected "sub" claim value',i,"sub","check_failed");if(p&&(h="string"==typeof p?[p]:p,!("string"==typeof(d=i.aud)?h.includes(d):Array.isArray(d)&&h.some(Set.prototype.has.bind(new Set(d))))))throw new vn('unexpected "aud" claim value',i,"aud","check_failed");var d,h;let m;switch(typeof n.clockTolerance){case"string":m=Ra(n.clockTolerance);break;case"number":m=n.clockTolerance;break;case"undefined":m=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const f=n.currentDate,v=Ca(f||new Date);if((void 0!==i.iat||l)&&"number"!=typeof i.iat)throw new vn('"iat" claim must be a number',i,"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new vn('"nbf" claim must be a number',i,"nbf","invalid");if(i.nbf>v+m)throw new vn('"nbf" claim timestamp check failed',i,"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new vn('"exp" claim must be a number',i,"exp","invalid");if(i.exp<=v-m)throw new gn('"exp" claim timestamp check failed',i,"exp","check_failed")}if(l){const e=v-i.iat;if(e-m>("number"==typeof l?l:Ra(l)))throw new gn('"iat" claim timestamp check failed (too far in the past)',i,"iat","check_failed");if(e<0-m)throw new vn('"iat" claim timestamp check failed (it should be in the past)',i,"iat","check_failed")}return i}var Ma=new WeakMap;class Wa{constructor(e){if(d(this,Ma,void 0),!Cn(e))throw new TypeError("JWT Claims Set MUST be an object");h(Ma,this,structuredClone(e))}data(){return nn.encode(JSON.stringify(u(Ma,this)))}get iss(){return u(Ma,this).iss}set iss(e){u(Ma,this).iss=e}get sub(){return u(Ma,this).sub}set sub(e){u(Ma,this).sub=e}get aud(){return u(Ma,this).aud}set aud(e){u(Ma,this).aud=e}set jti(e){u(Ma,this).jti=e}set nbf(e){"number"==typeof e?u(Ma,this).nbf=La("setNotBefore",e):e instanceof Date?u(Ma,this).nbf=La("setNotBefore",Ca(e)):u(Ma,this).nbf=Ca(new Date)+Ra(e)}set exp(e){"number"==typeof e?u(Ma,this).exp=La("setExpirationTime",e):e instanceof Date?u(Ma,this).exp=La("setExpirationTime",Ca(e)):u(Ma,this).exp=Ca(new Date)+Ra(e)}set iat(e){void 0===e?u(Ma,this).iat=Ca(new Date):e instanceof Date?u(Ma,this).iat=La("setIssuedAt",Ca(e)):u(Ma,this).iat=La("setIssuedAt","string"==typeof e?Ca(new Date)+Ra(e):e)}}var Da=new WeakMap,qa=new WeakMap,Ja=new WeakMap;class $a{constructor(e){if(d(this,Da,void 0),d(this,qa,void 0),d(this,Ja,void 0),!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");h(Da,this,e)}setProtectedHeader(e){return In(u(qa,this),"setProtectedHeader"),h(qa,this,e),this}setUnprotectedHeader(e){return In(u(Ja,this),"setUnprotectedHeader"),h(Ja,this,e),this}async sign(e,t){if(!u(qa,this)&&!u(Ja,this))throw new wn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Un(u(qa,this),u(Ja,this)))throw new wn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const i=g(g({},u(qa,this)),u(Ja,this));let n=!0;if(Bn(wn,new Map([["b64",!0]]),null==t?void 0:t.crit,u(qa,this),i).has("b64")&&(n=u(qa,this).b64,"boolean"!=typeof n))throw new wn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const a=i.alg;if("string"!=typeof a||!a)throw new wn('JWS "alg" (Algorithm) Header Parameter missing or invalid');let o,s,r,c;Yn(a,e,"sign"),n?(o=pn(u(Da,this)),s=sn(o)):(s=u(Da,this),o=""),u(qa,this)?(r=pn(JSON.stringify(u(qa,this))),c=sn(r)):(r="",c=new Uint8Array);const p=on(c,sn("."),s),l=await $n(e,a),d=await async function(e,t,i){const n=await Nn(e,t,"sign");Ln(e,n);const a=await crypto.subtle.sign(zn(e,n.algorithm),n,i);return new Uint8Array(a)}(a,l,p),h={signature:pn(d),payload:o};return u(Ja,this)&&(h.header=u(Ja,this)),u(qa,this)&&(h.protected=r),h}}var Ha=new WeakMap;class Ka{constructor(e){d(this,Ha,void 0),h(Ha,this,new $a(e))}setProtectedHeader(e){return u(Ha,this).setProtectedHeader(e),this}async sign(e,t){const i=await u(Ha,this).sign(e,t);if(void 0===i.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return"".concat(i.protected,".").concat(i.payload,".").concat(i.signature)}}var Fa=new WeakMap,Va=new WeakMap;class Za{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,Fa,void 0),d(this,Va,void 0),h(Va,this,new Wa(e))}setIssuer(e){return u(Va,this).iss=e,this}setSubject(e){return u(Va,this).sub=e,this}setAudience(e){return u(Va,this).aud=e,this}setJti(e){return u(Va,this).jti=e,this}setNotBefore(e){return u(Va,this).nbf=e,this}setExpirationTime(e){return u(Va,this).exp=e,this}setIssuedAt(e){return u(Va,this).iat=e,this}setProtectedHeader(e){return h(Fa,this,e),this}async sign(e,t){var i;const n=new Ka(u(Va,this).data());if(n.setProtectedHeader(u(Fa,this)),Array.isArray(null===(i=u(Fa,this))||void 0===i?void 0:i.crit)&&u(Fa,this).crit.includes("b64")&&!1===u(Fa,this).b64)throw new xn("JWTs MUST NOT use unencoded payload");return n.sign(e,t)}}function Ba(e){return Cn(e)}var Ga,Xa,Ya=new WeakMap,Qa=new WeakMap;class eo{constructor(e){if(d(this,Ya,void 0),d(this,Qa,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Ba)}(e))throw new _n("JSON Web Key Set malformed");h(Ya,this,structuredClone(e))}jwks(){return u(Ya,this)}async getKey(e,t){const i=g(g({},e),null==t?void 0:t.header),n=i.alg,a=i.kid,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 yn('Unsupported "alg" value for a JSON Web Key Set')}}(n),s=u(Ya,this).keys.filter(e=>{let t=o===e.kty;if(t&&"string"==typeof a&&(t=a===e.kid),!t||"string"!=typeof e.alg&&"AKP"!==o||(t=n===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t)switch(n){case"ES256":t="P-256"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv;break;case"Ed25519":case"EdDSA":t="Ed25519"===e.crv}return t}),r=s[0],c=s.length;if(0===c)throw new kn;if(1!==c){const e=new Sn,t=u(Qa,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new w(e.apply(this,arguments))}}(function*(){for(const e of s)try{yield yield p(to(t,e,n))}catch(e){}}),e}return to(u(Qa,this),r,n)}}async function to(e,t,i){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[i]){const e=await async function(e,t){if(!Cn(e))throw new TypeError("JWK must be an object");let i;switch(null!=t||(t=e.alg),null!=i||(i=e.ext),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return cn(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new yn('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return Wn(g(g({},e),{},{alg:t,ext:i}));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 Wn(g(g({},e),{},{ext:i}));case"EC":case"OKP":return Wn(g(g({},e),{},{alg:t,ext:i}));default:throw new yn('Unsupported "kty" (Key Type) Parameter value')}}(g(g({},t),{},{ext:!0}),i);if(e instanceof Uint8Array||"public"!==e.type)throw new _n("JSON Web Key Set members must be public keys");n[i]=e}return n[i]}function io(e){const t=new eo(e),i=async(e,i)=>t.getKey(e,i);return Object.defineProperties(i,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),i}let no;if("undefined"==typeof navigator||null===(Ga=navigator.userAgent)||void 0===Ga||null===(Xa=Ga.startsWith)||void 0===Xa||!Xa.call(Ga,"Mozilla/5.0 ")){const e="v6.2.3";no="".concat("jose","/").concat(e)}const ao=Symbol(),oo=Symbol();var so=new WeakMap,ro=new WeakMap,co=new WeakMap,po=new WeakMap,lo=new WeakMap,uo=new WeakMap,ho=new WeakMap,mo=new WeakMap,fo=new WeakMap,vo=new WeakMap;class go{constructor(e,t){if(d(this,so,void 0),d(this,ro,void 0),d(this,co,void 0),d(this,po,void 0),d(this,lo,void 0),d(this,uo,void 0),d(this,ho,void 0),d(this,mo,void 0),d(this,fo,void 0),d(this,vo,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var i,n;h(so,this,new URL(e.href)),h(ro,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),h(co,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),h(po,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),h(ho,this,new Headers(null==t?void 0:t.headers)),no&&!u(ho,this).has("User-Agent")&&u(ho,this).set("User-Agent",no),u(ho,this).has("accept")||(u(ho,this).set("accept","application/json"),u(ho,this).append("accept","application/jwk-set+json")),h(mo,this,null==t?void 0:t[ao]),void 0!==(null==t?void 0:t[oo])&&(h(vo,this,null==t?void 0:t[oo]),i=null==t?void 0:t[oo],n=u(po,this),"object"==typeof i&&null!==i&&"uat"in i&&"number"==typeof i.uat&&!(Date.now()-i.uat>=n)&&"jwks"in i&&Cn(i.jwks)&&Array.isArray(i.jwks.keys)&&Array.prototype.every.call(i.jwks.keys,Cn)&&(h(lo,this,u(vo,this).uat),h(fo,this,io(u(vo,this).jwks))))}pendingFetch(){return!!u(uo,this)}coolingDown(){return"number"==typeof u(lo,this)&&Date.now()<u(lo,this)+u(co,this)}fresh(){return"number"==typeof u(lo,this)&&Date.now()<u(lo,this)+u(po,this)}jwks(){var e;return null===(e=u(fo,this))||void 0===e?void 0:e.jwks()}async getKey(e,t){u(fo,this)&&this.fresh()||await this.reload();try{return await u(fo,this).call(this,e,t)}catch(i){if(i instanceof kn&&!1===this.coolingDown())return await this.reload(),u(fo,this).call(this,e,t);throw i}}async reload(){u(uo,this)&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&h(uo,this,void 0),u(uo,this)||h(uo,this,async function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fetch;const a=await n(e,{method:"GET",signal:i,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new Tn;throw e});if(200!==a.status)throw new fn("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch(e){throw new fn("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(u(so,this).href,u(ho,this),AbortSignal.timeout(u(ro,this)),u(mo,this)).then(e=>{h(fo,this,io(e)),u(vo,this)&&(u(vo,this).uat=Date.now(),u(vo,this).jwks=e),h(lo,this,Date.now()),h(uo,this,void 0)}).catch(e=>{throw h(uo,this,void 0),e})),await u(uo,this)}}const bo=["mfaToken"],yo=["mfaToken"];var wo,xo,_o,ko,So,To,Eo,Po,Ao,jo,Io,Oo,Co,Uo,Ro,Lo,zo,No,Mo,Wo,Do,qo,Jo,$o,Ho,Ko,Fo,Vo,Zo,Bo,Go,Xo,Yo,Qo;function es(e){var t,i;if("object"!=typeof e||null===e)return{error:"unknown_error",error_description:String(e)};const n=e,a={error:null!==(t=n.error)&&void 0!==t?t:"",error_description:null!==(i=n.error_description)&&void 0!==i?i:"",message:n.message};if("mfa_required"===n.error&&n.cause){a.mfa_token="string"==typeof n.cause.mfa_token?n.cause.mfa_token:void 0;const e=n.cause.mfa_requirements;"object"==typeof e&&null!==e&&(a.mfa_requirements=e)}return a}var ts=class extends Error{constructor(e,t){super(t),f(this,"code",void 0),this.name="NotSupportedError",this.code=e}},is=class extends Error{constructor(e,t,i){super(t),f(this,"cause",void 0),f(this,"code",void 0),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message,mfa_token:i.mfa_token,mfa_requirements:i.mfa_requirements}}},ns=class extends is{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},as=class extends is{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},os=class extends is{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},ss=class extends is{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},rs=class extends is{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},cs=class extends is{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},ps=class extends is{constructor(e,t){super("token_revocation_error",e,t),this.name="TokenRevocationError"}},ls=class extends Error{constructor(e){super(e),f(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},us=class extends is{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),f(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},ds=class extends is{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},hs=class extends is{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},ms=class extends is{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},fs=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),f(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}},vs=class extends Error{constructor(e){super(e),f(this,"code","organization_validation_error"),this.name="OrganizationValidationError"}};function gs(e){return Object.entries(e).filter(e=>void 0!==y(e,2)[1]).reduce((e,t)=>g(g({},e),{},{[t[0]]:t[1]}),{})}function bs(e){if(!e.trim())throw new vs("organization must not be blank")}function ys(e,t){if(!e)return;const i=t.trim();if(i.startsWith("org_")){const t=e.org_id;if("string"!=typeof t)throw new vs("Organization Id (org_id) claim must be a string present in the ID token");if(t!==i)throw new vs('Organization Id (org_id) claim value mismatch in the ID token; expected "'.concat(i,'", found "').concat(t,'"'))}else{const t=e.org_name;if("string"!=typeof t)throw new vs("Organization Name (org_name) claim must be a string present in the ID token");if(t.toLowerCase()!==i.toLowerCase())throw new vs('Organization Name (org_name) claim value mismatch in the ID token; expected "'.concat(i,'", found "').concat(t,'"'))}}var ws=class extends Error{constructor(e,t,i){super(t),f(this,"cause",void 0),f(this,"code",void 0),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message}}},xs=class extends ws{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},_s=class extends ws{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},ks=class extends ws{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},Ss=class extends ws{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}},Ts=class extends ws{constructor(e,t){super("mfa_verify_error",e,t),this.name="MfaVerifyError"}};function Es(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var Ps=class e{constructor(e,t,i,n,a,o,s){f(this,"accessToken",void 0),f(this,"idToken",void 0),f(this,"refreshToken",void 0),f(this,"expiresAt",void 0),f(this,"scope",void 0),f(this,"claims",void 0),f(this,"authorizationDetails",void 0),f(this,"tokenType",void 0),f(this,"issuedTokenType",void 0),f(this,"recoveryCode",void 0),f(this,"act",void 0),this.accessToken=e,this.idToken=i,this.refreshToken=n,this.expiresAt=t,this.scope=a,this.claims=o,this.authorizationDetails=s}static fromTokenEndpointResponse(t){const i=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,i,t.authorization_details);return n.tokenType=t.token_type,n.issuedTokenType=t.issued_token_type,n}},As={otp:"http://auth0.com/oauth/grant-type/mfa-otp",oob:"http://auth0.com/oauth/grant-type/mfa-oob","recovery-code":"http://auth0.com/oauth/grant-type/mfa-recovery-code"},js=(wo=new WeakMap,xo=new WeakMap,_o=new WeakMap,ko=new WeakMap,So=new WeakMap,class{constructor(e){var t;d(this,wo,void 0),d(this,xo,void 0),d(this,_o,void 0),d(this,ko,void 0),d(this,So,void 0),h(wo,this,"https://".concat(e.domain)),h(xo,this,e.clientId),h(_o,this,e.clientSecret),h(ko,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(So,this,e.getConfiguration)}async listAuthenticators(e){const t="".concat(u(wo,this),"/mfa/authenticators"),i=e.mfaToken,n=await u(ko,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!n.ok){let t;try{t=await n.json()}catch(e){throw new xs("Failed to list authenticators")}throw new xs(t.error_description||"Failed to list authenticators",t)}return(await n.json()).map(Es)}async enrollAuthenticator(e){const t="".concat(u(wo,this),"/mfa/associate"),i=e.mfaToken,n=b(e,bo),a={authenticator_types:n.authenticatorTypes};"oobChannels"in n&&(a.oob_channels=n.oobChannels),"phoneNumber"in n&&n.phoneNumber&&(a.phone_number=n.phoneNumber),"email"in n&&n.email&&(a.email=n.email);const o=await u(ko,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(a)});if(!o.ok){let t;try{t=await o.json()}catch(e){throw new _s("Failed to enroll authenticator")}throw new _s(t.error_description||"Failed to enroll authenticator",t)}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,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await o.json())}async deleteAuthenticator(e){const t=e.authenticatorId,i=e.mfaToken,n="".concat(u(wo,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),a=await u(ko,this).call(this,n,{method:"DELETE",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!a.ok){let t;try{t=await a.json()}catch(e){throw new ks("Failed to delete authenticator")}throw new ks(t.error_description||"Failed to delete authenticator",t)}}async challengeAuthenticator(e){const t="".concat(u(wo,this),"/mfa/challenge"),i=e.mfaToken,n=b(e,yo),a={mfa_token:i,client_id:u(xo,this),challenge_type:n.challengeType};u(_o,this)&&(a.client_secret=u(_o,this)),n.authenticatorId&&(a.authenticator_id=n.authenticatorId);const o=await u(ko,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!o.ok){let t;try{t=await o.json()}catch(e){throw new Ss("Failed to challenge authenticator")}throw new Ss(t.error_description||"Failed to challenge authenticator",t)}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 o.json())}async verify(e){if(!u(So,this))throw new Error("MFA verify requires a configuration provider (getConfiguration was not set)");const t=await u(So,this).call(this),i={mfa_token:e.mfaToken};e.audience&&(i.audience=e.audience),"otp"===e.factorType?i.otp=e.otp:"oob"===e.factorType?(i.oob_code=e.oobCode,e.bindingCode&&(i.binding_code=e.bindingCode)):"recovery-code"===e.factorType&&(i.recovery_code=e.recoveryCode);try{const n=await Oa(t,As[e.factorType],i),a=Ps.fromTokenEndpointResponse(n);return n.recovery_code&&(a.recoveryCode=n.recovery_code),a}catch(e){var n,a,o;if(e instanceof Ts)throw e;const t=e;throw new Ts(t.error_description||t.message||"Failed to verify MFA challenge",{error:null!==(n=t.error)&&void 0!==n?n:"mfa_verify_error",error_description:null!==(a=null!==(o=t.error_description)&&void 0!==o?o:t.message)&&void 0!==a?a:"Failed to verify MFA challenge"})}}}),Is=class extends Error{constructor(e,t,i){super(t),f(this,"cause",void 0),f(this,"code",void 0),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message}}},Os=class extends Is{constructor(e,t){super("passkey_register_error",e,t),this.name="PasskeyRegisterError"}},Cs=class extends Is{constructor(e,t){super("passkey_challenge_error",e,t),this.name="PasskeyChallengeError"}},Us=class extends Is{constructor(e,t){super("passkey_get_token_error",e,t),this.name="PasskeyGetTokenError",this.cause=t&&{error:t.error,error_description:t.error_description,message:t.message,mfa_token:t.mfa_token,mfa_requirements:t.mfa_requirements}}},Rs="urn:okta:params:oauth:grant-type:webauthn",Ls=(To=new WeakMap,Eo=new WeakMap,Po=new WeakMap,Ao=new WeakMap,jo=new WeakSet,class{constructor(e){var t;m(this,jo),d(this,To,void 0),d(this,Eo,void 0),d(this,Po,void 0),d(this,Ao,void 0),h(To,this,"https://".concat(e.domain)),h(Eo,this,e.clientId),h(Po,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(Ao,this,e.grantRequest)}async register(e){const t="".concat(u(To,this),"/passkey/register"),i=g(g(g(g(g(g(g(g({},e.email&&{email:e.email}),e.name&&{name:e.name}),e.phoneNumber&&{phone_number:e.phoneNumber}),e.username&&{username:e.username}),e.givenName&&{given_name:e.givenName}),e.familyName&&{family_name:e.familyName}),e.nickname&&{nickname:e.nickname}),e.picture&&{picture:e.picture}),n={client_id:u(Eo,this),user_profile:i};e.realm&&(n.realm=e.realm),e.organization&&(n.organization=e.organization),e.userMetadata&&(n.user_metadata=e.userMetadata);const a=await u(Po,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const e=await c(jo,this,zs).call(this,a);throw new Os(e.error_description||"Failed to request signup challenge",e)}return{authSession:(o=await a.json()).auth_session,authnParamsPublicKey:g({},o.authn_params_public_key)};var o}async challenge(e){const t="".concat(u(To,this),"/passkey/challenge"),i={client_id:u(Eo,this)};null!=e&&e.realm&&(i.realm=e.realm),null!=e&&e.organization&&(i.organization=e.organization);const n=await u(Po,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!n.ok){const e=await c(jo,this,zs).call(this,n);throw new Cs(e.error_description||"Failed to request login challenge",e)}return{authSession:(a=await n.json()).auth_session,authnParamsPublicKey:g({},a.authn_params_public_key)};var a}async getTokenByPasskey(e){void 0!==e.organization&&bs(e.organization);const t=new URLSearchParams({auth_session:e.authSession,authn_response:JSON.stringify(e.credential)});let i;e.realm&&t.append("realm",e.realm),e.scope&&t.append("scope",e.scope),e.audience&&t.append("audience",e.audience),e.organization&&t.append("organization",e.organization);try{i=await u(Ao,this).call(this,Rs,t)}catch(e){const t=es(e);throw new Us(t.error_description||"Failed to exchange passkey credential for tokens.",t)}return e.organization&&ys(i.claims,e.organization),i}});async function zs(e){try{return await e.json()}catch(t){return{error:"unknown_error",error_description:"HTTP ".concat(e.status," ").concat(e.statusText)}}}var Ns=class extends Error{constructor(e,t,i){super(t),f(this,"cause",void 0),f(this,"code",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message,mfa_token:i.mfa_token,mfa_requirements:i.mfa_requirements}}},Ms=class extends Ns{constructor(e,t){super("passwordless_start_error",e,t),this.name="PasswordlessStartError"}},Ws=class extends Ns{constructor(e,t){super("passwordless_verify_error",e,t),this.name="PasswordlessVerifyError"}},Ds=class extends Ns{constructor(e,t){super("passwordless_db_get_token_error",e,t),this.name="PasswordlessDbGetTokenError"}},qs=class extends Ns{constructor(e,t,i,n){super("passwordless_challenge_error",e,i),f(this,"statusCode",void 0),f(this,"validationErrors",void 0),this.name="PasswordlessChallengeError",this.statusCode=t,this.validationErrors=n}};function Js(e){return/^\+[1-9]\d{1,14}$/.test(e)}async function $s(e,t,i){if(e.useMtls)return{};if(e.clientAssertionSigningKey){var n;const a=null!==(n=e.clientAssertionSigningAlg)&&void 0!==n?n:"RS256",o=e.clientAssertionSigningKey instanceof CryptoKey?e.clientAssertionSigningKey:await Zn(e.clientAssertionSigningKey,a);return{client_assertion:await new Za({}).setProtectedHeader({alg:a}).setIssuer(t).setSubject(t).setAudience("https://".concat(i,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(o),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}if(e.clientSecret)return{client_secret:e.clientSecret};throw new fs}var Hs=(Io=new WeakMap,Oo=new WeakMap,Co=new WeakMap,Uo=new WeakMap,Ro=new WeakMap,Lo=new WeakMap,zo=new WeakSet,class{constructor(e){var t;m(this,zo),d(this,Io,void 0),d(this,Oo,void 0),d(this,Co,void 0),d(this,Uo,void 0),d(this,Ro,void 0),d(this,Lo,void 0),h(Oo,this,e.domain),h(Io,this,"https://".concat(e.domain)),h(Co,this,e.clientId),h(Uo,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(Ro,this,{clientSecret:e.clientSecret,clientAssertionSigningKey:e.clientAssertionSigningKey,clientAssertionSigningAlg:e.clientAssertionSigningAlg,useMtls:e.useMtls}),h(Lo,this,e.grantRequest)}async sendEmail(e){await c(zo,this,Ks).call(this,function(e){var t;const i=null!==(t=e.send)&&void 0!==t?t:"code",n={email:e.email,connection:"email",send:i};return"link"===i&&e.authParams&&(n.authParams=e.authParams),n}(e),"Failed to send passwordless email",e.language)}async sendSms(e){if(!Js(e.phoneNumber))throw new Ms("Phone number must be in E.164 format (e.g. +14155550100).");await c(zo,this,Ks).call(this,function(e){return{phone_number:e.phoneNumber,connection:"sms"}}(e),"Failed to send passwordless SMS",e.language)}async challengeWithEmail(e){const t=function(e){var t;return{email:e.email,connection:e.connection,allow_signup:null!==(t=e.allowSignup)&&void 0!==t&&t}}(e);return c(zo,this,Fs).call(this,t,"Failed to request email OTP challenge")}async challengeWithPhoneNumber(e){if(!Js(e.phoneNumber))throw new qs("Phone number must be in E.164 format (e.g. +14155550100).",0,void 0,void 0);const t=function(e){var t;const i={phone_number:e.phoneNumber,connection:e.connection,allow_signup:null!==(t=e.allowSignup)&&void 0!==t&&t};return e.deliveryMethod&&(i.delivery_method=e.deliveryMethod),i}(e);return c(zo,this,Fs).call(this,t,"Failed to request phone OTP challenge")}async getTokenByPasswordlessDbConnection(e){const t=new URLSearchParams({auth_session:e.authSession,otp:e.otp});if(e.scope&&t.append("scope",e.scope),e.audience&&t.append("audience",e.audience),!u(Lo,this))throw new Ds("Missing grant request delegate.",es(new Error("missing grantRequest")));try{return await u(Lo,this).call(this,"http://auth0.com/oauth/grant-type/passwordless/otp",t)}catch(e){throw new Ds("There was an error while trying to request a token.",es(e))}}});async function Ks(e,t,i){var n;const a=await $s(u(Ro,this),u(Co,this),u(Oo,this)),o=g(g({client_id:u(Co,this)},e),a);let s,r;try{s=await u(Uo,this).call(this,"".concat(u(Io,this),"/passwordless/start"),{method:"POST",headers:g({"Content-Type":"application/json"},i?{"x-request-language":i}:{}),body:JSON.stringify(o)})}catch(e){throw new Ms("".concat(t,": a network error occurred."))}if(!s.ok){if(204!==s.status)try{r=await s.json()}catch(e){r=void 0}throw new Ms((null===(n=r)||void 0===n?void 0:n.error_description)||t,r)}}async function Fs(e,t){var i,n;const a=await $s(u(Ro,this),u(Co,this),u(Oo,this)),o=g(g({client_id:u(Co,this)},e),a);let s,r;try{s=await u(Uo,this).call(this,"".concat(u(Io,this),"/otp/challenge"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})}catch(e){throw new qs("challenge error: a network error occurred.",0,void 0,void 0)}if(s.ok){let i;try{i=await s.json()}catch(e){throw new qs("".concat(t,": could not parse the response body."),s.status,void 0,void 0)}return{authSession:i.auth_session}}try{r=await s.json()}catch(e){r=void 0}throw new qs((null===(i=r)||void 0===i?void 0:i.error_description)||t,s.status,r,null===(n=r)||void 0===n?void 0:n.validation_errors)}var Vs=class extends Error{constructor(e,t,i){super(t),f(this,"cause",void 0),f(this,"code",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message}}},Zs=class extends Vs{constructor(e,t){super("signup_error",e,t),this.name="SignUpError"}},Bs=class extends Vs{constructor(e,t){super("change_password_error",e,t),this.name="ChangePasswordError"}};function Gs(e,t,i){for(const n of t)if(null===e[n]||void 0===e[n]||""===e[n])throw new i('Required parameter "'.concat(String(n),'" was null, undefined, or empty.'))}var Xs=(No=new WeakMap,Mo=new WeakMap,Wo=new WeakMap,Do=new WeakSet,class{constructor(e){var t;m(this,Do),d(this,No,void 0),d(this,Mo,void 0),d(this,Wo,void 0),h(No,this,"https://".concat(e.domain)),h(Mo,this,e.clientId),h(Wo,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async signUp(e){var t;Gs(e,["email","password","connection"],Zs);const i=g({client_id:null!==(t=e.clientId)&&void 0!==t?t:u(Mo,this)},function(e){const t={email:e.email,password:e.password,connection:e.connection};return void 0!==e.username&&(t.username=e.username),void 0!==e.givenName&&(t.given_name=e.givenName),void 0!==e.familyName&&(t.family_name=e.familyName),void 0!==e.name&&(t.name=e.name),void 0!==e.nickname&&(t.nickname=e.nickname),void 0!==e.picture&&(t.picture=e.picture),void 0!==e.userMetadata&&(t.user_metadata=e.userMetadata),t}(e)),n=await c(Do,this,Ys).call(this,"/dbconnections/signup",i,Zs,"Failed to sign up");return function(e){var t,i;return{id:null!==(t=null!==(i=e._id)&&void 0!==i?i:e.user_id)&&void 0!==t?t:e.id,email:"string"==typeof e.email?e.email:"",emailVerified:Boolean(e.email_verified),username:e.username,givenName:e.given_name,familyName:e.family_name,name:e.name,nickname:e.nickname,picture:e.picture,userMetadata:e.user_metadata}}(await n.json())}async changePassword(e){var t;if(Gs(e,["connection"],Bs),!e.email&&!e.username)throw new Bs('Either "email" or "username" is required.');const i=g({client_id:null!==(t=e.clientId)&&void 0!==t?t:u(Mo,this)},function(e){const t={connection:e.connection};return void 0!==e.email&&(t.email=e.email),void 0!==e.username&&(t.username=e.username),void 0!==e.organization&&(t.organization=e.organization),t}(e));return(await c(Do,this,Ys).call(this,"/dbconnections/change_password",i,Bs,"Failed to request a password change")).text()}});async function Ys(e,t,i,n){let a;try{a=await u(Wo,this).call(this,"".concat(u(No,this)).concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){throw new i("".concat(n,": a network error occurred."))}if(a.ok)return a;const o=await async function(e){let t;try{t=await e.json()}catch(e){return}return"string"==typeof t.error?t:"string"==typeof t.code?{error:t.code,error_description:"string"==typeof t.description?t.description:""}:void 0}(a);throw new i((null==o?void 0:o.error_description)||n,o)}var Qs=(qo=new WeakMap,Jo=new WeakMap,$o=new WeakMap,class{constructor(e,t){d(this,qo,new Map),d(this,Jo,void 0),d(this,$o,void 0),h($o,this,Math.max(1,Math.floor(e))),h(Jo,this,Math.max(0,Math.floor(t)))}get(e){const t=u(qo,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return u(qo,this).delete(e),u(qo,this).set(e,t),t.value;u(qo,this).delete(e)}}set(e,t){for(u(qo,this).has(e)&&u(qo,this).delete(e),u(qo,this).set(e,{value:t,expiresAt:Date.now()+u(Jo,this)});u(qo,this).size>u($o,this);){const e=u(qo,this).keys().next().value;if(void 0===e)break;u(qo,this).delete(e)}}}),er=new Map;function tr(e){return{ttlMs:1e3*("number"==typeof(null==e?void 0:e.ttl)?e.ttl:600),maxEntries:"number"==typeof(null==e?void 0:e.maxEntries)&&e.maxEntries>0?e.maxEntries:100}}var ir=class{static createDiscoveryCache(e){const t=(i=e.maxEntries,n=e.ttlMs,"".concat(i,":").concat(n));var i,n;let a=(o=t,er.get(o));var o;return a||(a=new Qs(e.maxEntries,e.ttlMs),er.set(t,a)),a}static createJwksCache(){return{}}},nr="openid profile email offline_access",ar=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 or(e){if(null==e)throw new cs("subject_token is required");if("string"!=typeof e)throw new cs("subject_token must be a string");if(0===e.trim().length)throw new cs("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new cs("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new cs("subject_token must not include the 'Bearer ' prefix")}function sr(e,t){if(t)for(const n of Object.entries(t)){var i=y(n,2);const t=i[0],a=i[1];if(!ar.has(t))if(Array.isArray(a)){if(a.length>20)throw new cs("Parameter '".concat(t,"' exceeds maximum array size of ").concat(20));a.forEach(i=>{e.append(t,i)})}else e.append(t,a)}}var rr,cr,pr="urn:ietf:params:oauth:token-type:access_token",lr=(Ho=new WeakMap,Ko=new WeakMap,Fo=new WeakMap,Vo=new WeakMap,Zo=new WeakMap,Bo=new WeakMap,Go=new WeakMap,Xo=new WeakMap,Yo=new WeakMap,Qo=new WeakSet,class{constructor(e){var t,i,n,a;if(m(this,Qo),d(this,Ho,void 0),d(this,Ko,void 0),d(this,Fo,void 0),d(this,Vo,void 0),d(this,Zo,void 0),d(this,Bo,void 0),d(this,Go,void 0),d(this,Xo,void 0),d(this,Yo,void 0),f(this,"mfa",void 0),f(this,"passkey",void 0),f(this,"passwordless",void 0),f(this,"database",void 0),h(Vo,this,e),e.useMtls&&!e.customFetch)throw new ts("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");h(Zo,this,function(e,t){if(!1===t.enabled)return e;const i={name:t.name,version:t.version},n=btoa(JSON.stringify(i));return async(t,i)=>{const a=t instanceof Request?new Headers(t.headers):new Headers;return null!=i&&i.headers&&new Headers(i.headers).forEach((e,t)=>{a.set(t,e)}),a.set("Auth0-Client",n),e(t,g(g({},i),{},{headers:a}))}}(null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)},!1===(null==(i=e.telemetry)?void 0:i.enabled)?i:{enabled:!0,name:null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"@auth0/auth0-auth-js",version:null!==(a=null==i?void 0:i.version)&&void 0!==a?a:"1.12.0"}));const o=tr(e.discoveryCache);h(Go,this,ir.createDiscoveryCache(o)),h(Xo,this,new Map),h(Yo,this,ir.createJwksCache()),this.mfa=new js({domain:u(Vo,this).domain,clientId:u(Vo,this).clientId,clientSecret:u(Vo,this).clientSecret,customFetch:u(Zo,this),getConfiguration:async()=>(await c(Qo,this,hr).call(this)).configuration}),this.passkey=new Ls({domain:u(Vo,this).domain,clientId:u(Vo,this).clientId,customFetch:u(Zo,this),grantRequest:async(e,t)=>{const i=(await c(Qo,this,hr).call(this)).serverMetadata,n=await c(Qo,this,dr).call(this,i);n[ra]=function(e,t){return(i,n)=>{const a=null==n?void 0:n.body;if(t!==Rs||!(a instanceof URLSearchParams))return e(i,n);const o={};for(const e of a){var s=y(e,2);const t=s[0],i=s[1];o[t]="authn_response"===t?JSON.parse(i):i}const r=new Headers(null==n?void 0:n.headers);return r.set("Content-Type","application/json"),e(i,g(g({},n),{},{headers:r,body:JSON.stringify(o)}))}}(u(Zo,this),e);const a=await Oa(n,e,t);return Ps.fromTokenEndpointResponse(a)}}),this.passwordless=new Hs({domain:u(Vo,this).domain,clientId:u(Vo,this).clientId,customFetch:u(Zo,this),clientSecret:u(Vo,this).clientSecret,clientAssertionSigningKey:u(Vo,this).clientAssertionSigningKey,clientAssertionSigningAlg:u(Vo,this).clientAssertionSigningAlg,useMtls:u(Vo,this).useMtls,grantRequest:async(e,t)=>{const i=(await c(Qo,this,hr).call(this)).configuration,n=await Oa(i,e,t);return Ps.fromTokenEndpointResponse(n)}}),this.database=new Xs({domain:u(Vo,this).domain,clientId:u(Vo,this).clientId,customFetch:u(Zo,this)})}async getServerMetadata(){return(await c(Qo,this,hr).call(this)).serverMetadata}async buildAuthorizationUrl(e){const t=(await c(Qo,this,hr).call(this)).serverMetadata;if(null!=e&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new ts("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await c(Qo,this,br).call(this,e)}catch(e){throw new ds(e)}}async buildLinkUserUrl(e){try{const t=await c(Qo,this,br).call(this,{authorizationParams:g(g({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new hs(e)}}async buildUnlinkUserUrl(e){try{const t=await c(Qo,this,br).call(this,{authorizationParams:g(g({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new ms(e)}}async backchannelAuthentication(e){const t=await c(Qo,this,hr).call(this),i=t.configuration,n=t.serverMetadata,a=gs(g(g({},u(Vo,this).authorizationParams),null==e?void 0:e.authorizationParams)),o=new URLSearchParams(g(g({scope:nr},a),{},{client_id:u(Vo,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&o.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&o.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const e=await ya(i,o),t=await wa(i,e);return Ps.fromTokenEndpointResponse(t)}catch(e){throw new us(e)}}async initiateBackchannelAuthentication(e){const t=await c(Qo,this,hr).call(this),i=t.configuration,n=t.serverMetadata,a=gs(g(g({},u(Vo,this).authorizationParams),null==e?void 0:e.authorizationParams)),o=new URLSearchParams(g(g({scope:nr},a),{},{client_id:u(Vo,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&o.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&o.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const e=await ya(i,o);return{authReqId:e.auth_req_id,expiresIn:e.expires_in,interval:e.interval}}catch(e){throw new us(e)}}async backchannelAuthenticationGrant(e){let t=e.authReqId;const i=(await c(Qo,this,hr).call(this)).configuration,n=new URLSearchParams({auth_req_id:t});try{const e=await Oa(i,"urn:openid:params:grant-type:ciba",n);return Ps.fromTokenEndpointResponse(e)}catch(e){throw new us(e)}}async getTokenForConnection(e){var t;if(e.refreshToken&&e.accessToken)throw new rs("Either a refresh or access token should be specified, but not both.");const i=null!==(t=e.accessToken)&&void 0!==t?t:e.refreshToken;if(!i)throw new rs("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:e.connection,subjectToken:i,subjectTokenType:e.accessToken?pr:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint})}catch(e){if(e instanceof cs)throw new rs(e.message,e.cause);throw e}}async exchangeToken(e){return"connection"in e?c(Qo,this,mr).call(this,e):c(Qo,this,fr).call(this,e)}async getTokenByCode(e,t){const i=(await c(Qo,this,hr).call(this)).configuration;let n;void 0!==t.organization&&bs(t.organization);try{const a=await _a(i,e,{pkceCodeVerifier:t.codeVerifier});n=Ps.fromTokenEndpointResponse(a)}catch(e){throw new ns("There was an error while trying to request a token.",es(e))}return t.organization&&ys(n.claims,t.organization),n}async getTokenByMagicLinkCode(e,t){const i=(await c(Qo,this,hr).call(this)).configuration;try{const n=await _a(i,e,{expectedState:null==t?void 0:t.expectedState});return Ps.fromTokenEndpointResponse(n)}catch(e){const t=e instanceof Error&&e.message?e.message:"There was an error while trying to request a token.";throw new ns(t,e)}}async getTokenByRefreshToken(e){const t=(await c(Qo,this,hr).call(this)).configuration,i=new URLSearchParams;e.audience&&i.append("audience",e.audience),e.scope&&i.append("scope",e.scope);try{const n=await ka(t,e.refreshToken,i);return Ps.fromTokenEndpointResponse(n)}catch(e){throw new os("The access token has expired and there was an error while trying to refresh it.",es(e))}}async revokeToken(e){const t=(await c(Qo,this,hr).call(this)).configuration,i={};e.tokenTypeHint&&(i.token_type_hint=e.tokenTypeHint);try{await async function(e,t,i){Pa(e);const n=na(e),a=n.as,o=n.c,s=n.auth,r=n.fetch,c=n.tlsOnly,p=n.timeout;return async function(e,t,i,n,a){Gt(e),Xt(t),$t(n,'"token"');const o=ii(e,"revocation_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==a?void 0:a[kt])),s=new URLSearchParams(null==a?void 0:a.additionalParameters);s.set("token",n);const r=Wt(null==a?void 0:a.headers);return r.delete("accept"),vi(e,t,i,o,s,r,a)}(a,o,s,t,{[Et]:r,[kt]:!c,additionalParameters:new URLSearchParams(i),headers:new Headers(ta),signal:Aa(p)}).then(Ki).catch(ha)}(t,e.token,i)}catch(e){throw new ps("An error occurred while trying to revoke the token.",es(e))}}async getTokenByPassword(e){const t=(await c(Qo,this,hr).call(this)).configuration,i=new URLSearchParams({username:e.username,password:e.password});e.audience&&i.append("audience",e.audience),e.scope&&i.append("scope",e.scope),e.realm&&i.append("realm",e.realm);let n=t;if(e.auth0ForwardedFor){const i=await c(Qo,this,gr).call(this);n=new fa(t.serverMetadata(),u(Vo,this).clientId,u(Vo,this).clientSecret,i),n[ra]=(t,i)=>u(Zo,this).call(this,t,g(g({},i),{},{headers:g(g({},i.headers),{},{"auth0-forwarded-for":e.auth0ForwardedFor})}))}try{const e=await Oa(n,"password",i);return Ps.fromTokenEndpointResponse(e)}catch(e){throw new ss("There was an error while trying to request a token.",es(e))}}async getTokenByPasswordlessEmail(e){const t=new URLSearchParams({username:e.email,otp:e.code,realm:"email"});return e.audience&&t.append("audience",e.audience),e.scope&&t.append("scope",e.scope),c(Qo,this,vr).call(this,t)}async getTokenByPasswordlessSms(e){if(!Js(e.phoneNumber))throw new Ws("Phone number must be in E.164 format (e.g. +14155550100).");const t=new URLSearchParams({username:e.phoneNumber,otp:e.code,realm:"sms"});return e.audience&&t.append("audience",e.audience),e.scope&&t.append("scope",e.scope),c(Qo,this,vr).call(this,t)}async getTokenByClientCredentials(e){const t=(await c(Qo,this,hr).call(this)).configuration;try{const i=new URLSearchParams({audience:e.audience});e.organization&&i.append("organization",e.organization);const n=await Sa(t,i);return Ps.fromTokenEndpointResponse(n)}catch(e){throw new as("There was an error while trying to request a token.",es(e))}}async buildLogoutUrl(e){const t=await c(Qo,this,hr).call(this),i=t.configuration;if(!t.serverMetadata.end_session_endpoint){const t=new URL("https://".concat(u(Vo,this).domain,"/v2/logout"));return t.searchParams.set("returnTo",e.returnTo),t.searchParams.set("client_id",u(Vo,this).clientId),t}return function(e,t){Pa(e);const i=na(e),n=i.as,a=i.c,o=ii(n,"end_session_endpoint",!1,i.tlsOnly);(t=new URLSearchParams(t)).has("client_id")||t.set("client_id",a.client_id);for(const e of t.entries()){var s=y(e,2);const t=s[0],i=s[1];o.searchParams.append(t,i)}return o}(i,{post_logout_redirect_uri:e.returnTo})}async verifyLogoutToken(e){const t=(await c(Qo,this,hr).call(this)).serverMetadata,i=tr(u(Vo,this).discoveryCache),n=t.jwks_uri;u(Bo,this)||h(Bo,this,function(e,t){const i=new go(e,t),n=async(e,t)=>i.getKey(e,t);return Object.defineProperties(n,{coolingDown:{get:()=>i.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>i.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>i.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>i.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>i.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}(new URL(n),{cacheMaxAge:i.ttlMs,[ao]:u(Zo,this),[oo]:u(Yo,this)}));const a=(await async function(e,t,i){var n;const a=await async function(e,t,i){if(e instanceof Uint8Array&&(e=an.decode(e)),"string"!=typeof e)throw new wn("Compact JWS must be a string or Uint8Array");const n=e.split("."),a=n[0],o=n[1],s=n[2];if(3!==n.length)throw new wn("Invalid Compact JWS");const r=await async function(e,t,i){if(!Cn(e))throw new wn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new wn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new wn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new wn("JWS Payload missing");if("string"!=typeof e.signature)throw new wn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Cn(e.header))throw new wn("JWS Unprotected Header incorrect type");let n={};if(e.protected)try{const t=cn(e.protected);n=JSON.parse(an.decode(t))}catch(e){throw new wn("JWS Protected Header is invalid")}if(!Un(n,e.header))throw new wn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a=g(g({},n),e.header);let o=!0;if(Bn(wn,new Map([["b64",!0]]),null==i?void 0:i.crit,n,a).has("b64")&&(o=n.b64,"boolean"!=typeof o))throw new wn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const s=a.alg;if("string"!=typeof s||!s)throw new wn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const r=i&&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,i.algorithms);if(r&&!r.has(s))throw new bn('"alg" (Algorithm) Header Parameter value not allowed');if(o){if("string"!=typeof e.payload)throw new wn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new wn("JWS Payload must be a string or an Uint8Array instance");let c=!1;"function"==typeof t&&(t=await t(n,e),c=!0),Yn(s,t,"verify");const p=on(void 0!==e.protected?sn(e.protected):new Uint8Array,sn("."),"string"==typeof e.payload?o?sn(e.payload):nn.encode(e.payload):e.payload),l=On(e.signature,"signature",wn),u=await $n(t,s),d=await async function(e,t,i,n){const a=await Nn(e,t,"verify");Ln(e,a);const o=zn(e,a.algorithm);try{return await crypto.subtle.verify(o,a,i,n)}catch(e){return!1}}(s,u,l,p);if(!d)throw new En;let h;h=o?On(e.payload,"payload",wn):"string"==typeof e.payload?nn.encode(e.payload):e.payload;const m={payload:h};return void 0!==e.protected&&(m.protectedHeader=n),void 0!==e.header&&(m.unprotectedHeader=e.header),c?g(g({},m),{},{key:u}):m}({payload:o,protected:a,signature:s},t,i),c={payload:r.payload,protectedHeader:r.protectedHeader};return"function"==typeof t?g(g({},c),{},{key:r.key}):c}(e,t,i);if(null!==(n=a.protectedHeader.crit)&&void 0!==n&&n.includes("b64")&&!1===a.protectedHeader.b64)throw new xn("JWTs MUST NOT use unencoded payload");const o={payload:Na(a.protectedHeader,a.payload,i),protectedHeader:a.protectedHeader};return"function"==typeof t?g(g({},o),{},{key:a.key}):o}(e.logoutToken,u(Bo,this),{issuer:t.issuer,audience:u(Vo,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in a)&&!("sub"in a))throw new ls('either "sid" or "sub" (or both) claims must be present');if("sid"in a&&"string"!=typeof a.sid)throw new ls('"sid" claim must be a string');if("sub"in a&&"string"!=typeof a.sub)throw new ls('"sub" claim must be a string');if("nonce"in a)throw new ls('"nonce" claim is prohibited');if(!("events"in a))throw new ls('"events" claim is missing');if("object"!=typeof a.events||null===a.events)throw new ls('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in a.events))throw new ls('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if("object"!=typeof a.events["http://schemas.openid.net/event/backchannel-logout"])throw new ls('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:a.sid,sub:a.sub}}});function ur(){const e=u(Vo,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(u(Vo,this).useMtls?"1":"0")}async function dr(e){const t=await c(Qo,this,gr).call(this),i=new fa(e,u(Vo,this).clientId,u(Vo,this).clientSecret,t);return i[ra]=u(Zo,this),i}async function hr(){if(u(Ho,this)&&u(Ko,this))return{configuration:u(Ho,this),serverMetadata:u(Ko,this)};const e=c(Qo,this,ur).call(this),t=u(Go,this).get(e);if(t)return h(Ko,this,t.serverMetadata),h(Ho,this,await c(Qo,this,dr).call(this,t.serverMetadata)),{configuration:u(Ho,this),serverMetadata:u(Ko,this)};const i=u(Xo,this).get(e);if(i){const e=await i;return h(Ko,this,e.serverMetadata),h(Ho,this,await c(Qo,this,dr).call(this,e.serverMetadata)),{configuration:u(Ho,this),serverMetadata:u(Ko,this)}}const n=(async()=>{const t=await c(Qo,this,gr).call(this),i=await async function(e,t,i,n,a){const o=await async function(e,t){var i,n;if(!(e instanceof URL))throw la('"server" must be an instance of URL',pa);const a=!e.href.includes("/.well-known/"),o=null!==(i=null==t?void 0:t.timeout)&&void 0!==i?i:30,s=AbortSignal.timeout(1e3*o),r=await(a?async function(e,t){return async function(e,t,i,n){if(!(e instanceof URL))throw _t('"'.concat("issuerIdentifier",'" must be an instance of URL'),xt);ei(e,!0!==(null==n?void 0:n[kt]));const a=i(new URL(e.href)),o=Wt(null==n?void 0:n.headers);return o.set("accept","application/json"),((null==n?void 0:n[Et])||fetch)(a.href,{body:void 0,headers:Object.fromEntries(o.entries()),method:"GET",redirect:"manual",signal:Dt(a,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=qt("".concat(e.pathname,"/").concat(".well-known/openid-configuration"))}(e);break;case"oauth2":!function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=qt("".concat(t,"/").concat(i?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw _t('"options.algorithm" must be "oidc" (default), or "oauth2"',wt)}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[Et]:null==t?void 0:t[ra],[kt]:null==t||null===(n=t.execute)||void 0===n?void 0:n.includes(xa),signal:s,headers:new Headers(ta)}):((null==t?void 0:t[ra])||fetch)((ei(e,null==t||null===(c=t.execute)||void 0===c||!c.includes(xa)),e.href),{headers:Object.fromEntries(new Headers(g({accept:"application/json"},ta)).entries()),body:void 0,method:"GET",redirect:"manual",signal:s})).then(e=>async function(e,t){const i=e;if(!(i instanceof URL)&&i!==en)throw _t('"expectedIssuerIdentifier" must be an instance of URL',xt);if(!yt(t,Response))throw _t('"response" must be an instance of Response',xt);if(200!==t.status)throw Nt('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Ni,t);Fi(t);const n=await Qi(t);if($t(n.issuer,'"response" body "issuer" property',Li,{body:n}),i!==en&&new URL(n.issuer).href!==i.href)throw Nt('"response" body "issuer" property does not match the expected value',Ji,{expected:i.href,body:n,attribute:"issuer"});return n}(en,e)).catch(ha);var c;return a&&new URL(r.issuer).href!==e.href&&(function(e,t,i){return!("https://login.microsoftonline.com"!==e.origin||null!=i&&i.algorithm&&"oidc"!==i.algorithm||(t[ma]=!0,0))}(e,r,t)||function(e,t){return!(!e.hostname.endsWith(".b2clogin.com")||null!=t&&t.algorithm&&"oidc"!==t.algorithm)}(e,t)||(()=>{throw new ua("discovered metadata issuer does not match the expected issuer",{code:Ji,cause:{expected:e.href,body:r,attribute:"issuer"}})})()),r}(e,a),s=new fa(o,t,i,n);let r=na(s);if(null!=a&&a[ra]&&(r.fetch=a[ra]),null!=a&&a.timeout&&(r.timeout=a.timeout),null!=a&&a.execute)for(const e of a.execute)e(s);return s}(new URL("https://".concat(u(Vo,this).domain)),u(Vo,this).clientId,{use_mtls_endpoint_aliases:u(Vo,this).useMtls},t,{[ra]:u(Zo,this)}),n=i.serverMetadata();return u(Go,this).set(e,{serverMetadata:n}),{configuration:i,serverMetadata:n}})(),a=n.then(e=>({serverMetadata:e.serverMetadata}));a.catch(()=>{}),u(Xo,this).set(e,a);try{const e=await n,t=e.configuration,i=e.serverMetadata;h(Ho,this,t),h(Ko,this,i),u(Ho,this)[ra]=u(Zo,this)}finally{u(Xo,this).delete(e)}return{configuration:u(Ho,this),serverMetadata:u(Ko,this)}}async function mr(e){var t,i;const n=(await c(Qo,this,hr).call(this)).configuration;if("audience"in e||"resource"in e)throw new cs("audience and resource parameters are not supported for Token Vault exchanges");or(e.subjectToken);const a=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==(t=e.subjectTokenType)&&void 0!==t?t:pr,requested_token_type:null!==(i=e.requestedTokenType)&&void 0!==i?i:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&a.append("login_hint",e.loginHint),e.scope&&a.append("scope",e.scope),sr(a,e.extra);try{const e=await Oa(n,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",a);return Ps.fromTokenEndpointResponse(e)}catch(t){throw new cs("Failed to exchange token for connection '".concat(e.connection,"'."),es(t))}}async function fr(e){const t=(await c(Qo,this,hr).call(this)).configuration;if(or(e.subjectToken),void 0!==e.organization&&bs(e.organization),void 0!==e.actorToken&&void 0===e.actorTokenType)throw new cs("actorTokenType is required when actorToken is provided");const i=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});let n,a;e.audience&&i.append("audience",e.audience),e.scope&&i.append("scope",e.scope),e.requestedTokenType&&i.append("requested_token_type",e.requestedTokenType),e.organization&&i.append("organization",e.organization),e.actorToken&&i.append("actor_token",e.actorToken),e.actorTokenType&&i.append("actor_token_type",e.actorTokenType),sr(i,e.extra);try{a=await Oa(t,"urn:ietf:params:oauth:grant-type:token-exchange",i),n=Ps.fromTokenEndpointResponse(a)}catch(t){throw new cs("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),es(t))}var o;if(e.organization&&ys(n.claims,e.organization),e.actorToken)if(null!==(o=n.claims)&&void 0!==o&&o.act)n.act=n.claims.act;else try{n.act=function(e){if("string"!=typeof e)throw new xn("JWTs must use Compact JWS serialization, JWT must be a string");const t=e.split("."),i=t[1],n=t.length;if(5===n)throw new xn("Only JWTs using Compact JWS serialization can be decoded");if(3!==n)throw new xn("Invalid JWT");if(!i)throw new xn("JWTs must contain a payload");let a,o;try{a=cn(i)}catch(e){throw new xn("Failed to base64url decode the payload")}try{o=JSON.parse(an.decode(a))}catch(e){throw new xn("Failed to parse the decoded payload as JSON")}if(!Cn(o))throw new xn("Invalid JWT Claims Set");return o}(a.access_token).act}catch(e){}return n}async function vr(e){const t=(await c(Qo,this,hr).call(this)).configuration;try{const i=await Oa(t,"http://auth0.com/oauth/grant-type/passwordless/otp",e);return Ps.fromTokenEndpointResponse(i)}catch(e){throw new Ws("There was an error while trying to request a token.",es(e))}}async function gr(){return u(Fo,this)||h(Fo,this,(async()=>{if(!u(Vo,this).clientSecret&&!u(Vo,this).clientAssertionSigningKey&&!u(Vo,this).useMtls)throw new fs;if(u(Vo,this).useMtls)return(e,t,i,n)=>{i.set("client_id",t.client_id)};let e=u(Vo,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await Zn(e,u(Vo,this).clientAssertionSigningAlg||"RS256")),e?function(e){return function(e,t){const i=(o=e)instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&$t(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{},n=i.key,a=i.kid;var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw _t("".concat(t," must be a CryptoKey"),xt)}(e,t),"private"!==e.type)throw _t("".concat(t," must be a private CryptoKey"),wt)}(n,'"clientPrivateKey.key"'),async(e,i,o,s)=>{var r;const c={alg:Ft(n),kid:a},p=function(e,t){const i=Bt()+Vt(t);return{jti:Kt(),aud:e.issuer,exp:i+60,iat:i,nbf:i,iss:t.client_id,sub:t.client_id}}(e,i);null==t||null===(r=t[Pt])||void 0===r||r.call(t,c,p),o.set("client_id",i.client_id),o.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),o.set("client_assertion",await async function(e,t,i){if(!i.usages.includes("sign"))throw _t('CryptoKey instances used for signing assertions must include "sign" in their "usages"',wt);const n="".concat(Rt(Ot(JSON.stringify(e))),".").concat(Rt(Ot(JSON.stringify(t)))),a=Rt(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:Zi(e)};case"RSA-PSS":switch(Vi(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 Lt("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return Vi(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new Lt("unsupported CryptoKey algorithm name",{cause:e})}(i),i,Ot(n)));return"".concat(n,".").concat(a)}(c,p,n))}}(e,void 0)}(e):sa(u(Vo,this).clientSecret)})().catch(e=>{throw h(Fo,this,void 0),e})),u(Fo,this)}async function br(e){const t=(await c(Qo,this,hr).call(this)).configuration,i=Kt(),n=await function(e){return async function(e){return $t(e,"codeVerifier"),Rt(await crypto.subtle.digest("SHA-256",Ot(e)))}(e)}(i),a=gs(g(g({},u(Vo,this).authorizationParams),null==e?void 0:e.authorizationParams)),o=new URLSearchParams(g(g({scope:nr},a),{},{client_id:u(Vo,this).clientId,code_challenge:n,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Ea(t,o):await Ta(t,o),codeVerifier:i}}class yr extends A{constructor(e,t){super(e,t),Object.setPrototypeOf(this,yr.prototype)}static fromPayload(e){let t=e.error,i=e.error_description;return new yr(t,i)}}class wr extends yr{constructor(e,t){super(e,t),Object.setPrototypeOf(this,wr.prototype)}}class xr extends yr{constructor(e,t){super(e,t),Object.setPrototypeOf(this,xr.prototype)}}class _r extends yr{constructor(e,t){super(e,t),Object.setPrototypeOf(this,_r.prototype)}}class kr extends yr{constructor(e,t){super(e,t),Object.setPrototypeOf(this,kr.prototype)}}class Sr extends yr{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Sr.prototype)}}class Tr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=e}set(e,t){this.cleanup(),this.contexts.set(e,Object.assign(Object.assign({},t),{createdAt:Date.now()}))}get(e){const t=this.contexts.get(e);if(t){if(!(Date.now()-t.createdAt>this.ttlMs))return t;this.contexts.delete(e)}}remove(e){this.contexts.delete(e)}cleanup(){const e=Date.now();for(const i of this.contexts){var t=y(i,2);const n=t[0];e-t[1].createdAt>this.ttlMs&&this.contexts.delete(n)}}get size(){return this.contexts.size}}class Er{constructor(e,t){this.authJsMfaClient=e,this.auth0Client=t,this.contextManager=new Tr}setMFAAuthDetails(e,t,i,n){this.contextManager.set(e,{scope:t,audience:i,mfaRequirements:n})}async getAuthenticators(e){var t,i,n;const a=this.contextManager.get(e);if(!a)throw new wr("invalid_request","MFA context not found for this MFA token");const o=null===(i=null===(t=a.mfaRequirements)||void 0===t?void 0:t.challenge)||void 0===i?void 0:i.map(e=>e.type);try{const t=await this.authJsMfaClient.listAuthenticators({mfaToken:e});return o&&0!==o.length?t.filter(e=>!!e.type&&o.includes(e.type)):t}catch(e){if(e instanceof xs)throw new wr(null===(n=e.cause)||void 0===n?void 0:n.error,e.message);throw e}}async enroll(e){var t;const i=function(e){const t=ft[e.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:e.mfaToken,authenticatorTypes:t.authenticatorTypes},t.oobChannels&&{oobChannels:t.oobChannels}),"phoneNumber"in e&&{phoneNumber:e.phoneNumber}),"email"in e&&{email:e.email})}(e);try{return await this.authJsMfaClient.enrollAuthenticator(i)}catch(e){if(e instanceof _s)throw new xr(null===(t=e.cause)||void 0===t?void 0:t.error,e.message);throw e}}async challenge(e){var t;try{const t={challengeType:e.challengeType,mfaToken:e.mfaToken};return e.authenticatorId&&(t.authenticatorId=e.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(t)}catch(e){if(e instanceof Ss)throw new _r(null===(t=e.cause)||void 0===t?void 0:t.error,e.message);throw e}}async getEnrollmentFactors(e){const t=this.contextManager.get(e);if(!t||!t.mfaRequirements)throw new Sr("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return t.mfaRequirements.enroll&&0!==t.mfaRequirements.enroll.length?t.mfaRequirements.enroll:[]}async verify(e){const t=this.contextManager.get(e.mfaToken);if(!t)throw new kr("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const i=function(e){return"otp"in e&&e.otp?"http://auth0.com/oauth/grant-type/mfa-otp":"oobCode"in e&&e.oobCode?"http://auth0.com/oauth/grant-type/mfa-oob":"recoveryCode"in e&&e.recoveryCode?"http://auth0.com/oauth/grant-type/mfa-recovery-code":void 0}(e);if(!i)throw new kr("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const n=t.scope,a=t.audience;try{const t=await this.auth0Client._requestTokenForMfa({grant_type:i,mfaToken:e.mfaToken,scope:n,audience:a,otp:e.otp,oob_code:e.oobCode,binding_code:e.bindingCode,recovery_code:e.recoveryCode});return this.contextManager.remove(e.mfaToken),t}catch(e){if(e instanceof kr)throw new kr(e.error,e.error_description);throw e}}}class Pr extends Error{constructor(e,t,i){super(t),this.name="PasskeyError",this.code=e,this.cause=i,Object.setPrototypeOf(this,Pr.prototype)}}class Ar{constructor(e,t){rr.set(this,void 0),cr.set(this,void 0),o(this,rr,e,"f"),o(this,cr,t,"f")}async signup(e){if(!window.PublicKeyCredential)throw new Pr("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e.scope,i=e.audience,o=n(e,["scope","audience"]),s=await a(this,rr,"f").register(o),r=Or(s.authnParamsPublicKey),c=await navigator.credentials.create({publicKey:r});if(!c)throw new Pr("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");const p=Ur(c);return a(this,cr,"f")._requestTokenForPasskey({authSession:s.authSession,credential:p,realm:o.realm,organization:o.organization,scope:t,audience:i})}async login(e){if(!window.PublicKeyCredential)throw new Pr("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e||{},i=t.scope,o=t.audience,s=n(t,["scope","audience"]),r=await a(this,rr,"f").challenge(Object.keys(s).length>0?s:void 0),c=Cr(r.authnParamsPublicKey),p=await navigator.credentials.get({publicKey:c});if(!p)throw new Pr("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");const l=Rr(p);return a(this,cr,"f")._requestTokenForPasskey({authSession:r.authSession,credential:l,realm:s.realm,organization:s.organization,scope:i,audience:o})}async getSignupChallenge(e){if(!window.PublicKeyCredential)throw new Pr("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await a(this,rr,"f").register(e);return{authSession:t.authSession,publicKey:Or(t.authnParamsPublicKey)}}async getLoginChallenge(e){if(!window.PublicKeyCredential)throw new Pr("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await a(this,rr,"f").challenge(e);return{authSession:t.authSession,publicKey:Cr(t.authnParamsPublicKey)}}async getTokenWithPasskey(e){if(!window.PublicKeyCredential)throw new Pr("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e.authSession,i=e.credential,n=e.realm,o=e.organization,s=e.scope,r=e.audience,c=i.response;let p;if(c instanceof AuthenticatorAttestationResponse)p=Ur(i);else{if(!(c instanceof AuthenticatorAssertionResponse))throw new Pr("passkey_invalid_credential","The provided credential is not a valid attestation or assertion response.");p=Rr(i)}return a(this,cr,"f")._requestTokenForPasskey({authSession:t,credential:p,realm:n,organization:o,scope:s,audience:r})}}function jr(e){const t=new Uint8Array(e),i=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ir(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),i=t+"=".repeat((4-t.length%4)%4),n=atob(i),a=new Uint8Array(n.length);for(let e=0;e<n.length;e++)a[e]=n.charCodeAt(e);return a.buffer}function Or(e){return Object.assign(Object.assign({},e),{challenge:Ir(e.challenge),user:Object.assign(Object.assign({},e.user),{id:Ir(e.user.id)}),pubKeyCredParams:e.pubKeyCredParams,authenticatorSelection:e.authenticatorSelection})}function Cr(e){return Object.assign(Object.assign({},e),{challenge:Ir(e.challenge)})}function Ur(e){var t;const i=e.response;return{id:e.id,rawId:jr(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:jr(i.clientDataJSON),attestationObject:jr(i.attestationObject)},clientExtensionResults:e.getClientExtensionResults()}}function Rr(e){var t;const i=e.response;return{id:e.id,rawId:jr(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:jr(i.clientDataJSON),authenticatorData:jr(i.authenticatorData),signature:jr(i.signature),userHandle:i.userHandle?jr(i.userHandle):void 0},clientExtensionResults:e.getClientExtensionResults()}}rr=new WeakMap,cr=new WeakMap;class Lr{resolveOnlineAccess(e){if("online"!==e.refreshTokenMode)return!1;if(!0!==e.useRefreshTokens)throw new j('`refreshTokenMode: "online"` requires the refresh-token grant.',"Set `useRefreshTokens: true`.");if(!0!==e.useDpop)throw new j('`refreshTokenMode: "online"` requires DPoP, which is missing or disabled.',"Set `useDpop: true` (DPoP is mandatory for online access).");return!0}constructor(e){let t,i;if(this.userCache=(new Me).enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0,refreshTokenMode:"offline"},this.onlineAccess=this.resolveOnlineAccess(e),this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!q())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===q().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),this.lockManager=(de||(de=function(){return"undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.locks)||void 0===e?void 0:e.request)?new le:new ue;var e}()),de),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)i=e.cache;else{if(t=e.cacheLocation||k,!st(t))throw new Error('Invalid cache location "'.concat(t,'"'));i=st(t)()}var n;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:_,this.cookieStorage=!1===e.legacySameSiteCookie?Ze:Ge,this.orgHintCookieName=(n=this.options.clientId,"auth0.".concat(n,".organization_hint")),this.isAuthenticatedCookieName=(e=>"auth0.".concat(e,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:Xe;let o="";var s;this.onlineAccess?o=S:this.options.useRefreshTokens&&(o="offline_access"),this.scope=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];if("object"!=typeof e)return{[P]:Ce(t,e,...n)};let o={[P]:Ce(t,...n)};return Object.keys(e).forEach(i=>{const a=e[i];o[i]=Ce(t,a,...n)}),o}(this.options.authorizationParams.scope,"openid",o),this.transactionManager=new De(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||E,this.cacheManager=new We(i,i.allKeys?void 0:new nt(i,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new lt(this.options.clientId):void 0,this.domainUrl=(s=this.options.domain,/^https?:\/\//.test(s)?s:"https://".concat(s)),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:"https://".concat(e,"/"):"".concat(t,"/"))(this.options.issuer,this.domainUrl);const r="".concat(this.domainUrl,"/me/"),c=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:r},detailedResponse:!0})}}));this.myAccount=new ht(c,r),this.authJsClient=new lr({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new Er(this.authJsClient.mfa,this),this.passkey=new Ar(this.authJsClient.passkey,this),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&t===k&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new it,this.worker.postMessage({type:"init",allowedBaseUrl:this.domainUrl}))}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(e){const t=this.options.auth0Client||T,i=K(t,!0),n=encodeURIComponent(btoa(JSON.stringify(i)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(n)}_authorizeUrl(e){return this._url("/authorize?".concat(F(e)))}async _verifyIdToken(e,t,i){const n=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),i=y(t,3),n=i[0],a=i[1],o=i[2];if(3!==t.length||!n||!a||!o)throw new Error("ID token could not be decoded");const s=JSON.parse(Z(a)),r={__raw:e},c={};return Object.keys(s).forEach(e=>{r[e]=s[e],Je.includes(e)||(c[e]=s[e])}),{encoded:{header:n,payload:a,signature:o},header:JSON.parse(Z(n)),claims:r,user:c}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!qe(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!qe(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!qe(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const i=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+i),n>a)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(n,") is after expiration time (").concat(a,")"));if(null!=t.claims.nbf&&qe(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-i),n<e)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(n,") is before ").concat(e))}if(null!=t.claims.auth_time&&qe(t.claims.auth_time)){const a=new Date(0);if(a.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+i),n>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (".concat(n,") is after last auth at ").concat(a))}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const e=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(e,'", found "').concat(t.claims.org_id,'"'))}else{const e=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(e,'", found "').concat(t.claims.org_name,'"'))}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:i,leeway:this.options.leeway,max_age:(a=this.options.authorizationParams.max_age,"string"!=typeof a?a:parseInt(a,10)||void 0),now:n});var a}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}_extractSessionTransferToken(e){return new URLSearchParams(window.location.search).get(e)||void 0}_clearSessionTransferTokenFromUrl(e){try{const t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState({},"",t.toString()))}catch(e){}}_applySessionTransferToken(e){const t=this.options.sessionTransferTokenQueryParamName;if(!t||e.session_transfer_token)return e;const i=this._extractSessionTransferToken(t);return i?(this._clearSessionTransferTokenFromUrl(t),Object.assign(Object.assign({},e),{session_transfer_token:i})):e}async _prepareAuthorizeUrl(e,t,i){var n;const a=$(J()),o=$(J()),s=J(),r=await V(s),c=B(r),p=await(null===(n=this.dpop)||void 0===n?void 0:n.calculateThumbprint()),l=((e,t,i,n,a,o,s,r,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),i),{scope:Ue(t,i.scope,i.audience),response_type:"code",response_mode:r||"query",state:n,nonce:a,redirect_uri:s||e.authorizationParams.redirect_uri,code_challenge:o,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,a,o,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||i,null==t?void 0:t.response_mode,p),u=this._authorizeUrl(l);return{nonce:o,code_verifier:s,scope:l.scope,audience:l.audience||P,redirect_uri:l.redirect_uri,state:a,url:u}}async loginWithPopup(e,t){var i;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup","left=".concat(e,",top=").concat(t,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(),!t.popup))throw new L;const n=this._applySessionTransferToken(e.authorizationParams||{}),a=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin);t.popup.location.href=a.url;const o=await((e,t)=>new Promise((i,n)=>{let a;const o=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(s),window.removeEventListener("message",a,!1),n(new R(e.popup)))},1e3),s=setTimeout(()=>{clearInterval(o),n(new U(e.popup)),window.removeEventListener("message",a,!1)},1e3*(e.timeoutInSeconds||60));a=function(r){if(r.origin===t&&r.data&&"authorization_response"===r.data.type){if(clearTimeout(s),clearInterval(o),window.removeEventListener("message",a,!1),!1!==e.closePopup&&e.popup.close(),r.data.response.error)return n(A.fromPayload(r.data.response));i(r.data.response)}},window.addEventListener("message",a)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(a.url).origin);if(a.state!==o.state)throw new A("state_mismatch","Invalid state");const s=(null===(i=e.authorizationParams)||void 0===i?void 0:i.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:s})}async getUser(){var e;if(await this._isSessionCeilingReached())return;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;if(await this._isSessionCeilingReached())return;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(){var e;const t=rt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),i=t.openUrl,a=t.fragment,o=t.appState,s=n(t,["openUrl","fragment","appState"]),r=(null===(e=s.authorizationParams)||void 0===e?void 0:e.organization)||this.options.authorizationParams.organization,c=this._applySessionTransferToken(s.authorizationParams||{}),p=await this._prepareAuthorizeUrl(c),l=p.url,u=n(p,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},u),{appState:o,response_type:Qe.Code}),r&&{organization:r}));const d=a?"".concat(l,"#").concat(a):l;i?await i(d):window.location.assign(d)}async handleRedirectCallback(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href).split("?").slice(1);if(0===e.length)throw new Error("There are no query params available for parsing.");const t=this.transactionManager.get();if(!t)throw new A("missing_transaction","Invalid state");this.transactionManager.remove();const i=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(e.join(""));return t.response_type===Qe.ConnectCode?this._handleConnectAccountRedirectCallback(i,t):this._handleLoginRedirectCallback(i,t)}async _handleLoginRedirectCallback(e,t){const i=e.code,n=e.state,a=e.error,o=e.error_description;if(a)throw new I(a,o||a,n,t.appState);if(!t.code_verifier||t.state&&t.state!==n)throw new A("state_mismatch","Invalid state");const s=t.organization,r=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:i},c?{redirect_uri:c}:{}),{nonceIn:r,organization:s}),{appState:t.appState,response_type:Qe.Code}}async _handleConnectAccountRedirectCallback(e,t){const i=e.connect_code,n=e.state,a=e.error,o=e.error_description;if(a)throw new O(a,o||a,t.connection,n,t.appState);if(!i)throw new A("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===n))throw new A("state_mismatch","Invalid state");const s=await this.myAccount.completeAccount({auth_session:t.auth_session,connect_code:i,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},s),{appState:t.appState,response_type:Qe.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(at))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(at)}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t,i;const n=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Ue(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(i=e.authorizationParams)||void 0===i?void 0:i.audience)||this.options.authorizationParams.audience)})}),a=await this._getTokenSilently(n);return e.detailedResponse?a:null==a?void 0:a.access_token}async _getTokenSilently(e){const t=e.cacheMode,i=n(e,["cacheMode"]);if(await this._isSessionCeilingReached())return;if("off"!==t){const e=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||P,clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const a=(o=this.options.clientId,s=i.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(o,".").concat(s));var o,s;try{return await this.lockManager.runWithLock(a,5e3,async()=>{if("off"!==t){const e=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||P,clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(i):await this._getTokenFromIFrame(i),n=e.id_token,a=e.token_type,o=e.access_token,s=e.oauthTokenScope,r=e.expires_in;return Object.assign(Object.assign({id_token:n,token_type:a,access_token:o},s?{scope:s}:null),{expires_in:r})})}catch(e){if(this._isInteractiveError(e)&&"popup"===this.options.interactiveErrorHandler)return await this._handleInteractiveErrorWithPopup(i);throw e}}_isInteractiveError(e){return e instanceof z||e instanceof A&&this._isIframeMfaError(e)}_isIframeMfaError(e){return"login_required"===e.error&&"Multifactor authentication required"===e.error_description}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});const t=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||P,clientId:this.options.clientId});if(!t)throw new A("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return t}catch(e){throw e}}async getTokenWithPopup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,n;const a=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Ue(this.scope,null===(i=e.authorizationParams)||void 0===i?void 0:i.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},x),t),await this.loginWithPopup(a,t),(await this.cacheManager.get(new ze({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||P,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},i=t.federated,a=n(t,["federated"]),o=i?"&federated":"";return this._url("/v2/logout?".concat(F(Object.assign({clientId:e.clientId},a))))+o}async revokeRefreshToken(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.options.useRefreshTokens)return;const t=e.audience||this.options.authorizationParams.audience||P,i=await this.cacheManager.getRefreshTokensByAudience(t,this.options.clientId);await async function(e,t){let i=e.auth0Client,n=e.useFormData,a=e.refreshTokens,o=e.audience,s=e.client_id,r=e.onRefreshTokenRevoked;const c=e.timeout||_,p="refresh_token",l="".concat(e.baseUrl,"/oauth/revoke"),u={"Content-Type":n?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(K(i||T)))};if(t){const i={client_id:s,token_type_hint:p},a=n?F(i):JSON.stringify(i);try{return await Pe({type:"revoke",timeout:c,fetchUrl:l,fetchOptions:{method:"POST",body:a,headers:u},useFormData:n,auth:{audience:null!=o?o:P}},t)}catch(e){throw new A("revoke_error",e.message)}}for(const t of a){const i={client_id:s,token_type_hint:p,token:t},a=n?F(i):JSON.stringify(i),o=await Ae(l,{method:"POST",body:a,headers:u},c);if(!o.ok){let t,i;try{var d=JSON.parse(await o.text());t=d.error,i=d.error_description}catch(e){}throw new A(t||"revoke_error",i||"HTTP error ".concat(o.status))}await(null==r?void 0:r(t))}}({baseUrl:this.domainUrl,timeout:this.httpTimeoutMs,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,client_id:this.options.clientId,refreshTokens:i,audience:t,onRefreshTokenRevoked:e=>this.cacheManager.stripRefreshToken(e)},this.worker),this.onlineAccess&&await this._clearLocalSession()}async logout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=rt(e),i=t.openUrl,a=n(t,["openUrl"]);await this._clearLocalSession(e.clientId);const o=this._buildLogoutUrl(a);i?await i(o):!1!==i&&window.location.assign(o)}async _getTokenFromIFrame(e){const t=(i=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(i));var i;try{return await this.lockManager.runWithLock(t,5e3,async()=>{const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),i=this.cookieStorage.get(this.orgHintCookieName);i&&!t.organization&&(t.organization=i);const n=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin),a=n.url,o=n.state,s=n.nonce,r=n.code_verifier,c=n.redirect_uri,p=n.scope,l=n.audience;if(window.crossOriginIsolated)throw new A("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const u=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let d;try{d=new URL(this.domainUrl).origin}catch(e){d=this.domainUrl}const h=await function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60;return new Promise((n,a)=>{const o=window.document.createElement("iframe");o.setAttribute("width","0"),o.setAttribute("height","0"),o.style.display="none";const s=()=>{window.document.body.contains(o)&&(window.document.body.removeChild(o),window.removeEventListener("message",r,!1))};let r;const c=setTimeout(()=>{a(new C),s()},1e3*i);r=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const i=e.source;i&&i.close(),e.data.response.error?a(A.fromPayload(e.data.response)):n(e.data.response),clearTimeout(c),window.removeEventListener("message",r,!1),setTimeout(s,2e3)},window.addEventListener("message",r,!1),window.document.body.appendChild(o),o.setAttribute("src",e)})}(a,d,u);if(o!==h.state)throw new A("state_mismatch","Invalid state");const m=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:r,code:h.code,grant_type:"authorization_code",redirect_uri:c,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:s,organization:t.organization});return Object.assign(Object.assign({},m),{scope:p,oauthTokenScope:m.scope,audience:l})})}catch(e){throw"login_required"===e.error&&(e instanceof A&&this._isIframeMfaError(e)&&"popup"===this.options.interactiveErrorHandler||this.logout({openUrl:!1})),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new ze({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||P,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new N(e.authorizationParams.audience||P,e.authorizationParams.scope)}const i=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,n="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,a=((e,t,i,n)=>{var a;if(e&&i&&n){if(t.audience!==i)return t.scope;const e=n.split(" "),o=(null===(a=t.scope)||void 0===a?void 0:a.split(" "))||[],s=o.every(t=>e.includes(t));return e.length>=o.length&&s?n:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const p=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:i}),n&&{timeout:n}),{scopesToRequest:a});if(!this.onlineAccess&&p.refresh_token&&(null==t?void 0:t.refresh_token)&&await this.cacheManager.updateEntry(t.refresh_token,p.refresh_token,this.options.clientId,this.options.useMrrt),this.options.useMrrt&&(o=null==t?void 0:t.audience,s=null==t?void 0:t.scope,r=e.authorizationParams.audience,c=e.authorizationParams.scope,o!==r||!((e,t)=>{const i=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>i.includes(e))})(c,s))){const t=((e,t,i)=>{const n=(null==e?void 0:e.split(" "))||[],a=i?n.filter(e=>e!==S):n,o=(null==t?void 0:t.split(" "))||[];return a.filter(e=>-1==o.indexOf(e)).join(",")})(a,p.scope,this.onlineAccess);if(t){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope),new M(e.authorizationParams.audience||"default",t)}}return Object.assign(Object.assign({},p),{scope:e.authorizationParams.scope,oauthTokenScope:p.scope,audience:e.authorizationParams.audience||P})}catch(t){if(t.message){if(t.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),t;if((t.message.includes("Missing Refresh Token")||t.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e)}throw t}var o,s,r,c}async _saveEntryInCache(e){const t=e.decodedToken.claims,i=t.session_expiry,a=t.iat;if(void 0!==i){if("number"!=typeof i)throw new A("invalid_token","Invalid session_expiry: value must be a number.");if(i>=1e10)throw new A("invalid_token","Invalid session_expiry: value appears to be in milliseconds; expected a Unix timestamp in seconds.");if(void 0===a||i<=a)throw new A("invalid_token","Invalid session_expiry: session ceiling is before or at the token issue time.")}const o=e.id_token,s=e.decodedToken,r=n(e,["id_token","decodedToken"]);this.userCache.set(Le,{id_token:o,decodedToken:s}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _clearLocalSession(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.clientId;var t;null===e?await this.cacheManager.clear():await this.cacheManager.clear(e),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove(Le);try{await(null===(t=this.dpop)||void 0===t?void 0:t.clear())}catch(e){}if(this.worker)try{await Pe({type:"clear"},this.worker)}catch(e){}}async _isSessionCeilingReached(){var e,t;const i=this.userCache.get(Le),n=null!=i?i:await this.cacheManager.getIdToken(new ze({clientId:this.options.clientId})),a=null===(t=null===(e=null==n?void 0:n.decodedToken)||void 0===e?void 0:e.claims)||void 0===t?void 0:t.session_expiry;if(void 0===a)return!1;const o=await this.nowProvider();return Math.floor(o/1e3)>=a-30&&(await this._clearLocalSession(),!0)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||P,t=this.scope[e],i=await this.cacheManager.getIdToken(new ze({clientId:this.options.clientId,audience:e,scope:t})),n=this.userCache.get(Le);return i&&i.id_token===(null==n?void 0:n.id_token)?n:(this.userCache.set(Le,i),i)}async _getEntryFromCache(e){let t=e.scope,i=e.audience,n=e.clientId,a=e.cacheMode;const o=await this.cacheManager.get(new ze({scope:t,audience:i,clientId:n}),60,this.options.useMrrt,a);if(o&&o.access_token){const e=o.token_type,t=o.access_token,i=o.oauthTokenScope,n=o.expires_in,a=await this._getIdTokenFromCache();return a&&Object.assign(Object.assign({id_token:a.id_token,token_type:e||"Bearer",access_token:t},i?{scope:i}:null),{expires_in:n})}}_storeMfaContext(e,t,i){e instanceof z&&this.mfa.setMFAAuthDetails(e.mfa_token,t,i,e.mfa_requirements)}async _requestToken(e,t){var i,n,a,o,s,r;const c=t||{},p=c.nonceIn,l=c.organization,u=c.scopesToRequest;try{const t=await Oe(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop,preserveRefreshToken:this.onlineAccess},e),{scope:u||e.scope}),this.worker);let c=await this._verifyIdToken(t.id_token,p,l);if("authorization_code"===e.grant_type){const e=await this._getIdTokenFromCache();(null===(n=null===(i=null==e?void 0:e.decodedToken)||void 0===i?void 0:i.claims)||void 0===n?void 0:n.sub)&&e.decodedToken.claims.sub!==c.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(Le))}if("authorization_code"!==e.grant_type){const e=await this._getIdTokenFromCache(),t=null===(o=null===(a=null==e?void 0:e.decodedToken)||void 0===a?void 0:a.claims)||void 0===o?void 0:o.session_expiry;void 0!==t&&(c=Object.assign(Object.assign({},c),{claims:Object.assign(Object.assign({},c.claims),{session_expiry:t})}))}return!t.refresh_token&&this.onlineAccess&&(t.refresh_token=null!==(s=e.refresh_token)&&void 0!==s?s:null===(r=await this.cacheManager.get(new ze({scope:u||e.scope,audience:e.audience||P,clientId:this.options.clientId}),void 0,this.options.useMrrt))||void 0===r?void 0:r.refresh_token),await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},t),{decodedToken:c,scope:e.scope,audience:e.audience||P}),t.scope?{oauthTokenScope:t.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(l||c.claims.org_id),Object.assign(Object.assign({},t),{decodedToken:c})}catch(t){throw"authorization_code"!==e.grant_type&&this._storeMfaContext(t,u||e.scope,e.audience),t}}_buildTokenExchangeParams(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type}),e.actor_token&&{actor_token:e.actor_token}),e.actor_token_type&&{actor_token_type:e.actor_token_type}),{scope:Ue(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}async loginWithCustomTokenExchange(e){return this._requestToken(this._buildTokenExchangeParams(e))}async customTokenExchange(e){const t=this._buildTokenExchangeParams(e);try{const i=await Oe(Object.assign(Object.assign({},t),{baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,dpop:this.dpop}),this.worker,!0);return i.id_token&&await this._verifyIdToken(i.id_token,void 0,e.organization),i}catch(e){throw this._storeMfaContext(e,t.scope,t.audience),e}}async exchangeToken(e){return this.loginWithCustomTokenExchange(e)}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new dt(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const t=e.openUrl,i=e.appState,n=e.connection,a=e.scopes,o=e.authorization_params,s=e.redirectUri,r=void 0===s?this.options.authorizationParams.redirect_uri||window.location.origin:s;if(!n)throw new Error("connection is required");const c=$(J()),p=J(),l=await V(p),u=B(l),d=await this.myAccount.connectAccount({connection:n,scopes:a,redirect_uri:r,state:c,code_challenge:u,code_challenge_method:"S256",authorization_params:o}),h=d.connect_uri,m=d.connect_params,f=d.auth_session;this.transactionManager.create({state:c,code_verifier:p,auth_session:f,redirect_uri:r,appState:i,connection:n,response_type:Qe.ConnectCode});const v=new URL(h);v.searchParams.set("ticket",m.ticket),t?await t(v.toString()):window.location.assign(v)}async _requestTokenForPasskey(e){const t=e.audience||this.options.authorizationParams.audience,i=e.organization||this.options.authorizationParams.organization;return this._requestToken(Object.assign(Object.assign(Object.assign({grant_type:"urn:okta:params:oauth:grant-type:webauthn",auth_session:e.authSession,authn_response:e.credential},e.realm&&{realm:e.realm}),i&&{organization:i}),{scope:Ue(this.scope,e.scope,t),audience:t}))}async _requestTokenForMfa(e,t){const i=e.mfaToken,a=n(e,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},a),{mfa_token:i}),t)}}async function zr(e){const t=new Lr(e);return await t.checkSession(),t}},991(e,t){"use strict";t.byteLength=function(e){var t=r(e),i=t[0],n=t[1];return 3*(i+n)/4-n},t.toByteArray=function(e){var t,i,o=r(e),s=o[0],c=o[1],p=new a(function(e,t,i){return 3*(t+i)/4-i}(0,s,c)),l=0,u=c>0?s-4:s;for(i=0;i<u;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=255&t;return 2===c&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,p[l++]=255&t),1===c&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,p[l++]=t>>8&255,p[l++]=255&t),p},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,o=[],s=16383,r=0,c=n-a;r<c;r+=s)o.push(p(e,r,r+s>c?c:r+s));return 1===a?(t=e[n-1],o.push(i[t>>2]+i[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],o.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")),o.join("")};for(var i=[],n=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)i[s]=o[s],n[o.charCodeAt(s)]=s;function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function c(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}function p(e,t,i){for(var n,a=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(c(n));return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},318(e,t){t.read=function(e,t,i,n,a){var o,s,r=8*a-n-1,c=(1<<r)-1,p=c>>1,l=-7,u=i?a-1:0,d=i?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-l)-1,h>>=-l,l+=r;l>0;o=256*o+e[t+u],u+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+u],u+=d,l-=8);if(0===o)o=1-p;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=p}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,i,n,a,o){var s,r,c,p=8*o-a-1,l=(1<<p)-1,u=l>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,m=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(s++,c/=2),s+u>=l?(r=0,s=l):s+u>=1?(r=(t*c-1)*Math.pow(2,a),s+=u):(r=t*Math.pow(2,u-1)*Math.pow(2,a),s=0));a>=8;e[i+h]=255&r,h+=m,r/=256,a-=8);for(s=s<<a|r,p+=a;p>0;e[i+h]=255&s,h+=m,s/=256,p-=8);e[i+h-m]|=128*f}},526(e,t,i){"use strict";var n=i(991),a=i(318),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;var s=2147483647;function r(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return p(e,t,i)}function p(e,t,i){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|f(e,t),n=r(i),a=n.write(e,t);return a!==i&&(n=n.slice(0,a)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,i);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,i);var a=function(e){if(c.isBuffer(e)){var t=0|m(e.length),i=r(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?r(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,i);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 u(e){return l(e),r(e<0?0:0|m(e))}function d(e){for(var t=e.length<0?0:0|m(e.length),i=r(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function h(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),Object.setPrototypeOf(n,c.prototype),n}function m(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function f(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);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return W(e).length;default:if(a)return n?-1:M(e).length;t=(""+t).toLowerCase(),a=!0}}function v(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,i);case"utf8":case"utf-8":return E(this,t,i);case"ascii":return A(this,t,i);case"latin1":case"binary":return j(this,t,i);case"base64":return T(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function b(e,t,i,n,a){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),J(i=+i)&&(i=a?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(a)return-1;i=e.length-1}else if(i<0){if(!a)return-1;i=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,i,n,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):y(e,[t],i,n,a);throw new TypeError("val must be string, number or Buffer")}function y(e,t,i,n,a){var o,s=1,r=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;s=2,r/=2,c/=2,i/=2}function p(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(a){var l=-1;for(o=i;o<r;o++)if(p(e,o)===p(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(i+c>r&&(i=r-c),o=i;o>=0;o--){for(var u=!0,d=0;d<c;d++)if(p(e,o+d)!==p(t,d)){u=!1;break}if(u)return o}return-1}function w(e,t,i,n){i=Number(i)||0;var a=e.length-i;n?(n=Number(n))>a&&(n=a):n=a;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var r=parseInt(t.substr(2*s,2),16);if(J(r))return s;e[i+s]=r}return s}function x(e,t,i,n){return D(M(t,e.length-i),e,i,n)}function _(e,t,i,n){return D(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function k(e,t,i,n){return D(W(t),e,i,n)}function S(e,t,i,n){return D(function(e,t){for(var i,n,a,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(i=e.charCodeAt(s))>>8,a=i%256,o.push(a),o.push(n);return o}(t,e.length-i),e,i,n)}function T(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function E(e,t,i){i=Math.min(e.length,i);for(var n=[],a=t;a<i;){var o,s,r,c,p=e[a],l=null,u=p>239?4:p>223?3:p>191?2:1;if(a+u<=i)switch(u){case 1:p<128&&(l=p);break;case 2:128==(192&(o=e[a+1]))&&(c=(31&p)<<6|63&o)>127&&(l=c);break;case 3:o=e[a+1],s=e[a+2],128==(192&o)&&128==(192&s)&&(c=(15&p)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[a+1],s=e[a+2],r=e[a+3],128==(192&o)&&128==(192&s)&&128==(192&r)&&(c=(15&p)<<18|(63&o)<<12|(63&s)<<6|63&r)>65535&&c<1114112&&(l=c)}null===l?(l=65533,u=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),a+=u}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=P));return i}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,i){return p(e,t,i)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,i){return function(e,t,i){return l(e),e<=0?r(e):void 0!==t?"string"==typeof i?r(e).fill(t,i):r(e).fill(t):r(e)}(e,t,i)},c.allocUnsafe=function(e){return u(e)},c.allocUnsafeSlow=function(e){return u(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,a=0,o=Math.min(i,n);a<o;++a)if(e[a]!==t[a]){i=e[a],n=t[a];break}return i<n?-1:n<i?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=c.allocUnsafe(t),a=0;for(i=0;i<e.length;++i){var o=e[i];if(q(o,Uint8Array))a+o.length>n.length?c.from(o).copy(n,a):Uint8Array.prototype.set.call(n,o,a);else{if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,a)}a+=o.length}return n},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):v.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",i=t.IS;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,i,n,a){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===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||i>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=i)return 0;if(n>=a)return-1;if(t>=i)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(n>>>=0),s=(i>>>=0)-(t>>>=0),r=Math.min(o,s),p=this.slice(n,a),l=e.slice(t,i),u=0;u<r;++u)if(p[u]!==l[u]){o=p[u],s=l[u];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},c.prototype.indexOf=function(e,t,i){return b(this,e,t,i,!0)},c.prototype.lastIndexOf=function(e,t,i){return b(this,e,t,i,!1)},c.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var a=this.length-t;if((void 0===i||i>a)&&(i=a),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,e,t,i);case"utf8":case"utf-8":return x(this,e,t,i);case"ascii":case"latin1":case"binary":return _(this,e,t,i);case"base64":return k(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function A(e,t,i){var n="";i=Math.min(e.length,i);for(var a=t;a<i;++a)n+=String.fromCharCode(127&e[a]);return n}function j(e,t,i){var n="";i=Math.min(e.length,i);for(var a=t;a<i;++a)n+=String.fromCharCode(e[a]);return n}function I(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var a="",o=t;o<i;++o)a+=$[e[o]];return a}function O(e,t,i){for(var n=e.slice(t,i),a="",o=0;o<n.length-1;o+=2)a+=String.fromCharCode(n[o]+256*n[o+1]);return a}function C(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,i,n,a,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function R(e,t,i,n,a,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function L(e,t,i,n,o){return t=+t,i>>>=0,o||R(e,0,i,4),a.write(e,t,i,n,23,4),i+4}function z(e,t,i,n,o){return t=+t,i>>>=0,o||R(e,0,i,8),a.write(e,t,i,n,52,8),i+8}c.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(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||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);for(var n=this[e],a=1,o=0;++o<t&&(a*=256);)n+=this[e+o]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);for(var n=t,a=1,o=this[e+--n];n>0&&(a*=256);)o+=this[e+--n]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(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||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||U(this,e,t,i,Math.pow(2,8*i)-1,0);var a=1,o=0;for(this[t]=255&e;++o<i&&(a*=256);)this[t+o]=e/a&255;return t+i},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||U(this,e,t,i,Math.pow(2,8*i)-1,0);var a=i-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+i},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||U(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||U(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,i){return e=+e,t>>>=0,i||U(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,i){return e=+e,t>>>=0,i||U(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,i){return e=+e,t>>>=0,i||U(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.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*i-1);U(this,e,t,i,a-1,-a)}var o=0,s=1,r=0;for(this[t]=255&e;++o<i&&(s*=256);)e<0&&0===r&&0!==this[t+o-1]&&(r=1),this[t+o]=(e/s|0)-r&255;return t+i},c.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*i-1);U(this,e,t,i,a-1,-a)}var o=i-1,s=1,r=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===r&&0!==this[t+o+1]&&(r=1),this[t+o]=(e/s|0)-r&255;return t+i},c.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||U(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||U(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||U(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||U(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,i){return e=+e,t>>>=0,i||U(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.writeFloatLE=function(e,t,i){return L(this,e,t,!0,i)},c.prototype.writeFloatBE=function(e,t,i){return L(this,e,t,!1,i)},c.prototype.writeDoubleLE=function(e,t,i){return z(this,e,t,!0,i)},c.prototype.writeDoubleBE=function(e,t,i){return z(this,e,t,!1,i)},c.prototype.copy=function(e,t,i,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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<n-i&&(n=e.length-t+i);var a=n-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),a},c.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var o;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=t;o<i;++o)this[o]=e;else{var s=c.isBuffer(e)?e:c.from(e,n),r=s.length;if(0===r)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-t;++o)this[o+t]=s[o%r]}return this};var N=/[^+/0-9A-Za-z-_]/g;function M(e,t){var i;t=t||1/0;for(var n=e.length,a=null,o=[],s=0;s<n;++s){if((i=e.charCodeAt(s))>55295&&i<57344){if(!a){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}a=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),a=i;continue}i=65536+(a-55296<<10|i-56320)}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,i,n){for(var a=0;a<n&&!(a+i>=t.length||a>=e.length);++a)t[a+i]=e[a];return a}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}var $=function(){for(var e="0123456789abcdef",t=new Array(256),i=0;i<16;++i)for(var n=16*i,a=0;a<16;++a)t[n+a]=e[i]+e[a];return t}()},942(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var i,n="",a=0,o=-1,s=0,r=0;r<=e.length;++r){if(r<e.length)i=e.charCodeAt(r);else{if(47===i)break;i=47}if(47===i){if(o===r-1||1===s);else if(o!==r-1&&2===s){if(n.length<2||2!==a||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",a=0):a=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),o=r,s=0;continue}}else if(2===n.length||1===n.length){n="",a=0,o=r,s=0;continue}t&&(n.length>0?n+="/..":n="..",a=2)}else n.length>0?n+="/"+e.slice(o+1,r):n=e.slice(o+1,r),a=r-o-1;o=r,s=0}else 46===i&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var e,n="",a=!1,o=arguments.length-1;o>=-1&&!a;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(n=s+"/"+n,a=47===s.charCodeAt(0))}return n=i(n,!a),a?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!n)).length||n||(e="."),e.length>0&&a&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,i=0;i<arguments.length;++i){var a=arguments[i];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":n.normalize(e)},relative:function(e,i){if(t(e),t(i),e===i)return"";if((e=n.resolve(e))===(i=n.resolve(i)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var o=e.length,s=o-a,r=1;r<i.length&&47===i.charCodeAt(r);++r);for(var c=i.length-r,p=s<c?s:c,l=-1,u=0;u<=p;++u){if(u===p){if(c>p){if(47===i.charCodeAt(r+u))return i.slice(r+u+1);if(0===u)return i.slice(r+u)}else s>p&&(47===e.charCodeAt(a+u)?l=u:0===u&&(l=0));break}var d=e.charCodeAt(a+u);if(d!==i.charCodeAt(r+u))break;47===d&&(l=u)}var h="";for(u=a+l+1;u<=o;++u)u!==o&&47!==e.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+i.slice(r+l):(r+=l,47===i.charCodeAt(r)&&++r,i.slice(r))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var i=e.charCodeAt(0),n=47===i,a=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(i=e.charCodeAt(s))){if(!o){a=s;break}}else o=!1;return-1===a?n?"/":".":n&&1===a?"//":e.slice(0,a)},basename:function(e,i){if(void 0!==i&&"string"!=typeof i)throw new TypeError('"ext" argument must be a string');t(e);var n,a=0,o=-1,s=!0;if(void 0!==i&&i.length>0&&i.length<=e.length){if(i.length===e.length&&i===e)return"";var r=i.length-1,c=-1;for(n=e.length-1;n>=0;--n){var p=e.charCodeAt(n);if(47===p){if(!s){a=n+1;break}}else-1===c&&(s=!1,c=n+1),r>=0&&(p===i.charCodeAt(r)?-1===--r&&(o=n):(r=-1,o=c))}return a===o?o=c:-1===o&&(o=e.length),e.slice(a,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){a=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(a,o)},extname:function(e){t(e);for(var i=-1,n=0,a=-1,o=!0,s=0,r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47!==c)-1===a&&(o=!1,a=r+1),46===c?-1===i?i=r:1!==s&&(s=1):-1!==i&&(s=-1);else if(!o){n=r+1;break}}return-1===i||-1===a||0===s||1===s&&i===a-1&&i===n+1?"":e.slice(i,a)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var i=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return i?i===t.root?i+n:i+"/"+n:n}(0,e)},parse:function(e){t(e);var i={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return i;var n,a=e.charCodeAt(0),o=47===a;o?(i.root="/",n=1):n=0;for(var s=-1,r=0,c=-1,p=!0,l=e.length-1,u=0;l>=n;--l)if(47!==(a=e.charCodeAt(l)))-1===c&&(p=!1,c=l+1),46===a?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!p){r=l+1;break}return-1===s||-1===c||0===u||1===u&&s===c-1&&s===r+1?-1!==c&&(i.base=i.name=0===r&&o?e.slice(1,c):e.slice(r,c)):(0===r&&o?(i.name=e.slice(1,s),i.base=e.slice(1,c)):(i.name=e.slice(r,s),i.base=e.slice(r,c)),i.ext=e.slice(s,c)),r>0?i.dir=e.slice(0,r-1):o&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},930(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,i,n){var a=n&&n.stringify||t;if("object"==typeof e&&null!==e){var o=i.length+1;if(1===o)return e;var s=new Array(o);s[0]=a(e);for(var r=1;r<o;r++)s[r]=a(i[r]);return s.join(" ")}if("string"!=typeof e)return e;var c=i.length;if(0===c)return e;for(var p="",l=0,u=-1,d=e&&e.length||0,h=0;h<d;){if(37===e.charCodeAt(h)&&h+1<d){switch(u=u>-1?u:0,e.charCodeAt(h+1)){case 100:case 102:if(l>=c)break;if(null==i[l])break;u<h&&(p+=e.slice(u,h)),p+=Number(i[l]),u=h+2,h++;break;case 105:if(l>=c)break;if(null==i[l])break;u<h&&(p+=e.slice(u,h)),p+=Math.floor(Number(i[l])),u=h+2,h++;break;case 79:case 111:case 106:if(l>=c)break;if(void 0===i[l])break;u<h&&(p+=e.slice(u,h));var m=typeof i[l];if("string"===m){p+="'"+i[l]+"'",u=h+2,h++;break}if("function"===m){p+=i[l].name||"<anonymous>",u=h+2,h++;break}p+=a(i[l]),u=h+2,h++;break;case 115:if(l>=c)break;u<h&&(p+=e.slice(u,h)),p+=String(i[l]),u=h+2,h++;break;case 37:u<h&&(p+=e.slice(u,h)),p+="%",u=h+2,h++,l--}++l}++h}return-1===u?e:(u<d&&(p+=e.slice(u)),p)}},48(e,t,i){var n,a,o;o=function(){return function(){return function(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var i=e.shift();e[0]=i+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var a=e[n];if("string"!=typeof a)throw new TypeError("Url must be a string. Received "+a);""!==a&&(n>0&&(a=a.replace(/^[\/]+/,"")),a=n<e.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),t.push(a))}var o=t.join("/"),s=(o=o.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=o():void 0===(a="function"==typeof(n=o)?n.call(t,i,t,e):n)||(e.exports=a)},122(){},360(){},826(){},713(e,t,i){"use strict";const n=i(930);e.exports=u;const a=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},o={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:b,wrapResponseSerializer:b,wrapErrorSerializer:b,req:g,res:g,err:f,errWithCause:f};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}const r=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),p={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function l(e,t){const i={logger:t,parent:e[c]};t[c]=i}function u(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const i=e.browser.write||a;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},o=function(e,t){return Array.isArray(e)?e.filter(function(e){return"!stdSerializers.err"!==e}):!0===e&&Object.keys(t)}(e.browser.serialize,n);let c=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);const f=Object.keys(e.customLevels||{}),g=["error","fatal","warn","info","debug","trace"].concat(f);"function"==typeof i&&g.forEach(function(e){i[e]=i}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const b=e.level||"info",w=Object.create(i);w.log||(w.log=y),function(e,t,i){const n={};t.forEach(e=>{n[e]=i[e]?i[e]:a[e]||a[p[e]||"log"]||y}),e[r]=n}(w,g,i),l({},w),Object.defineProperty(w,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,x,w,"error"),d(this,x,w,"fatal"),d(this,x,w,"warn"),d(this,x,w,"info"),d(this,x,w,"debug"),d(this,x,w,"trace"),f.forEach(e=>{d(this,x,w,e)})}});const x={transmit:t,serialize:o,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:g,timestamp:v(e)};return w.levels=function(e){const t=e.customLevels||{};return{values:Object.assign({},u.levels.values,t),labels:Object.assign({},u.levels.labels,function(e){const t={};return Object.keys(e).forEach(function(i){t[e[i]]=i}),t}(t))}}(e),w.level=b,w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=y,w.serializers=n,w._serialize=o,w._stdErrSerialize=c,w.child=function(i,a){if(!i)throw new Error("missing bindings for child Pino");a=a||{},o&&i.serializers&&(a.serializers=i.serializers);const s=a.serializers;if(o&&s){var r=Object.assign({},n,s),c=!0===e.browser.serialize?Object.keys(r):o;delete i.serializers,h([i],c,r,this._stdErrSerialize)}function p(e){this._childLevel=1+(0|e._childLevel),this.bindings=i,r&&(this.serializers=r,this._serialize=c),t&&(this._logEvent=m([].concat(e._logEvent.bindings,i)))}p.prototype=this;const u=new p(this);return l(this,u),u.level=this.level,u},t&&(w._logEvent=m()),w}function d(e,t,i,o){if(Object.defineProperty(e,o,{value:s(e.level,i)>s(o,i)?y:i[r][o],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[o]===y)return;e[o]=function(e,t,i,o){return c=e[r][o],function(){const r=t.timestamp(),p=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===a?a:this;for(var u=0;u<p.length;u++)p[u]=arguments[u];if(t.serialize&&!t.asObject&&h(p,this._serialize,this.serializers,this._stdErrSerialize),t.asObject||t.formatters?c.call(l,function(e,t,i,a,o={}){const{level:s=()=>e.levels.values[t],log:r=e=>e}=o;e._serialize&&h(i,e._serialize,e.serializers,e._stdErrSerialize);const c=i.slice();let p=c[0];const l={};a&&(l.time=a),l.level=s(t,e.levels.values[t]);let u=1+(0|e._childLevel);if(u<1&&(u=1),null!==p&&"object"==typeof p){for(;u--&&"object"==typeof c[0];)Object.assign(l,c.shift());p=c.length?n(c.shift(),c):void 0}else"string"==typeof p&&(p=n(c.shift(),c));return void 0!==p&&(l.msg=p),r(l)}(this,o,p,r,t.formatters)):c.apply(l,p),t.transmit){const n=t.transmit.level||e._level,a=i.levels.values[n],c=i.levels.values[o];if(c<a)return;!function(e,t,i){const n=t.send,a=t.ts,o=t.methodLevel,s=t.methodValue,r=t.val,c=e._logEvent.bindings;h(i,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=i.filter(function(e){return-1===c.indexOf(e)}),e._logEvent.level.label=o,e._logEvent.level.value=s,n(o,e._logEvent,r),e._logEvent=m(c)}(this,{ts:r,methodLevel:o,methodValue:c,transmitLevel:n,transmitValue:i.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:s(e._level,i)},p)}};var c}(e,t,i,o);const p=function(e){const t=[];e.bindings&&t.push(e.bindings);let i=e[c];for(;i.parent;)i=i.parent,i.logger.bindings&&t.push(i.logger.bindings);return t.reverse()}(e);0!==p.length&&(e[o]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(p,e[o]))}function h(e,t,i,n){for(const a in e)if(n&&e[a]instanceof Error)e[a]=u.stdSerializers.err(e[a]);else if("object"==typeof e[a]&&!Array.isArray(e[a]))for(const n in e[a])t&&t.indexOf(n)>-1&&n in i&&(e[a][n]=i[n](e[a][n]))}function m(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function f(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const i in e)void 0===t[i]&&(t[i]=e[i]);return t}function v(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?w:x}function g(){return{}}function b(e){return e}function y(){}function w(){return!1}function x(){return Date.now()}u.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},u.stdSerializers=o,u.stdTimeFunctions=Object.assign({},{nullTime:w,epochTime:x,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=u,e.exports.pino=u},797(e,t,i){"use strict";var n,a=i(526).hp,o=Object.create,s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,p=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>function(){return t||(0,e[c(e)[0]])((t={exports:{}}).exports,t),t.exports},d=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of c(t))l.call(e,a)||a===i||s(e,a,{get:()=>t[a],enumerable:!(n=r(t,a))||n.enumerable});return e},h=(e,t,i)=>(i=null!=e?o(p(e)):{},d(!t&&e&&e.__esModule?i:s(i,"default",{value:e,enumerable:!0}),e)),m=u({"../../node_modules/mime-db/db.json"(e,t){t.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}}}),f=u({"../../node_modules/mime-db/index.js"(e,t){t.exports=m()}}),v=u({"../../node_modules/mime-types/index.js"(e){var t,n,a,o=f(),s=i(942).extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var t=r.exec(e),i=t&&o[t[1].toLowerCase()];return i&&i.charset?i.charset:!(!t||!c.test(t[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var i=-1===t.indexOf("/")?e.lookup(t):t;if(!i)return!1;if(-1===i.indexOf("charset")){var n=e.charset(i);n&&(i+="; charset="+n.toLowerCase())}return i},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var i=r.exec(t),n=i&&e.extensions[i[1].toLowerCase()];return!(!n||!n.length)&&n[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var i=s("x."+t).toLowerCase().substr(1);return i&&e.types[i]||!1},e.types=Object.create(null),t=e.extensions,n=e.types,a=["nginx","apache",void 0,"iana"],Object.keys(o).forEach(function(e){var i=o[e],s=i.extensions;if(s&&s.length){t[e]=s;for(var r=0;r<s.length;r++){var c=s[r];if(n[c]){var p=a.indexOf(o[n[c]].source),l=a.indexOf(i.source);if("application/octet-stream"!==n[c]&&(p>l||p===l&&"application/"===n[c].substr(0,12)))continue}n[c]=e}}})}}),g={};function b(e){return e&&e.length>0?e:void 0}function y(e){const t=b(e.apiKey);if(void 0!==t)return{apiKey:t};const i=b(e.accessToken);return void 0!==i?{accessToken:i}:void 0!==e.session?{session:e.session}:void 0!==e.oAuth2?{oAuth2:e.oAuth2}:e.auth}function w(e){if(void 0!==e)return b(e.apiKey)}function x(e){if(void 0!==e)return b(e.accessToken)}((e,t)=>{for(var i in t)s(e,i,{get:t[i],enumerable:!0})})(g,{AbstractJob:()=>ie,AnnotationInclusionMode:()=>je,AnnotationType:()=>Ee,AreaType:()=>Ce,ArtifactType:()=>Me,AssetInclusionMode:()=>Ae,AssetStatus:()=>Te,AssetUrlType:()=>He,AutoAnnotateStatus:()=>Se,AutoAnnotateTask:()=>Ie,ChangeType:()=>De,ContourType:()=>G,DEFAULT_PREDICTION_VERSION:()=>H,DataApiType:()=>_e,DataEndpoint:()=>Qe,DepthMap:()=>tt,Endpoint:()=>ve,EndpointState:()=>C,EvaluationStatus:()=>Ke,ExportedBy:()=>Ne,EyePop:()=>lt,EyePopDataWebSocketError:()=>Xe,EyepopLineDecoder:()=>z,ForwardOperatorType:()=>V,InferenceType:()=>Z,LoadFromAssetUuidJob:()=>pe,LoadFromGroupJob:()=>ce,LoadFromJob:()=>se,LoadMediaStreamJob:()=>le,ModelExportStatus:()=>ze,ModelFormat:()=>Je,ModelPrecisionType:()=>$e,ModelStatus:()=>Le,ModelTask:()=>Re,ModelTrainingStage:()=>We,ModelType:()=>Ue,MotionModel:()=>B,PointCloud:()=>at,PopComponentType:()=>F,PredictionVersion:()=>$,QUATERNION_TOLERANCE:()=>D,Semaphore:()=>he,Stream:()=>R,TaskMode:()=>Ve,TaskType:()=>Fe,TranscodeMode:()=>Oe,TransientPopId:()=>ge,UploadGroupJob:()=>re,UploadJob:()=>oe,UserReview:()=>Pe,VideoMode:()=>K,VlmAbilityStatus:()=>Ze,WebrtcBase:()=>ee,WebrtcWhep:()=>ut,WebrtcWhip:()=>te,WorkerEndpoint:()=>we,WorkflowPhase:()=>qe,accessTokenCredential:()=>x,apiKeyCredential:()=>w,cloudOfDepth:()=>ct,cloudOfObject:()=>rt,cloudsOfPrediction:()=>pt,decodeDepthMap:()=>it,decodePointCloud:()=>st,default:()=>ht,encodeMultipartFormData:()=>W,getBaseUrl:()=>ke,randomMultipartBoundary:()=>M,readableStreamFromString:()=>N,resolveAuth:()=>y,validateCamera:()=>J,validatePop:()=>X}),e.exports=(n=g,d(s({},"__esModule",{value:!0}),n));var _=new Set(["error","failed","stopped","pipeline_error","unknown"]),k=e=>new Promise(t=>setTimeout(t,e));function S(e){if(e.pipeline_uuid)return e.pipeline_uuid;const t=e.pipelines?.[0];return t?.id||t?.pipeline_id||null}function T(e,t){if(t.includes("application/json")){const t=JSON.parse(e);if(t&&"object"==typeof t)return!(!t.message||t.session_status)||"running"==t.session_status}return t.includes("text/plain")&&e.includes("I'm fine")}function E(e){if(e.access_token_expires_at){const t=Date.parse(e.access_token_expires_at);return Number.isNaN(t)?null:t}return e.access_token_expires_in?Date.now()+1e3*e.access_token_expires_in:null}async function P(e){if((e.headers.get("content-type")||"").includes("application/json"))try{const t=I(A(await e.clone().json()));if(t)return t}catch(e){}const t=await e.text();return I(t)||t}function A(e){if("string"==typeof e)try{return A(JSON.parse(e))}catch(t){const i=e.replace(/\\"/g,'"');if(i!=e)try{return A(JSON.parse(i))}catch(e){}return e}return e}async function j(e){return A(await e.json())}function I(e){if("string"==typeof(e=A(e)))return e;if(!e||"object"!=typeof e)return null;const t=e,i=A(t.error),n=I(i)||("string"==typeof i?i:null),a=[t.code,n,t.message,t.details].filter(e=>"string"==typeof e&&e.length>0).join(": ");if(a)return a;if(t.pipeline_error)return I(t.pipeline_error);if(i&&"object"==typeof i)return I(i);try{return JSON.stringify(e)}catch(e){return null}}var O=class{constructor(e){this.options=e}async resolve(){const e=this.options.sessionUuid?await this.getPermanentComputeSession(this.options.sessionUuid):await this.getOnDemandComputeSession(),t=function(e){if(e.pipeline_error){const i=[(t=e.pipeline_error).code,t.message,t.details].filter(e=>"string"==typeof e&&e.length>0).join(": ");return i?`Pipeline failed for compute session ${e.session_uuid}: ${i}`:`Pipeline failed for compute session ${e.session_uuid}`}var t;return"pipeline_error"==e.session_status?`Pipeline failed for compute session ${e.session_uuid}`:null}(e);if(t)throw new Error(t);const i=await this.sessionAuthorizationHeader(e);await this.waitUntilReady(e,i);const n=S(e);if(this.options.pop&&!n)throw new Error("Compute session did not provide a pipeline for the requested pop");return{session:e,pipelineId:n,accessToken:e.access_token||null,accessTokenValidUntil:E(e)}}async getOnDemandComputeSession(){let e=null;const t=`${this.options.computeUrl}/v1/sessions`,i={Authorization:await this.options.authorizationHeader()};let n;if(!this.options.pop){this.options.requestLogger?.debug("fetching sessions from: %s",t);const a=await this.options.httpClient.fetch(t,{headers:i});if(404==a.status)n=[];else{if(200!=a.status){const e=await P(a);throw new Error(`Unexpected status ${a.status} fetching compute sessions: ${e}`)}n=await j(a)}if(n.length>0){this.options.logger?.debug(`User has ${n.length} sessions, inspecting for usable session`);for(let t of n)if(!(_.has(t.session_status)||t.persistent||this.options.sessionName&&t.session_name!==this.options.sessionName)){e=t,this.options.logger?.debug(`Use active session ${t.session_uuid} with pipeline ${S(t)}`);break}}}if(!e){this.options.requestLogger?.debug("creating a new session at: %s",t);const a=function(e){const t={};return e.sessionName&&(t.session_name=e.sessionName),e.pipelineImage&&(t.pipeline_image=e.pipelineImage),e.pipelineVersion&&(t.pipeline_version=e.pipelineVersion),e.pop&&(t.pop=e.pop),Object.keys(t).length>0?JSON.stringify(t):void 0}(this.options),o={headers:{...i,...a?{"Content-Type":"application/json"}:{}},method:"POST"};a&&(o.body=a);const s="wait=true",r=await this.options.httpClient.fetch(`${t}?${s}`,o);if(200!=r.status){const e=await P(r);throw new Error(`Unexpected status ${r.status} creating a compute session: ${e}`)}if(n=await j(r),0==n.length)throw new Error("Unexpected, no compute session after attempt to create one");e=n[0]||null}if(!e)throw new Error("unexpected undefined session");return e}async getPermanentComputeSession(e){let t=null;const i=`${this.options.computeUrl}/v1/sessions/${e}`;this.options.requestLogger?.debug("fetching session from: %s",i);const n={Authorization:await this.options.authorizationHeader()};let a=await this.options.httpClient.fetch(i,{headers:n});if(404==a.status)throw new Error(`Unexpected status ${a.status} compute sessions ${e} not found`);if(200!=a.status){const e=await P(a);throw new Error(`Unexpected status ${a.status} fetching compute sessions: ${e}`)}return t=await j(a),t}async sessionAuthorizationHeader(e){return e.access_token?`Bearer ${e.access_token}`:this.options.authorizationHeader()}async waitUntilReady(e,t){let i=!1;const n=Date.now()+this.options.readyTimeoutMs;for(;!i;){const a=`${e.session_endpoint}/health`,o=await this.options.httpClient.fetch(a,{headers:{Authorization:t,Accept:"application/json"}});if(200==o.status){const t=o.headers.get("content-type")||"",a=await o.text();try{i=T(a,t)}catch(t){this.options.logger?.debug(`session ${e.session_uuid} health check returned invalid JSON, wait and poll for update`)}if(!i&&Date.now()>n)throw new Error(`Created session ${e.session_uuid} did not become healthy after ${this.options.readyTimeoutMs/1e3} seconds`);i||(this.options.logger?.debug(`session ${e.session_uuid} health check not ready, wait and poll for update`),await k(250))}else{if(Date.now()>n)throw new Error(`Created session ${e.session_uuid} did not become healthy after ${this.options.readyTimeoutMs/1e3} seconds`);this.options.logger?.debug(`session ${e.session_uuid} health check status ${o.status}, wait and poll for update`),await k(250)}}}},C=(e=>(e.Idle="Idle",e.Busy="Busy",e.Authenticating="Authenticating",e.FetchConfig="FetchConfig",e.Error="Error",e.NotAvailable="NotAvailable",e))(C||{}),U=i(182),R=class e{constructor(e,t){this.iterator=e,this.controller=t}static iterFromReadableStream(e,t,i){let n=!1;return async function*(){if(n)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let a=!1;try{for await(const t of async function*(){const t=new z,i=function(e){if(e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();const t=e.getReader();return{async next(){try{const e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){const e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}(await e);for await(let e of i)for(const i of t.decode(e))yield i;for(const e of t.flush())yield e}())if(!a&&t){const e=JSON.parse(t),n=e.event;void 0!==n?await i(n):yield e}a=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{a||t.abort()}}()}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],i=[],n=this.iterator(),a=e=>({next:()=>{if(0===e.length){const e=n.next();t.push(e),i.push(e)}return e.shift()}});return[new e(()=>a(t),this.controller),new e(()=>a(i),this.controller)]}},L=class e{constructor(){this.buffer=[],this.trailingCR=!1}decode(t){let i=this.decodeText(t);if(this.trailingCR&&(i="\r"+i,this.trailingCR=!1),i.endsWith("\r")&&(this.trailingCR=!0,i=i.slice(0,-1)),!i)return[];const n=e.NEWLINE_CHARS.has(i[i.length-1]||"");let a=i.split(e.NEWLINE_REGEXP);return 1!==a.length||n?(this.buffer.length>0&&(a=[this.buffer.join("")+a[0],...a.slice(1)],this.buffer=[]),n||(this.buffer=[a.pop()||""]),a):(this.buffer.push(a[0]),[])}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==a){if(e instanceof a)return e.toString();if(e instanceof Uint8Array)return a.from(e).toString();throw new Error(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new Error(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new Error("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){if(!this.buffer.length&&!this.trailingCR)return[];const e=[this.buffer.join("")];return this.buffer=[],this.trailingCR=!1,e}};L.NEWLINE_CHARS=new Set(["\n","\r","\v","\f","","","","
","\u2028","\u2029"]),L.NEWLINE_REGEXP=/\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;var z=L;function N(e){return new ReadableStream({start(t){t.enqueue(a.from(e)),t.close()}})}function M(){return`----formdata-boundary-${(0,U.v4)()}`}function W(e,t){const i=new TextEncoder;let n=0,a=null;return new ReadableStream({async pull(o){if(a){const{done:e,value:t}=await a.read();if(!e)return void o.enqueue(t);a=null,o.enqueue(i.encode("\r\n")),n++}if(n>=e.length)return o.enqueue(i.encode(`--${t}--\r\n`)),void o.close();const s=e[n];let r=`--${t}\r\nContent-Disposition: form-data; name="${s.name}"\r\n`;s.contentType&&(r+=`Content-Type: ${s.contentType}\r\n`),r+="\r\n",o.enqueue(i.encode(r)),"string"==typeof s.content?(o.enqueue(i.encode(s.content)),o.enqueue(i.encode("\r\n")),n++):a=function(e){if(e instanceof ReadableStream)return e;if(e instanceof Blob)return e.stream();const t=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);return new ReadableStream({start(e){e.enqueue(t),e.close()}})}(s.content).getReader()},async cancel(t){await(a?.cancel(t));const i=a?n+1:n;await Promise.all(e.slice(i).map(e=>async function(e,t){e instanceof ReadableStream&&await e.cancel(t)}(e.content,t)))}})}var D=.001;function q(e){return void 0===e||Number.isFinite(e)}function J(e){if(void 0!==e.intrinsics&&void 0!==e.hfovDegrees)throw new Error("camera.intrinsics and camera.hfovDegrees are alternatives, supply one");if(void 0===e.intrinsics&&void 0===e.hfovDegrees)throw new Error("camera requires either camera.intrinsics or camera.hfovDegrees");if(void 0!==e.hfovDegrees){if(!(e.hfovDegrees>0&&e.hfovDegrees<180))throw new Error("camera.hfovDegrees must be a horizontal field of view in (0, 180) degrees")}else{const t=e.intrinsics;for(const[e,i]of[["fx",t.fx],["fy",t.fy]])if(!(i>0&&Number.isFinite(i)))throw new Error(`camera.intrinsics.${e} must be a positive, finite focal length`);for(const[e,i,n]of[["cx",t.cx,"width"],["cy",t.cy,"height"]])if(!(i>=0&&i<=1))throw new Error(`camera.intrinsics.${e} must be within [0, 1] of the frame ${n}`)}if(void 0!==e.distortion)for(const t of["k1","k2","p1","p2","k3"])if(!q(e.distortion[t]))throw new Error(`camera.distortion.${t} must be a finite number`);if(void 0!==e.extrinsics){const t=e.extrinsics.translation;if(void 0!==t)for(const e of["x","y","z"])if(!Number.isFinite(t[e]))throw new Error(`camera.extrinsics.translation.${e} must be a finite number`);const i=e.extrinsics.rotation;if(void 0!==i){const e=Math.sqrt(i.w**2+i.x**2+i.y**2+i.z**2);if(!(Math.abs(e-1)<=D))throw new Error("camera.extrinsics.rotation must be a unit quaternion")}}}var $=(e=>(e[e.V1=1]="V1",e[e.V2=2]="V2",e))($||{}),H=2,K=(e=>(e.STREAM="stream",e.BUFFER="buffer",e))(K||{}),F=(e=>(e.FORWARD="forward",e.INFERENCE="inference",e.TRACKING="tracking",e.CONTOUR_FINDER="contour_finder",e.COMPONENT_FINDER="component_finder",e))(F||{}),V=(e=>(e.FULL="full",e.CROP="crop",e.CROP_WITH_FULL_FALLBACK="crop_with_full_fallback",e))(V||{}),Z=(e=>(e.IMAGE_CLASSIFICATION="image_classification",e.OBJECT_DETECTION="object_detection",e.KEY_POINTS="key_points",e.OCR="ocr",e.MESH="mesh",e.FEATURE_VECTOR="feature_vector",e.SEMANTIC_SEGMENTATION="semantic_segmentation",e.SEGMENTATION="segmentation",e))(Z||{}),B=(e=>(e.RANDOM_WALK="random_walk",e.CONSTANT_VELOCITY="constant_velocity",e.CONSTANT_ACCELERATION="constant_acceleration",e))(B||{}),G=(e=>(e.ALL_PIXELS="all_pixels",e.POLYGON="polygon",e.CONVEX_HULL="convex_hull",e.HOUGH_CIRCLES="hough_circles",e.CIRCLE="circle",e.TRIANGLE="triangle",e.RECTANGLE="rectangle",e))(G||{});function X(e){if(void 0!==e.depthMap&&void 0===e.depthMap.ability==(void 0===e.depthMap.abilityUuid))throw new Error("depthMap requires exactly one of ability or abilityUuid");void 0!==e.defaults?.camera&&J(e.defaults.camera)}var Y=i(182),Q=h(i(942)),ee=class e{constructor(e,t,i,n,a,o){this._getSession=e,this._client=t,this._requestLogger=o,this._ingressId=i,this._urlPath=`${n}/${this._ingressId}`,this._is_pipeline_direct=a,this._pc=null,this._eTag="",this._location=null,this._queuedCandidates=[],this._offerData=null}async close(){const e=this._pc;if(this._pc=null,e)return e.close()}ingressId(){return this._ingressId}gresUrl(e,t=null){let i,n;if(this._is_pipeline_direct){if(!e.pipelineId)throw new Error("cannot connect with is_pipeline_direct=true but !session.pipelineId");i=Q.default.join("pipelines",e.pipelineId,this._urlPath)}else i=this._urlPath;return t&&(i=Q.default.join(i,t)),n=e.baseUrl?.endsWith("/")?e.baseUrl:e.baseUrl+"/",new URL(i,n)}async onLocalOffer(t){if(!this._pc)throw new Error("onLocalOffer no peer connection");if(!t.sdp)throw new Error("onLocalOffer no sdp");this._offerData=e.parseOffer(t.sdp),await this._pc.setLocalDescription(t);const i=await this._getSession(),n=this.gresUrl(i),a={...i.authenticationHeaders(),"Content-Type":"application/sdp"},o=await this._client.fetch(n,{headers:a,method:"POST",body:t.sdp});return o.status>=300?Promise.reject(`unknown status code for POST '${n}': ${o.status} (${o.statusText})`):(this._eTag=o.headers.get("ETag")??"",this._location=o.headers.get("Location"),await this.onRemoteAnswer(new RTCSessionDescription({type:"answer",sdp:await o.text()})))}async sendLocalCandidates(t){if(!this._offerData)throw new Error("sendLocalCandidates no offerData");const i=await this._getSession(),n=this.gresUrl(i,this._location),a={...i.authenticationHeaders(),"Content-Type":"application/trickle-ice-sdpfrag","If-Match":this._eTag},o=await this._client.fetch(n,{headers:a,method:"PATCH",body:e.generateSdpFragment(this._offerData,t)});return o.status>=300?Promise.reject(`unknown status code for PATCH '${n}': ${o.status} (${o.statusText})`):this}async onLocalCandidate(e){return null!==e.candidate&&(""===this._eTag?this._queuedCandidates.push(e.candidate):await this.sendLocalCandidates([e.candidate])),this}static linkToIceServers(e){return(null!==e?e.split(", ").map(e=>{let t=e.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i);return t||(t=e.match(/^(.+?); rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i)),t?{urls:[t[1]],username:te.unquoteCredential(t[3]),credential:te.unquoteCredential(t[4])}:null}):[]).filter(function(e){return null!=e})}static editAnswer(e,t,i,n,a,o){const s=e.split("m=");for(let e=0;e<s.length;e++){const r=s[e];r&&r.startsWith("video")?s[e]=te.setVideoBitrate(te.setCodec(r,t),n):r&&r.startsWith("audio")&&(s[e]=te.setAudioBitrate(te.setCodec(r,i),a,o))}return s.join("m=")}static setCodec(e,t){const i=e.split("\r\n"),n=[],a=[];for(const e of i)e.startsWith("a=rtpmap:")?t&&e.toLowerCase().includes(t)&&(a.push(e.slice(9).split(" ")[0]),n.push(e)):n.push(e);const o=[];for(const e of n)e.startsWith("a=fmtp:")?a.includes(e.slice(7).split(" ")[0])&&o.push(e):e.startsWith("a=rtcp-fb:")?a.includes(e.slice(10).split(" ")[0])&&o.push(e):o.push(e);return o.join("\r\n")}static setVideoBitrate(e,t){let i=e.split("\r\n");for(let e=0;e<i.length;e++){const n=i[e];if(n&&n.startsWith("c=")){i=[...i.slice(0,e+1),"b=TIAS:"+(1024*t).toString(),...i.slice(e+1)];break}}return i.join("\r\n")}static setAudioBitrate(e,t,i){let n="",a=e.split("\r\n");for(let e=0;e<a.length;e++){const t=a[e];if(t&&t.startsWith("a=rtpmap:")&&t.toLowerCase().includes("opus/")){n=t.slice(9).split(" ")[0]||"";break}}if(""===n)return e;for(let e=0;e<a.length;e++){const o=a[e];o&&o.startsWith("a=fmtp:"+n+" ")&&(a[e]=i?"a=fmtp:"+n+" minptime=10;useinbandfec=1;maxaveragebitrate="+(1024*(t??0)).toString():"a=fmtp:"+n+" maxplaybackrate=48000;stereo=1;sprop-stereo=1;maxaveragebitrate"+(1024*(t??0)).toString())}return a.join("\r\n")}static parseOffer(e){let t=[],i="",n="";for(const a of e.split("\r\n"))a.startsWith("m=")?t.push(a.slice(2)):""===i&&a.startsWith("a=ice-ufrag:")?i=a.slice(12):""===n&&a.startsWith("a=ice-pwd:")&&(n=a.slice(10));return{iceUfrag:i,icePwd:n,medias:t}}static generateSdpFragment(e,t){const i=new Map;for(const e of t)if(null!==e.sdpMLineIndex){const t=e.sdpMLineIndex;let n=i.get(t);void 0===n&&(n=[],i.set(t,n)),n.push(e)}let n="a=ice-ufrag:"+e.iceUfrag+"\r\na=ice-pwd:"+e.icePwd+"\r\n",a=0;for(const t of e.medias){let e=i.get(a);if(void 0!==e){n+="m="+t+"\r\na=mid:"+a+"\r\n";for(const t of e)n+="a="+t.candidate+"\r\n"}a++}return n}static unquoteCredential(e){return e?JSON.parse(`"${e}"`):""}},te=class extends ee{constructor(e,t,i,n,a){super(t,i,(0,Y.v4)().toString(),"liveIngress/whip",n,a),this._stream=e}async start(){const e=await this._getSession(),t=this.gresUrl(e),i=await this._client.fetch(t,{headers:e.authenticationHeaders(),method:"GET"});return i.status>=300?Promise.reject(`unknown status code for GET '${t}': ${i.status} (${i.statusText})`):await this.onIceServers(i)}async stream(){return this._stream?Promise.resolve(this._stream):Promise.reject("fetching stream failed")}async onRemoteAnswer(e){if(!this._pc)throw new Error("onLocalOffer no peer connection");return await this._pc.setRemoteDescription(new RTCSessionDescription(e)),0!==this._queuedCandidates.length&&(await this.sendLocalCandidates(this._queuedCandidates),this._queuedCandidates=[]),this}async onIceServers(e){if(!this._stream)throw new Error("onIceServers no stream");const t=this._stream,i=new RTCPeerConnection({iceServers:ee.linkToIceServers(e.headers.get("Link"))});return this._pc=i,i.onicecandidate=e=>this.onLocalCandidate(e),new Promise(async(e,n)=>{i.oniceconnectionstatechange=()=>{switch(i.iceConnectionState){case"failed":case"disconnected":n(`peer connection: ${i.iceConnectionState}`);break;case"connected":e(this)}},t.getTracks().forEach(e=>{this._requestLogger.debug("onIceServers our stream has track: %s",e),i.addTrack(e,t)}),t.addEventListener("addtrack",e=>{this._requestLogger.debug("onIceServers got lazy track: ",e.track),i.addTrack(e.track,t)}),await this.onLocalOffer(await i.createOffer())})}async close(){const e=this._stream;return this._stream=null,e&&e.getTracks().forEach(e=>{e.stop()}),super.close()}},ie=class{constructor(e,t,i,n,a=H){this._responseStream=null,this._controller=new AbortController,this._getSession=t,this._params=e,this._client=i,this._requestLogger=n,this._version=a}[Symbol.asyncIterator](){if(!this._responseStream)throw Error("logical bug");return R.iterFromReadableStream(this._responseStream,this._controller,async e=>await this.onEvent(e))}async startJob(){return Promise.reject("abstract class")}async onEvent(e){return"error"==e.type?Promise.reject(`Error event for source ${e.source_id}: ${e.message}`):Promise.resolve()}start(e,t){return this._responseStream=new Promise(async(i,n)=>{try{let e=1;for(;;)try{const a=await this.startJob();if(401==a.status){if(t(a.status),!e--){n(`response ${a.status}: ${a.statusText}`);break}this._requestLogger.info("received 401 response, attempt to reauthorize once")}else{if(404!=a.status){if(a.ok){if(a.body){i(a.body);break}{const e=await a.text();if(e){i(N(e));break}n("response body is empty");break}}n(`upload error ${a.status}: ${await a.text()}`);break}if(t(a.status),!e--){n(`response ${a.status}: ${a.statusText}`);break}this._requestLogger.info("received 404 response, attempt to restart pop")}}catch(i){if(!e--){t(500),n(i);break}this._requestLogger.info("unknown, attempt to restart pop (as if we received 404)",i),t(404)}}catch(e){n(e)}finally{e()}}),this}cancel(){this._controller.abort("cancelled")}};ie.n=0;var ne,ae,oe=class extends ie{get[Symbol.toStringTag](){return"uploadJob"}constructor(e,t,i,n,a,o,s,r,c){super(a,o,s,r),this._uploadStream=e,this._uploadBodyFactory=c,this._mimeType=t,this._size=i,this._videoMode=n,this._needsFullDuplex=!s.isFullDuplex()&&t.startsWith("video/")&&"stream"==n}async uploadBody(){return this._uploadBodyFactory?await this._uploadBodyFactory():this._uploadStream}async onEvent(e){if("prepared"==e.type){if(!e.source_id)return Promise.reject("did not get a prepared sourceId to simulate full duplex");const t=await this._getSession();if(!t.baseUrl)return Promise.reject("session.baseUrl must not ne null");let i;const n=new URLSearchParams({mode:"queue",processing:"async",sourceId:e.source_id});if(void 0!==this._videoMode&&n.set("videoMode",this._videoMode),void 0!==this._version&&n.set("version",this._version.toString()),this._params.motionDetect)for(const[e,t]of Object.entries(this._params.motionDetect))n.set(e,t);const a=`${t.baseUrl.replace(/\/+$/,"")}/pipelines/${t.pipelineId}/source?${n.toString()}`;if(this._params.componentParams||this._params.roi||this._params.camera){const e=new FormData;if(this._params.componentParams){const t=new Blob([JSON.stringify(this._params.componentParams)],{type:"application/json"});e.append("params",t)}if(this._params.roi){const t=new Blob([JSON.stringify(this._params.roi)],{type:"application/json"});e.append("roi",t)}if(this._params.fps){const t=new Blob([JSON.stringify(this._params.fps)],{type:"application/json"});e.append("fps",t)}if(this._params.camera){const t=new Blob([JSON.stringify(this._params.camera)],{type:"application/json"});e.append("camera",t)}const n=await new Response(await this.uploadBody()).blob();e.append("file",n);const o={...t.authenticationHeaders(),Accept:"application/jsonl"};i=this._client.fetch(a,{headers:o,method:"POST",body:e,signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}else{const e={...t.authenticationHeaders(),Accept:"application/jsonl","Content-Type":this._mimeType};this._size&&(e["Content-Length"]=`${this._size}`),i=this._client.fetch(a,{headers:e,method:"POST",body:await this.uploadBody(),signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}i.then(async e=>{204!=e.status&&this._requestLogger.debug(`unexpected status ${e.status} (${await e.text()}) for POST ${a}`)}).catch(e=>{this._requestLogger.debug(`error ${e} for POST ${a}`)})}return Promise.resolve()}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not be null");let t;if(this._needsFullDuplex){const i=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/prepareSource?timeout=10s`,n={...e.authenticationHeaders(),Accept:"application/jsonl"};t=await this._client.fetch(i,{headers:n,method:"POST",signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}else{const i=new URLSearchParams({mode:"queue",processing:"sync"});if(void 0!==this._videoMode&&i.set("videoMode",this._videoMode),void 0!==this._version&&i.set("version",this._version.toString()),this._params.motionDetect)for(const[e,t]of Object.entries(this._params.motionDetect))i.set(e,t);const n=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?${i.toString()}`;if(this._params.componentParams||this._params.roi||this._params.camera){const i=new FormData;if(this._params.componentParams){const e=new Blob([JSON.stringify(this._params.componentParams)],{type:"application/json"});i.append("params",e)}if(this._params.roi){const e=new Blob([JSON.stringify(this._params.roi)],{type:"application/json"});i.append("roi",e)}if(this._params.fps){const e=new Blob([JSON.stringify(this._params.fps)],{type:"application/json"});i.append("fps",e)}if(this._params.camera){const e=new Blob([JSON.stringify(this._params.camera)],{type:"application/json"});i.append("camera",e)}const a=await new Response(await this.uploadBody()).blob();i.append("file",a);const o={...e.authenticationHeaders(),Accept:"application/jsonl"};t=await this._client.fetch(n,{headers:o,method:"POST",body:i,signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}else{const i={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":this._mimeType};this._size&&(i["Content-Length"]=`${this._size}`),t=await this._client.fetch(n,{headers:i,method:"POST",body:await this.uploadBody(),signal:this._controller.signal,duplex:"half"})}}return t}},se=class extends ie{constructor(e,t,i,n,a){super(t,i,n,a),this._location=e}get[Symbol.toStringTag](){return"loadFromJob"}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not ne null");const t={sourceType:"URL",url:this._location,params:this._params.componentParams,roi:this._params.roi,fps:this._params.fps,camera:this._params.camera,version:this._version};this._params.motionDetect&&Object.assign(t,this._params.motionDetect);const i={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},n=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=queue&processing=sync`;return await this._client.fetch(n,{headers:i,method:"PATCH",body:JSON.stringify(t),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}},re=class extends ie{get[Symbol.toStringTag](){return"uploadGroupJob"}constructor(e,t,i,n,a){if(super(t,i,n,a),0===e.length)throw new Error("upload group requires at least one source");this._sources=e}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject(new Error("session.baseUrl must not be null"));const t=new URLSearchParams({mode:"queue",processing:"sync"});if(void 0!==this._version&&t.set("version",this._version.toString()),this._params.motionDetect)for(const[e,i]of Object.entries(this._params.motionDetect))t.set(e,i);const i=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?${t.toString()}`,n=[];this._params.componentParams&&n.push({name:"params",contentType:"application/json",content:JSON.stringify(this._params.componentParams)}),this._params.roi&&n.push({name:"roi",contentType:"application/json",content:JSON.stringify(this._params.roi)}),this._params.fps&&n.push({name:"fps",contentType:"application/json",content:JSON.stringify(this._params.fps)}),this._params.camera&&n.push({name:"camera",contentType:"application/json",content:JSON.stringify(this._params.camera)});for(const e of this._sources)n.push({name:"file",contentType:e.mimeType,content:e.stream});const a=M(),o={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":`multipart/form-data; boundary=${a}`};return await this._client.fetch(i,{headers:o,method:"POST",body:W(n,a),signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}},ce=class extends ie{get[Symbol.toStringTag](){return"loadFromGroupJob"}constructor(e,t,i,n,a){if(super(t,i,n,a),0===e.length)throw new Error("load from group requires at least one url");this._urls=e}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject(new Error("session.baseUrl must not be null"));const t={sourceType:"GROUP",sources:this._urls.map(e=>({sourceType:"URL",url:e})),version:this._version};this._params.componentParams&&(t.params=this._params.componentParams),this._params.roi&&(t.roi=this._params.roi),this._params.camera&&(t.camera=this._params.camera),this._params.motionDetect&&Object.assign(t,this._params.motionDetect);const i={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},n=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=queue&processing=sync`;return await this._client.fetch(n,{headers:i,method:"PATCH",body:JSON.stringify(t),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}},pe=class extends ie{constructor(e,t,i,n,a){super(t,i,n,a),this._assetUuid=e}get[Symbol.toStringTag](){return"loadFromAssetUuidJob"}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not ne null");const t={sourceType:"ASSET_UUID",assetUuid:this._assetUuid,params:this._params.componentParams,roi:this._params.roi,fps:this._params.fps,camera:this._params.camera,version:this._version};this._params.motionDetect&&Object.assign(t,this._params.motionDetect);const i={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},n=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=queue&processing=sync`;return await this._client.fetch(n,{headers:i,method:"PATCH",body:JSON.stringify(t),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}},le=class extends ie{constructor(e,t,i,n,a){super(t,i,n,a),this._mediaStream=e}get[Symbol.toStringTag](){return"loadLiveIngressJob"}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not ne null");const t=new te(this._mediaStream,async()=>e,this._client,!0,this._requestLogger);t.start().then(e=>{this._requestLogger.debug("direct whip for ingressId=%s successful",t.ingressId())}).catch(e=>{this._controller.abort(e)});const i={sourceType:"WHIP",whipIngressId:t.ingressId(),params:this._params.componentParams,roi:this._params.roi,fps:this._params.fps,camera:this._params.camera,version:this._version};this._params.motionDetect&&Object.assign(i,this._params.motionDetect);const n={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},a=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=preempt&processing=sync`;return await this._client.fetch(a,{headers:n,method:"PATCH",body:JSON.stringify(i),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}};if("document"in globalThis&&"implementation"in globalThis.document)ne=async(e,t)=>{throw new DOMException("resolving a path to a file is not supported in browser")};else{let mt=function(e){return new ReadableStream({async pull(t){const{value:i,done:n}=await e.next();n?t.close():t.enqueue(new Uint8Array(i))}})};async function*ft(e){for await(const t of e)yield t}ne=async(e,t)=>{const n=v(),a=i(122),o=ft((await a.open(e.path,"r")).createReadStream());return{stream:mt(o),mimeType:e.mimeType?e.mimeType:n.lookup(e.path)||"image/*"}}}function ue(e,t){const i=e instanceof Request?e.url:e;return`${e instanceof Request?e.method:t?.method||(void 0!==t?.body?"POST":"GET")} ${i}`}if("document"in globalThis&&"implementation"in globalThis.document){class vt{constructor(e){this._logger=e}async fetch(e,t){const i=ue(e,t);this._logger.debug(`Browser fetch() BEFORE ${i}`);const n=await fetch(e,t);return this._logger.debug(`AFTER ${i} -> ${n.status}`),n}async close(){}isFullDuplex(){return!1}}ae=async e=>new vt(e)}else{class gt{constructor(e,t,i){this._agent=e,this._fetch=t,this._logger=i}async fetch(e,t){t||(t={}),t.dispatcher=this._agent;const i=ue(e,t);this._logger.debug(`Node fetch() BEFORE ${i}`);const n=await this._fetch(e,t);return this._logger.debug(`AFTER ${i} -> ${n.status}`),n}async close(){return this._agent.close()}isFullDuplex(){return!1}}ae=async e=>{const t=i(360),n=new t.Agent({keepAliveTimeout:1e4,connections:5,pipelining:0});return e.debug("Using node fetch with undici agent as http client"),new gt(n,t.fetch,e)}}var de,he=class{constructor(e){this.promiseResolverQueue=[],this.permits=e}getPermits(){return this.permits}async wait(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(e=>this.promiseResolverQueue.push(e))}async acquire(){return this.wait()}async waitFor(e){if(this.permits>0)return this.permits-=1,Promise.resolve(!0);let t=e=>{};const i=new Promise(e=>{t=e});return this.promiseResolverQueue.push(t),setTimeout(()=>{const e=this.promiseResolverQueue.indexOf(t);-1!==e?this.promiseResolverQueue.splice(e,1):console.warn("Semaphore.waitFor couldn't find its promise resolver in the queue"),t(!1)},e),i}tryAcquire(){return this.permits>0&&(this.permits-=1,!0)}drainPermits(){if(this.permits>0){const e=this.permits;return this.permits=0,e}return 0}signal(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Semaphore.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}release(){this.signal()}async execute(e){await this.wait();try{return await e()}finally{this.signal()}}},me=i(713),fe=i(262);de="document"in globalThis&&"implementation"in globalThis.document?async(e,t)=>{if(null==t.eyepopUrl)return Promise.reject("options.eyepopUrl cannot be null");const i={clientId:e.clientId,domain:e.domain,authorizationParams:{scope:e.scope,audience:e.audience}},n=await(0,fe.createAuth0Client)(i);await n.isAuthenticated()||await n.loginWithPopup();const a=await n.getTokenSilently();if(!a)return Promise.reject("auth0 login failed");let o;const s=t;return o=void 0!==s.popId?{eyepopUrl:t.eyepopUrl,accessToken:a,validUntil:Date.now()+36e5,popId:s.popId,baseUrl:void 0,pipelineId:void 0,authenticationHeaders:()=>({Authorization:`Bearer ${a}`})}:{eyepopUrl:t.eyepopUrl,accessToken:a,validUntil:Date.now()+36e5},o}:(e,t)=>Promise.reject("auth0 login not supported server-side");var ve=class{constructor(e){let t;this._options=e,this._token=null,this._expire_token_time=null,this._client=null,this._statusRetryHandlers=new Map,this._statusRetryHandlers.set(401,this.statusHandler401),this._limit=new he(this._options.jobQueueLength??1024),this._state="Idle",this._message=null,this._stateChangeHandler=null,t=e.logger?e.logger:(0,me.pino)(),this._logger=t.child({module:"eyepop"}),this._requestLogger=this._logger.child({module:"requests"})}setStatusRetryHandlers(e=void 0){this._statusRetryHandlers=new Map(e),this._statusRetryHandlers.set(401,this.statusHandler401)}eyepopUrl(){return this._options.eyepopUrl?this._options.eyepopUrl.replace(/\/+$/,""):"https://compute.eyepop.ai"}eyepopWebApiUrl(){return this._options.eyepopUrl?this._options.eyepopUrl.replace(/\/+$/,"").replace(/compute\./,"web-api."):"https://api.eyepop.ai"}pendingJobs(){return(this._options.jobQueueLength??1024)-this._limit.getPermits()}state(){return this._state}lastMessage(){return this._message}onStateChanged(e){return this._stateChangeHandler=e,this}updateState(e=void 0,t=void 0){const i=this._state;null==e&&(e=this._limit.getPermits()==this._options.jobQueueLength?"Idle":"Busy"),this._state=e,this._message=t||null,this._stateChangeHandler&&this._stateChangeHandler(i,this._state)}async connect(){if(this._client)return this._logger.warn("endpoint already connected"),this;if(!this._options.eyepopUrl)return Promise.reject("option eyepopUrl or environment variable EYEPOP_URL is required");const e=y(this._options);if(void 0===e)return Promise.reject("cannot connect without defined auth option");if(void 0!==e.session)this._token=e.session.accessToken,this._expire_token_time=e.session.validUntil/1e3;else if(void 0!==e.oAuth2);else if(void 0!==x(e));else if(void 0!==w(e));else if(void 0===e.isLocal)return Promise.reject("option apiKey/accessToken or environment variable EYEPOP_API_KEY is required");return void 0!==this._options.platformSupport?.createHttpClient?this._client=await this._options.platformSupport.createHttpClient(this._requestLogger):this._client=await ae(this._requestLogger),await this.reconnect()}async disconnect(e=!0){if(e&&this._limit)for(let e=0;e<this._options.jobQueueLength;e++)await this._limit.acquire();this._limit=new he(this._options.jobQueueLength??1024),this._client&&(await this._client.close(),this._client=null)}async session(){return await this.currentAccessToken(),null==this._token||null==this._expire_token_time?Promise.reject("endpoint not connected"):{eyepopUrl:this._options.eyepopUrl,accessToken:this._token,validUntil:1e3*this._expire_token_time}}statusHandler401(e){this._token=null,this._expire_token_time=null}async fetchWithRetry(e,t=1){for(;;)try{const i=await e();if(i.ok)return i;{const e=this._statusRetryHandlers.get(i.status);if(null==e)return i;if(e(i.status),!t--)return i;this._requestLogger.info("received %d response, retry",i.status)}}catch(e){const i=this._statusRetryHandlers.get(404);if(null==i)return Promise.reject(`error ${e}`);if(i(e),!t--)return Promise.reject(`error ${e}`);this._requestLogger.info("error %s, retry",e)}}async reconnect(){throw new Error("reconnect() not implemented")}async authorizationHeader(){return void 0!==y(this._options)?.isLocal?"Implicit":`Bearer ${await this.currentAccessToken()}`}async currentAccessToken(){const e=Date.now()/1e3;if(!this._token||this._expire_token_time<e){this.updateState("Authenticating");try{const t=y(this._options);if(!this._client)return Promise.reject("endpoint not connected");if(void 0!==t?.isLocal)this._token="implicit",this._expire_token_time=Number.MAX_VALUE;else{if(void 0!==t?.session)return Promise.reject("temporary access token expired");if(void 0!==t?.oAuth2&&this._options.eyepopUrl){const e=await de(t.oAuth2,this._options);this._token=e.accessToken,this._expire_token_time=e.validUntil/1e3}else if(void 0!==x(t))this._token=x(t),this._expire_token_time=Number.MAX_VALUE;else{if(!this._options.eyepopUrl)return Promise.reject("no valid auth option");{const i=w(t);if(void 0===i)return Promise.reject("no valid auth option");const n={Authorization:`Bearer ${i}`},a=`${this.eyepopUrl()}/v1/auth/authenticate`,o=await this._client.fetch(a,{method:"POST",headers:n});if(200!=o.status){const e=await o.text();return Promise.reject(`Unexpected status ${o.status}: ${e}`)}const s=await o.json();this._token=s.access_token,this._expire_token_time=e+s.expires_in-60}}}}finally{this.updateState()}}return this._logger.debug("using access token, valid for at least %d seconds",this._expire_token_time-e),this._token}},ge=(e=>(e.Transient="transient",e))(ge||{}),be=class e extends ve{constructor(e){super(e),this.setStatusRetryHandlers(new Map([[404,e=>this.statusHandler404(e)]])),this._baseUrl=null,this._pipelineId=null,this._popName=null,this._sessionAccessToken=null,this._sessionAccessTokenValidUntil=null,this._pipeline=null,this._pipelineCreatePromise=null}options(){return this._options}async disconnect(e=!0){if("transient"==this.options().popId&&this._pipelineId){const e=`${this._baseUrl}/pipelines/${this._pipelineId}`,t={Authorization:await this.authorizationHeader()};let i=await(this._client?.fetch(e,{method:"DELETE",headers:t}));if(204!=i?.status){const e=await(i?.text());this._logger.info(`stopping pipeline failed, status ${i?.status}: ${e}`)}}return super.disconnect(e)}statusHandler404(e){this._pipelineId=null,this._baseUrl=null}async session(){let e=null;return null==this._baseUrl&&(await this.reconnect(),null==this._baseUrl)?Promise.reject("endpoint not connected"):(e=this._sessionAccessToken?{eyepopUrl:this.options().eyepopUrl,accessToken:this._sessionAccessToken,validUntil:this._sessionAccessTokenValidUntil||Number.MAX_VALUE}:await super.session(),{eyepopUrl:e.eyepopUrl,accessToken:e.accessToken,validUntil:e.validUntil,popId:this.options().popId,baseUrl:this._baseUrl,pipelineId:this._pipelineId||void 0,authenticationHeaders:()=>this._authenticationHeaders(e)})}popName(){return this._popName}pop(){return this._pipeline?this._pipeline.pop||null:this.options().pop||null}async changePop(e){if(X(e),"transient"==this.options().popId)return void await this.changeTransientPop(e);const t=this._client;if(!this._baseUrl||!t)return Promise.reject("endpoint not connected, use connect()");let i=await this.fetchWithRetry(async()=>{const i=await this.session();let n={"Content-Type":"application/json",...this._authenticationHeaders(i)};const a=`${i.baseUrl}/pipelines/${i.pipelineId}/pop`;return await t.fetch(a,{method:"PATCH",body:JSON.stringify(e),headers:n})});if(204!=i.status){const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}this.options().pop=e,this._pipeline?this._pipeline.pop=e:this._pipeline={id:this._pipelineId||"unknown",state:"idle",startTime:(new Date).toString(),pop:e}}_authenticationHeaders(e){return void 0!==y(this._options)?.isLocal?{}:{Authorization:`Bearer ${e.accessToken}`}}popId(){return this.options().popId||null}async process(e,t){return void 0!==e.source?await this.processV2(e):await this.processV1(e,t)}async processV1(e,t){return void 0!==e.file?this.uploadFile(e,{componentParams:t}):void 0!==e.stream?this.uploadStream(e,{componentParams:t}):void 0!==e.path?this.uploadPath(e,{componentParams:t}):void 0!==e.url?this.loadFrom(e,{componentParams:t}):void 0!==e.assetUuid?this.loadFromAssetUuid(e,{componentParams:t}):void 0!==e.mediaStream?this.loadMediaStream(e,{componentParams:t}):Promise.reject("unknown source type")}validateProcessParams(e){void 0!==e.camera&&J(e.camera)}async processV2(e){return this.validateProcessParams(e),void 0!==e.source.file?this.uploadFile(e.source,e):void 0!==e.source.stream?this.uploadStream(e.source,e):void 0!==e.source.path?this.uploadPath(e.source,e):void 0!==e.source.url?this.loadFrom(e.source,e):void 0!==e.source.assetUuid?this.loadFromAssetUuid(e.source,e):void 0!==e.source.mediaStream?this.loadMediaStream(e.source,e):Promise.reject("unknown source type")}async uploadGroup(e,t={}){if(0===e.length)throw new Error("upload group requires at least one path");if(this.validateProcessParams(t),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=await Promise.all(e.map(async e=>{let t;return t=this._options.platformSupport?.resolvePath?await this._options.platformSupport.resolvePath({path:e},this._logger):await ne({path:e},this._logger),{stream:t.stream,mimeType:t.mimeType}})),n=new re(i,t,async()=>this.session(),this._client,this._requestLogger);return n.start(()=>{this.jobDone(n)},e=>{this.jobStatus(n,e)})}catch(e){throw this._limit.release(),e}}async uploadStreamGroup(e,t,i={}){if(0===e.length)throw new Error("upload stream group requires at least one stream");if(void 0!==t&&t.length!==e.length)throw new Error("mimeTypes must have the same length as streams");if(this.validateProcessParams(i),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=e.map((e,i)=>({stream:e,mimeType:t?.[i]??null})),a=new re(n,i,async()=>this.session(),this._client,this._requestLogger);return a.start(()=>{this.jobDone(a)},e=>{this.jobStatus(a,e)})}catch(e){throw this._limit.release(),e}}async loadFromGroup(e,t={}){if(0===e.length)throw new Error("load from group requires at least one url");if(this.validateProcessParams(t),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=new ce(e,t,async()=>this.session(),this._client,this._requestLogger);return i.start(()=>{this.jobDone(i)},e=>{this.jobStatus(i,e)})}catch(e){throw this._limit.release(),e}}async uploadFile(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))return Promise.reject("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=new oe(e.file,e.file.type,e.file.size,e.videoMode,t,async()=>this.session(),this._client,this._requestLogger);return i.start(()=>{this.jobDone(i)},e=>{this.jobStatus(i,e)})}catch(e){throw this._limit.release(),e}}async uploadStream(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))return Promise.reject("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=new oe(e.stream,e.mimeType,e.size,e.videoMode,t,async()=>this.session(),this._client,this._requestLogger);return i.start(()=>{this.jobDone(i)},e=>{this.jobStatus(i,e)})}catch(e){throw this._limit.release(),e}}async uploadPath(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=async()=>this._options.platformSupport?.resolvePath?await this._options.platformSupport.resolvePath(e,this._logger):await ne(e,this._logger),n=await i();let a=!0;const o=async()=>a?(a=!1,n.stream):(await i()).stream,s=new oe(n.stream,n.mimeType,n.size,e.videoMode,t,async()=>this.session(),this._client,this._requestLogger,o);return s.start(()=>{this.jobDone(s)},e=>{this.jobStatus(s,e)})}catch(e){throw this._limit.release(),e}}async loadFrom(e,t){if(e.url.startsWith("file://"))return await this.uploadPath({path:e.url.substring(7)},t);if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=new se(e.url,t,async()=>this.session(),this._client,this._requestLogger);return i.start(()=>{this.jobDone(i)},e=>{this.jobStatus(i,e)})}catch(e){throw this._limit.release(),e}}async loadFromAssetUuid(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=new pe(e.assetUuid,t,async()=>this.session(),this._client,this._requestLogger);return i.start(()=>{this.jobDone(i)},e=>{this.jobStatus(i,e)})}catch(e){throw this._limit.release(),e}}async loadMediaStream(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=new le(e.mediaStream,t,async()=>this.session(),this._client,this._requestLogger);return i.start(()=>{this.jobDone(i)},e=>{this.jobStatus(i,e)})}catch(e){throw this._limit.release(),e}}jobDone(e){this._limit?.release(),this.updateState()}jobStatus(e,t){404==t?this.statusHandler404(t):401==t&&this.statusHandler401(t)}async reconnect(){return"transient"==this.options().popId?(await this.getComputeSession(),this.options().pop&&this.setTransientPipelinePop()):this.options().sessionUuid?await this.getComputeSession():await this.startWebApiSessionWithPopId(),this.updateState(),Promise.resolve(this)}async startWebApiSessionWithPopId(){if(!this._client)throw new Error("endpoint not initialized");const e=`${this.eyepopWebApiUrl()}/pops/${this.options().popId}/config?auto_start=false`,t={Authorization:await this.authorizationHeader()};this.updateState("FetchConfig");let i=await this._client.fetch(e,{headers:t});if(401==i.status){this._requestLogger.debug("GET %s: 401, about to retry with fresh access token",e),this.statusHandler401(i.status);const t={Authorization:await this.authorizationHeader()};this.updateState("FetchConfig"),i=await this._client.fetch(e,{headers:t})}if(200!=i.status){const e=await i.text();throw 429==i.status?this.updateState("NotAvailable",e):this.updateState("Error",e),new Error(`Unexpected status ${i.status}: ${e}`)}let n=await i.json();if(!n.base_url&&this.options().autoStart){const e=`${this.eyepopWebApiUrl()}/pops/${this.options().popId}/config?auto_start=true`;this._requestLogger.debug("pop was not running, trying to autostart with: %s",e);const t={Authorization:await this.authorizationHeader()};if(i=await this._client.fetch(e,{headers:t}),200!=i.status){this.updateState("Error");const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}n=await i.json()}const a=new URL(n.base_url,this.eyepopUrl());if(this._baseUrl=a.toString(),this._baseUrl){if(this._baseUrl=this._baseUrl.replace(/\/+$/,""),this._pipelineId=n.pipeline_id,this._popName=n.name,!this._pipelineId||!this._baseUrl)throw new Error("Pop not started");const e=`${this._baseUrl}/pipelines/${this._pipelineId}`,t={Authorization:await this.authorizationHeader()};let i=await this._client.fetch(e,{method:"GET",headers:t});if(i.status>200){const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}if(this._pipeline=await i.json(),this.options().stopJobs){const e={sourceType:"NONE"},t={Authorization:await this.authorizationHeader(),"Content-Type":"application/json"},i=`${this._baseUrl}/pipelines/${this._pipeline.id}/source?mode=preempt&processing=sync`;let n=await this._client.fetch(i,{method:"PATCH",headers:t,body:JSON.stringify(e)});if(n.status>=300){const e=await n.text();throw new Error(`Unexpected status ${n.status}: ${e}`)}}}}sessionReadyTimeoutMs(){const t=this.options().sessionReadyTimeoutSeconds;return"number"==typeof t&&Number.isFinite(t)&&t>0?1e3*t:e.WAIT_FOR_IS_READY}async getComputeSession(){if(!this._client)throw new Error("endpoint not initialized");let e;try{e=await new O({computeUrl:this.eyepopUrl(),httpClient:this._client,authorizationHeader:()=>this.computeAuthorizationHeader(),sessionUuid:this.options().sessionUuid,sessionName:this.options().sessionName,pipelineImage:this.options().pipelineImage,pipelineVersion:this.options().pipelineVersion,pop:this.options().pop,readyTimeoutMs:this.sessionReadyTimeoutMs(),logger:this._logger,requestLogger:this._requestLogger}).resolve()}catch(e){throw this.updateState("Error"),e}this._sessionAccessToken=e.accessToken,this._sessionAccessTokenValidUntil=e.accessTokenValidUntil,this._baseUrl=e.session.session_endpoint,this._pipeline=null,this._pipelineId=e.pipelineId,this.options().pop&&this.setTransientPipelinePop()}async startTransientPipeline(){const e=this._client,t=this._baseUrl;if(null==e||null==t)throw new Error("endpoint not initialized");let i;if(this.options().pop)i=this.options().pop;else{if(!this._pipeline||!this._pipeline.pop)throw new Error("Cannot start a transient pipeline without a pop");i=this._pipeline.pop}const n={pop:i,source:{sourceType:"NONE"},idleTimeoutSeconds:30,logging:["out_meta"],videoOutput:"no_output"},a=`${t.replace(/\/+$/,"")}/pipelines`,o=await this.fetchWithRetry(async()=>{let t={Accept:"application/json","Content-Type":"application/json",Authorization:await this.authorizationHeader()};return e.fetch(a,{method:"POST",body:JSON.stringify(n),headers:t})});if(200!=o.status){const e=await o.text();throw new Error(`Unexpected status ${o.status} starting transient pipeline: ${e.slice(0,300)}`)}return(await o.json()).id}async ensureTransientPipelineStarted(){if("transient"==this.options().popId&&!this._pipelineId&&this.options().pop&&(this._baseUrl||await this.reconnect(),!this._pipelineId))if(this.options().pop){if(await this.reconnect(),!this._pipelineId)throw new Error("Compute session did not provide a pipeline for the requested pop")}else{this._pipelineCreatePromise||(this._pipelineCreatePromise=this.startTransientPipeline());try{this._pipelineId=await this._pipelineCreatePromise,this.setTransientPipelinePop()}finally{this._pipelineCreatePromise=null}}}async changeTransientPop(e){if(!this._client)throw new Error("endpoint not initialized");const t=this.options().pop,i=this._baseUrl,n=this._sessionAccessToken,a=this._sessionAccessTokenValidUntil;this._pipelineId&&(await this.deleteTransientPipeline(this._pipelineId),this._pipelineId=null),this._pipeline=null;try{this.options().pop=e,await this.getComputeSession()}catch(e){throw this.options().pop=t,this._pipeline=null,this._pipelineId=null,this._baseUrl=t?null:i,this._sessionAccessToken=n,this._sessionAccessTokenValidUntil=a,e}if(!this._pipelineId)throw new Error("Compute session did not provide a pipeline for the requested pop");this.setTransientPipelinePop()}async deleteTransientPipeline(e){if(!this._client||!this._baseUrl)return;const t=`${this._baseUrl}/pipelines/${e}`,i={Authorization:await this.authorizationHeader()};let n=await this._client.fetch(t,{method:"DELETE",headers:i});if(n.status>=300){const e=await n.text();this._logger.info(`stopping pipeline failed, status ${n.status}: ${e}`)}}async authorizationHeader(){return this._sessionAccessToken?`Bearer ${this._sessionAccessToken}`:super.authorizationHeader()}async computeAuthorizationHeader(){const e=y(this.options());if(void 0!==e?.isLocal)return"Implicit";const t=w(e)??x(e);return void 0!==t?`Bearer ${t}`:super.authorizationHeader()}setTransientPipelinePop(){const e=this.options().pop;e&&this._pipelineId&&(this._pipeline={id:this._pipelineId,state:"idle",startTime:(new Date).toString(),pop:e})}};be.WAIT_FOR_IS_READY=6e4;var ye,we=be;ye="document"in globalThis&&"implementation"in globalThis.document?(e,t)=>new WebSocket(e,t):(e,t)=>new(i(826).WebSocket)(e,t);var xe=h(i(48)),_e=(e=>(e.dataset="dataset",e.vlm="vlm",e))(_e||{});function ke(e,t){switch(t){case"dataset":return e.datasetApiUrl??"";case"vlm":return e.vlmApiUrl??"";default:throw new Error(`unsupported type ${t}`)}}var Se=(e=>(e.error="error",e.requested="requested",e.in_progress="in_progress",e.completed="completed",e))(Se||{}),Te=(e=>(e.rejected="rejected",e.upload_in_progress="upload_in_progress",e.upload_failed="upload_failed",e.transform_failed="transform_failed",e.transform_in_progress="transform_in_progress",e.accepted="accepted",e))(Te||{}),Ee=(e=>(e.ground_truth="ground_truth",e.prediction="prediction",e.auto="auto",e))(Ee||{}),Pe=(e=>(e.approved="approved",e.rejected="rejected",e.unknown="unknown",e))(Pe||{}),Ae=(e=>(e.all_assets="all_assets",e.annotated_only="annotated_only",e.manual_annotated_only="manual_annotated_only",e.auto_annotated_only="auto_annotated_only",e))(Ae||{}),je=(e=>(e.all="all",e.user_reviewed="user_reviewed",e.user_approved="user_approved",e.ground_truth="ground_truth",e))(je||{}),Ie=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e))(Ie||{}),Oe=(e=>(e.original="original",e.video_original_size="video_original_size",e.image_original_size="image_original_size",e.image_fit_1024="image_fit_1024",e.image_fit_640="image_fit_640",e.image_fit_224="image_fit_224",e.image_cover_1024="image_cover_1024",e.image_cover_640="image_cover_640",e.image_cover_224="image_cover_224",e))(Oe||{}),Ce=(e=>(e.RECTANGLE="rectangle",e.CONTOUR="contour",e))(Ce||{}),Ue=(e=>(e.epdet_b1="epdet_b1",e.imported="imported",e.vlm_ability="vlm_ability",e))(Ue||{}),Re=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e.keypoint_detection="keypoint_detection",e))(Re||{}),Le=(e=>(e.error="error",e.draft="draft",e.requested="requested",e.in_progress="in_progress",e.available="available",e.published="published",e))(Le||{}),ze=(e=>(e.in_progress="in_progress",e.finished="finished",e.error="error",e))(ze||{}),Ne=(e=>(e.eyepop="eyepop",e.qc_ai_hub="qc_ai_hub",e))(Ne||{}),Me=(e=>(e.eyepop_bundle="eyepop_bundle",e.weights_file="weights_file",e))(Me||{}),We=(e=>(e.waiting="waiting",e.scheduling="scheduling",e.preparing="preparing",e.training="training",e.exporting="exporting",e))(We||{}),De=(e=>(e.dataset_added="dataset_added",e.dataset_removed="dataset_removed",e.dataset_modified="dataset_modified",e.dataset_version_modified="dataset_version_modified",e.asset_added="asset_added",e.asset_removed="asset_removed",e.asset_status_modified="asset_status_modified",e.asset_annotation_modified="asset_annotation_modified",e.model_added="model_added",e.model_removed="model_removed",e.model_modified="model_modified",e.model_status_modified="model_status_modified",e.model_progress="model_progress",e.events_lost="events_lost",e.workflow_started="workflow_started",e.workflow_succeeded="workflow_succeeded",e.workflow_failed="workflow_failed",e.workflow_task_started="workflow_task_started",e.workflow_task_succeeded="workflow_task_succeeded",e.workflow_task_failed="workflow_task_failed",e))(De||{}),qe=(e=>(e.unknown="Unknown",e.pending="Pending",e.running="Running",e.succeeded="Succeeded",e.failed="Failed",e.error="Error",e))(qe||{}),Je=(e=>(e.TensorFlowLite="TensorFlowLite",e.TensorFlowGraphDef="TensorFlowGraphDef",e.ONNX="ONNX",e.TorchScript="TorchScript",e.TorchScriptCpu="TorchScriptCpu",e.TorchScriptCuda="TorchScriptCuda",e.PyTorch="PyTorch",e.ModelLess="ModelLess",e))(Je||{}),$e=(e=>(e.float32="float32",e.float16="float16",e.int32="int32",e.int8="int8",e.uint8="uint8",e))($e||{}),He=(e=>(e.gcs="gcs",e.s3="s3",e.https_signed="https_signed",e))(He||{}),Ke=(e=>(e.success="success",e.failed="failed",e))(Ke||{}),Fe=(e=>(e.classification="classification",e))(Fe||{}),Ve=(e=>(e.image="image",e.video="video",e))(Ve||{}),Ze=(e=>(e.in_progress="in_progress",e.draft="draft",e.published="published",e))(Ze||{}),Be=class{constructor(e,t,i,n){this._response=null,this._runInfo=null,this._controller=new AbortController,this._vlmFetch=i,this._assetUrl=e,this._inferRequest=t,this._requestLogger=n}[Symbol.asyncIterator](){if(!this._response)throw Error("logical bug");let e=!1;const t=this._response,i=this._controller;return async function*(){if(e)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");e=!0;let n=!1;try{const e=await t;if(e)for(let t of e)yield t;n=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{n||i.abort()}}()}start(e){return this._response=new Promise(async(t,i)=>{try{let e=null;for(;;){let n=null;if(e)n=await this._vlmFetch(`/api/v1/requests/${e}?timeout=20`,{method:"POST"});else{const e=new Map(Object.entries(this._inferRequest));e.set("url",this._assetUrl);const t=new FormData;t.append("infer_request",JSON.stringify(Object.fromEntries(e))),n=await this._vlmFetch("/api/v1/infer?timeout=20",{method:"POST",body:t})}const a=n.predictions,o=n.run_info;if(a){this._runInfo=o,t(a);break}if(e=n.request_id,!e){i(`missing request_id in response: ${JSON.stringify(n)}`);break}}}catch(e){i(e)}finally{e()}}),this}cancel(){this._controller.abort("cancelled")}},Ge=class{constructor(e,t,i,n){this._response=null,this._controller=new AbortController,this._vlmFetch=i,this._evaluateRequest=e,this._workerRelease=t,this._requestLogger=n}async response(){if(!this._response)throw Error("logical bug");return await this._response}start(e){return this._response=new Promise(async(t,i)=>{try{let e=null;for(;;){let n=null;if(e)n=await this._vlmFetch(`/api/v1/evaluations/${e}?timeout=20`,{method:"GET"});else{const e=this._workerRelease?`&worker_release=${this._workerRelease}`:"";n=await this._vlmFetch(`/api/v1/evaluations?timeout=20${e}`,{method:"POST",body:JSON.stringify(this._evaluateRequest),headers:{"Content-Type":"application/json"}})}if(n.run_info){t(n);break}if(e=n.request_id,!e){i(`missing request_id in response: ${JSON.stringify(n)}`);break}}}catch(e){i(e)}finally{e()}}),this}cancel(){this._controller.abort("cancelled")}},Xe=class extends Error{constructor(e,t){const i=t?.error??t,n=function(e,t){return t instanceof Error?t.message:"string"==typeof t?t:e?.message??""}(t,i);super(n?`EyePop Dataset event WebSocket connection failed: ${n}`:"EyePop Dataset event WebSocket connection failed"),this.code="DATA_WEBSOCKET_CONNECTION_FAILED",this.name="EyePopDataWebSocketError",this.endpoint=function(e){try{return new URL(e).origin}catch{return e}}(e),this.sourceError=i}};function Ye(e,t){if(null!==t)return t}var Qe=class extends ve{constructor(e){super(e),this.datasetApiUrl=null,this.vlmApiUrl=null,this._ws=null,this._ws_current_reconnect_delay=null,this._ws_reconnect_timeout=null,this._ws_reconnect_enabled=!1,this._ws_connecting=null,this._accountId=e.accountId||null,this._account_event_handlers=[],this._dataset_uuid_to_event_handlers=new Map;const t=y(e);if(void 0!==t?.session){const e=t.session;e.accountId&&(this._accountId=e.accountId)}}async session(){const e=await super.session();return{eyepopUrl:e.eyepopUrl,accessToken:e.accessToken,validUntil:e.validUntil,accountId:this.options().accountId,datasetApiUrl:this.datasetApiUrl,vlmApiUrl:this.vlmApiUrl}}async disconnect(e=!0){this._ws_reconnect_enabled=!1,this._ws_reconnect_timeout&&(clearTimeout(this._ws_reconnect_timeout),this._ws_reconnect_timeout=null),this.datasetApiUrl=null,this.vlmApiUrl=null,this._ws&&(this.close_ws(this._ws,"unsubscribe"),this._ws=null),await super.disconnect(e)}async reconnect(){if(!this._client)return Promise.reject("endpoint not initialized");const e=this._accountId?`?account_uuid=${this._accountId}`:"",t=`${this.eyepopUrl()}/v1/configs${e}`;let i={Authorization:await this.authorizationHeader()};this.updateState("FetchConfig");let n=await this._client.fetch(t,{headers:i});if(401==n.status&&(this._requestLogger.debug("GET %s: 401, about to retry with fresh access token",t),this.statusHandler401(n.status),i={Authorization:await this.authorizationHeader()},this.updateState("FetchConfig"),n=await this._client.fetch(t,{headers:i})),200!=n.status){this.updateState("Error");const e=await n.text();return Promise.reject(`Unexpected status ${n.status} for ${t}: ${e}`)}let a=await n.json();const o=new URL(a.dataset_api_url,this.eyepopUrl());this.datasetApiUrl=o.toString();const s=new URL(a.vlm_api_url,this.eyepopUrl());if(this.vlmApiUrl=s.toString(),this.options().disableWs?(this._ws_reconnect_enabled=!1,this._logger.info("disabled ws connection")):await this.reconnect_ws(),this.options().useCookie){const e=this._client,t=(0,xe.default)(this.datasetApiUrl,"security","check?set_cookie=true"),i={Authorization:await this.authorizationHeader()};if(n=await e.fetch(t,{headers:i}),204!=n.status){this.updateState("Error");const e=await n.text();return Promise.reject(`Unexpected status ${n.status}: ${e}`)}}return this.updateState(),Promise.resolve(this)}async reconnect_ws(){if(this._ws_connecting)return this._ws_connecting;const e=this.open_ws();this._ws_connecting=e;try{await e}finally{this._ws_connecting=null}}async open_ws(){this._ws&&(this.close_ws(this._ws,"unsubscribe"),this._ws=null);const e=this.datasetApiUrl?.replace("https://","wss://").replace("http://","ws://");if(!e)return;const t=(0,xe.default)(e,"events");return this._requestLogger.debug("about to connect ws to: %s",t),new Promise((e,i)=>{let n=!1;const a=()=>{n=!0,e()},o=e=>{n=!0,i(e)},s=ye(t);if(!s)return a();this._ws=s,s.onopen=()=>{this.authorizationHeader().then(e=>{if(this._ws!==s)return this.close_ws(s,"unsubscribe"),void a();let t=JSON.stringify({authorization:e});this._requestLogger.debug("ws send: %s",t),s.send(t),t=JSON.stringify({subscribe:{account_uuid:this._accountId}}),this._requestLogger.debug("ws send: %s",t),s.send(t);for(const e of this._dataset_uuid_to_event_handlers.keys()){const t=JSON.stringify({subscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",t),s.send(t)}this._ws_current_reconnect_delay=1e3,this._ws_reconnect_enabled=!0,a()}).catch(e=>{this.close_ws(s,"authorization failed",1011),o(e)})},s.onmessage=e=>{const t=JSON.parse(e.data);this._requestLogger.debug("received ws: %s",JSON.stringify(t));const i=t;this.dispatchChangeEvent(i)},s.onclose=e=>{const{code:i,reason:a}=e;this._requestLogger.debug("ws closed: %d %s",i,a),n||o(new Xe(t,new Error(`closed before the connection was established: ${i} ${a}`))),this._ws===s&&(this._ws=null,this.schedule_ws_reconnect())},s.onerror=e=>{const i=new Xe(t,e);return this._logger.error({err:i},"dataset event WebSocket connection failed"),o(i),null}})}close_ws(e,t,i=1e3){try{e.close(i,t)}catch(e){this._logger.warn({err:e},"ignored exception closing the dataset event WebSocket")}}schedule_ws_reconnect(){this._ws_reconnect_enabled&&!this._ws_reconnect_timeout&&(this._ws_current_reconnect_delay?this._ws_current_reconnect_delay<6e4&&(this._ws_current_reconnect_delay*=1.5):this._ws_current_reconnect_delay=1e3,this._ws_reconnect_timeout=setTimeout(()=>{this._ws_reconnect_enabled?this.reconnect_ws().catch(e=>{this._requestLogger.debug("dataset event WebSocket reconnect failed: %s",e)}).finally(()=>{this._ws_reconnect_timeout=null,this._ws||this.schedule_ws_reconnect()}):this._ws_reconnect_timeout=null},this._ws_current_reconnect_delay))}options(){return this._options}async request(e,t={},i=!1,n="dataset"){const a=this._client;if(!a)return Promise.reject("endpoint not connected");let o=await this.fetchWithRetry(async()=>{const o=await this.session(),s=ke(o,n),r={...i?{}:{Authorization:`Bearer ${o.accessToken}`},...t.headers||{}};t.body||(t.body=null);const c={headers:r,method:t.method||"GET",body:t.body};return this._requestLogger.debug("Request - "+c.method+" "+e+" BODY: "+(c.body?c.body:"")),await a.fetch((0,xe.default)(s??"",e),c)});if(204===o.status)return null;const s=o.headers.get("Content-Type");if(this._requestLogger.debug("Response - "+o.status+" "+o.statusText),!o.ok)throw s&&(s.toLowerCase().startsWith("application/json")||s.toLowerCase().startsWith("text/"))?new Error(`Request failed with ${o.status} ${o.statusText}: ${await o.text()}`):new Error(`Request failed with ${o.status} ${o.statusText}`);return s&&s.toLowerCase().startsWith("application/json")?await o.json():await o.blob()}async listDatasets(e=!0,t){const i=void 0!==t?`&modifiable_version_only=${t}`:"";return this.request(`/datasets?account_uuid=${this._accountId}&include_stats=${e}${i}`,{method:"GET"})}async createDataset(e){return this.request(`/datasets?account_uuid=${this._accountId}`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async getDataset(e,t=!0,i,n){const a=i?`&dataset_version=${i}`:"",o=void 0!==n?`&modifiable_version_only=${n}`:"";return this.request(`/datasets/${e}?include_stats=${t}${a}${o}`,{method:"GET"})}async updateDataset(e,t,i=!0){return this.request(`/datasets/${e}?start_auto_annotate=${i}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async updateDatasetHeroAsset(e,t){return this.request(`/datasets/${e}/hero_asset`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteDataset(e){return this.request(`/datasets/${e}`,{method:"DELETE"})}async freezeDatasetVersion(e,t){const i=t?`&dataset_version=${t}`:"";return this.request(`/datasets/${e}/freeze?${i}`,{method:"POST"})}async analyzeDatasetVersion(e,t){const i=t?`&dataset_version=${t}`:"";return this.request(`/datasets/${e}/analyze?${i}`,{method:"POST"})}async autoAnnotateDatasetVersion(e,t,i){const n=t?`&dataset_version=${t}`:"",a=i?`&max_assets=${i}`:"";return this.request(`/datasets/${e}/auto_annotate?${n}${a}`,{method:"POST"})}async deleteDatasetVersion(e,t){return this.request(`/datasets/${e}/versions?dataset_version=${t}`,{method:"DELETE"})}async deleteAnnotations(e,t,i=["unknown"]){let n="";for(let e in i)n+=`&user_review=${e}`;await this.request(`/datasets/${e}/annotations?dataset_version=${t}${n}`,{method:"DELETE"})}async createDatasetAutoAnnotate(e,t,i){const n=i?`dataset_version=${i}&`:"";return this.request(`/datasets/${t}/auto_annotates?${n}`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async updateDatasetAutoAnnotate(e,t,i,n,a){const o=a?`dataset_version=${a}&`:"";return this.request(`/datasets/${t}/auto_annotates?auto_annotate=${i}&source=${encodeURIComponent(n)}&${o}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async listDatasetAutoAnnotates(e,t,i,n){const a=n?`dataset_version=${n}&`:"",o=t?`auto_annotate=${t}&`:"",s=i?`source=${i}&`:"";return this.request(`/datasets/${e}/auto_annotates?${a}&${o}&${s}`,{method:"GET"})}async uploadAsset(e,t,i,n=void 0){const a=t?`&dataset_version=${t}`:"";let o;return o=n?`/assets?dataset_uuid=${e}${a}&external_id=${n}`:`/assets?dataset_uuid=${e}${a}`,this.request(o,{method:"POST",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}})}async importAsset(e,t,i,n=void 0){const a=t?`&dataset_version=${t}`:"";let o;return o=n?`/assets/imports?dataset_uuid=${e}${a}&external_id=${n}`:`/assets/imports?dataset_uuid=${e}${a}`,this.request(o,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async listAssets(e,t,i=!1,n,a,o,s,r,c){const p=new URLSearchParams;p.set("dataset_uuid",e),null!=t&&p.set("dataset_version",String(t)),i&&p.set("include_annotations","true"),null!=a&&p.set("inclusion_mode",a),null!=o&&p.set("annotation_inclusion_mode",o);for(const e of s??[])p.append("include_partition",e);for(const e of r??[])p.append("include_auto_annotate",e);for(const e of c??[])p.append("include_source",e);return null!=n&&p.set("top_k",String(n)),this.request(`/assets?${p.toString()}`,{method:"GET"})}async getAsset(e,t,i,n=!1,a){const o=i?`&dataset_version=${i}`:"",s=n?"&include_annotations=true":"",r=t?`&dataset_uuid=${t}`:"",c=a?`&top_k=${a}`:"";return this.request(`/assets/${e}?${r}${o}${s}${c}`,{method:"GET"})}async deleteAsset(e,t,i){const n=i?`&dataset_version=${i}`:"",a=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}?${a}${n}`,{method:"DELETE"})}async resurrectAsset(e,t,i,n){const a=n?`&into_dataset_version=${n}`:"";return this.request(`/assets/${e}/resurrect?dataset_uuid=${t}&from_dataset_version=${i}${a}`,{method:"POST"})}async updateAssetGroundTruth(e,t,i,n){const a=i?`&dataset_version=${i}`:"",o=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${o}${a}`,{method:"PATCH",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async deleteAssetGroundTruth(e,t,i){const n=i?`&dataset_version=${i}`:"",a=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${a}${n}`,{method:"DELETE"})}async updateAutoAnnotationStatus(e,t,i,n){if(!["approved","rejected","unknown"].includes(i))throw new Error("Invalid status");const a=n?`?approved_threshold=${n}`:"";return this.request(`/assets/${e}/auto_annotations/${t}/user_review/${i}${a}`,{method:"PATCH"})}async addAssetAnnotation(e,t,i,n,a,o,s,r){const c=t?`dataset_uuid=${t}&`:"",p=i?`&dataset_version=${i}&`:"",l=a?`&auto_annotate=${a}&`:"",u=o?`&source=${encodeURIComponent(o)}&`:"",d=s?`&user_review=${s}&`:"",h=void 0!==r?`&approved_threshold=${r}&`:"";return this.request(`/assets/${e}/annotations?${c}${p}${l}${u}${d}${h}`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async updateAssetAnnotationApproval(e,t,i,n,a,o,s){const r=t?`dataset_uuid=${t}&`:"",c=i?`&dataset_version=${i}&`:"",p=n?`&auto_annotate=${n}&`:"",l=a?`&source=${encodeURIComponent(a)}&`:"",u=o?`&user_review=${o}&`:"",d=s?`&approved_threshold=${s}&`:"";return this.request(`/assets/${e}/annotations?${r}${c}${p}${l}${u}${d}`,{method:"PATCH"})}async downloadAsset(e,t,i,n="original",a,o,s){const r=i?`&dataset_version=${i}`:"",c=t?`&dataset_uuid=${t}`:"",p=a?`&start_timestamp=${a}`:"",l=o?`&end_timestamp=${o}`:"",u=s?`&url_type=${s}`:"";return this.request(`/assets/${e}/download?transcode_mode=${n}${c}${r}${p}${l}${u}`,{method:"GET"})}async previewAutoAnnotateAsset(e,t,i){return this.request(`/assets/${e}/preview_auto_annotate?auto_annotate=${t}`,{method:"POST",body:i?JSON.stringify(i):null,headers:i?{"Content-Type":"application/json"}:{}})}async addAssetRoi(e,t,i,n,a){const o=n?`&dataset_version=${n}`:"",s=i?`&dataset_uuid=${i}`:"";return this.request(`/assets/${e}/rois?${s}${o}`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteAssetRoi(e,t,i,n){const a=n?`&dataset_version=${n}`:"",o=i?`&dataset_uuid=${i}`:"";return this.request(`/assets/${e}/rois/${encodeURIComponent(t)}?${o}${a}`,{method:"DELETE"})}async listModels(){return this.request(`/models?account_uuid=${this._accountId}`,{method:"GET"})}async findModelsForDataset(e){return this.request(`/models?dataset_uuid=${e}`,{method:"GET"})}async createModel(e,t,i,n=!0){return this.request(`/models?dataset_uuid=${e}&dataset_version=${t}&start_training=${n}`,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async getModel(e){return this.request(`/models/${e}`,{method:"GET"})}async getModelTrainingProgress(e){return this.request(`/models/${e}/progress`,{method:"GET"})}async updateModel(e,t){return this.request(`/models/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteModel(e){return this.request(`/models/${e}`,{method:"DELETE"})}async trainModel(e){return this.request(`/models/${e}/train`,{method:"POST"})}async publishModel(e){return this.request(`/models/${e}/publish`,{method:"POST"})}async exportModel(e,t,i){if("qc_ai_hub"!=t)return Promise.reject(`Unexpected export_by ${t}, must be 'qc_ai_hub'`);await this.request(`/models/${e}/exports/qc_ai_hub`,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async downloadModelArtifacts(e,t,i,n){const a=n?`artifact_type=${n}&`:"",o=i?`device_name=${encodeURIComponent(i)}&`:"";let s="";if(t)for(const e of t)s+=`model_format=${e}&`;return this.request(`/exports/model_artifacts/?model_uuid=${e}&${a}${o}${s}`,{method:"GET"})}addAccountEventHandler(e){this._account_event_handlers.push(e)}removeAccountEventHandler(e){this._account_event_handlers=this._account_event_handlers.filter(t=>t!==e)}addDatasetEventHandler(e,t){let i=this._dataset_uuid_to_event_handlers.get(e);if(this._logger.debug("addDatasetEventHandler %s",i),void 0===i){i=[],this._dataset_uuid_to_event_handlers.set(e,i);const t=this._ws;if(t){const i=JSON.stringify({subscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",i),t.send(i)}}i.find(e=>e===t)!==t&&(this._logger.debug("addDatasetEventHandler event_handlers=%s",i),i.push(t))}removeDatasetEventHandler(e,t){let i=this._dataset_uuid_to_event_handlers.get(e);if(void 0!==i&&(i=i.filter(e=>e!==t),0==i.length)){const t=this._ws;if(t){const i=JSON.stringify({unsubscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",i),t.send(i)}this._dataset_uuid_to_event_handlers.delete(e)}}removeAllDatasetEventHandlers(e){if(void 0===this._dataset_uuid_to_event_handlers.get(e))return;const t=this._ws;if(t){const i=JSON.stringify({unsubscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",i),t.send(i)}this._dataset_uuid_to_event_handlers.delete(e)}async startWorkflow(e,t,i){return this.request(`/workflows?account_uuid=${e}&template_name=${t}`,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async getWorkflow(e,t){return this.request(`/workflows/${e}?account_uuid=${t}`,{method:"GET"})}async listWorkflows(e,t,i,n){const a=[t?.map(e=>`dataset_uuid=${e}`).join("&")||"",i?.map(e=>`model_uuid=${e}`).join("&")||"",n?.map(e=>`phase=${e}`).join("&")||""].filter(e=>e).join("&");return this.request(`/workflows?account_uuid=${e}${a?`&${a}`:""}`,{method:"GET"})}async inferAsset(e,t,i,n,a,o,s){const r=`ai.eyepop://data/assets/${e}?${a?`transcode_mode=${a}&`:""}${i?`dataset_uuid=${i}&`:""}${n?`dataset_version=${n}&`:""}${o?`start_timestamp=${o}&`:""}${s?`end_timestamp=${s}&`:""}`;if(!this.vlmApiUrl||!this._client||!this._limit)throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const e=new Be(r,t,async(e,t)=>await this.request(e,t,!1,"vlm"),this._requestLogger);return e.start(()=>{this.jobDone(e)})}catch(e){throw this._limit.release(),e}}async evaluateDataset(e,t){if(!this.vlmApiUrl||!this._client||!this._limit)throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=new Ge(e,t??null,async(e,t)=>await this.request(e,t,!1,"vlm"),this._requestLogger);return i.start(()=>{this.jobDone(i)})}catch(e){throw this._limit.release(),e}}jobDone(e){this._limit?.release()}async dispatchChangeEvent(e){switch(e.change_type){case"dataset_added":case"dataset_modified":case"dataset_removed":case"dataset_version_modified":case"workflow_started":case"workflow_succeeded":case"workflow_failed":case"workflow_task_started":case"workflow_task_succeeded":case"workflow_task_failed":this._logger.debug("dispatchChangeEvent account_event_handlers=%s",this._account_event_handlers);for(let t of this._account_event_handlers)await t(e);break;case"asset_added":case"asset_removed":case"asset_status_modified":case"asset_annotation_modified":case"model_added":case"model_modified":case"model_removed":case"model_status_modified":case"model_progress":const t=this._dataset_uuid_to_event_handlers.get(e.dataset_uuid);if(this._logger.debug("dispatchChangeEvent event_handlers=%s",t),void 0!==t)for(let i of t)await i(e)}}async listVlmAbilityGroups(){return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`,{method:"GET"})}async createVlmAbilityGroup(e){return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`,{method:"POST",body:JSON.stringify(e,Ye),headers:{"Content-Type":"application/json"}})}async getVlmAbilityGroup(e){return this.request(`/vlm_ability_groups/${e}`,{method:"GET"})}async deleteVlmAbilityGroup(e){return this.request(`/vlm_ability_groups/${e}`,{method:"DELETE"})}async updateVlmAbilityGroup(e,t){return this.request(`/vlm_ability_groups/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async listVlmAbilities(){return this.request(`/vlm_abilities?account_uuid=${this._accountId}`,{method:"GET"})}async createVlmAbility(e,t){const i=t?`&vlm_ability_group_uuid=${t}`:"";return this.request(`/vlm_abilities?account_uuid=${this._accountId}${i}`,{method:"POST",body:JSON.stringify(e,Ye),headers:{"Content-Type":"application/json"}})}async getVlmAbility(e){return this.request(`/vlm_abilities/${e}`,{method:"GET"})}async deleteVlmAbility(e){return this.request(`/vlm_abilities/${e}`,{method:"DELETE"})}async updateVlmAbility(e,t){return this.request(`/vlm_abilities/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async refineVlmAbility(e,t,i){return void 0!==t?this.request(`/vlm_abilities/${e}/refine`,{method:"POST",body:JSON.stringify(t,Ye),headers:{"Content-Type":"application/json"}}):void 0!==i?this.request(`/vlm_abilities/${e}/refine_task`,{method:"POST",body:JSON.stringify(i,Ye),headers:{"Content-Type":"application/json"}}):Promise.reject("refine vlm ability requires auto_prompt or auto_config parameter")}async cloneVlmAbility(e,t,i,n){const a=new URLSearchParams;return t?a.set("account_uuid",t):this._accountId&&a.set("account_uuid",this._accountId),i&&a.set("name",i),n&&a.set("default_alias_name",n),this.request(`/vlm_abilities/${e}/clone?${a.toString()}`,{method:"POST"})}async publishVlmAbility(e,t,i){const n=t?`alias_name=${encodeURIComponent(t)}&`:"",a=i?`tag_name=${encodeURIComponent(i)}&`:"";return this.request(`/vlm_abilities/${e}/publish?${n}${a}`,{method:"POST"})}async addVlmAbilityAlias(e,t,i){return this.request(`/vlm_abilities/${e}/alias/${encodeURIComponent(t)}/tag/${i?encodeURIComponent(i):""}`,{method:"POST"})}async removeVlmAbilityAlias(e,t,i){return this.request(`/vlm_abilities/${e}/alias/${encodeURIComponent(t)}/tag/${encodeURIComponent(i)}`,{method:"DELETE"})}async listVlmAbilityEvaluations(e){return this.request(`/vlm_abilities/${e}/evaluations`,{method:"GET"})}async getVlmAbilityEvaluation(e,t){return this.request(`/vlm_abilities/${e}/evaluations/${t}`,{method:"GET"})}async startVlmAbilityEvaluation(e,t){return this.request(`/vlm_abilities/${e}/evaluations`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async resolveAliases(e){const t=new URLSearchParams;return e.forEach(e=>{t.append("alias",e)}),this.request(`/exports/aliases?${t.toString()}`,{method:"GET"})}},et=1===new Uint8Array(new Uint16Array([1]).buffer)[0],tt=class{constructor(e,t,i){this.width=e,this.height=t,this.values=i}at(e,t,i,n){let a=e,o=t;i&&n&&(a=e*this.width/i,o=t*this.height/n);const s=Math.min(Math.max(Math.floor(a),0),this.width-1),r=Math.min(Math.max(Math.floor(o),0),this.height-1);return this.values[r*this.width+s]}isSky(e,t,i,n){return this.at(e,t,i,n)===Number.POSITIVE_INFINITY}get finiteMin(){return this.computeFiniteRange(),this._finiteMin}get finiteMax(){return this.computeFiniteRange(),this._finiteMax}computeFiniteRange(){if(void 0!==this._finiteMin||void 0!==this._finiteMax)return;let e=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY;for(let i=0;i<this.values.length;i++){const n=this.values[i];Number.isFinite(n)&&(n<e&&(e=n),n>t&&(t=n))}t>=e&&(this._finiteMin=e,this._finiteMax=t)}};function it(e){if(!Number.isSafeInteger(e.width)||e.width<=0||!Number.isSafeInteger(e.height)||e.height<=0||!Number.isSafeInteger(e.width*e.height*4))throw new Error(`invalid depth dimensions: ${e.width}x${e.height}`);const t=function(e){if(void 0!==a){const t=a.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}(e.values),i=e.width*e.height;if(t.byteLength!==4*i)throw new Error(`depth values hold ${t.byteLength} bytes, expected ${4*i} for ${e.width}x${e.height} float32`);let n;if(et){const e=new Uint8Array(t);n=new Float32Array(e.buffer,0,i)}else{const e=new DataView(t.buffer,t.byteOffset,t.byteLength);n=new Float32Array(i);for(let t=0;t<i;t++)n[t]=e.getFloat32(4*t,!0)}return new tt(e.width,e.height,n)}var nt=1===new Uint8Array(new Uint16Array([1]).buffer)[0],at=class{constructor(e,t,i,n){this.width=e,this.height=t,this.points=i,this.box=n}at(e,t){if(!(e>=0&&e<this.width&&t>=0&&t<this.height))throw new Error(`(${e}, ${t}) is outside a ${this.width}x${this.height} cloud`);const i=3*(t*this.width+e),n=this.points[i],a=this.points[i+1],o=this.points[i+2];if(!(Number.isNaN(n)||Number.isNaN(a)||Number.isNaN(o)))return{x:n,y:a,z:o}}atSource(e,t){if(void 0===this.box)throw new Error("atSource needs a box; build with cloudOfObject or cloudOfDepth");if(!(this.box.width>0&&this.box.height>0))throw new Error(`invalid bounding box extent: ${this.box.width}x${this.box.height}`);const i=Math.min(Math.max(Math.floor((e-this.box.x)/this.box.width*this.width),0),this.width-1),n=Math.min(Math.max(Math.floor((t-this.box.y)/this.box.height*this.height),0),this.height-1);return this.at(i,n)}isPlaced(e,t){return void 0!==this.at(e,t)}get placedPoints(){const e=[];for(let t=0;t<this.points.length;t+=3){const i=this.points[t],n=this.points[t+1],a=this.points[t+2];Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(a)||e.push({x:i,y:n,z:a})}return e}get bounds(){let e=!1;const t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,z:Number.POSITIVE_INFINITY},i={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY,z:Number.NEGATIVE_INFINITY};for(let n=0;n<this.points.length;n+=3){const a=this.points[n],o=this.points[n+1],s=this.points[n+2];Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s)||(e=!0,t.x=Math.min(t.x,a),t.y=Math.min(t.y,o),t.z=Math.min(t.z,s),i.x=Math.max(i.x,a),i.y=Math.max(i.y,o),i.z=Math.max(i.z,s))}return e?{min:t,max:i}:void 0}};function ot(e,t,i,n){if(!Number.isSafeInteger(e)||e<=0||!Number.isSafeInteger(t)||t<=0)throw new Error(`invalid point cloud dimensions: ${e}x${t}`);const o=function(e){if(void 0!==a){const t=a.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}(i),s=e*t*3;if(o.byteLength!==4*s)throw new Error(`'world' holds ${o.byteLength} bytes, expected ${4*s} for ${e}x${t} xyz float32`);let r;if(nt){const e=new Uint8Array(o);r=new Float32Array(e.buffer,0,s)}else{const e=new DataView(o.buffer,o.byteOffset,o.byteLength);r=new Float32Array(s);for(let t=0;t<s;t++)r[t]=e.getFloat32(4*t,!0)}return new at(e,t,r,n)}function st(e,t){if(void 0!==e&&void 0!==e.world)return ot(e.width,e.height,e.world,t)}function rt(e){if(void 0!==e&&void 0!==e.mask)return st(e.mask,{x:e.x,y:e.y,width:e.width,height:e.height})}function ct(e,t,i){if(void 0===e||void 0===e.world)return;const n=t&&i?{x:0,y:0,width:t,height:i}:void 0;return ot(e.width,e.height,e.world,n)}function pt(e){const t=[];if(void 0===e)return t;const i=e=>{for(const n of e??[]){const e=rt(n);void 0!==e&&t.push(e),i(n.objects)}};i(e.objects);const n=ct(e.depth,e.source_width,e.source_height);return void 0!==n&&t.push(n),t}var lt,ut=class extends ee{constructor(e,t,i,n){super(t,i,e,"liveIngress/whep",!1,n),this._stream=null}async close(){const e=this._stream;return this._stream=null,e&&e.getTracks().forEach(e=>{e.stop()}),super.close()}async stream(){return this._stream?Promise.resolve(this._stream):Promise.reject("fetching stream failed")}async start(){const e=await this._getSession(),t=this.gresUrl(e),i=await this._client.fetch(t,{headers:e.authenticationHeaders(),method:"GET"});return i.status>=300?Promise.reject(`unknown status code for GET '${t}': ${i.status} (${i.statusText})`):this.onIceServers(i)}async onRemoteAnswer(e){if(!this._pc)throw new Error("onLocalOffer no peer connection");return await this._pc.setRemoteDescription(new RTCSessionDescription(e)),0!==this._queuedCandidates.length&&(await this.sendLocalCandidates(this._queuedCandidates),this._queuedCandidates=[]),this}async onIceServers(e){if(this._stream)throw new Error("onIceServers has stream");const t=new RTCPeerConnection({iceServers:ee.linkToIceServers(e.headers.get("Link"))});return t.addTransceiver("video",{direction:"sendrecv"}),t.onicecandidate=e=>this.onLocalCandidate(e),this._pc=t,this._requestLogger.info(`onIceServers ${t.iceConnectionState}`),new Promise(async(e,i)=>{t.ontrack=t=>{this._requestLogger.debug(`new track: ${t.track.kind}`),this._stream=t.streams[0]||null,e(this)},t.oniceconnectionstatechange=()=>{switch(t.iceConnectionState){case"failed":case"disconnected":this._requestLogger.debug("oniceconnectionstatechange disconnected"),i(`peer connection: ${t.iceConnectionState}`);break;case"connected":this._requestLogger.debug("oniceconnectionstatechange connected")}},await this.onLocalOffer(await t.createOffer())})}},dt=e=>{if("undefined"!=typeof process)return process.env?.[e]??void 0};(e=>{const t=dt("EYEPOP_API_KEY"),i=t?{apiKey:t}:void 0;function n(e={}){if(void 0!==e.pop&&X(e.pop),void 0===e.isLocalMode&&(e.isLocalMode=(e=>{if(void 0===e)return!1;const t=e.toLowerCase();return"true"==t||"yes"==t})(dt("EYEPOP_LOCAL_MODE"))),e.isLocalMode&&(e.eyepopUrl="http://127.0.0.1:8080"),a(e),void 0===y(e)){if(!e.isLocalMode)throw new Error("apiKey/accessToken/session/oAuth2 option or EYEPOP_API_KEY environment variable is required");e.auth={isLocal:!0}}void 0===e.sessionUuid&&(e.sessionUuid=dt("EYEPOP_SESSION_UUID")),void 0===e.sessionName&&(e.sessionName=dt("EYEPOP_SESSION_NAME")),void 0===e.pipelineImage&&(e.pipelineImage=dt("EYEPOP_PIPELINE_IMAGE")),void 0===e.pipelineVersion&&(e.pipelineVersion=dt("EYEPOP_PIPELINE_VERSION")),void 0===e.popId&&void 0===e.sessionUuid&&(e.popId=dt("EYEPOP_POP_ID")||"transient"),void 0===e.autoStart&&(e.autoStart=!0),void 0===e.stopJobs&&(e.stopJobs=!0);const t=y(e);return void 0!==t&&void 0!==t.session&&void 0!==t.session&&t.session.popId&&(e.popId=t.session.popId),new we(e)}function a(e){void 0===y(e)&&i&&(e.apiKey=i.apiKey);const t=y(e);if(!e.eyepopUrl&&t&&t.session&&t.session.eyepopUrl&&(e.eyepopUrl=t.session.eyepopUrl),e.eyepopUrl||(e.eyepopUrl=dt("EYEPOP_URL")),e.eyepopUrl||(e.eyepopUrl="https://compute.eyepop.ai"),t&&void 0!==t.oAuth2&&"boolean"==typeof t.oAuth2){const t=e.eyepopUrl&&e.eyepopUrl.match(/https:(.*).staging.eyepop.xyz/i)?{oAuth2:{domain:"dev-eyepop.us.auth0.com",clientId:"jktx3YO2UnbkNPvr05PQWf26t1kNTJyg",audience:"https://dev-app.eyepop.ai",scope:"admin:clouds access:inference-api access:datasets"}}:{oAuth2:{domain:"eyepop.us.auth0.com",clientId:"Lb9ubA9Hf3jlaqWLUx8XgA0zvotgViCl",audience:"https://api.eyepop.ai",scope:"admin:clouds access:inference-api access:datasets"}};void 0!==e.oAuth2?e.oAuth2=t.oAuth2:e.auth=t}e.jobQueueLength||(e.jobQueueLength=128)}e.endpoint=n,e.workerEndpoint=n,e.dataEndpoint=function(e={}){a(e);const t=y(e);if(void 0===t)throw new Error("apiKey/accessToken/session/oAuth2 option or EYEPOP_API_KEY environment variable is required");return void 0===e.accountId&&(e.accountId=dt("EYEPOP_ACCOUNT_ID")),void 0!==t.session&&void 0!==t.session&&t.session.accountId&&(e.accountId=t.session.accountId),new Qe(e)}})(lt||(lt={}));var ht=lt},182(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.validate=t.v7=t.v6ToV1=t.v6=t.v5=t.v4=t.v3=t.v1ToV6=t.v1=t.stringify=t.parse=t.NIL=t.MAX=void 0;var n=i(196);Object.defineProperty(t,"MAX",{enumerable:!0,get:function(){return n.default}});var a=i(465);Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}});var o=i(178);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return o.default}});var s=i(11);Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.default}});var r=i(425);Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}});var c=i(568);Object.defineProperty(t,"v1ToV6",{enumerable:!0,get:function(){return c.default}});var p=i(591);Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return p.default}});var l=i(286);Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return l.default}});var u=i(557);Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return u.default}});var d=i(356);Object.defineProperty(t,"v6",{enumerable:!0,get:function(){return d.default}});var h=i(268);Object.defineProperty(t,"v6ToV1",{enumerable:!0,get:function(){return h.default}});var m=i(299);Object.defineProperty(t,"v7",{enumerable:!0,get:function(){return m.default}});var f=i(746);Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return f.default}});var v=i(770);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return v.default}})},196(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="ffffffff-ffff-ffff-ffff-ffffffffffff"},338(e,t){"use strict";function i(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function a(e,t,i,a,o,s){return n((r=n(n(t,e),n(a,s)))<<(c=o)|r>>>32-c,i);var r,c}function o(e,t,i,n,o,s,r){return a(t&i|~t&n,e,t,o,s,r)}function s(e,t,i,n,o,s,r){return a(t&n|i&~n,e,t,o,s,r)}function r(e,t,i,n,o,s,r){return a(t^i^n,e,t,o,s,r)}function c(e,t,i,n,o,s,r){return a(i^(t|~n),e,t,o,s,r)}t.default=function(e){return function(e){const t=new Uint8Array(4*e.length);for(let i=0;i<4*e.length;i++)t[i]=e[i>>2]>>>i%4*8&255;return t}(function(e,t){const a=new Uint32Array(i(t)).fill(0);a.set(e),a[t>>5]|=128<<t%32,a[a.length-1]=t,e=a;let p=1732584193,l=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const i=p,a=l,h=u,m=d;p=o(p,l,u,d,e[t],7,-680876936),d=o(d,p,l,u,e[t+1],12,-389564586),u=o(u,d,p,l,e[t+2],17,606105819),l=o(l,u,d,p,e[t+3],22,-1044525330),p=o(p,l,u,d,e[t+4],7,-176418897),d=o(d,p,l,u,e[t+5],12,1200080426),u=o(u,d,p,l,e[t+6],17,-1473231341),l=o(l,u,d,p,e[t+7],22,-45705983),p=o(p,l,u,d,e[t+8],7,1770035416),d=o(d,p,l,u,e[t+9],12,-1958414417),u=o(u,d,p,l,e[t+10],17,-42063),l=o(l,u,d,p,e[t+11],22,-1990404162),p=o(p,l,u,d,e[t+12],7,1804603682),d=o(d,p,l,u,e[t+13],12,-40341101),u=o(u,d,p,l,e[t+14],17,-1502002290),l=o(l,u,d,p,e[t+15],22,1236535329),p=s(p,l,u,d,e[t+1],5,-165796510),d=s(d,p,l,u,e[t+6],9,-1069501632),u=s(u,d,p,l,e[t+11],14,643717713),l=s(l,u,d,p,e[t],20,-373897302),p=s(p,l,u,d,e[t+5],5,-701558691),d=s(d,p,l,u,e[t+10],9,38016083),u=s(u,d,p,l,e[t+15],14,-660478335),l=s(l,u,d,p,e[t+4],20,-405537848),p=s(p,l,u,d,e[t+9],5,568446438),d=s(d,p,l,u,e[t+14],9,-1019803690),u=s(u,d,p,l,e[t+3],14,-187363961),l=s(l,u,d,p,e[t+8],20,1163531501),p=s(p,l,u,d,e[t+13],5,-1444681467),d=s(d,p,l,u,e[t+2],9,-51403784),u=s(u,d,p,l,e[t+7],14,1735328473),l=s(l,u,d,p,e[t+12],20,-1926607734),p=r(p,l,u,d,e[t+5],4,-378558),d=r(d,p,l,u,e[t+8],11,-2022574463),u=r(u,d,p,l,e[t+11],16,1839030562),l=r(l,u,d,p,e[t+14],23,-35309556),p=r(p,l,u,d,e[t+1],4,-1530992060),d=r(d,p,l,u,e[t+4],11,1272893353),u=r(u,d,p,l,e[t+7],16,-155497632),l=r(l,u,d,p,e[t+10],23,-1094730640),p=r(p,l,u,d,e[t+13],4,681279174),d=r(d,p,l,u,e[t],11,-358537222),u=r(u,d,p,l,e[t+3],16,-722521979),l=r(l,u,d,p,e[t+6],23,76029189),p=r(p,l,u,d,e[t+9],4,-640364487),d=r(d,p,l,u,e[t+12],11,-421815835),u=r(u,d,p,l,e[t+15],16,530742520),l=r(l,u,d,p,e[t+2],23,-995338651),p=c(p,l,u,d,e[t],6,-198630844),d=c(d,p,l,u,e[t+7],10,1126891415),u=c(u,d,p,l,e[t+14],15,-1416354905),l=c(l,u,d,p,e[t+5],21,-57434055),p=c(p,l,u,d,e[t+12],6,1700485571),d=c(d,p,l,u,e[t+3],10,-1894986606),u=c(u,d,p,l,e[t+10],15,-1051523),l=c(l,u,d,p,e[t+1],21,-2054922799),p=c(p,l,u,d,e[t+8],6,1873313359),d=c(d,p,l,u,e[t+15],10,-30611744),u=c(u,d,p,l,e[t+6],15,-1560198380),l=c(l,u,d,p,e[t+13],21,1309151649),p=c(p,l,u,d,e[t+4],6,-145523070),d=c(d,p,l,u,e[t+11],10,-1120210379),u=c(u,d,p,l,e[t+2],15,718787259),l=c(l,u,d,p,e[t+9],21,-343485551),p=n(p,i),l=n(l,a),u=n(u,h),d=n(d,m)}return Uint32Array.of(p,l,u,d)}(function(e){if(0===e.length)return new Uint32Array;const t=new Uint32Array(i(8*e.length)).fill(0);for(let i=0;i<e.length;i++)t[i>>2]|=(255&e[i])<<i%4*8;return t}(e),8*e.length))}},779(e,t){"use strict";const i="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);t.default={randomUUID:i}},465(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="00000000-0000-0000-0000-000000000000"},178(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(746);t.default=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,255&t,(t=parseInt(e.slice(9,13),16))>>>8,255&t,(t=parseInt(e.slice(14,18),16))>>>8,255&t,(t=parseInt(e.slice(19,23),16))>>>8,255&t,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,255&t)}},697(e,t){"use strict";t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i},291(e,t){"use strict";let i;const n=new Uint8Array(16);t.default=function(){if(!i){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");i=crypto.getRandomValues.bind(crypto)}return i(n)}},829(e,t){"use strict";function i(e,t,i,n){switch(e){case 0:return t&i^~t&n;case 1:case 3:return t^i^n;case 2:return t&i^t&n^i&n}}function n(e,t){return e<<t|e>>>32-t}t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520],o=new Uint8Array(e.length+1);o.set(e),o[e.length]=128;const s=(e=o).length/4+2,r=Math.ceil(s/16),c=new Array(r);for(let t=0;t<r;++t){const i=new Uint32Array(16);for(let n=0;n<16;++n)i[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];c[t]=i}c[r-1][14]=8*(e.length-1)/Math.pow(2,32),c[r-1][14]=Math.floor(c[r-1][14]),c[r-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<r;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=c[e][t];for(let e=16;e<80;++e)o[e]=n(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=a[0],r=a[1],p=a[2],l=a[3],u=a[4];for(let e=0;e<80;++e){const a=Math.floor(e/20),c=n(s,5)+i(a,r,p,l)+u+t[a]+o[e]>>>0;u=l,l=p,p=n(r,30)>>>0,r=s,s=c}a[0]=a[0]+s>>>0,a[1]=a[1]+r>>>0,a[2]=a[2]+p>>>0,a[3]=a[3]+l>>>0,a[4]=a[4]+u>>>0}return Uint8Array.of(a[0]>>24,a[0]>>16,a[0]>>8,a[0],a[1]>>24,a[1]>>16,a[1]>>8,a[1],a[2]>>24,a[2]>>16,a[2]>>8,a[2],a[3]>>24,a[3]>>16,a[3]>>8,a[3],a[4]>>24,a[4]>>16,a[4]>>8,a[4])}},11(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unsafeStringify=void 0;const n=i(746),a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function o(e,t=0){return(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase()}t.unsafeStringify=o,t.default=function(e,t=0){const i=o(e,t);if(!(0,n.default)(i))throw TypeError("Stringified UUID is invalid");return i}},425(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV1State=void 0;const n=i(291),a=i(11),o={};function s(e,t,i){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=i.slice(10,16),e.node[0]|=1,e.clockseq=16383&(i[8]<<8|i[9])),e.msecs=t,e}function r(e,t,i,n,a,o,s=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(o){if(s<0||s+16>o.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`)}else o=new Uint8Array(16),s=0;t??=Date.now(),i??=0,n??=16383&(e[8]<<8|e[9]),a??=e.slice(10,16);const r=(1e4*(268435455&(t+=122192928e5))+i)%4294967296;o[s++]=r>>>24&255,o[s++]=r>>>16&255,o[s++]=r>>>8&255,o[s++]=255&r;const c=t/4294967296*1e4&268435455;o[s++]=c>>>8&255,o[s++]=255&c,o[s++]=c>>>24&15|16,o[s++]=c>>>16&255,o[s++]=n>>>8|128,o[s++]=255&n;for(let e=0;e<6;++e)o[s++]=a[e];return o}t.updateV1State=s,t.default=function(e,t,i){let c;const p=e?._v6??!1;if(e){const t=Object.keys(e);1===t.length&&"_v6"===t[0]&&(e=void 0)}if(e)c=r(e.random??e.rng?.()??(0,n.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,i);else{const e=Date.now(),a=(0,n.default)();s(o,e,a),c=r(a,o.msecs,o.nsecs,p?void 0:o.clockseq,p?void 0:o.node,t,i)}return t??(0,a.unsafeStringify)(c)}},568(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(178),a=i(11);t.default=function(e){const t=(i="string"==typeof e?(0,n.default)(e):e,Uint8Array.of((15&i[6])<<4|i[7]>>4&15,(15&i[7])<<4|(240&i[4])>>4,(15&i[4])<<4|(240&i[5])>>4,(15&i[5])<<4|(240&i[0])>>4,(15&i[0])<<4|(240&i[1])>>4,(15&i[1])<<4|(240&i[2])>>4,96|15&i[2],i[3],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]));var i;return"string"==typeof e?(0,a.unsafeStringify)(t):t}},591(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const n=i(338),a=i(988);var o=i(988);function s(e,t,i,o){return(0,a.default)(48,n.default,e,t,i,o)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return o.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return o.URL}}),s.DNS=a.DNS,s.URL=a.URL,t.default=s},988(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=t.stringToBytes=void 0;const n=i(178),a=i(11);function o(e){e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let i=0;i<e.length;++i)t[i]=e.charCodeAt(i);return t}t.stringToBytes=o,t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t.default=function(e,t,i,s,r,c){const p="string"==typeof i?o(i):i,l="string"==typeof s?(0,n.default)(s):s;if("string"==typeof s&&(s=(0,n.default)(s)),16!==s?.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+p.length);if(u.set(l),u.set(p,l.length),u=t(u),u[6]=15&u[6]|e,u[8]=63&u[8]|128,r){if((c=c||0)<0||c+16>r.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)r[c+e]=u[e];return r}return(0,a.unsafeStringify)(u)}},286(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(779),a=i(291),o=i(11);t.default=function(e,t,i){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const s=(e=e||{}).random??e.rng?.()??(0,a.default)();if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){if((i=i||0)<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[i+e]=s[e];return t}return(0,o.unsafeStringify)(s)}},557(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const n=i(829),a=i(988);var o=i(988);function s(e,t,i,o){return(0,a.default)(80,n.default,e,t,i,o)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return o.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return o.URL}}),s.DNS=a.DNS,s.URL=a.URL,t.default=s},356(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(11),a=i(425),o=i(568);t.default=function(e,t,i){e??={},i??=0;let s=(0,a.default)({...e,_v6:!0},new Uint8Array(16));if(s=(0,o.default)(s),t){if(i<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;e++)t[i+e]=s[e];return t}return(0,n.unsafeStringify)(s)}},268(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(178),a=i(11);t.default=function(e){const t=(i="string"==typeof e?(0,n.default)(e):e,Uint8Array.of((15&i[3])<<4|i[4]>>4&15,(15&i[4])<<4|(240&i[5])>>4,(15&i[5])<<4|15&i[6],i[7],(15&i[1])<<4|(240&i[2])>>4,(15&i[2])<<4|(240&i[3])>>4,16|(240&i[0])>>4,(15&i[0])<<4|(240&i[1])>>4,i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]));var i;return"string"==typeof e?(0,a.unsafeStringify)(t):t}},299(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV7State=void 0;const n=i(291),a=i(11),o={};function s(e,t,i){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=i[6]<<23|i[7]<<16|i[8]<<8|i[9],e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++),e}function r(e,t,i,n,a=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(a<0||a+16>n.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`)}else n=new Uint8Array(16),a=0;return t??=Date.now(),i??=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9],n[a++]=t/1099511627776&255,n[a++]=t/4294967296&255,n[a++]=t/16777216&255,n[a++]=t/65536&255,n[a++]=t/256&255,n[a++]=255&t,n[a++]=112|i>>>28&15,n[a++]=i>>>20&255,n[a++]=128|i>>>14&63,n[a++]=i>>>6&255,n[a++]=i<<2&255|3&e[10],n[a++]=e[11],n[a++]=e[12],n[a++]=e[13],n[a++]=e[14],n[a++]=e[15],n}t.updateV7State=s,t.default=function(e,t,i){let c;if(e)c=r(e.random??e.rng?.()??(0,n.default)(),e.msecs,e.seq,t,i);else{const e=Date.now(),a=(0,n.default)();s(o,e,a),c=r(a,o.msecs,o.seq,t,i)}return t??(0,a.unsafeStringify)(c)}},746(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(697);t.default=function(e){return"string"==typeof e&&n.default.test(e)}},770(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=i(746);t.default=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}}};const t={};function i(n){const a=t[n];if(void 0!==a)return a.exports;const o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}return i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(797)})()),"undefined"!=typeof globalThis&&globalThis.EyePopSdk&&(globalThis.EyePop=globalThis.EyePopSdk.EyePop,globalThis.PopComponentType=globalThis.EyePopSdk.PopComponentType);
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.EyePopSdk=t():e.EyePopSdk=t()}(self,()=>(()=>{var e={262(e,t,n){"use strict";function i(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n}function a(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function o(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n}function s(e,t){this.v=e,this.k=t}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function c(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function p(e){return new s(e,0)}function l(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function u(e,t){return e.get(c(e,t))}function d(e,t,n){l(e,t),t.set(e,n)}function h(e,t,n){return e.set(c(e,t),n),n}function m(e,t){l(e,t),t.add(e)}function f(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(e,t){if(null==e)return{};var n,i,a=function(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,a,o,s,r=[],c=!0,p=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=o.call(n)).done)&&(r.push(i.value),r.length!==t);c=!0);}catch(e){p=!0,a=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e){return function(){return new x(e.apply(this,arguments))}}function x(e){var t,n;function i(t,n){try{var o=e[t](n),r=o.value,c=r instanceof s;Promise.resolve(c?r.v:r).then(function(n){if(c){var s="return"===t&&r.k?t:"next";if(!r.k||n.done)return i(s,n);n=e[s](n).value}a(!!o.done,n)},function(e){i("throw",e)})}catch(e){a(2,e)}}function a(e,a){2===e?t.reject(a):t.resolve({value:a,done:e}),(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,a){return new Promise(function(o,s){var r={key:e,arg:a,resolve:o,reject:s,next:null};n?n=n.next=r:(t=n=r,i(e,a))})},"function"!=typeof e.return&&(this.return=void 0)}n.r(t),n.d(t,{AnonymousSessionApiClient:()=>Xc,AnonymousSessionClient:()=>tc,AnonymousSessionError:()=>Yr,Auth0Client:()=>Yc,AuthenticationError:()=>O,CacheKey:()=>De,ConnectError:()=>R,GenericError:()=>C,InMemoryCache:()=>qe,InvalidConfigurationError:()=>I,LocalStorageCache:()=>We,MfaApiClient:()=>Dc,MfaChallengeError:()=>Nc,MfaEnrollmentError:()=>Uc,MfaEnrollmentFactorsError:()=>Lc,MfaError:()=>Oc,MfaListAuthenticatorsError:()=>Rc,MfaRequiredError:()=>M,MfaVerifyError:()=>zc,MissingRefreshTokenError:()=>D,MissingScopesError:()=>W,MyAccountApiClient:()=>ft,MyAccountApiError:()=>vt,PasskeyApiClient:()=>qc,PasskeyChallengeError:()=>Ar,PasskeyError:()=>Wc,PasskeyGetTokenError:()=>jr,PasskeyRegisterError:()=>Er,PopupCancelledError:()=>z,PopupOpenError:()=>L,PopupTimeoutError:()=>N,ResponseType:()=>tt,TimeoutError:()=>U,UseDpopNonceError:()=>q,User:()=>nt,createAuth0Client:()=>ep,isFederatedDomain:()=>Qc}),"function"==typeof SuppressedError&&SuppressedError,x.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},x.prototype.next=function(e){return this._invoke("next",e)},x.prototype.throw=function(e){return this._invoke("throw",e)},x.prototype.return=function(e){return this._invoke("return",e)};const _={timeoutInSeconds:60},k=1e4,T="memory",S="Multifactor authentication required",E="online_access",A={name:"auth0-spa-js",version:"2.28.3"},j=()=>Date.now(),P="default";class C extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,C.prototype)}static fromPayload(e){let t=e.error,n=e.error_description;return new C(t,n)}}class I extends C{constructor(e,t){super("invalid_configuration","".concat(e," ").concat(t)),this.suggestion=t,Object.setPrototypeOf(this,I.prototype)}}class O extends C{constructor(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super(e,t),this.state=n,this.appState=i,Object.setPrototypeOf(this,O.prototype)}}class R extends C{constructor(e,t,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(e,t),this.connection=n,this.state=i,this.appState=a,Object.setPrototypeOf(this,R.prototype)}}class U extends C{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,U.prototype)}}class N extends U{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,N.prototype)}}class z extends C{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,z.prototype)}}class L extends C{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,L.prototype)}}class M extends C{constructor(e,t,n,i){super(e,t),this.mfa_token=n,this.mfa_requirements=i,Object.setPrototypeOf(this,M.prototype)}}class D extends C{constructor(e,t){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(J(e,["default"]),"', scope: '").concat(J(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,D.prototype)}}class W extends C{constructor(e,t){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(J(e,["default"]),"', missing scope: '").concat(J(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,W.prototype)}}class q extends C{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,q.prototype)}}function J(e){return e&&!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).includes(e)?e:""}const $=()=>window.crypto,F=()=>{let e="";for(;e.length<43;){const t=$().getRandomValues(new Uint8Array(43-e.length));for(const n of t)e.length<43&&n<198&&(e+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~."[n%66])}return e},H=e=>btoa(e),K=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],V=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(e).reduce((n,i)=>{if(t&&"env"===i)return n;const a=K.find(e=>e.key===i);return a&&a.type.includes(typeof e[i])&&(n[i]=e[i]),n},{})},Z=e=>{var t=e.clientId,n=i(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter(t=>void 0!==e[t]).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]}),{}))(Object.assign({client_id:t},n))).toString()},G=async e=>{const t=$().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},B=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),X=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))};var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},Q={},ee={};Object.defineProperty(ee,"__esModule",{value:!0});var te=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var i=e.locked.get(t);void 0===i?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(i.unshift(n),e.locked.set(t,i))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,i){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 i=n.pop();e.locked.set(t,n),void 0!==i&&setTimeout(i,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();ee.default=function(){return te.getInstance()};var ne=Y&&Y.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(a,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function r(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?a(e.value):new n(function(t){t(e.value)}).then(s,r)}c((i=i.apply(e,t||[])).next())})},ie=Y&&Y.__generator||function(e,t){var n,i,a,o,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function r(o){return function(r){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(a=2&o[0]?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((a=(a=s.trys).length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){s.label=o[1];break}if(6===o[0]&&s.label<a[1]){s.label=a[1],a=o;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(o);break}a[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],i=0}finally{n=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,r])}}},ae=Y;Object.defineProperty(Q,"__esModule",{value:!0});var oe=ee,se="browser-tabs-lock-key",re={key:function(e){return ne(ae,void 0,void 0,function(){return ie(this,function(e){throw new Error("Unsupported")})})},getItem:function(e){return ne(ae,void 0,void 0,function(){return ie(this,function(e){throw new Error("Unsupported")})})},clear:function(){return ne(ae,void 0,void 0,function(){return ie(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return ne(ae,void 0,void 0,function(){return ie(this,function(e){throw new Error("Unsupported")})})},setItem:function(e,t){return ne(ae,void 0,void 0,function(){return ie(this,function(e){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function ce(e){return new Promise(function(t){return setTimeout(t,e)})}function pe(e){for(var t="",n=0;n<e;n++)t+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"[Math.floor(61*Math.random())];return t}var le=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+pe(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return void 0===n&&(n=5e3),ne(this,void 0,void 0,function(){var i,a,o,s,r,c,p;return ie(this,function(l){switch(l.label){case 0:i=Date.now()+pe(4),a=Date.now()+n,o=se+"-"+t,s=void 0===this.storageHandler?re:this.storageHandler,l.label=1;case 1:return Date.now()<a?[4,ce(30)]:[3,8];case 2:return l.sent(),null!==s.getItemSync(o)?[3,5]:(r=this.id+"-"+t+"-"+i,[4,ce(Math.floor(25*Math.random()))]);case 3:return l.sent(),s.setItemSync(o,JSON.stringify({id:this.id,iat:i,timeoutKey:r,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,ce(30)];case 4:return l.sent(),null!==(c=s.getItemSync(o))&&(p=JSON.parse(c)).id===this.id&&p.iat===i?(this.acquiredIatSet.add(i),this.refreshLockWhileAcquired(o,i),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?re:this.storageHandler),[4,this.waitForSomethingToChange(a)];case 6:l.sent(),l.label=7;case 7:return i=Date.now()+pe(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return ne(this,void 0,void 0,function(){var n=this;return ie(this,function(i){return setTimeout(function(){return ne(n,void 0,void 0,function(){var n,i,a;return ie(this,function(o){switch(o.label){case 0:return[4,oe.default().lock(t)];case 1:return o.sent(),this.acquiredIatSet.has(t)?(n=void 0===this.storageHandler?re:this.storageHandler,null===(i=n.getItemSync(e))?(oe.default().unlock(t),[2]):((a=JSON.parse(i)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(a)),oe.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(oe.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return ne(this,void 0,void 0,function(){return ie(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var i=!1,a=Date.now(),o=!1;function s(){if(o||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(r),o=!0),!i){i=!0;var t=50-(Date.now()-a);t>0?setTimeout(n,t):n(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var r=setTimeout(s,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 ne(this,void 0,void 0,function(){return ie(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 ne(this,void 0,void 0,function(){var n,i,a,o;return ie(this,function(s){switch(s.label){case 0:return n=void 0===this.storageHandler?re:this.storageHandler,i=se+"-"+t,null===(a=n.getItemSync(i))?[2]:(o=JSON.parse(a)).id!==this.id?[3,2]:[4,oe.default().lock(o.iat)];case 1:s.sent(),this.acquiredIatSet.delete(o.iat),n.removeItemSync(i),oe.default().unlock(o.iat),e.notifyWaiters(),s.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,i=t,a=[],o=0;;){var s=i.keySync(o);if(null===s)break;a.push(s),o++}for(var r=!1,c=0;c<a.length;c++){var p=a[c];if(p.includes(se)){var l=i.getItemSync(p);if(null!==l){var u=JSON.parse(l);(void 0===u.timeRefreshed&&u.timeAcquired<n||void 0!==u.timeRefreshed&&u.timeRefreshed<n)&&(i.removeItemSync(p),r=!0)}}}r&&e.notifyWaiters()},e.waiters=void 0,e}(),ue=Q.default=le;class de{async runWithLock(e,t,n){const i=new AbortController,a=setTimeout(()=>i.abort(),t);try{return await navigator.locks.request(e,{mode:"exclusive",signal:i.signal},async e=>{if(clearTimeout(a),!e)throw new Error("Lock not available");return await n()})}catch(e){if(clearTimeout(a),i.signal.aborted&&"AbortError"===(null==e?void 0:e.name))throw new U;throw e}}}class he{constructor(){this.activeLocks=new Set,this.lock=new ue,this.pagehideHandler=()=>{this.activeLocks.forEach(e=>this.lock.releaseLock(e)),this.activeLocks.clear()}}async runWithLock(e,t,n){let i=!1;for(let n=0;n<10&&!i;n++)i=await this.lock.acquireLock(e,t);if(!i)throw new U;this.activeLocks.add(e),1===this.activeLocks.size&&"undefined"!=typeof window&&window.addEventListener("pagehide",this.pagehideHandler);try{return await n()}finally{this.activeLocks.delete(e),await this.lock.releaseLock(e),0===this.activeLocks.size&&"undefined"!=typeof window&&window.removeEventListener("pagehide",this.pagehideHandler)}}}let me=null;function fe(){return me||(me=function(){return"undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.locks)||void 0===e?void 0:e.request)?new de:new he;var e}()),me}const ve=new TextEncoder,ge=new TextDecoder;function ye(e){return"string"==typeof e?ve.encode(e):ge.decode(e)}function be(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new ke(`${e.name} modulusLength must be at least 2048 bits`)}let we;if(Uint8Array.prototype.toBase64)we=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;we=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let i=0;i<t.byteLength;i+=e)n.push(String.fromCharCode.apply(null,t.subarray(i,i+e)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function xe(e){return we(e)}class _e extends Error{constructor(e){var t;super(null!=e?e:"operation not supported"),this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class ke extends Error{constructor(e){var t;super(e),this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}function Te(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){if("SHA-256"===e.algorithm.hash.name)return"PS256";throw new _e("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(e){if("SHA-256"===e.algorithm.hash.name)return"RS256";throw new _e("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(e){if("P-256"===e.algorithm.namedCurve)return"ES256";throw new _e("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new _e("unsupported CryptoKey algorithm name")}}function Se(e){return e instanceof CryptoKey}function Ee(e){return Se(e)&&"public"===e.type}async function Ae(e){const{kty:t,e:n,n:i,x:a,y:o,crv:s}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:s,e:n,n:i,x:a,y:o}}const je="dpop-nonce",Pe=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","urn:okta:params:oauth:grant-type:webauthn","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"],Ce=(e,t)=>new Promise(function(n,i){const a=new MessageChannel;a.port1.onmessage=function(e){e.data.error?i(new Error(e.data.error)):n(e.data),a.port1.close()},t.postMessage(e,[a.port2])}),Ie=(e,t,n)=>{const i=new AbortController;let a;return t.signal=i.signal,Promise.race([fetch(e,t),new Promise((e,t)=>{a=setTimeout(()=>{i.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(a)})},Oe=async function(e,t,n,i,a,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:k;return a?(async(e,t,n,i,a,o,s,r,c,p)=>Ce({type:"refresh",auth:{audience:t,scope:n},timeout:a,fetchUrl:e,fetchOptions:i,useFormData:s,useMrrt:r,skipTokenStorage:c,preserveRefreshToken:p},o))(e,t,n,i,s,a,o,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0,arguments.length>9?arguments[9]:void 0):(async(e,t,n)=>{const i=await Ie(e,t,n);return{ok:i.ok,json:await i.json(),headers:(a=i.headers,[...a].reduce((e,t)=>{let n=b(t,2),i=n[0],a=n[1];return e[i]=a,e},{}))};var a})(e,i,s)};async function Re(e,t,n,a,o,s,r,c,p,l,u,d){if(p){const t=await p.generateProof({url:e,method:o.method||"GET",nonce:await p.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let h,m=null;for(let i=0;i<3;i++)try{h=await Oe(e,n,a,o,s,r,t,c,u,d),m=null;break}catch(e){m=e}if(m)throw m;const f=h.json,v=f.error,g=f.error_description,y=i(f,["error","error_description"]),b=h,w=b.headers,x=b.ok;let _;if(p&&(_=w[je],_&&await p.setNonce(_)),!x){const i=g||"HTTP error. Unable to fetch ".concat(e);if("mfa_required"===v)throw new M(v,i,y.mfa_token,y.mfa_requirements);if("missing_refresh_token"===v)throw new D(n,a);if("use_dpop_nonce"===v){if(!p||!_||l)throw new q(_);return Re(e,t,n,a,o,s,r,c,p,!0,u,d)}throw new C(v||"request_error",i)}return y}async function Ue(e,t,n){var a=e.baseUrl,o=e.timeout,s=e.audience,r=e.scope,c=e.auth0Client,p=e.useFormData,l=e.useMrrt,u=e.dpop,d=e.preserveRefreshToken,h=i(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop","preserveRefreshToken"]);const m="urn:ietf:params:oauth:grant-type:token-exchange"===h.grant_type,f="urn:okta:params:oauth:grant-type:webauthn"===h.grant_type,v="refresh_token"===h.grant_type&&l,g=m||f||v,y=Object.assign(Object.assign(Object.assign({},h),g&&s&&{audience:s}),g&&r&&{scope:r}),b=f||!p,w=b?JSON.stringify(y):Z(y),x=(_=h.grant_type,Pe.includes(_));var _;return await Re("".concat(a,"/oauth/token"),o,s||P,r,{method:"POST",body:w,headers:{"Content-Type":b?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(V(c||A)))}},t,p,l,x?u:void 0,void 0,n,d)}const Ne=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(i=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(i))).join(" ");var i},ze=(e,t,n)=>{let i;return n&&(i=e[n]),i||(i=e[P]),Ne(i,t)},Le="@@auth0spajs@@",Me="@@user@@";class De{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Le,n=arguments.length>2?arguments[2]:void 0;this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const t=b(e.split("::"),4),n=t[0],i=t[1],a=t[2],o=t[3];return new De({clientId:i,scope:o,audience:a},n)}static fromCacheEntry(e){const t=e.scope,n=e.audience,i=e.client_id;return new De({scope:t,audience:n,clientId:i})}}class We{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith(Le))}}class qe{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class Je{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||j}async setIdToken(e,t,n){var i;const a=this.getIdTokenCacheKey(e);await this.cache.set(a,{id_token:t,decodedToken:n}),await(null===(i=this.keyManifest)||void 0===i?void 0:i.add(a))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;var a;let o=await this.cache.get(e.toKey()),s=e;if(!o){const t=await this.getCacheKeys();if(!t)return;const a=this.matchExistingCacheKey(e,t);if(a&&(o=await this.cache.get(a),s=De.fromKey(a)),!o&&n&&"cache-only"!==i)return this.getEntryWithRefreshToken(e,t)}if(!o)return;const r=await this.nowProvider(),c=Math.floor(r/1e3);return o.expiresAt-t<c?o.body.refresh_token?this.modifiedCachedEntry(o,s):(await this.cache.remove(s.toKey()),void await(null===(a=this.keyManifest)||void 0===a?void 0:a.remove(s.toKey()))):o.body}async modifiedCachedEntry(e,t){const n={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},i={body:n,expiresAt:e.expiresAt};return await this.cache.set(t.toKey(),i),{refresh_token:n.refresh_token,audience:n.audience,scope:n.scope}}async set(e){var t;const n=new De({clientId:e.client_id,scope:e.scope,audience:e.audience}),i=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),i),await(null===(t=this.keyManifest)||void 0===t?void 0:t.add(n.toKey()))}async remove(e,t,n){const i=new De({clientId:e,scope:n,audience:t});await this.cache.remove(i.toKey())}async stripRefreshToken(e){var t;const n=await this.getCacheKeys();if(n)for(const i of n){const n=await this.cache.get(i);(null===(t=null==n?void 0:n.body)||void 0===t?void 0:t.refresh_token)===e&&(delete n.body.refresh_token,await this.cache.set(i,n))}}async clear(e){var t;const n=await this.getCacheKeys();n&&(await n.filter(t=>!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new De({clientId:e},Le,Me).toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const i=De.fromKey(t),a=new Set(i.scope&&i.scope.split(" ")),o=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],s=i.scope&&o.reduce((e,t)=>e&&a.has(t),!0);return i.prefix===Le&&i.clientId===e.clientId&&i.audience===e.audience&&s})[0]}async getEntryWithRefreshToken(e,t){var n;for(const i of t){const t=De.fromKey(i);if(t.prefix===Le&&t.clientId===e.clientId){const e=await this.cache.get(i);if(null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.refresh_token)return{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}}}async getRefreshTokensByAudience(e,t){var n;const i=await this.getCacheKeys();if(!i)return[];const a=new Set;for(const o of i){const i=De.fromKey(o);if(i.prefix===Le&&i.clientId===t&&i.audience===e){const e=await this.cache.get(o);(null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.refresh_token)&&a.add(e.body.refresh_token)}}return Array.from(a)}async updateEntry(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=await this.getCacheKeys();if(a)for(const o of a){if(De.fromKey(o).clientId!==n)continue;const a=await this.cache.get(o);if(!(null==a?void 0:a.body))continue;const s=a.body.refresh_token;s&&(i||s===e)&&(a.body.refresh_token=t,await this.cache.set(o,a))}}}class $e{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Fe=e=>"number"==typeof e,He=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var Ke=Y&&Y.__assign||function(){return Ke=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ke.apply(this,arguments)};function Ve(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function Ze(e,t,n){document.cookie=function(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return Ve("Expires",e.expires?e.expires.toUTCString():"")+Ve("Domain",e.domain)+Ve("Path",e.path)+Ve("Secure",e.secure)+Ve("SameSite",e.sameSite)}(n)}(e,t,Ke({path:"/"},n))}var Ge=Ze,Be=function(e,t){Ze(e,"",Ke(Ke({},t),{expires:-1}))};const Xe={get(e){const t=function(e){return function(e){for(var t={},n=e?e.split("; "):[],i=/(%[\dA-F]{2})+/gi,a=0;a<n.length;a++){var o=n[a].split("="),s=o.slice(1).join("=");'"'===s.charAt(0)&&(s=s.slice(1,-1));try{t[o[0].replace(i,decodeURIComponent)]=s.replace(i,decodeURIComponent)}catch(e){}}return t}(document.cookie)[e]}(e);if(void 0!==t)return JSON.parse(t)},save(e,t,n){let i={};"https:"===window.location.protocol&&(i={secure:!0,sameSite:"none"}),(null==n?void 0:n.daysUntilExpire)&&(i.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(i.domain=n.cookieDomain),Ge(e,JSON.stringify(t),i)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Be(e,n)}},Ye="_legacy_",Qe={get:e=>Xe.get(e)||Xe.get("".concat(Ye).concat(e)),save(e,t,n){let i={};"https:"===window.location.protocol&&(i={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(i.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(i.domain=n.cookieDomain),Ge("".concat(Ye).concat(e),JSON.stringify(t),i),Xe.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Be(e,n),Xe.remove(e,t),Xe.remove("".concat(Ye).concat(e),t)}},et={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var tt;!function(e){e.Code="code",e.ConnectCode="connect_code"}(tt||(tt={}));class nt{}var it,at=function(e){return it=it||function(){var e=function(e){var t=atob(e);return t}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxhLGk9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihpLnB1c2goby52YWx1ZSksaS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoYT1yLnJldHVybigpLE9iamVjdChhKSE9PWEpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGl9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKHQpLHRoaXMuZXJyb3I9ZSx0aGlzLmVycm9yX2Rlc2NyaXB0aW9uPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsci5wcm90b3R5cGUpfXN0YXRpYyBmcm9tUGF5bG9hZChlKXtsZXQgdD1lLmVycm9yLG89ZS5lcnJvcl9kZXNjcmlwdGlvbjtyZXR1cm4gbmV3IHIodCxvKX19Y2xhc3MgbyBleHRlbmRzIHJ7Y29uc3RydWN0b3IoZSx0KXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIiwiTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyIuY29uY2F0KG4oZSxbImRlZmF1bHQiXSksIicsIHNjb3BlOiAnIikuY29uY2F0KG4odCksIicpIikpLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsby5wcm90b3R5cGUpfX1mdW5jdGlvbiBuKGUpe3JldHVybiBlJiYhKGFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTpbXSkuaW5jbHVkZXMoZSk/ZToiIn0iZnVuY3Rpb24iPT10eXBlb2YgU3VwcHJlc3NlZEVycm9yJiZTdXBwcmVzc2VkRXJyb3I7Y29uc3Qgcz1lPT57dmFyIHQ9ZS5jbGllbnRJZCxyPWZ1bmN0aW9uKGUsdCl7dmFyIHI9e307Zm9yKHZhciBvIGluIGUpT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKGUsbykmJnQuaW5kZXhPZihvKTwwJiYocltvXT1lW29dKTtpZihudWxsIT1lJiYiZnVuY3Rpb24iPT10eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyl7dmFyIG49MDtmb3Iobz1PYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKGUpO248by5sZW5ndGg7bisrKXQuaW5kZXhPZihvW25dKTwwJiZPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLmNhbGwoZSxvW25dKSYmKHJbb1tuXV09ZVtvW25dXSl9cmV0dXJuIHJ9KGUsWyJjbGllbnRJZCJdKTtyZXR1cm4gbmV3IFVSTFNlYXJjaFBhcmFtcygoZT0+T2JqZWN0LmtleXMoZSkuZmlsdGVyKHQ9PnZvaWQgMCE9PWVbdF0pLnJlZHVjZSgodCxyKT0+T2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHQpLHtbcl06ZVtyXX0pLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IGE9e30saT1udWxsO2NvbnN0IGM9KGUsdCk9PiIiLmNvbmNhdChlLCJ8IikuY29uY2F0KHQpLGw9KGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSx1PShlLHQpPT5hW2MoZSx0KV0sZj1lPT57T2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChyPT57bGV0IG89dChyLDIpLG49b1swXTtvWzFdPT09ZSYmZGVsZXRlIGFbbl19KX0saD1lPT57Y29uc3QgdD1uZXcgVVJMU2VhcmNoUGFyYW1zKGUpLHI9e307cmV0dXJuIHQuZm9yRWFjaCgoZSx0KT0+e3JbdF09ZX0pLHJ9LGQ9YXN5bmMgZT0+e2xldCByLG4saT1lLmRhdGEsZj1pLnRpbWVvdXQsZD1pLmF1dGgscD1pLmZldGNoVXJsLHk9aS5mZXRjaE9wdGlvbnMsZz1pLnVzZUZvcm1EYXRhLGI9aS51c2VNcnJ0LE89aS5za2lwVG9rZW5TdG9yYWdlLGs9aS5wcmVzZXJ2ZVJlZnJlc2hUb2tlbixtPXQoZS5wb3J0cywxKVswXSxqPXt9O2NvbnN0IHY9ZHx8e30sXz12LmF1ZGllbmNlLHc9di5zY29wZTt0cnl7Y29uc3QgZT1nP2goeS5ib2R5KTpKU09OLnBhcnNlKHkuYm9keSk7aWYoZS5yZWZyZXNoX3Rva2VufHwicmVmcmVzaF90b2tlbiIhPT1lLmdyYW50X3R5cGUpZS5tZmFfdG9rZW4mJihuPXUoXyx3KSwhbiYmYiYmKG49YS5sYXRlc3RfcmVmcmVzaF90b2tlbikpO2Vsc2V7aWYobj11KF8sdyksIW4mJmIpe2NvbnN0IGU9YS5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+ISFPYmplY3Qua2V5cyhhKS5maW5kKHI9PntpZigibGF0ZXN0X3JlZnJlc2hfdG9rZW4iIT09cil7Y29uc3Qgbz1sKHQsciksbj1yLnNwbGl0KCJ8IilbMV0uc3BsaXQoIiAiKSxzPWUuc3BsaXQoIiAiKS5ldmVyeShlPT5uLmluY2x1ZGVzKGUpKTtyZXR1cm4gbyYmc319KSkodyxfKTtlJiYhdCYmKG49ZSl9aWYoIW4pdGhyb3cgbmV3IG8oXyx3KTt5LmJvZHk9Zz9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpfWxldCBpLGQ7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGk9bmV3IEFib3J0Q29udHJvbGxlcix5LnNpZ25hbD1pLnNpZ25hbCk7dHJ5e2Q9YXdhaXQgUHJvbWlzZS5yYWNlKFsoUD1mLG5ldyBQcm9taXNlKGU9PnNldFRpbWVvdXQoZSxQKSkpLGZldGNoKHAsT2JqZWN0LmFzc2lnbih7fSx5KSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBtLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZClyZXR1cm4gaSYmaS5hYm9ydCgpLHZvaWQgbS5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZihVPWQuaGVhZGVycyxqPVsuLi5VXS5yZWR1Y2UoKGUscik9PntsZXQgbz10KHIsMiksbj1vWzBdLHM9b1sxXTtyZXR1cm4gZVtuXT1zLGV9LHt9KSxyPWF3YWl0IGQuanNvbigpLE8pcmV0dXJuIGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4sdm9pZCBtLnBvc3RNZXNzYWdlKHtvazpkLm9rLGpzb246cixoZWFkZXJzOmp9KTtyLnJlZnJlc2hfdG9rZW4/KGImJihhLmxhdGVzdF9yZWZyZXNoX3Rva2VuPXIucmVmcmVzaF90b2tlbixTPW4sTT1yLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChlPT57bGV0IHI9dChlLDIpLG89clswXTtyWzFdPT09UyYmKGFbb109TSl9KSksKChlLHQscik9PnthW2ModCxyKV09ZX0pKHIucmVmcmVzaF90b2tlbixfLHcpLGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4pOmt8fCgoZSx0KT0+e2RlbGV0ZSBhW2MoZSx0KV19KShfLHcpLG0ucG9zdE1lc3NhZ2Uoe29rOmQub2ssanNvbjpyLGhlYWRlcnM6an0pfWNhdGNoKGUpe20ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmp9KX12YXIgUyxNLFUsUH0scD1hc3luYyBlPT57bGV0IHI9ZS5kYXRhLG89ci50aW1lb3V0LG49ci5hdXRoLGk9ci5mZXRjaFVybCxjPXIuZmV0Y2hPcHRpb25zLHU9ci51c2VGb3JtRGF0YSxkPXQoZS5wb3J0cywxKVswXTtjb25zdCBwPShufHx7fSkuYXVkaWVuY2U7dHJ5e2NvbnN0IGU9KGU9Pntjb25zdCByPW5ldyBTZXQ7cmV0dXJuIE9iamVjdC5lbnRyaWVzKGEpLmZvckVhY2gobz0+e2xldCBuPXQobywyKSxzPW5bMF0sYT1uWzFdO2woZSxzKSYmci5hZGQoYSl9KSxBcnJheS5mcm9tKHIpfSkocCk7aWYoMD09PWUubGVuZ3RoKXJldHVybiB2b2lkIGQucG9zdE1lc3NhZ2Uoe29rOiEwfSk7Y29uc3Qgcj11P2goYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7Zm9yKGNvbnN0IHQgb2YgZSl7Y29uc3QgZT11P3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7dG9rZW46dH0pKTtsZXQgbixhLGwsaDsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYobj1uZXcgQWJvcnRDb250cm9sbGVyLGE9bi5zaWduYWwpO3RyeXtoPWF3YWl0IFByb21pc2UucmFjZShbbmV3IFByb21pc2UoZT0+e2w9c2V0VGltZW91dChlLG8pfSksZmV0Y2goaSxPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sYykse2JvZHk6ZSxzaWduYWw6YX0pKV0pLmZpbmFsbHkoKCk9PmNsZWFyVGltZW91dChsKSl9Y2F0Y2goZSl7cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfSl9aWYoIWgpcmV0dXJuIG4mJm4uYWJvcnQoKSx2b2lkIGQucG9zdE1lc3NhZ2Uoe2Vycm9yOiJUaW1lb3V0IHdoZW4gZXhlY3V0aW5nICdmZXRjaCcifSk7aWYoIWgub2spe2xldCBlO3RyeXtjb25zdCB0PUpTT04ucGFyc2UoYXdhaXQgaC50ZXh0KCkpO2U9dC5lcnJvcl9kZXNjcmlwdGlvbn1jYXRjaChlKXt9cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZXx8IkhUVFAgZXJyb3IgIi5jb25jYXQoaC5zdGF0dXMpfSl9Zih0KX1kLnBvc3RNZXNzYWdlKHtvazohMH0pfWNhdGNoKGUpe2QucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZXx8IlVua25vd24gZXJyb3IgZHVyaW5nIHRva2VuIHJldm9jYXRpb24ifSl9fSx5PShlLHQpPT57aWYoIWkpcmV0dXJuITE7dHJ5e2NvbnN0IHI9bmV3IFVSTChpKS5vcmlnaW4sbz1uZXcgVVJMKGUuZmV0Y2hVcmwpO3JldHVybiBvLm9yaWdpbj09PXImJm8ucGF0aG5hbWU9PT10fWNhdGNoKGUpe3JldHVybiExfX07YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZT0+e2NvbnN0IHI9ZS5kYXRhLG89dChlLnBvcnRzLDEpWzBdO2lmKCEoInR5cGUiaW4gcil8fCJpbml0IiE9PXIudHlwZSlyZXR1cm4idHlwZSJpbiByJiYiY2xlYXIiPT09ci50eXBlPyhhPXt9LHZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITB9KSkpOiJ0eXBlImluIHImJiJyZXZva2UiPT09ci50eXBlP3kociwiL29hdXRoL3Jldm9rZSIpP3ZvaWQgcChlKTp2b2lkKG51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpOnZvaWQoImZldGNoVXJsImluIHImJnkociwiL29hdXRoL3Rva2VuIik/ZChlKTpudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjoiaW52YWxpZF9mZXRjaF91cmwiLGVycm9yX2Rlc2NyaXB0aW9uOiJVbmF1dGhvcml6ZWQgZmV0Y2ggVVJMIn0saGVhZGVyczp7fX0pKTtpZihudWxsPT09aSl0cnl7bmV3IFVSTChyLmFsbG93ZWRCYXNlVXJsKSxpPXIuYWxsb3dlZEJhc2VVcmx9Y2F0Y2goZSl7cmV0dXJufX0pfSgpOwoK"),t=e.indexOf("\n",10)+1,n=e.substring(t)+"",i=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(i)}(),new Worker(it,e)};class ot{constructor(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var t;const n=new Set((null===(t=await this.cache.get(this.manifestKey))||void 0===t?void 0:t.keys)||[]);n.add(e),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(e){const t=await this.cache.get(this.manifestKey);if(t){const n=new Set(t.keys);return n.delete(e),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return"".concat(Le,"::").concat(e)}}const st="auth0.is.authenticated",rt={memory:()=>(new qe).enclosedCache,localstorage:()=>new We},ct=e=>rt[e],pt=e=>{const t=e.openUrl,n=e.onRedirect,a=i(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},a),{openUrl:!1===t||t?t:n})},lt={NONCE:"nonce",KEYPAIR:"keypair"};class ut{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(lt).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const i=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{i.onsuccess=()=>e(i.result),i.onerror=()=>t(i.error)})}buildKey(e){const t=e?"_".concat(e):"auth0";return"".concat(this.clientId,"::").concat(t)}setNonce(e,t){return this.save(lt.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(lt.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(lt.NONCE,this.buildKey(e))}findKeyPair(){return this.find(lt.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());await Promise.all((null==n?void 0:n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t))))||[])}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith("".concat(t,"::")))}clearNonces(){return this.deleteByClientId(lt.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(lt.KEYPAIR,this.clientId)}}class dt{constructor(e){this.storage=new ut(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let i;return i={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(i,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function(e){let t=e.keyPair,n=e.url,i=e.method,a=e.nonce,o=e.accessToken;const s=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(n);return async function(e,t,n,i,a,o){const s=null==e?void 0:e.privateKey,r=null==e?void 0:e.publicKey;if(!Se(c=s)||"private"!==c.type)throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!Ee(r))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(!0!==r.extractable)throw new TypeError('"keypair.publicKey.extractable" must be true');if("string"!=typeof t)throw new TypeError('"htu" must be a string');if("string"!=typeof n)throw new TypeError('"htm" must be a string');if(void 0!==i&&"string"!=typeof i)throw new TypeError('"nonce" must be a string or undefined');if(void 0!==a&&"string"!=typeof a)throw new TypeError('"accessToken" must be a string or undefined');if(void 0!==o&&("object"!=typeof o||null===o||Array.isArray(o)))throw new TypeError('"additional" must be an object');const p=Object.assign(Object.create(null),o,{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:i,htu:t,ath:a?xe(await crypto.subtle.digest("SHA-256",ye(a))):void 0});return async function(e,t,n){if(!1===n.usages.includes("sign"))throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const i=`${xe(ye(JSON.stringify(e)))}.${xe(ye(JSON.stringify(t)))}`;return`${i}.${xe(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return be(e.algorithm),{name:e.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return be(e.algorithm),{name:e.algorithm.name};case"Ed25519":return{name:e.algorithm.name}}throw new _e}(n),n,ye(i)))}`}({alg:Te(s),typ:"dpop+jwt",jwk:await Ae(r)},p,s)}(t,s,i,a,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!Ee(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await Ae(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new _e("unsupported JWK kty")}return xe(await crypto.subtle.digest({name:"SHA-256"},ye(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var ht;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(ht||(ht={}));class mt{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return"".concat(e.replace(/\/?\/$/,""),"/").concat(t.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),i=e instanceof Request?new Request(n,e):n;return new Request(i,t)}setAuthorizationHeader(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ht.Bearer;e.headers.set("authorization","".concat(n," ").concat(t))}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),i=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",i)}async prepareRequest(e,t){const n=await this.getAccessToken(t);if(void 0===n)throw new C("missing_access_token","No access token available");let i,a;"string"==typeof n?(i=this.config.dpopNonceId?ht.DPoP:ht.Bearer,a=n):(i=n.token_type,a=n.access_token),this.setAuthorizationHeader(e,a,i),i===ht.DPoP&&await this.setDpopProofHeader(e,a)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,je);if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new q(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,i){const a=this.buildBaseRequest(e,t);await this.prepareRequest(a,i);const o=await this.config.fetch(a);return this.handleResponse(o,n)}fetchWithAuth(e,t,n){const i={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},i),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,i,n)}}class ft{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(t)}async getFactors(){const e=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/factors"),{method:"GET"},{scope:["read:me:factors"]});return(await this._handleResponse(e)).factors}async getAuthenticationMethods(e){const t=e?"?".concat(new URLSearchParams({type:e})):"",n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods").concat(t),{method:"GET"},{scope:["read:me:authentication_methods"]});return(await this._handleResponse(n)).authentication_methods}async getAuthenticationMethod(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"GET"},{scope:["read:me:authentication_methods"]});return this._handleResponse(t)}async deleteAuthenticationMethod(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"DELETE"},{scope:["delete:me:authentication_methods"]});t.ok||await this._handleResponse(t)}async updateAuthenticationMethod(e,t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},{scope:["update:me:authentication_methods"]});return this._handleResponse(n)}async enrollmentChallenge(e){var t;const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:authentication_methods"]}),i=await this._handleResponse(n),a=null!==(t=n.headers.get("location"))&&void 0!==t?t:"",o=decodeURIComponent(a.split("/").pop()||"");return Object.assign(Object.assign({},i),{id:o,location:a})}async enrollmentVerify(e){const t=e,n=t.location;t.type;const a=i(t,["location","type"]),o=await this.myAccountFetcher.fetchWithAuth("".concat(n,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},{scope:["create:me:authentication_methods"]});return this._handleResponse(o)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new vt({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new vt(t)}}class vt extends Error{constructor(e){let t=e.type,n=e.status,i=e.title,a=e.detail,o=e.validation_errors;super(a),this.name="MyAccountApiError",this.type=t,this.status=n,this.title=i,this.detail=a,this.validation_errors=o,Object.setPrototypeOf(this,vt.prototype)}}const gt={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}};var yt,bt;let wt;if("undefined"==typeof navigator||null===(yt=navigator.userAgent)||void 0===yt||null===(bt=yt.startsWith)||void 0===bt||!bt.call(yt,"Mozilla/5.0 ")){const e="v3.8.6";wt="".concat("oauth4webapi","/").concat(e)}function xt(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch(e){return!1}}const _t="ERR_INVALID_ARG_VALUE",kt="ERR_INVALID_ARG_TYPE";function Tt(e,t,n){const i=new TypeError(e,{cause:n});return Object.assign(i,{code:t}),i}const St=Symbol(),Et=Symbol(),At=Symbol(),jt=Symbol(),Pt=Symbol(),Ct=Symbol(),It=new TextEncoder,Ot=new TextDecoder;function Rt(e){return"string"==typeof e?It.encode(e):Ot.decode(e)}let Ut,Nt;if(Uint8Array.prototype.toBase64)Ut=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;Ut=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let i=0;i<t.byteLength;i+=e)n.push(String.fromCharCode.apply(null,t.subarray(i,i+e)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function zt(e){return"string"==typeof e?Nt(e):Ut(e)}Nt=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw Tt("The input to be decoded is not correctly encoded.",_t,e)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw Tt("The input to be decoded is not correctly encoded.",_t,e)}};class Lt extends Error{constructor(e,t){var n;super(e,t),f(this,"code",void 0),this.name=this.constructor.name,this.code=Wn,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}class Mt extends Error{constructor(e,t){var n;super(e,t),f(this,"code",void 0),this.name=this.constructor.name,null!=t&&t.code&&(this.code=null==t?void 0:t.code),null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}function Dt(e,t,n){return new Mt(e,{code:t,cause:n})}function Wt(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function qt(e){xt(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(null!=e?e:{});if(wt&&!t.has("user-agent")&&t.set("user-agent",wt),t.has("authorization"))throw Tt('"options.headers" must not include the "authorization" header name',_t);return t}function Jt(e,t){if(void 0!==t){if("function"==typeof t&&(t=t(e.href)),!(t instanceof AbortSignal))throw Tt('"options.signal" must return or be an instance of AbortSignal',kt);return t}}function $t(e){return e.includes("//")?e.replace("//","/"):e}function Ft(e,t,n,i,a){try{if("number"!=typeof e||!Number.isFinite(e))throw Tt("".concat(n," must be a number"),kt,a);if(e>0)return;if(t){if(0!==e)throw Tt("".concat(n," must be a non-negative number"),_t,a);return}throw Tt("".concat(n," must be a positive number"),_t,a)}catch(e){if(i)throw Dt(e.message,i,a);throw e}}function Ht(e,t,n,i){try{if("string"!=typeof e)throw Tt("".concat(t," must be a string"),kt,i);if(0===e.length)throw Tt("".concat(t," must not be empty"),_t,i)}catch(e){if(n)throw Dt(e.message,n,i);throw e}}function Kt(e){!function(e,t){if(bn(e)!==t)throw function(e){let t='"response" content-type must be ';for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(i.length>2){const e=i.pop();t+="".concat(i.join(", "),", or ").concat(e)}else 2===i.length?t+="".concat(i[0]," or ").concat(i[1]):t+=i[0];return Dt(t,Hn,e)}(e,t)}(e,"application/json")}function Vt(){return zt(crypto.getRandomValues(new Uint8Array(32)))}function Zt(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 Lt("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 Lt("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 Lt("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 Lt("unsupported CryptoKey algorithm name",{cause:e})}}function Gt(e){const t=null==e?void 0:e[Et];return"number"==typeof t&&Number.isFinite(t)?t:0}function Bt(e){const t=null==e?void 0:e[At];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Xt(){return Math.floor(Date.now()/1e3)}function Yt(e){if("object"!=typeof e||null===e)throw Tt('"as" must be an object',kt);Ht(e.issuer,'"as.issuer"')}function Qt(e){if("object"!=typeof e||null===e)throw Tt('"client" must be an object',kt);Ht(e.client_id,'"client.client_id"')}function en(e){return Ht(e,'"clientSecret"'),(t,n,i,a)=>{i.set("client_id",n.client_id),i.set("client_secret",e)}}const tn=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function nn(e,t){if(t&&"https:"!==e.protocol)throw Dt("only requests to HTTPS are allowed",Vn,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw Dt("only HTTP and HTTPS requests are allowed",Zn,e)}function an(e,t,n,i){let a;if("string"!=typeof e||!(a=tn(e)))throw Dt("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?Yn:Qn,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return nn(a,i),a}function on(e,t,n,i){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?an(e.mtls_endpoint_aliases[t],t,n,i):an(e[t],t,n,i)}class sn extends Error{constructor(e,t){var n;super(e,t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"error",void 0),f(this,"status",void 0),f(this,"error_description",void 0),f(this,"response",void 0),this.name=this.constructor.name,this.code=Dn,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===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}class rn extends Error{constructor(e,t){var n,i;super(e,t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"error",void 0),f(this,"error_description",void 0),this.name=this.constructor.name,this.code=qn,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==(n=t.cause.get("error_description"))&&void 0!==n?n:void 0,null===(i=Error.captureStackTrace)||void 0===i||i.call(Error,this,this.constructor)}}class cn extends Error{constructor(e,t){var n;super(e,t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"response",void 0),f(this,"status",void 0),this.name=this.constructor.name,this.code=Mn,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}const pn="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",ln="("+pn+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',un="("+pn+")\\s*=\\s*("+pn+")",dn=new RegExp("^[,\\s]*("+pn+")"),hn=new RegExp("^[,\\s]*"+ln+"[,\\s]*(.*)"),mn=new RegExp("^[,\\s]*"+un+"[,\\s]*(.*)"),fn=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function vn(e,t,n){if(e.status!==t){let t;var i;if(An(e),t=await async function(e){if(e.status>399&&e.status<500){ti(e),Kt(e);try{const t=await e.clone().json();if(Wt(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===(i=e.body)||void 0===i?void 0:i.cancel()),new sn("server responded with an error in the response body",{cause:t,response:e});throw Dt('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),Kn,e)}}function gn(e){if(!On.has(e))throw Tt('"options.DPoP" is not a valid DPoPHandle',_t)}const yn=Symbol();function bn(e){var t;return null===(t=e.headers.get("content-type"))||void 0===t?void 0:t.split(";")[0]}async function wn(e,t,n,i,a){if(Yt(e),Qt(t),!xt(i,Response))throw Tt('"response" must be an instance of Response',kt);if(An(i),200!==i.status)throw Dt('"response" is not a conform UserInfo Endpoint response (unexpected HTTP status code)',Kn,i);let o;if(ti(i),"application/jwt"===bn(i)){const n=await ai(await i.text(),oi.bind(void 0,t.userinfo_signed_response_alg,e.userinfo_signing_alg_values_supported,void 0),Gt(t),Bt(t),null==a?void 0:a[Ct]).then(jn.bind(void 0,t.client_id)).then(Cn.bind(void 0,e)),s=n.claims,r=n.jwt;Tn.set(i,r),o=s}else{if(t.userinfo_signed_response_alg)throw Dt("JWT UserInfo Response expected",Jn,i);o=await pi(i)}if(Ht(o.sub,'"response" body "sub" property',Fn,{body:o}),n===yn);else if(Ht(n,'"expectedSubject"'),o.sub!==n)throw Dt('unexpected "response" body "sub" property value',Xn,{expected:n,body:o,attribute:"sub"});return o}async function xn(e,t,n,i,a,o,s){return await n(e,t,a,o),o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==s?void 0:s[jt])||fetch)(i.href,{body:a,headers:Object.fromEntries(o.entries()),method:"POST",redirect:"manual",signal:Jt(i,null==s?void 0:s.signal)})}async function _n(e,t,n,i,a,o){var s;const r=on(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[St]));a.set("grant_type",i);const c=qt(null==o?void 0:o.headers);c.set("accept","application/json"),void 0!==(null==o?void 0:o.DPoP)&&(gn(o.DPoP),await o.DPoP.addProof(r,c,"POST"));const p=await xn(e,t,n,r,a,c,o);return null==o||null===(s=o.DPoP)||void 0===s||s.cacheNonce(p,r),p}const kn=new WeakMap,Tn=new WeakMap;function Sn(e){if(!e.id_token)return;const t=kn.get(e);if(!t)throw Tt('"ref" was already garbage collected or did not resolve from the proper sources',_t);return t}async function En(e,t,n,i,a,o){if(Yt(e),Qt(t),!xt(n,Response))throw Tt('"response" must be an instance of Response',kt);await vn(n,200,"Token Endpoint"),ti(n);const s=await pi(n);if(Ht(s.access_token,'"response" body "access_token" property',Fn,{body:s}),Ht(s.token_type,'"response" body "token_type" property',Fn,{body:s}),s.token_type=s.token_type.toLowerCase(),void 0!==s.expires_in){let e="number"!=typeof s.expires_in?parseFloat(s.expires_in):s.expires_in;Ft(e,!0,'"response" body "expires_in" property',Fn,{body:s}),s.expires_in=e}if(void 0!==s.refresh_token&&Ht(s.refresh_token,'"response" body "refresh_token" property',Fn,{body:s}),void 0!==s.scope&&"string"!=typeof s.scope)throw Dt('"response" body "scope" property must be a string',Fn,{body:s});if(void 0!==s.id_token){Ht(s.id_token,'"response" body "id_token" property',Fn,{body:s});const o=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&o.push("auth_time"),void 0!==t.default_max_age&&(Ft(t.default_max_age,!0,'"client.default_max_age"'),o.push("auth_time")),null!=i&&i.length&&o.push(...i);const r=await ai(s.id_token,oi.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Gt(t),Bt(t),a).then(Nn.bind(void 0,o)).then(In.bind(void 0,e)).then(Pn.bind(void 0,t.client_id)),c=r.claims,p=r.jwt;if(Array.isArray(c.aud)&&1!==c.aud.length){if(void 0===c.azp)throw Dt('ID Token "aud" (audience) claim includes additional untrusted audiences',Bn,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw Dt('unexpected ID Token "azp" (authorized party) claim value',Bn,{expected:t.client_id,claims:c,claim:"azp"})}void 0!==c.auth_time&&Ft(c.auth_time,!0,'ID Token "auth_time" (authentication time)',Fn,{claims:c}),Tn.set(n,p),kn.set(s,c)}if(void 0!==(null==o?void 0:o[s.token_type]))o[s.token_type](n,s);else if("dpop"!==s.token_type&&"bearer"!==s.token_type)throw new Lt("unsupported `token_type` value",{cause:{body:s}});return s}function An(e){let t;if(t=function(e){if(!xt(e,Response))throw Tt('"response" must be an instance of Response',kt);const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let i=t;for(;i;){var a;let t=i.match(dn);const c=null===(a=t)||void 0===a?void 0:a[1].toLowerCase();if(!c)return;const p=i.substring(t[0].length);if(p&&!p.match(/^[\s,]/))return;const l=p.match(/^\s+(.*)$/),u=!!l;i=l?l[1]:void 0;const d={};let h;if(u)for(;i;){let n,a;if(t=i.match(hn)){var o=b(t,4);if(n=o[1],a=o[2],i=o[3],a.includes("\\"))try{a=JSON.parse('"'.concat(a,'"'))}catch(e){}d[n.toLowerCase()]=a}else{if(!(t=i.match(mn))){if(t=i.match(fn)){if(Object.keys(d).length)break;var s=b(t,3);h=s[1],i=s[2];break}return}var r=b(t,4);n=r[1],a=r[2],i=r[3],d[n.toLowerCase()]=a}}else i=p||void 0;const m={scheme:c,parameters:d};h&&(m.token68=h),n.push(m)}return n.length?n:void 0}(e))throw new cn("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}function jn(e,t){return void 0!==t.claims.aud?Pn(e,t):t}function Pn(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw Dt('unexpected JWT "aud" (audience) claim value',Bn,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw Dt('unexpected JWT "aud" (audience) claim value',Bn,{expected:e,claims:t.claims,claim:"aud"});return t}function Cn(e,t){return void 0!==t.claims.iss?In(e,t):t}function In(e,t){var n,i;const a=null!==(n=null===(i=e[ui])||void 0===i?void 0:i.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==a)throw Dt('unexpected JWT "iss" (issuer) claim value',Bn,{expected:a,claims:t.claims,claim:"iss"});return t}const On=new WeakSet,Rn=Symbol(),Un={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 Nn(e,t){for(const n of e)if(void 0===t.claims[n])throw Dt('JWT "'.concat(n,'" (').concat(Un[n],") claim missing"),Fn,{claims:t.claims});return t}const zn=Symbol(),Ln=Symbol(),Mn="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Dn="OAUTH_RESPONSE_BODY_ERROR",Wn="OAUTH_UNSUPPORTED_OPERATION",qn="OAUTH_AUTHORIZATION_RESPONSE_ERROR",Jn="OAUTH_JWT_USERINFO_EXPECTED",$n="OAUTH_PARSE_ERROR",Fn="OAUTH_INVALID_RESPONSE",Hn="OAUTH_RESPONSE_IS_NOT_JSON",Kn="OAUTH_RESPONSE_IS_NOT_CONFORM",Vn="OAUTH_HTTP_REQUEST_FORBIDDEN",Zn="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Gn="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Bn="OAUTH_JWT_CLAIM_COMPARISON_FAILED",Xn="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",Yn="OAUTH_MISSING_SERVER_METADATA",Qn="OAUTH_INVALID_SERVER_METADATA";async function ei(e){if(!xt(e,Response))throw Tt('"response" must be an instance of Response',kt);await vn(e,200,"Revocation Endpoint")}function ti(e){if(e.bodyUsed)throw Tt('"response" body has been used already',_t)}function ni(e){const t=e.algorithm;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new Lt("unsupported ".concat(t.name," modulusLength"),{cause:e})}function ii(e){switch(e.algorithm.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Lt("unsupported ECDSA namedCurve",{cause:e})}}async function ai(e,t,n,i,a){let o,s,r=e.split("."),c=r[0],p=r[1],l=r.length;if(5===l){if(void 0===a)throw new Lt("JWE decryption is not configured",{cause:e});var u=(e=await a(e)).split(".");c=u[0],p=u[1],l=u.length}if(3!==l)throw Dt("Invalid JWT",Fn,e);try{o=JSON.parse(Rt(zt(c)))}catch(e){throw Dt("failed to parse JWT Header body as base64url encoded JSON",$n,e)}if(!Wt(o))throw Dt("JWT Header must be a top level object",Fn,e);if(t(o),void 0!==o.crit)throw new Lt('no JWT "crit" header parameter extensions are supported',{cause:{header:o}});try{s=JSON.parse(Rt(zt(p)))}catch(e){throw Dt("failed to parse JWT Payload body as base64url encoded JSON",$n,e)}if(!Wt(s))throw Dt("JWT Payload must be a top level object",Fn,e);const d=Xt()+n;if(void 0!==s.exp){if("number"!=typeof s.exp)throw Dt('unexpected JWT "exp" (expiration time) claim type',Fn,{claims:s});if(s.exp<=d-i)throw Dt('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Gn,{claims:s,now:d,tolerance:i,claim:"exp"})}if(void 0!==s.iat&&"number"!=typeof s.iat)throw Dt('unexpected JWT "iat" (issued at) claim type',Fn,{claims:s});if(void 0!==s.iss&&"string"!=typeof s.iss)throw Dt('unexpected JWT "iss" (issuer) claim type',Fn,{claims:s});if(void 0!==s.nbf){if("number"!=typeof s.nbf)throw Dt('unexpected JWT "nbf" (not before) claim type',Fn,{claims:s});if(s.nbf>d+i)throw Dt('unexpected JWT "nbf" (not before) claim value',Gn,{claims:s,now:d,tolerance:i,claim:"nbf"})}if(void 0!==s.aud&&"string"!=typeof s.aud&&!Array.isArray(s.aud))throw Dt('unexpected JWT "aud" (audience) claim type',Fn,{claims:s});return{header:o,claims:s,jwt:e}}function oi(e,t,n,i){if(void 0===e)if(Array.isArray(t)){if(!t.includes(i.alg))throw Dt('unexpected JWT "alg" header parameter',Fn,{header:i,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw Dt('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if("string"==typeof n?i.alg!==n:"function"==typeof n?!n(i.alg):!n.includes(i.alg))throw Dt('unexpected JWT "alg" header parameter',Fn,{header:i,expected:n,reason:"default value"})}else if("string"==typeof e?i.alg!==e:!e.includes(i.alg))throw Dt('unexpected JWT "alg" header parameter',Fn,{header:i,expected:e,reason:"client configuration"})}function si(e,t){const n=e.getAll(t),i=n[0];if(n.length>1)throw Dt('"'.concat(t,'" parameter must be provided only once'),Fn);return i}const ri=Symbol(),ci=Symbol();async function pi(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt;try{t=await e.json()}catch(t){throw n(e),Dt('failed to parse "response" body as JSON',$n,t)}if(!Wt(t))throw Dt('"response" body must be a top level object',Fn,{body:t});return t}const li=Symbol(),ui=Symbol(),di=new TextEncoder,hi=new TextDecoder,mi=new TextDecoder("utf-8",{fatal:!0});function fi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.reduce((e,t)=>e+t.length,0),a=new Uint8Array(i);let o=0;for(const e of t)a.set(e,o),o+=e.length;return a}function vi(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);if(i>127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=i}return t}const gi=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))},yi=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];if(i.length>2){const t=i.pop();e+="one of type ".concat(i.join(", "),", or ").concat(t,".")}else 2===i.length?e+="one of type ".concat(i[0]," or ").concat(i[1],"."):e+="of type ".concat(i[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 o;null!==(o=t.constructor)&&void 0!==o&&o.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}("Key for the ".concat(e," algorithm must be "),t,...i)};class bi extends Error{constructor(e,t){var n;super(e,t),f(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}f(bi,"code","ERR_JOSE_GENERIC");class wi extends bi{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:i,payload:t}}),f(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),f(this,"claim",void 0),f(this,"reason",void 0),f(this,"payload",void 0),this.claim=n,this.reason=i,this.payload=t}}f(wi,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class xi extends bi{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:i,payload:t}}),f(this,"code","ERR_JWT_EXPIRED"),f(this,"claim",void 0),f(this,"reason",void 0),f(this,"payload",void 0),this.claim=n,this.reason=i,this.payload=t}}f(xi,"code","ERR_JWT_EXPIRED");class _i extends bi{constructor(){super(...arguments),f(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}f(_i,"code","ERR_JOSE_ALG_NOT_ALLOWED");class ki extends bi{constructor(){super(...arguments),f(this,"code","ERR_JOSE_NOT_SUPPORTED")}}f(ki,"code","ERR_JOSE_NOT_SUPPORTED"),f(class extends bi{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),f(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),f(class extends bi{constructor(){super(...arguments),f(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Ti extends bi{constructor(){super(...arguments),f(this,"code","ERR_JWS_INVALID")}}f(Ti,"code","ERR_JWS_INVALID");class Si extends bi{constructor(){super(...arguments),f(this,"code","ERR_JWT_INVALID")}}f(Si,"code","ERR_JWT_INVALID"),f(class extends bi{constructor(){super(...arguments),f(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Ei extends bi{constructor(){super(...arguments),f(this,"code","ERR_JWKS_INVALID")}}f(Ei,"code","ERR_JWKS_INVALID");class Ai extends bi{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),f(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}f(Ai,"code","ERR_JWKS_NO_MATCHING_KEY");class ji extends bi{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),f(this,Symbol.asyncIterator,w(function*(){})),f(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}f(ji,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Pi extends bi{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),f(this,"code","ERR_JWKS_TIMEOUT")}}f(Pi,"code","ERR_JWKS_TIMEOUT");class Ci extends bi{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),f(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}f(Ci,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Ii=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}};function Oi(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}const Ri="The input to be decoded is not correctly encoded.";function Ui(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64("string"==typeof e?e:hi.decode(e),{alphabet:"base64url"})}catch(e){throw new TypeError(Ri,{cause:e})}let t=e;if(t instanceof Uint8Array&&(t=hi.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError(Ri);t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Oi(t)}catch(e){throw new TypeError(Ri)}}function Ni(e){let t=e;return"string"==typeof t&&(t=di.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();const t=[];for(let n=0;n<e.length;n+=32768)t.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(t.join(""))}(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function zi(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function Li(e){return zi(e)&&Array.isArray(e.keys)&&Array.from(e.keys).every(zi)}function Mi(e,t,n){try{return Ui(e)}catch(e){throw new n("Failed to base64url decode the ".concat(t))}}async function Di(e,t){var n,i,a,o;if("RSA"===t.kty&&"oth"in t&&void 0!==t.oth)throw new ki('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');if(!e.kty.includes(t.kty))throw new ki('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');const s=null!==(n=null===(i=e.resolve)||void 0===i?void 0:i.call(e,{kty:t.kty,crv:t.crv}))&&void 0!==n?n:e.subtle,r=!(!t.d&&!t.priv),c=g({},t);return"AKP"!==c.kty&&delete c.alg,delete c.use,crypto.subtle.importKey("jwk",c,s,null!==(a=t.ext)&&void 0!==a?a:!r,null!==(o=t.key_ops)&&void 0!==o?o:e.usages[r?1:0])}function Wi(e){return g({__proto__:null},e)}const qi=e=>e[Symbol.toStringTag];const Ji=0,$i=1,Fi=2,Hi=3;let Ki;const Vi={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function Zi(e,t,n){Ki||(Ki=new WeakMap);const i=Ki.get(e);return n&&(i?i[t]=n:Ki.set(e,{[t]:n})),null!=n?n:null==i?void 0:i[t]}const Gi=async(e,t,n)=>{var i;return null!==(i=Zi(e,n.alg))&&void 0!==i?i:Zi(e,n.alg,await Di(n,g(g({},t),{},{alg:n.alg})))};async function Bi(e,t,n){const i=function(e,t,n){const i=e.alg,a=e.secret,o="decrypt"===n||"sign"===n;if(a&&t instanceof Uint8Array)return[Ji,t];if(zi(t)){const s=function(e){const t=Wi(e);if(void 0!==t.ext&&"boolean"!=typeof t.ext)throw new TypeError('"ext" (Extractable) Parameter must be a boolean');if(void 0!==t.key_ops){const e=t.key_ops,n=Array.isArray(e)?[...e]:void 0;if(!n||n.some(e=>"string"!=typeof e)||new Set(n).size!==n.length)throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}(t);if("string"!=typeof s.kty)throw new TypeError(a?yi(i,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):yi(i,t,"CryptoKey","KeyObject","JSON Web Key"));if(!(a?"oct"===s.kty&&"string"==typeof s.k:"oct"!==s.kty&&(o?"AKP"===s.kty&&"string"==typeof s.priv||"string"==typeof s.d:void 0===s.d&&void 0===s.priv)))throw new TypeError(a?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':"JSON Web Key for this operation must be a ".concat(o?"private":"public"," JWK"));return((e,t,n)=>{const i=e.alg;if(void 0!==t.use){const e="sign"===n||"verify"===n?"sig":"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!==i)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(i,'" when present'));if(Array.isArray(t.key_ops)){var a;const i="encrypt"===n||"decrypt"===n?null===(a=e.ops)||void 0===a?void 0:a["encrypt"===n?0:1]:n;if(i&&!t.key_ops.includes(i))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}})(e,s,n),[Hi,t,s]}if(!(e=>Ii(e)||(e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]))(e))(t))throw new TypeError(a?yi(i,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):yi(i,t,"CryptoKey","KeyObject","JSON Web Key"));if(a){if("secret"!==t.type)throw new TypeError("".concat(qi(t),' instances for symmetric algorithms must be of type "secret"'))}else{if("secret"===t.type)throw new TypeError("".concat(qi(t),' instances for asymmetric algorithms must not be of type "secret"'));const e=o?"private":"public";if(("public"===t.type||"private"===t.type)&&t.type!==e){const i="sign"===n?"signing":"verify"===n?"verifying":"".concat(n.slice(0,-1),"tion");throw new TypeError("".concat(qi(t)," instances for asymmetric algorithm ").concat(i,' must be of type "').concat(e,'"'))}}return Ii(t)?[$i,t]:[Fi,t]}(e,t,n);switch(i[0]){case Ji:case $i:return i[1];case Hi:{const t=i[1],n=i[2];if("oct"===n.kty)return Ui(n.k);if(!Object.isFrozen(t)){const e=t.key_ops;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}return Gi(t,n,e)}case Fi:{const t=i[1];return"secret"===t.type?t.export():"toCryptoKey"in t&&"function"==typeof t.toCryptoKey?((e,t)=>{var n,i,a;const o=Zi(e,t.alg);if(o)return o;const s="public"===e.type,r=t.usages[s?0:1],c=e.asymmetricKeyType,p=Vi[null===(n=e.asymmetricKeyDetails)||void 0===n?void 0:n.namedCurve],l=null!==(i=null===(a=t.resolve)||void 0===a?void 0:a.call(t,{crv:p,asymmetricKeyType:c}))&&void 0!==i?i:t.subtle;return Zi(e,t.alg,e.toCryptoKey(l,s,r))})(t,e):Gi(t,t.export({format:"jwk"}),e)}}}function Xi(e){const t={__proto__:null};for(const n in e)t[n]=g(g({},e[n]),{},{alg:n});return t}const Yi=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Qi=[[],["deriveBits"]],ea=[[],[]];function ta(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:"SHA-".concat(e)},usages:Yi,ops:["wrapKey","unwrapKey"]}}function na(){return{kty:["EC","OKP"],subtle:{name:"ECDH"},resolve:e=>{let t=e.kty,n=e.crv,i=e.asymmetricKeyType;if("X25519"===n||"x25519"===i)return{name:"X25519"};if("OKP"===t)throw new ki('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:n}},usages:Qi,ops:[void 0,"deriveBits"]}}function ia(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{kty:["oct"],secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:ea,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function aa(){return{kty:["oct"],secret:!0,subtle:{name:"PBKDF2"},usages:ea,ops:["deriveBits","deriveBits"]}}const oa=Xi({dir:{kty:["oct"],secret:!0,subtle:{name:"AES-GCM"},usages:ea,ops:["encrypt","decrypt"]},"RSA-OAEP":ta(1),"RSA-OAEP-256":ta(256),"RSA-OAEP-384":ta(384),"RSA-OAEP-512":ta(512),"ECDH-ES":na(),"ECDH-ES+A128KW":na(),"ECDH-ES+A192KW":na(),"ECDH-ES+A256KW":na(),A128KW:ia(128),A192KW:ia(192),A256KW:ia(256),A128GCMKW:ia(128,!0),A192GCMKW:ia(192,!0),A256GCMKW:ia(256,!0),"PBES2-HS256+A128KW":aa(),"PBES2-HS384+A192KW":aa(),"PBES2-HS512+A256KW":aa()}),sa=["encrypt","decrypt"];function ra(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:ea,ops:sa,cekBits:e,ivBits:t?128:96,cbc:t}}Xi({A128GCM:ra(128),A192GCM:ra(192),A256GCM:ra(256),"A128CBC-HS256":ra(256,!0),"A192CBC-HS384":ra(384,!0),"A256CBC-HS512":ra(512,!0)});const ca={__proto__:null,b64:!0};function pa(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError('"'.concat(e,'" option must be an array of strings'));if(t)return new Set(t)}function la(e,t,n,i,a){if(void 0!==a.crit&&void 0===(null==i?void 0:i.crit))throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||void 0===i.crit)return[];if(!Array.isArray(i.crit)||0===i.crit.length||i.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');const o=void 0===n?t:g(g({__proto__:null},n),t);for(const t of i.crit){if(!(t in o))throw new ki('Extension Header Parameter "'.concat(t,'" is not recognized'));if(!Object.hasOwn(a,t)||void 0===a[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(o[t]&&(!Object.hasOwn(i,t)||void 0===i[t]))throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return i.crit}function ua(e,t){if(t.includes("b64")){const t=e.b64;if("boolean"!=typeof t)throw new Ti('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}var da,ha;let ma,fa;if("undefined"==typeof navigator||null===(da=navigator.userAgent)||void 0===da||null===(ha=da.startsWith)||void 0===ha||!ha.call(da,"Mozilla/5.0 ")){const e="v6.8.4";fa="".concat("openid-client","/").concat(e),ma={"user-agent":fa}}const va=e=>ga.get(e);let ga,ya;function ba(e){return void 0!==e?en(e):(ya||(ya=new WeakMap),(e,t,n,i)=>{let a;return(a=ya.get(t))||(function(e,t){if("string"!=typeof e)throw Ta("".concat(t," must be a string"),ka);if(0===e.length)throw Ta("".concat(t," must not be empty"),_a)}(t.client_secret,'"metadata.client_secret"'),a=en(t.client_secret),ya.set(t,a)),a(e,t,n,i)})}const wa=yn,xa=jt,_a="ERR_INVALID_ARG_VALUE",ka="ERR_INVALID_ARG_TYPE";function Ta(e,t,n){const i=new TypeError(e,{cause:n});return Object.assign(i,{code:t}),i}class Sa extends Error{constructor(e,t){var n;super(e,t),f(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}function Ea(e,t,n){return new Sa(e,{cause:t,code:n})}function Aa(e){if(e instanceof TypeError||e instanceof Sa||e instanceof sn||e instanceof rn||e instanceof cn)throw e;if(e instanceof Mt)switch(e.code){case Vn:throw Ea("only requests to HTTPS are allowed",e,e.code);case Zn:throw Ea("only requests to HTTP or HTTPS are allowed",e,e.code);case Kn:throw Ea("unexpected HTTP response status code",e.cause,e.code);case Hn:throw Ea("unexpected response content-type",e.cause,e.code);case $n:throw Ea("parsing error occured",e,e.code);case Fn:throw Ea("invalid response encountered",e,e.code);case Bn:throw Ea("unexpected JWT claim value encountered",e,e.code);case Xn:throw Ea("unexpected JSON attribute value encountered",e,e.code);case Gn:throw Ea("JWT timestamp claim value failed validation",e,e.code);default:throw Ea(e.message,e,e.code)}if(e instanceof Lt)throw Ea("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Ea("runtime operation error",e,Wn);case"NotSupportedError":throw Ea("runtime unsupported operation",e,Wn);case"TimeoutError":throw Ea("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Ea("operation aborted",e,"OAUTH_ABORT")}throw new Sa("something went wrong",{cause:e})}new TextDecoder;const ja=Symbol();class Pa{constructor(e,t,n,i){var a,o,s,r,c;if("string"!=typeof t||!t.length)throw Ta('"clientId" must be a non-empty string',ka);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null===(a=n)||void 0===a?void 0:a.client_id)&&t!==n.client_id)throw Ta('"clientId" and "metadata.client_id" must be the same',_a);const p=g(g({},structuredClone(n)),{},{client_id:t});let l;p[Et]=null!==(o=null===(s=n)||void 0===s?void 0:s[Et])&&void 0!==o?o:0,p[At]=null!==(r=null===(c=n)||void 0===c?void 0:c[At])&&void 0!==r?r:30,l=i||("string"==typeof p.client_secret&&p.client_secret.length?ba(p.client_secret):(e,t,n,i)=>{n.set("client_id",t.client_id)});let u=Object.freeze(p);const d=structuredClone(e);ja in e&&(d[ui]=t=>{let n=t.claims.tid;return e.issuer.replace("{tenantid}",n)});let h=Object.freeze(d);ga||(ga=new WeakMap),ga.set(this,{__proto__:null,as:h,c:u,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(va(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(va(this).c)}get timeout(){return va(this).timeout}set timeout(e){va(this).timeout=e}get[xa](){return va(this).fetch}set[xa](e){va(this).fetch=e}}function Ca(e){Object.defineProperties(e,function(e){let t;if(void 0!==e.expires_in){const n=new Date;n.setSeconds(n.getSeconds()+e.expires_in),t=n.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 Sn(this)}catch(e){return}}}}}(e))}async function Ia(e,t,n){var i;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=null===(i=e.headers.get("retry-after"))||void 0===i?void 0:i.trim();if(void 0===o)return;let s;if(/^\d+$/.test(o))s=parseInt(o,10);else{const e=new Date(o);if(Number.isFinite(e.getTime())){const t=new Date,n=e.getTime()-t.getTime();n>0&&(s=Math.ceil(n/1e3))}}if(a&&!Number.isFinite(s))throw new Mt("invalid Retry-After header value",{cause:e});s>t&&await Oa(s-t,n)}function Oa(e,t){return new Promise((n,i)=>{const a=e=>{try{t.throwIfAborted()}catch(e){return void i(e)}if(e<=0)return void n();const o=Math.min(e,5);setTimeout(()=>a(e-o),1e3*o)};a(e)})}async function Ra(e,t){qa(e);const n=va(e),i=n.as,a=n.c,o=n.auth,s=n.fetch,r=n.tlsOnly,c=n.timeout;return async function(e,t,n,i,a){Yt(e),Qt(t);const o=on(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==a?void 0:a[St])),s=new URLSearchParams(i);s.set("client_id",t.client_id);const r=qt(null==a?void 0:a.headers);return r.set("accept","application/json"),xn(e,t,n,o,s,r,a)}(i,a,o,t,{[jt]:s,[St]:!r,headers:new Headers(ma),signal:Ja(c)}).then(e=>async function(e,t,n){if(Yt(e),Qt(t),!xt(n,Response))throw Tt('"response" must be an instance of Response',kt);await vn(n,200,"Backchannel Authentication Endpoint"),ti(n);const i=await pi(n);Ht(i.auth_req_id,'"response" body "auth_req_id" property',Fn,{body:i});let a="number"!=typeof i.expires_in?parseFloat(i.expires_in):i.expires_in;return Ft(a,!0,'"response" body "expires_in" property',Fn,{body:i}),i.expires_in=a,void 0!==i.interval&&Ft(i.interval,!1,'"response" body "interval" property',Fn,{body:i}),i}(i,a,e)).catch(Aa)}async function Ua(e,t,n,i){var a,o;qa(e),n=new URLSearchParams(n);let s=null!==(a=t.interval)&&void 0!==a?a:5;const r=null!==(o=null==i?void 0:i.signal)&&void 0!==o?o:AbortSignal.timeout(1e3*t.expires_in);try{await Oa(s,r)}catch(e){Aa(e)}const c=va(e),p=c.as,l=c.c,u=c.auth,d=c.fetch,h=c.tlsOnly,m=c.nonRepudiation,f=c.timeout,v=c.decrypt,y=(a,o)=>Ua(e,g(g({},t),{},{interval:a}),n,g(g({},i),{},{signal:r,flag:o})),b=function(e,t){const n=Ja(t);if(!n)return{signal:e,cleanup(){}};const i=new AbortController,a=e=>{const t=e.target;i.abort(t.reason)};return e.aborted?i.abort(e.reason):n.aborted?i.abort(n.reason):(e.addEventListener("abort",a,{once:!0}),n.addEventListener("abort",a,{once:!0})),{signal:i.signal,cleanup(){e.removeEventListener("abort",a),n.removeEventListener("abort",a)}}}(r,f),w=await async function(e,t,n,i,a){Yt(e),Qt(t),Ht(i,'"authReqId"');const o=new URLSearchParams(null==a?void 0:a.additionalParameters);return o.set("auth_req_id",i),_n(e,t,n,"urn:openid:params:grant-type:ciba",o,a)}(p,l,u,t.auth_req_id,{[jt]:d,[St]:!h,additionalParameters:n,DPoP:null==i?void 0:i.DPoP,headers:new Headers(ma),signal:b.signal}).catch(Aa).finally(b.cleanup);var x;if(503===w.status&&w.headers.has("retry-after"))return await Ia(w,s,r,!0),await(null===(x=w.body)||void 0===x?void 0:x.cancel()),y(s);const _=async function(e,t,n,i){return En(e,t,n,void 0,null==i?void 0:i[Ct],null==i?void 0:i.recognizedTokenTypes)}(p,l,w,{[Ct]:v});let k;try{k=await _}catch(e){if(Fa(e,i))return y(s,Ha);if(e instanceof sn)switch(e.error){case"slow_down":s+=5;case"authorization_pending":return await Ia(e.response,s,r),y(s)}Aa(e)}return k.id_token&&await(null==m?void 0:m(w)),Ca(k),k}function Na(e){va(e).tlsOnly=!1}async function za(e,t,n,i,a){if(qa(e),!((null==a?void 0:a.flag)===Ha||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw Ta('"currentUrl" must be an instance of URL, or Request',ka);let o,s;const r=va(e),c=r.as,p=r.c,l=r.auth,u=r.fetch,d=r.tlsOnly,h=r.jarm,m=r.hybrid,f=r.nonRepudiation,v=r.timeout,y=r.decrypt,w=r.implicit;if((null==a?void 0:a.flag)===Ha)o=a.authResponse,s=a.redirectUri;else{if(!(t instanceof URL)){const e=t;switch(t=new URL(t.url),e.method){case"GET":break;case"POST":const n=new URLSearchParams(await async function(e){if("POST"!==e.method)throw Tt("form_post responses are expected to use the POST method",_t,{cause:e});if("application/x-www-form-urlencoded"!==bn(e))throw Tt("form_post responses are expected to use the application/x-www-form-urlencoded content-type",_t,{cause:e});return async function(e){if(e.bodyUsed)throw Tt("form_post Request instances must contain a readable body",_t,{cause:e});return e.text()}(e)}(e));if(m)t.hash=n.toString();else for(const e of n.entries()){var x=b(e,2);const n=x[0],i=x[1];t.searchParams.append(n,i)}break;default:throw Ta("unexpected Request HTTP method",_a)}}switch(s=function(e){return(e=new URL(e)).search="",e.hash="",e.href}(t),!0){case!!h:o=await h(t,null==n?void 0:n.expectedState);break;case!!m:o=await m(t,null==n?void 0:n.expectedNonce,null==n?void 0:n.expectedState,null==n?void 0:n.maxAge);break;case!!w:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{o=function(e,t,n,i){if(Yt(e),Qt(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Tt('"parameters" must be an instance of URLSearchParams, or URL',kt);if(si(n,"response"))throw Dt('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Fn,{parameters:n});const a=si(n,"iss"),o=si(n,"state");if(!a&&e.authorization_response_iss_parameter_supported)throw Dt('response parameter "iss" (issuer) missing',Fn,{parameters:n});if(a&&a!==e.issuer)throw Dt('unexpected "iss" (issuer) response parameter value',Fn,{expected:e.issuer,parameters:n});switch(i){case void 0:case ci:if(void 0!==o)throw Dt('unexpected "state" response parameter encountered',Fn,{expected:void 0,parameters:n});break;case ri:break;default:if(Ht(i,'"expectedState" argument'),o!==i)throw Dt(void 0===o?'response parameter "state" missing':'unexpected "state" response parameter value',Fn,{expected:i,parameters:n})}if(si(n,"error"))throw new rn("authorization response from the server is an error",{cause:n});const s=si(n,"id_token"),r=si(n,"token");if(void 0!==s||void 0!==r)throw new Lt("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),On.add(c),c;var c}(c,p,t.searchParams,null==n?void 0:n.expectedState)}catch(e){Aa(e)}}}const _=await async function(e,t,n,i,a,o,s){if(Yt(e),Qt(t),!On.has(i))throw Tt('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',_t);Ht(a,'"redirectUri"');const r=si(i,"code");if(!r)throw Dt('no authorization code in "callbackParameters"',Fn);const c=new URLSearchParams(null==s?void 0:s.additionalParameters);return c.set("redirect_uri",a),c.set("code",r),o!==Rn&&(Ht(o,'"codeVerifier"'),c.set("code_verifier",o)),_n(e,t,n,"authorization_code",c,s)}(c,p,l,o,s,(null==n?void 0:n.pkceCodeVerifier)||Rn,{additionalParameters:i,[jt]:u,[St]:!d,DPoP:null==a?void 0:a.DPoP,headers:new Headers(ma),signal:Ja(v)}).catch(Aa);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);const k=async function(e,t,n,i){return"string"==typeof(null==i?void 0:i.expectedNonce)||"number"==typeof(null==i?void 0:i.maxAge)||null!=i&&i.requireIdToken?async function(e,t,n,i,a,o,s){const r=[];switch(i){case void 0:i=zn;break;case zn:break;default:Ht(i,'"expectedNonce" argument'),r.push("nonce")}switch(null!=a||(a=t.default_max_age),a){case void 0:a=Ln;break;case Ln:break;default:Ft(a,!0,'"maxAge" argument'),r.push("auth_time")}const c=await En(e,t,n,r,o,s);Ht(c.id_token,'"response" body "id_token" property',Fn,{body:c});const p=Sn(c);if(a!==Ln){const e=Xt()+Gt(t),n=Bt(t);if(p.auth_time+a<e-n)throw Dt("too much time has elapsed since the last End-User authentication",Gn,{claims:p,now:e,tolerance:n,claim:"auth_time"})}if(i===zn){if(void 0!==p.nonce)throw Dt('unexpected ID Token "nonce" claim value',Bn,{expected:void 0,claims:p,claim:"nonce"})}else if(p.nonce!==i)throw Dt('unexpected ID Token "nonce" claim value',Bn,{expected:i,claims:p,claim:"nonce"});return c}(e,t,n,i.expectedNonce,i.maxAge,i[Ct],i.recognizedTokenTypes):async function(e,t,n,i,a){const o=await En(e,t,n,void 0,i,a),s=Sn(o);if(s){if(void 0!==t.default_max_age){Ft(t.default_max_age,!0,'"client.default_max_age"');const e=Xt()+Gt(t),n=Bt(t);if(s.auth_time+t.default_max_age<e-n)throw Dt("too much time has elapsed since the last End-User authentication",Gn,{claims:s,now:e,tolerance:n,claim:"auth_time"})}if(void 0!==s.nonce)throw Dt('unexpected ID Token "nonce" claim value',Bn,{expected:void 0,claims:s,claim:"nonce"})}return o}(e,t,n,null==i?void 0:i[Ct],null==i?void 0:i.recognizedTokenTypes)}(c,p,_,{expectedNonce:null==n?void 0:n.expectedNonce,maxAge:null==n?void 0:n.maxAge,requireIdToken:null==n?void 0:n.idTokenExpected,[Ct]:y});let T;try{T=await k}catch(t){if(Fa(t,a))return za(e,void 0,n,i,g(g({},a),{},{flag:Ha,authResponse:o,redirectUri:s}));Aa(t)}return T.id_token&&await(null==f?void 0:f(_)),Ca(T),T}async function La(e,t,n,i){qa(e),n=new URLSearchParams(n);const a=va(e),o=a.as,s=a.c,r=a.auth,c=a.fetch,p=a.tlsOnly,l=a.nonRepudiation,u=a.timeout,d=a.decrypt,h=await async function(e,t,n,i,a){Yt(e),Qt(t),Ht(i,'"refreshToken"');const o=new URLSearchParams(null==a?void 0:a.additionalParameters);return o.set("refresh_token",i),_n(e,t,n,"refresh_token",o,a)}(o,s,r,t,{[jt]:c,[St]:!p,additionalParameters:n,DPoP:null==i?void 0:i.DPoP,headers:new Headers(ma),signal:Ja(u)}).catch(Aa),m=async function(e,t,n,i){return En(e,t,n,void 0,null==i?void 0:i[Ct],null==i?void 0:i.recognizedTokenTypes)}(o,s,h,{[Ct]:d});let f;try{f=await m}catch(a){if(Fa(a,i))return La(e,t,n,g(g({},i),{},{flag:Ha}));Aa(a)}return f.id_token&&await(null==l?void 0:l(h)),Ca(f),f}async function Ma(e,t,n){qa(e),t=new URLSearchParams(t);const i=va(e),a=i.as,o=i.c,s=i.auth,r=i.fetch,c=i.tlsOnly,p=i.timeout,l=await async function(e,t,n,i,a){return Yt(e),Qt(t),_n(e,t,n,"client_credentials",new URLSearchParams(i),a)}(a,o,s,t,{[jt]:r,[St]:!c,DPoP:null==n?void 0:n.DPoP,headers:new Headers(ma),signal:Ja(p)}).catch(Aa),u=async function(e,t,n){return En(e,t,n,void 0,void 0,void 0)}(a,o,l);let d;try{d=await u}catch(i){if(Fa(i,n))return Ma(e,t,g(g({},n),{},{flag:Ha}));Aa(i)}return Ca(d),d}function Da(e,t){qa(e);const n=va(e),i=n.as,a=n.c,o=n.tlsOnly,s=n.hybrid,r=n.jarm,c=n.implicit,p=on(i,"authorization_endpoint",!1,o);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",a.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",s?"code id_token":c?"id_token":"code"),c&&!t.has("nonce"))throw Ta("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",_a);r&&t.set("response_mode","jwt")}for(const e of t.entries()){var l=b(e,2);const t=l[0],n=l[1];p.searchParams.append(t,n)}return p}async function Wa(e,t,n){qa(e);const i=Da(e,t),a=va(e),o=a.as,s=a.c,r=a.auth,c=a.fetch,p=a.tlsOnly,l=a.timeout,u=await async function(e,t,n,i,a){var o;Yt(e),Qt(t);const s=on(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==a?void 0:a[St])),r=new URLSearchParams(i);r.set("client_id",t.client_id);const c=qt(null==a?void 0:a.headers);c.set("accept","application/json"),void 0!==(null==a?void 0:a.DPoP)&&(gn(a.DPoP),await a.DPoP.addProof(s,c,"POST"));const p=await xn(e,t,n,s,r,c,a);return null==a||null===(o=a.DPoP)||void 0===o||o.cacheNonce(p,s),p}(o,s,r,i.searchParams,{[jt]:c,[St]:!p,DPoP:null==n?void 0:n.DPoP,headers:new Headers(ma),signal:Ja(l)}).catch(Aa),d=async function(e,t,n){if(Yt(e),Qt(t),!xt(n,Response))throw Tt('"response" must be an instance of Response',kt);await vn(n,201,"Pushed Authorization Request Endpoint"),ti(n);const i=await pi(n);Ht(i.request_uri,'"response" body "request_uri" property',Fn,{body:i});let a="number"!=typeof i.expires_in?parseFloat(i.expires_in):i.expires_in;return Ft(a,!0,'"response" body "expires_in" property',Fn,{body:i}),i.expires_in=a,i}(o,s,u);let h;try{h=await d}catch(i){if(Fa(i,n))return Wa(e,t,g(g({},n),{},{flag:Ha}));Aa(i)}return Da(e,{request_uri:h.request_uri})}function qa(e){if(!(e instanceof Pa))throw Ta('"config" must be an instance of Configuration',ka);if(Object.getPrototypeOf(e)!==Pa.prototype)throw Ta("subclassing Configuration is not allowed",_a)}function Ja(e){return e?AbortSignal.timeout(1e3*e):void 0}async function $a(e,t,n,i){qa(e);const a=va(e),o=a.as,s=a.c,r=a.fetch,c=a.tlsOnly,p=a.nonRepudiation,l=a.timeout,u=a.decrypt,d=await async function(e,t,n,i){Yt(e),Qt(t);const a=on(e,"userinfo_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[St])),o=qt(null==i?void 0:i.headers);return t.userinfo_signed_response_alg?o.set("accept","application/jwt"):(o.set("accept","application/json"),o.append("accept","application/jwt")),async function(e,t,n,i,a,o){var s;if(Ht(e,'"accessToken"'),!(n instanceof URL))throw Tt('"url" must be an instance of URL',kt);nn(n,!0!==(null==o?void 0:o[St])),i=qt(i),null!=o&&o.DPoP&&(gn(o.DPoP),await o.DPoP.addProof(n,i,"GET".toUpperCase(),e)),i.set("authorization","".concat(i.has("dpop")?"DPoP":"Bearer"," ").concat(e));const r=await((null==o?void 0:o[jt])||fetch)(n.href,{duplex:xt(null,ReadableStream)?"half":void 0,body:null,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:Jt(n,null==o?void 0:o.signal)});return null==o||null===(s=o.DPoP)||void 0===s||s.cacheNonce(r,n),r}(n,0,a,o,0,g(g({},i),{},{[Et]:Gt(t)}))}(o,s,t,{[jt]:r,[St]:!c,DPoP:null==i?void 0:i.DPoP,headers:new Headers(ma),signal:Ja(l)}).catch(Aa);let h,m=wn(o,s,n,d,{[Ct]:u});try{h=await m}catch(a){if(Fa(a,i))return $a(e,t,n,g(g({},i),{},{flag:Ha}));Aa(a)}return"application/jwt"===bn(d)&&await(null==p?void 0:p(d)),h}function Fa(e,t){return!(null==t||!t.DPoP||t.flag===Ha)&&function(e){if(e instanceof cn){const t=e.cause,n=t[0];return 1===t.length&&"dpop"===n.scheme&&"use_dpop_nonce"===n.parameters.error}return e instanceof sn&&"use_dpop_nonce"===e.error}(e)}Object.freeze(Pa.prototype);const Ha=Symbol();async function Ka(e,t,n,i){qa(e);const a=va(e),o=a.as,s=a.c,r=a.auth,c=a.fetch,p=a.tlsOnly,l=a.timeout,u=a.decrypt,d=a.nonRepudiation,h=await async function(e,t,n,i,a,o){return Yt(e),Qt(t),Ht(i,'"grantType"'),_n(e,t,n,i,new URLSearchParams(a),o)}(o,s,r,t,new URLSearchParams(n),{[jt]:c,[St]:!p,DPoP:null==i?void 0:i.DPoP,headers:new Headers(ma),signal:Ja(l)}).catch(Aa);let m;"urn:ietf:params:oauth:grant-type:token-exchange"===t&&(m={n_a:()=>{}});const f=async function(e,t,n,i){return En(e,t,n,void 0,null==i?void 0:i[Ct],null==i?void 0:i.recognizedTokenTypes)}(o,s,h,{[Ct]:u,recognizedTokenTypes:m});let v;try{v=await f}catch(a){if(Fa(a,i))return Ka(e,t,n,g(g({},i),{},{flag:Ha}));Aa(a)}return v.id_token&&await(null==d?void 0:d(h)),Ca(v),v}async function Va(e,t,n){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[n]):(function(e,t,n){var i;const a=e.algorithm;if(a.name!==t.name)throw gi(t.name);if(t.hash&&(null===(i=a.hash)||void 0===i?void 0:i.name)!==t.hash)throw gi(t.hash,"algorithm.hash");if(t.namedCurve&&a.namedCurve!==t.namedCurve)throw gi(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&a.length!==t.length)throw gi(t.length,"algorithm.length");!function(e,t){if(t&&!e.usages.includes(t))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(t,"."))}(e,n)}(t,e.subtle,n),e.minRsaBits&&function(e,t){const n=t.algorithm.modulusLength;if("number"!=typeof n||n<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}(e.alg,t),t)}const Za=[["verify"],["sign"]];function Ga(e){const t={name:"HMAC",hash:"SHA-".concat(e)};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:Za}}function Ba(e,t){const n={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e)};return{kty:["RSA"],subtle:n,signing:t?g(g({},n),{},{saltLength:t}):n,usages:Za,minRsaBits:2048}}function Xa(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:"SHA-".concat(t)},usages:Za}}function Ya(){const e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:Za}}function Qa(e){const t={name:"ML-DSA-".concat(e)};return{kty:["AKP"],subtle:t,signing:t,usages:Za}}const eo=Xi({HS256:Ga(256),HS384:Ga(384),HS512:Ga(512),RS256:Ba(256),RS384:Ba(384),RS512:Ba(512),PS256:Ba(256,32),PS384:Ba(384,48),PS512:Ba(512,64),ES256:Xa("P-256",256),ES384:Xa("P-384",384),ES512:Xa("P-521",512),EdDSA:Ya(),Ed25519:Ya(),"ML-DSA-44":Qa(44),"ML-DSA-65":Qa(65),"ML-DSA-87":Qa(87)});function to(e){const t="string"==typeof e?eo[e]:void 0;if(!t)throw new ki("alg ".concat(e," is not supported either by JOSE or your javascript runtime"));return t}const no=e=>Math.floor(e.getTime()/1e3),io={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},ao=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,oo="check_failed";function so(){throw new TypeError("Invalid time period format")}function ro(e){"string"!=typeof e&&so();const t=ao.exec(e);(!t||t[4]&&t[1])&&so();const n=parseFloat(t[2]),i=Math.round(n*io[t[3][0].toLowerCase()]);return Number.isFinite(i)||so(),"-"===t[1]||"ago"===t[4]?-i:i}function co(e,t){if(!Number.isFinite(t))throw new TypeError("Invalid ".concat(e," input"));return t}function po(e,t){if("string"!=typeof t)throw new TypeError('"'.concat(e,'" claim must be a string'))}function lo(e,t){return"number"==typeof e?co(t,e):e instanceof Date?co(t,no(e)):no(new Date)+ro(e)}const uo=e=>{const t=e.toLowerCase();return e.includes("/")?t:"application/".concat(t)};function ho(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=e[t];if(void 0!==i||n){if("number"!=typeof i)throw new wi('"'.concat(t,'" claim must be a number'),e,t,"invalid");return i}}function mo(e,t){throw new wi('unexpected "'.concat(t,'" claim value'),e,t,oo)}function fo(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{n=JSON.parse(mi.decode(t))}catch(e){}if(!zi(n))throw new Si("JWT Claims Set must be a top-level JSON object");const a=i.typ;if(void 0!==a&&("string"!=typeof e.typ||uo(e.typ)!==uo(a)))throw new wi('unexpected "typ" JWT header value',n,"typ",oo);const o=i.requiredClaims,s=void 0===o?[]:o,r=i.issuer,c=i.subject,p=i.audience,l=i.maxTokenAge,u=[...s];void 0!==l&&u.push("iat"),void 0!==p&&u.push("aud"),void 0!==c&&u.push("sub"),void 0!==r&&u.push("iss");for(const e of new Set(u.reverse()))if(!Object.hasOwn(n,e))throw new wi('missing required "'.concat(e,'" claim'),n,e,"missing");var d,h;void 0===r||(Array.isArray(r)?r:[r]).includes(n.iss)||mo(n,"iss"),void 0!==c&&n.sub!==c&&mo(n,"sub"),void 0===p||(h="string"==typeof p?[p]:p,"string"==typeof(d=n.aud)?h.includes(d):Array.isArray(d)&&h.some(e=>d.includes(e)))||mo(n,"aud");const m=i.clockTolerance;let f=0;if("string"==typeof m)f=ro(m);else if(void 0!==m){if("number"!=typeof m)throw new TypeError("Invalid clockTolerance option type");f=m}co("clockTolerance option",f);const v=i.currentDate,g=co("currentDate option",no(void 0===v?new Date:v)),y=ho(n,"iat",void 0!==l),b=ho(n,"nbf");if(void 0!==b&&b>g+f)throw new wi('"nbf" claim timestamp check failed',n,"nbf",oo);const w=ho(n,"exp");if(void 0!==w&&w<=g-f)throw new xi('"exp" claim timestamp check failed',n,"exp",oo);if(void 0!==l){const e=g-y;if(e-f>co("maxTokenAge option","number"==typeof l?l:ro(l)))throw new xi('"iat" claim timestamp check failed (too far in the past)',n,"iat",oo);if(e<-f)throw new wi('"iat" claim timestamp check failed (it should be in the past)',n,"iat",oo)}return n}let vo;function go(e){return vo.get(e)}const yo=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!zi(e))throw new TypeError("JWT Claims Set MUST be an object");(vo||(vo=new WeakMap)).set(this,structuredClone(e))}setIssuer(e){return po("iss",e),go(this).iss=e,this}setSubject(e){return po("sub",e),go(this).sub=e,this}setAudience(e){return function(e){if("string"!=typeof e&&(!Array.isArray(e)||Array.from(e).some(e=>"string"!=typeof e)))throw new TypeError('"aud" claim must be a string or an array of strings')}(e),go(this).aud=e,this}setJti(e){return po("jti",e),go(this).jti=e,this}setNotBefore(e){return go(this).nbf=lo(e,"setNotBefore"),this}setExpirationTime(e){return go(this).exp=lo(e,"setExpirationTime"),this}setIssuedAt(e){return go(this).iat=void 0===e?no(new Date):"string"==typeof e?co("setIssuedAt",no(new Date)+ro(e)):lo(e,"setIssuedAt"),this}};var bo=new WeakMap;class wo extends yo{constructor(){super(...arguments),d(this,bo,void 0)}setProtectedHeader(e){return function(e){if(void 0!==e)throw new TypeError("".concat("setProtectedHeader"," can only be called once"))}(u(bo,this)),h(bo,this,e),this}async sign(e,t){return async function(e,t,n,i,a){const o=b(function(e){if(void 0===e)return[void 0,""];const t=function(e,t){let n,i;try{n=JSON.stringify(t),i=JSON.parse(n)}catch(t){throw new e("JOSE Header is not valid JSON",{cause:t})}if(!zi(i))throw new e("JOSE Header is not a JSON object");return[i,n]}(Ti,e);return[t[0],Ni(t[1])]}(t),2),s=o[0],r=o[1];if(!s)throw new Ti("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");(function(e,t,n){return function(e,t){const n=(null!=t?t:{}).crit;if(Array.isArray(n)&&new Set(n).size!==n.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}(Ti,e),ua(e,la(Ti,ca,n,e,t))})(s,s,n)||a();const c=function(e){const t=e.alg;if("string"!=typeof t||!t)throw new Ti('JWS "alg" (Algorithm) Header Parameter missing or invalid');return to(t)}(s),p=Ni(e),l=await async function(e,t,n,i){const a=fi(vi(e),vi("."),t),o=await Bi(n,i,"sign");return Ni(await async function(e,t,n){const i=await Va(e,t,"sign"),a=await crypto.subtle.sign(e.signing,i,n);return new Uint8Array(a)}(n,o,a))}(r,vi(p),c,i);return"".concat(r,".").concat(p,".").concat(l)}(function(e){const t=go(e);for(const e of["iat","nbf","exp"]){const n=t[e];if("number"==typeof n&&!Number.isFinite(n))throw new TypeError('"'.concat(e,'" claim must be a finite number'))}return di.encode(JSON.stringify(t))}(this),u(bo,this),null==t?void 0:t.crit,e,()=>{throw new Si("JWTs MUST NOT use unencoded payload")})}}const xo='"alg" (Algorithm)';function _o(){throw new ki("Invalid or unsupported ".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:'JWK "alg" (Algorithm) Parameter'," value"))}const ko=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},To=e=>{const t=e.data[e.pos++];if(void 0===t)throw new Error("Unexpected end of ASN.1 input");return t},So=e=>{const t=To(e);if(128&t){const n=127&t;let i=0;for(let t=0;t<n;t++)i=i<<8|To(e);return i}return t},Eo=(e,t,n)=>{if(To(e)!==t)throw new Error(n)},Ao=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},jo=e=>{const t=(e=>{Eo(e,6,"Expected algorithm OID");const t=So(e);return Ao(e,t)})(e);if(ko(t,[43,101,110]))return"X25519";if(!ko(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Eo(e,6,"Expected curve OID");const n=So(e),i=Ao(e,n);if(ko(i,[42,134,72,206,61,3,1,7]))return"P-256";if(ko(i,[43,129,4,0,34]))return"P-384";if(ko(i,[43,129,4,0,35]))return"P-521";throw new Error("Unsupported named curve")};async function Po(e,t,n){const i=e.get(t)||e.set(t,{}).get(t),a=n.alg;if(void 0===i[a]){const e=await Di(n,g(g({},t),{},{alg:a,ext:!0}));if("public"!==e.type)throw new Ei("JSON Web Key Set members must be public keys");i[a]=e}return i[a]}function Co(e){let t;try{t=structuredClone(e)}catch(e){}if(!Li(t))throw new Ei("JSON Web Key Set malformed");const n=new WeakMap;return Object.defineProperty(async(e,i)=>{const a=g(g({},e),null==i?void 0:i.header),o=a.alg,s=a.kid,r="string"==typeof o?eo[o]:void 0;if(!r||r.secret)throw new ki('Unsupported "alg" value for a JSON Web Key Set');const c=t.keys.filter(e=>function(e,t,n,i){const a=Wi(e),o=a.kty,s=a.key_ops,r=a.ext,c=a.kid,p=a.alg,l=a.use,u=a.crv,d=Array.isArray(s)?[...s]:s;return(void 0===r||"boolean"==typeof r)&&(void 0===d||Array.isArray(d)&&d.every((e,t)=>"string"==typeof e&&d.indexOf(e)===t)&&d.includes("verify"))&&t.kty.includes(o)&&(void 0===i||"string"==typeof i&&i===c)&&(void 0===p?"AKP"!==o:n===p)&&(void 0===l||"sig"===l)&&(!t.crv||u===t.crv)}(e,r,o,s)),l=c[0],u=c.length;if(!u)throw new Ai;if(1!==u){const e=new ji;throw e[Symbol.asyncIterator]=w(function*(){for(const e of c)try{yield yield p(Po(n,e,r))}catch(e){}}),e}return Po(n,l,r)},"jwks",{value:()=>structuredClone(t)})}var Io,Oo;let Ro;if("undefined"==typeof navigator||null===(Io=navigator.userAgent)||void 0===Io||null===(Oo=Io.startsWith)||void 0===Oo||!Oo.call(Io,"Mozilla/5.0 ")){const e="v6.2.10";Ro="".concat("jose","/").concat(e)}const Uo=Symbol(),No=Symbol();function zo(e,t){return Number.isFinite(e)&&Date.now()<e+t}function Lo(e,t,n){if(Number.isNaN(e))throw new TypeError('"'.concat(n,'" option must not be NaN'));return"number"==typeof e?e:t}async function Mo(e,t,n){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return((e,t,n)=>{const i=(e=>Oi(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);return(async(e,t,n,i)=>{const a=function(e){if(void 0!==e&&"boolean"!=typeof e)throw new TypeError('"extractable" option must be a boolean');return e}(null==i?void 0:i.extractable),o=function(e,t){var n,i;return null!==(n="string"==typeof e?null!==(i=eo[e])&&void 0!==i?i:oa[e]:void 0)&&void 0!==n?n:_o(t)}(n,xo);o.secret&&_o(xo);const s=!1;let r;if(o.resolve)try{const e={data:t,pos:0};!function(e){Eo(e,48,"Invalid ".concat("PKCS#8"," structure")),So(e);{Eo(e,2,"Expected version field");const t=So(e);e.pos+=t}Eo(e,48,"Expected algorithm identifier"),So(e)}(e),r=o.resolve({crv:jo(e)})}catch(e){throw new ki("Invalid or unsupported key format")}else r=o.subtle;return crypto.subtle.importKey(e,t,r,null!=a?a:s,o.usages[1])})("pkcs8",i,t,n)})(e,t,n)}const Do=["mfaToken"],Wo=["mfaToken"];var qo,Jo,$o,Fo,Ho,Ko,Vo,Zo,Go,Bo,Xo,Yo,Qo,es,ts,ns,is,as,os,ss,rs,cs,ps,ls,us,ds,hs,ms,fs,vs,gs,ys,bs,ws,xs,_s,ks,Ts,Ss,Es,As,js,Ps,Cs,Is,Os,Rs,Us,Ns,zs,Ls,Ms;function Ds(e){if("object"!=typeof e||null===e)return{};const t=e;return{statusCode:"number"==typeof t.statusCode?t.statusCode:void 0,headers:t.headers instanceof Headers?t.headers:void 0,body:"string"==typeof t.body?t.body:void 0}}function Ws(e){var t,n;if("object"!=typeof e||null===e)return{error:"unknown_error",error_description:String(e)};const i=e;let a;if(i.response instanceof Response)try{a=new Headers(i.response.headers),a.delete("set-cookie")}catch(e){a=void 0}const o={error:null!==(t=i.error)&&void 0!==t?t:"",error_description:null!==(n=i.error_description)&&void 0!==n?n:"",message:i.message,statusCode:"number"==typeof i.status?i.status:void 0,headers:a};if("mfa_required"===i.error&&i.cause){o.mfa_token="string"==typeof i.cause.mfa_token?i.cause.mfa_token:void 0;const e=i.cause.mfa_requirements;"object"==typeof e&&null!==e&&(o.mfa_requirements=e)}return o}var qs=class extends Error{constructor(e,t){super(t),f(this,"code",void 0),this.name="NotSupportedError",this.code=e}},Js=class extends Error{constructor(e,t,n){super(t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"statusCode",void 0),f(this,"headers",void 0),f(this,"body",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message,mfa_token:n.mfa_token,mfa_requirements:n.mfa_requirements};const i=Ds(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},$s=class extends Js{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Fs=class extends Js{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Hs=class extends Js{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Ks=class extends Js{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},Vs=class extends Js{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Zs=class extends Js{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Gs=class extends Js{constructor(e,t){super("token_revocation_error",e,t),this.name="TokenRevocationError"}},Bs=class extends Js{constructor(e,t){super("user_info_error",e,t),this.name="UserInfoError"}},Xs=class extends Error{constructor(e){super(e),f(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Ys=class extends Js{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),f(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},Qs=class extends Js{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},er=class extends Js{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},tr=class extends Js{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},nr=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),f(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}},ir=class extends Error{constructor(e){super(e),f(this,"code","organization_validation_error"),this.name="OrganizationValidationError"}},ar=class extends Error{constructor(e){super(e||"fullResponse: true requested but no HTTP Response was captured. This is a bug in CapturingFetch."),f(this,"code","missing_captured_response_error"),this.name="MissingCapturedResponseError"}};function or(e){try{const t=new Headers(e);return t.delete("set-cookie"),t}catch(e){return new Headers}}function sr(e,t,n){var i;const a="object"==typeof t&&null!==t?t:void 0,o=null!==(i=null==a?void 0:a.response)&&void 0!==i?i:n,s="number"==typeof(null==a?void 0:a.status)?a.status:null==o?void 0:o.status;"number"==typeof s&&(e.statusCode=s),null!=o&&o.headers&&(e.headers=or(o.headers))}function rr(e){return Object.entries(e).filter(e=>void 0!==b(e,2)[1]).reduce((e,t)=>g(g({},e),{},{[t[0]]:t[1]}),{})}function cr(e){if(!e.trim())throw new ir("organization must not be blank")}function pr(e,t){if(!e)return;const n=t.trim();if(n.startsWith("org_")){const t=e.org_id;if("string"!=typeof t)throw new ir("Organization Id (org_id) claim must be a string present in the ID token");if(t!==n)throw new ir('Organization Id (org_id) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(t,'"'))}else{const t=e.org_name;if("string"!=typeof t)throw new ir("Organization Name (org_name) claim must be a string present in the ID token");if(t.toLowerCase()!==n.toLowerCase())throw new ir('Organization Name (org_name) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(t,'"'))}}var lr=class extends Error{constructor(e,t,n){super(t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"statusCode",void 0),f(this,"headers",void 0),f(this,"body",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message};const i=Ds(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},ur=class extends lr{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},dr=class extends lr{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},hr=class extends lr{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},mr=class extends lr{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}},fr=class extends lr{constructor(e,t){super("mfa_verify_error",e,t),this.name="MfaVerifyError"}};function vr(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var gr=class e{constructor(e,t,n,i,a,o,s){f(this,"accessToken",void 0),f(this,"idToken",void 0),f(this,"refreshToken",void 0),f(this,"expiresAt",void 0),f(this,"scope",void 0),f(this,"claims",void 0),f(this,"authorizationDetails",void 0),f(this,"tokenType",void 0),f(this,"issuedTokenType",void 0),f(this,"recoveryCode",void 0),f(this,"act",void 0),this.accessToken=e,this.idToken=n,this.refreshToken=i,this.expiresAt=t,this.scope=a,this.claims=o,this.authorizationDetails=s}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,i=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 i.tokenType=t.token_type,i.issuedTokenType=t.issued_token_type,i}};function yr(e,t){if(!1===t.enabled)return e;const n={name:t.name,version:t.version},i=btoa(JSON.stringify(n));return async(t,n)=>{const a=t instanceof Request?new Headers(t.headers):new Headers;return null!=n&&n.headers&&new Headers(n.headers).forEach((e,t)=>{a.set(t,e)}),a.set("Auth0-Client",i),e(t,g(g({},n),{},{headers:a}))}}function br(e){var t,n;return!1===(null==e?void 0:e.enabled)?e:{enabled:!0,name:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"@auth0/auth0-auth-js",version:null!==(n=null==e?void 0:e.version)&&void 0!==n?n:"1.16.1"}}function wr(e){let t;const n=async(n,i)=>{const a=await e(n,i);return t=a.clone(),a};return n.getCapturedResponse=()=>t,n}function xr(e,t,n){if(!t)return e;const i=t.signal,a=t.headers,o=t.customFetch,s=o?yr(o,n):e;return i||a?async(e,t)=>{const n=a?new Headers(e instanceof Request?e.headers:void 0):void 0;if(n&&null!=t&&t.headers&&new Headers(t.headers).forEach((e,t)=>n.set(t,e)),a)for(const e of Object.entries(a)){var o=b(e,2);const t=o[0],i=o[1],a=t.toLowerCase();"authorization"!==a&&"auth0-client"!==a&&n.set(t,i)}const r=function(e,t){if(!e)return{signal:null!=t?t:void 0};if(!t)return{signal:e};if("undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.any)return{signal:AbortSignal.any([e,t])};const n=new AbortController,i=[e,t],a=i.find(e=>e.aborted);if(a)return n.abort(a.reason),{signal:n.signal};const o=[],s=()=>{i.forEach((e,t)=>{const n=o[t];n&&e.removeEventListener("abort",n)})};return i.forEach((e,t)=>{const i=()=>{s(),n.abort(e.reason)};o[t]=i,e.addEventListener("abort",i,{once:!0})}),{signal:n.signal,cleanup:s}}(i,null==t?void 0:t.signal);try{return await s(e,g(g(g({},t),n&&{headers:n}),{},{signal:r.signal}))}finally{var c;null===(c=r.cleanup)||void 0===c||c.call(r)}}:s}var _r={otp:"http://auth0.com/oauth/grant-type/mfa-otp",oob:"http://auth0.com/oauth/grant-type/mfa-oob","recovery-code":"http://auth0.com/oauth/grant-type/mfa-recovery-code"},kr=(qo=new WeakMap,Jo=new WeakMap,$o=new WeakMap,Fo=new WeakMap,Ho=new WeakMap,Ko=new WeakMap,Vo=new WeakMap,Zo=new WeakSet,class{constructor(e){var t,n;m(this,Zo),d(this,qo,void 0),d(this,Jo,void 0),d(this,$o,void 0),d(this,Fo,void 0),d(this,Ho,void 0),d(this,Ko,void 0),d(this,Vo,void 0),h(qo,this,"https://".concat(e.domain)),h(Jo,this,e.clientId),h($o,this,e.clientSecret),h(Fo,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(Ho,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:br()),h(Ko,this,e.getConfiguration),h(Vo,this,e.createCaptureConfiguration)}async listAuthenticators(e,t){const n="".concat(u(qo,this),"/mfa/authenticators"),i=e.mfaToken,a=await c(Zo,this,Tr).call(this,t)(n,{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!a.ok){const e=await a.clone().text(),t=a.status,n=or(a.headers);let o;try{o=JSON.parse(e)}catch(i){throw new ur("Failed to list authenticators",{error:"unknown_error",error_description:"Failed to list authenticators",statusCode:t,headers:n,body:e})}throw new ur(o.error_description||"Failed to list authenticators",g(g({},o),{},{statusCode:t,headers:n,body:e}))}return(await a.json()).map(vr)}async enrollAuthenticator(e,t){const n="".concat(u(qo,this),"/mfa/associate"),i=e.mfaToken,a=y(e,Do),o={authenticator_types:a.authenticatorTypes};"oobChannels"in a&&(o.oob_channels=a.oobChannels),"phoneNumber"in a&&a.phoneNumber&&(o.phone_number=a.phoneNumber),"email"in a&&a.email&&(o.email=a.email);const s=await c(Zo,this,Tr).call(this,t)(n,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok){const e=await s.clone().text(),t=s.status,n=or(s.headers);let a;try{a=JSON.parse(e)}catch(i){throw new dr("Failed to enroll authenticator",{error:"unknown_error",error_description:"Failed to enroll authenticator",statusCode:t,headers:n,body:e})}throw new dr(a.error_description||"Failed to enroll authenticator",g(g({},a),{},{statusCode:t,headers:n,body: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,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await s.json())}async deleteAuthenticator(e,t){const n=e.authenticatorId,i=e.mfaToken,a="".concat(u(qo,this),"/mfa/authenticators/").concat(encodeURIComponent(n)),o=await c(Zo,this,Tr).call(this,t)(a,{method:"DELETE",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!o.ok){const e=await o.clone().text(),t=o.status,n=or(o.headers);let a;try{a=JSON.parse(e)}catch(i){throw new hr("Failed to delete authenticator",{error:"unknown_error",error_description:"Failed to delete authenticator",statusCode:t,headers:n,body:e})}throw new hr(a.error_description||"Failed to delete authenticator",g(g({},a),{},{statusCode:t,headers:n,body:e}))}}async challengeAuthenticator(e,t){const n="".concat(u(qo,this),"/mfa/challenge"),i=e.mfaToken,a=y(e,Wo),o={mfa_token:i,client_id:u(Jo,this),challenge_type:a.challengeType};u($o,this)&&(o.client_secret=u($o,this)),a.authenticatorId&&(o.authenticator_id=a.authenticatorId);const s=await c(Zo,this,Tr).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok){const e=await s.clone().text(),t=s.status,n=or(s.headers);let a;try{a=JSON.parse(e)}catch(i){throw new mr("Failed to challenge authenticator",{error:"unknown_error",error_description:"Failed to challenge authenticator",statusCode:t,headers:n,body:e})}throw new mr(a.error_description||"Failed to challenge authenticator",g(g({},a),{},{statusCode:t,headers:n,body: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 s.json())}async verify(e,t){if(!u(Ko,this))throw new Error("MFA verify requires a configuration provider (getConfiguration was not set)");const n={mfa_token:e.mfaToken};if(e.audience&&(n.audience=e.audience),"otp"===e.factorType?n.otp=e.otp:"oob"===e.factorType?(n.oob_code=e.oobCode,e.bindingCode&&(n.binding_code=e.bindingCode)):"recovery-code"===e.factorType&&(n.recovery_code=e.recoveryCode),e.fullResponse){var i;if(!u(Vo,this))throw new Error("MFA verify fullResponse requires a capture-config factory (createCaptureConfiguration was not set)");const r=wr(null!==(i=(await u(Ko,this).call(this,t))[xa])&&void 0!==i?i:fetch),c=await u(Vo,this).call(this,r);try{const t=await Ka(c,_r[e.factorType],n),i=gr.fromTokenEndpointResponse(t);t.recovery_code&&(i.recoveryCode=t.recovery_code);const a=r.getCapturedResponse();if(!a)throw new ar;return{data:i,response:a}}catch(e){var a,o,s;if(e instanceof ar)throw e;if(e instanceof fr)throw e;const t=e,n=new fr(t.error_description||t.message||"Failed to verify MFA challenge",{error:null!==(a=t.error)&&void 0!==a?a:"mfa_verify_error",error_description:null!==(o=null!==(s=t.error_description)&&void 0!==s?s:t.message)&&void 0!==o?o:"Failed to verify MFA challenge"});throw sr(n,e,r.getCapturedResponse()),n}}const r=await u(Ko,this).call(this,t);try{const t=await Ka(r,_r[e.factorType],n),i=gr.fromTokenEndpointResponse(t);return t.recovery_code&&(i.recoveryCode=t.recovery_code),i}catch(e){var c,p,l;if(e instanceof fr)throw e;const t=e,n=new fr(t.error_description||t.message||"Failed to verify MFA challenge",{error:null!==(c=t.error)&&void 0!==c?c:"mfa_verify_error",error_description:null!==(p=null!==(l=t.error_description)&&void 0!==l?l:t.message)&&void 0!==p?p:"Failed to verify MFA challenge"});throw sr(n,e),n}}});function Tr(e){return xr(u(Fo,this),e,u(Ho,this))}var Sr=class extends Error{constructor(e,t,n){super(t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"statusCode",void 0),f(this,"headers",void 0),f(this,"body",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message};const i=Ds(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Er=class extends Sr{constructor(e,t){super("passkey_register_error",e,t),this.name="PasskeyRegisterError"}},Ar=class extends Sr{constructor(e,t){super("passkey_challenge_error",e,t),this.name="PasskeyChallengeError"}},jr=class extends Sr{constructor(e,t){super("passkey_get_token_error",e,t),this.name="PasskeyGetTokenError",this.cause=t&&{error:t.error,error_description:t.error_description,message:t.message,mfa_token:t.mfa_token,mfa_requirements:t.mfa_requirements}}};function Pr(e){return e.useMtls?{}:e.clientSecret?{client_secret:e.clientSecret}:{}}var Cr="urn:okta:params:oauth:grant-type:webauthn",Ir=(Go=new WeakMap,Bo=new WeakMap,Xo=new WeakMap,Yo=new WeakMap,Qo=new WeakMap,es=new WeakMap,ts=new WeakSet,class{constructor(e){var t,n;m(this,ts),d(this,Go,void 0),d(this,Bo,void 0),d(this,Xo,void 0),d(this,Yo,void 0),d(this,Qo,void 0),d(this,es,void 0),h(Go,this,"https://".concat(e.domain)),h(Bo,this,e.clientId),h(Xo,this,{clientSecret:e.clientSecret,useMtls:e.useMtls}),h(Yo,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(Qo,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:br()),h(es,this,e.grantRequest)}async register(e,t){const n="".concat(u(Go,this),"/passkey/register"),i=g(g(g(g(g(g(g(g({},e.email&&{email:e.email}),e.name&&{name:e.name}),e.phoneNumber&&{phone_number:e.phoneNumber}),e.username&&{username:e.username}),e.givenName&&{given_name:e.givenName}),e.familyName&&{family_name:e.familyName}),e.nickname&&{nickname:e.nickname}),e.picture&&{picture:e.picture}),a=g(g({client_id:u(Bo,this)},Pr(u(Xo,this))),{},{user_profile:i});e.realm&&(a.realm=e.realm),e.organization&&(a.organization=e.organization),e.userMetadata&&(a.user_metadata=e.userMetadata);const o=await c(ts,this,Or).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!o.ok){const e=await c(ts,this,Rr).call(this,o),t=new Er(e.error_description||"Failed to request signup challenge",e);throw t.statusCode=o.status,t.headers=or(o.headers),t}return{authSession:(s=await o.json()).auth_session,authnParamsPublicKey:g({},s.authn_params_public_key)};var s}async challenge(e,t){const n="".concat(u(Go,this),"/passkey/challenge"),i=g({client_id:u(Bo,this)},Pr(u(Xo,this)));null!=e&&e.realm&&(i.realm=e.realm),null!=e&&e.organization&&(i.organization=e.organization);const a=await c(ts,this,Or).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!a.ok){const e=await c(ts,this,Rr).call(this,a),t=new Ar(e.error_description||"Failed to request login challenge",e);throw t.statusCode=a.status,t.headers=or(a.headers),t}return{authSession:(o=await a.json()).auth_session,authnParamsPublicKey:g({},o.authn_params_public_key)};var o}async getTokenByPasskey(e,t){void 0!==e.organization&&cr(e.organization);const n=new URLSearchParams({auth_session:e.authSession,authn_response:JSON.stringify(e.credential)});let i;e.realm&&n.append("realm",e.realm),e.scope&&n.append("scope",e.scope),e.audience&&n.append("audience",e.audience),e.organization&&n.append("organization",e.organization);try{i=await u(es,this).call(this,Cr,n,t,e.fullResponse)}catch(e){if(e instanceof ar)throw e;const t=Ws(e),n=new jr(t.error_description||"Failed to exchange passkey credential for tokens.",t);throw sr(n,e),n}if(e.fullResponse){const t=i;return e.organization&&pr(t.data.claims,e.organization),t}const a=i;return e.organization&&pr(a.claims,e.organization),a}});function Or(e){return xr(u(Yo,this),e,u(Qo,this))}async function Rr(e){const t=await e.clone().text();try{return g(g({},JSON.parse(t)),{},{statusCode:e.status,headers:e.headers,body:t})}catch(n){return{error:"unknown_error",error_description:"HTTP ".concat(e.status," ").concat(e.statusText),statusCode:e.status,headers:e.headers,body:t}}}var Ur=class extends Error{constructor(e,t,n){super(t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"statusCode",void 0),f(this,"headers",void 0),f(this,"body",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.cause=n&&(n.error||n.error_description)?{error:n.error,error_description:n.error_description,message:n.message,mfa_token:n.mfa_token,mfa_requirements:n.mfa_requirements}:void 0;const i=Ds(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Nr=class extends Ur{constructor(e,t){super("passwordless_start_error",e,t),this.name="PasswordlessStartError"}},zr=class extends Ur{constructor(e,t){super("passwordless_verify_error",e,t),this.name="PasswordlessVerifyError"}},Lr=class extends Ur{constructor(e,t){super("passwordless_db_get_token_error",e,t),this.name="PasswordlessDbGetTokenError"}},Mr=class extends Ur{constructor(e,t,n,i,a){super("passwordless_challenge_error",e,n),f(this,"statusCode",void 0),f(this,"validationErrors",void 0),this.name="PasswordlessChallengeError",this.statusCode=t,this.validationErrors=i,this.headers=null!=a?a:this.headers}};function Dr(e){return/^\+[1-9]\d{1,14}$/.test(e)}async function Wr(e,t,n){if(e.useMtls)return{};if(e.clientAssertionSigningKey){var i;const a=null!==(i=e.clientAssertionSigningAlg)&&void 0!==i?i:"RS256",o=e.clientAssertionSigningKey instanceof CryptoKey?e.clientAssertionSigningKey:await Mo(e.clientAssertionSigningKey,a);return{client_assertion:await new wo({}).setProtectedHeader({alg:a}).setIssuer(t).setSubject(t).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(o),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}if(e.clientSecret)return{client_secret:e.clientSecret};throw new nr}var qr=(ns=new WeakMap,is=new WeakMap,as=new WeakMap,os=new WeakMap,ss=new WeakMap,rs=new WeakMap,cs=new WeakMap,ps=new WeakSet,class{constructor(e){var t,n;m(this,ps),d(this,ns,void 0),d(this,is,void 0),d(this,as,void 0),d(this,os,void 0),d(this,ss,void 0),d(this,rs,void 0),d(this,cs,void 0),h(is,this,e.domain),h(ns,this,"https://".concat(e.domain)),h(as,this,e.clientId),h(os,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(ss,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:br()),h(rs,this,{clientSecret:e.clientSecret,clientAssertionSigningKey:e.clientAssertionSigningKey,clientAssertionSigningAlg:e.clientAssertionSigningAlg,useMtls:e.useMtls}),h(cs,this,e.grantRequest)}async sendEmail(e,t){const n=await c(ps,this,$r).call(this,function(e){var t;const n=null!==(t=e.send)&&void 0!==t?t:"code",i={email:e.email,connection:"email",send:n};return"link"===n&&e.authParams&&(i.authParams=e.authParams),i}(e),"Failed to send passwordless email",e.language,t);if(e.fullResponse)return{data:void 0,response:n}}async sendSms(e,t){if(!Dr(e.phoneNumber))throw new Nr("Phone number must be in E.164 format (e.g. +14155550100).");const n=await c(ps,this,$r).call(this,function(e){return{phone_number:e.phoneNumber,connection:"sms"}}(e),"Failed to send passwordless SMS",e.language,t);if(e.fullResponse)return{data:void 0,response:n}}async challengeWithEmail(e,t){const n=function(e){var t;return{email:e.email,connection:e.connection,allow_signup:null!==(t=e.allowSignup)&&void 0!==t&&t}}(e);return c(ps,this,Fr).call(this,n,"Failed to request email OTP challenge",t)}async challengeWithPhoneNumber(e,t){if(!Dr(e.phoneNumber))throw new Mr("Phone number must be in E.164 format (e.g. +14155550100).",0,void 0,void 0);const n=function(e){var t;const n={phone_number:e.phoneNumber,connection:e.connection,allow_signup:null!==(t=e.allowSignup)&&void 0!==t&&t};return e.deliveryMethod&&(n.delivery_method=e.deliveryMethod),n}(e);return c(ps,this,Fr).call(this,n,"Failed to request phone OTP challenge",t)}async getTokenByPasswordlessDbConnection(e,t){const n=new URLSearchParams({auth_session:e.authSession,otp:e.otp});if(e.scope&&n.append("scope",e.scope),e.audience&&n.append("audience",e.audience),!u(cs,this))throw new Lr("Missing grant request delegate.",Ws(new Error("missing grantRequest")));try{return await u(cs,this).call(this,"http://auth0.com/oauth/grant-type/passwordless/otp",n,t,e.fullResponse)}catch(e){if(e instanceof ar)throw e;const t=new Lr("There was an error while trying to request a token.",Ws(e)),n=e;throw t.statusCode=n._statusCode,t.headers=n._headers,t}}});function Jr(e){return xr(u(os,this),e,u(ss,this))}async function $r(e,t,n,i){var a;const o=await Wr(u(rs,this),u(as,this),u(is,this)),s=g(g({client_id:u(as,this)},e),o);let r;try{r=await c(ps,this,Jr).call(this,i)("".concat(u(ns,this),"/passwordless/start"),{method:"POST",headers:g({"Content-Type":"application/json"},n?{"x-request-language":n}:{}),body:JSON.stringify(s)})}catch(e){throw new Nr("".concat(t,": a network error occurred."))}if(r.ok)return r;const p=await r.clone().text();let l;if(204!==r.status)try{l=JSON.parse(p)}catch(e){l=void 0}const d=new Nr((null===(a=l)||void 0===a?void 0:a.error_description)||t,l);throw d.statusCode=r.status,d.headers=or(r.headers),d.body=p,d}async function Fr(e,t,n){var i,a;const o=await Wr(u(rs,this),u(as,this),u(is,this)),s=g(g({client_id:u(as,this)},e),o);let r;try{r=await c(ps,this,Jr).call(this,n)("".concat(u(ns,this),"/otp/challenge"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(e){throw new Mr("challenge error: a network error occurred.",0,void 0,void 0)}if(r.ok){let n;try{n=await r.json()}catch(e){throw new Mr("".concat(t,": could not parse the response body."),r.status,void 0,void 0,or(r.headers))}return{authSession:n.auth_session}}const p=await r.clone().text();let l;try{l=JSON.parse(p)}catch(e){l=void 0}const d=l?g(g({},l),{},{statusCode:r.status,headers:r.headers,body:p}):{error:"",error_description:"",statusCode:r.status,headers:r.headers,body:p};throw new Mr((null===(i=l)||void 0===i?void 0:i.error_description)||t,r.status,d,null===(a=l)||void 0===a?void 0:a.validation_errors,or(r.headers))}var Hr=class extends Error{constructor(e,t,n){super(t),f(this,"cause",void 0),f(this,"code",void 0),f(this,"statusCode",void 0),f(this,"headers",void 0),f(this,"body",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message};const i=Ds(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Kr=class extends Hr{constructor(e,t){super("signup_error",e,t),this.name="SignUpError"}},Vr=class extends Hr{constructor(e,t){super("change_password_error",e,t),this.name="ChangePasswordError"}};function Zr(e,t,n){for(const i of t)if(null===e[i]||void 0===e[i]||""===e[i])throw new n('Required parameter "'.concat(String(i),'" was null, undefined, or empty.'))}function Gr(e){var t,n;return{id:null!==(t=null!==(n=e._id)&&void 0!==n?n:e.user_id)&&void 0!==t?t:e.id,email:"string"==typeof e.email?e.email:"",emailVerified:Boolean(e.email_verified),username:e.username,givenName:e.given_name,familyName:e.family_name,name:e.name,nickname:e.nickname,picture:e.picture,userMetadata:e.user_metadata}}var Br=(ls=new WeakMap,us=new WeakMap,ds=new WeakMap,hs=new WeakMap,ms=new WeakSet,class{constructor(e){var t,n;m(this,ms),d(this,ls,void 0),d(this,us,void 0),d(this,ds,void 0),d(this,hs,void 0),h(ls,this,"https://".concat(e.domain)),h(us,this,e.clientId),h(ds,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(hs,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:br())}async signUp(e,t){var n;Zr(e,["email","password","connection"],Kr);const i=g({client_id:null!==(n=e.clientId)&&void 0!==n?n:u(us,this)},function(e){const t={email:e.email,password:e.password,connection:e.connection};return void 0!==e.username&&(t.username=e.username),void 0!==e.givenName&&(t.given_name=e.givenName),void 0!==e.familyName&&(t.family_name=e.familyName),void 0!==e.name&&(t.name=e.name),void 0!==e.nickname&&(t.nickname=e.nickname),void 0!==e.picture&&(t.picture=e.picture),void 0!==e.userMetadata&&(t.user_metadata=e.userMetadata),t}(e)),a=await c(ms,this,Xr).call(this,"/dbconnections/signup",i,Kr,"Failed to sign up",t);if(e.fullResponse){const e=a.clone();return{data:Gr(await a.json()),response:e}}return Gr(await a.json())}async changePassword(e,t){var n;if(Zr(e,["connection"],Vr),!e.email&&!e.username)throw new Vr('Either "email" or "username" is required.');const i=g({client_id:null!==(n=e.clientId)&&void 0!==n?n:u(us,this)},function(e){const t={connection:e.connection};return void 0!==e.email&&(t.email=e.email),void 0!==e.username&&(t.username=e.username),void 0!==e.organization&&(t.organization=e.organization),t}(e)),a=await c(ms,this,Xr).call(this,"/dbconnections/change_password",i,Vr,"Failed to request a password change",t);if(e.fullResponse){const e=a.clone();return{data:await a.text(),response:e}}return a.text()}});async function Xr(e,t,n,i,a){const o=xr(u(ds,this),a,u(hs,this));let s;try{s=await o("".concat(u(ls,this)).concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){throw new n("".concat(i,": a network error occurred."))}if(s.ok)return s;const r=await s.clone().text(),c=await async function(e){let t;try{t=await e.json()}catch(e){return}return"string"==typeof t.error?t:"string"==typeof t.code?{error:t.code,error_description:"string"==typeof t.description?t.description:""}:void 0}(s.clone()),p=new n((null==c?void 0:c.error_description)||i,null!=c?c:{error:"unknown_error",error_description:i});throw p.statusCode=s.status,p.headers=or(s.headers),p.body=r,p}var Yr=class extends Error{constructor(e,t,n){super(t),f(this,"code",void 0),f(this,"cause",void 0),this.name="AnonymousSessionError",this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}};async function Qr(e,t,n){if(e.useMtls)return{};if(e.clientAssertionSigningKey){var i;const a=null!==(i=e.clientAssertionSigningAlg)&&void 0!==i?i:"RS256",o=e.clientAssertionSigningKey instanceof CryptoKey?e.clientAssertionSigningKey:await Mo(e.clientAssertionSigningKey,a);return{client_assertion:await new wo({}).setProtectedHeader({alg:a}).setIssuer(t).setSubject(t).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(o),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}return e.clientSecret?{client_secret:e.clientSecret}:{}}async function ec(e){const t="Request failed with status ".concat(e.status);let n={};try{n=await e.json()}catch(e){}return{error:"string"==typeof n.error?n.error:"server_error",error_description:"string"==typeof n.error_description?n.error_description:t}}var tc=(fs=new WeakMap,vs=new WeakMap,gs=new WeakMap,ys=new WeakMap,bs=new WeakMap,ws=new WeakMap,xs=new WeakMap,_s=new WeakMap,ks=new WeakSet,class{constructor(e){var t;m(this,ks),d(this,fs,void 0),d(this,vs,void 0),d(this,gs,void 0),d(this,ys,void 0),d(this,bs,void 0),d(this,ws,void 0),d(this,xs,void 0),d(this,_s,void 0),h(fs,this,e.domain),h(vs,this,"https://".concat(e.domain)),h(gs,this,e.clientId),h(ys,this,e.clientSecret),h(bs,this,e.clientAssertionSigningKey),h(ws,this,e.clientAssertionSigningAlg),h(xs,this,e.useMtls),h(_s,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async createSession(e){const t={client_id:u(gs,this)};null!=e&&e.audience&&(t.audience=e.audience),null!=e&&e.scope&&(t.scope=e.scope),null!=e&&e.metadata&&(t.metadata=e.metadata);const n=await c(ks,this,ic).call(this,t);if(!n.sessionToken)throw new Yr("server_error","session_token missing from create session response");return{sessionToken:n.sessionToken,accessToken:n.accessToken,expiresAt:n.expiresAt,sessionTokenExpiresAt:n.sessionTokenExpiresAt,scope:n.scope}}async getAccessToken(e){return null!=e&&e.sessionToken?c(ks,this,nc).call(this,e.sessionToken,e):this.createSession({audience:null==e?void 0:e.audience,scope:null==e?void 0:e.scope})}async logout(){const e="".concat(u(vs,this),"/anonymous/logout"),t={client_id:u(gs,this)},n=await u(_s,this).call(this,e,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",redirect:"error",body:JSON.stringify(t)});if(!n.ok){const e=await ec(n);throw new Yr(e.error,e.error_description||"Failed to end anonymous session",e)}}async mintTransferToken(e){const t="".concat(u(vs,this),"/anonymous/token"),n={client_id:u(gs,this),session_token:e,audience:"urn:auth0:anon_transfer"};try{const e=await Qr({clientSecret:u(ys,this),clientAssertionSigningKey:u(bs,this),clientAssertionSigningAlg:u(ws,this),useMtls:u(xs,this)},u(gs,this),u(fs,this));Object.assign(n,e);const i=await u(_s,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},redirect:"error",body:JSON.stringify(n)});if(!i.ok)return null;const a=await i.json();return"string"==typeof a.anon_transfer_token?a.anon_transfer_token:null}catch(e){return null}}});async function nc(e,t){const n={client_id:u(gs,this),session_token:e};null!=t&&t.audience&&(n.audience=t.audience),null!=t&&t.scope&&(n.scope=t.scope);const i=await c(ks,this,ic).call(this,n);return{sessionToken:e,accessToken:i.accessToken,expiresAt:i.expiresAt,sessionTokenExpiresAt:i.sessionTokenExpiresAt,scope:i.scope}}async function ic(e){const t="".concat(u(vs,this),"/anonymous/token"),n=await Qr({clientSecret:u(ys,this),clientAssertionSigningKey:u(bs,this),clientAssertionSigningAlg:u(ws,this),useMtls:u(xs,this)},u(gs,this),u(fs,this));Object.assign(e,n);const i=await u(_s,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",redirect:"error",body:JSON.stringify(e)});if(!i.ok){const e=await ec(i);throw new Yr(e.error,e.error_description||"Anonymous token request failed",e)}let a;try{a=await i.json()}catch(e){throw new Yr("server_error","Invalid response from anonymous token endpoint")}return function(e){const t=Math.floor(Date.now()/1e3);if("string"!=typeof e.access_token||!e.access_token)throw new Yr("server_error","access_token missing or invalid in anonymous token response");const n=e.expires_in;if("number"!=typeof n||!Number.isFinite(n))throw new Yr("server_error","expires_in missing or invalid in anonymous token response");return{accessToken:e.access_token,expiresAt:t+n,scope:e.scope,sessionToken:e.session_token,sessionTokenExpiresAt:"number"==typeof e.session_expires_in&&Number.isFinite(e.session_expires_in)?t+e.session_expires_in:void 0}}(a)}var ac=(Ts=new WeakMap,Ss=new WeakMap,Es=new WeakMap,class{constructor(e,t){d(this,Ts,new Map),d(this,Ss,void 0),d(this,Es,void 0),h(Es,this,Math.max(1,Math.floor(e))),h(Ss,this,Math.max(0,Math.floor(t)))}get(e){const t=u(Ts,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return u(Ts,this).delete(e),u(Ts,this).set(e,t),t.value;u(Ts,this).delete(e)}}set(e,t,n){u(Ts,this).has(e)&&u(Ts,this).delete(e);const i=null!=n&&Number.isFinite(n)&&n>0?n:u(Ss,this);for(u(Ts,this).set(e,{value:t,expiresAt:Date.now()+i});u(Ts,this).size>u(Es,this);){const e=u(Ts,this).keys().next().value;if(void 0===e)break;u(Ts,this).delete(e)}}}),oc=new Map;function sc(e){return{ttlMs:1e3*("number"==typeof(null==e?void 0:e.ttl)?e.ttl:600),maxEntries:"number"==typeof(null==e?void 0:e.maxEntries)&&e.maxEntries>0?e.maxEntries:100}}var rc=class{static createDiscoveryCache(e){const t=(n=e.maxEntries,i=e.ttlMs,"".concat(n,":").concat(i));var n,i;let a=(o=t,oc.get(o));var o;return a||(a=new ac(e.maxEntries,e.ttlMs),oc.set(t,a)),a}static createJwksCache(){return{}}},cc="openid profile email offline_access",pc=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 lc(e){if(null==e)throw new Zs("subject_token is required");if("string"!=typeof e)throw new Zs("subject_token must be a string");if(0===e.trim().length)throw new Zs("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Zs("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Zs("subject_token must not include the 'Bearer ' prefix")}function uc(e,t){if(t)for(const i of Object.entries(t)){var n=b(i,2);const t=n[0],a=n[1];if(!pc.has(t))if(Array.isArray(a)){if(a.length>20)throw new Zs("Parameter '".concat(t,"' exceeds maximum array size of ").concat(20));a.forEach(n=>{e.append(t,n)})}else e.append(t,a)}}var dc="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",hc="urn:ietf:params:oauth:grant-type:token-exchange",mc="urn:ietf:params:oauth:token-type:access_token";function fc(e,t){return(n,i)=>{const a=null==i?void 0:i.body;if(t!==Cr||!(a instanceof URLSearchParams))return e(n,i);const o={};for(const e of a){var s=b(e,2);const t=s[0],n=s[1];o[t]="authn_response"===t?JSON.parse(n):n}const r=new Headers(null==i?void 0:i.headers);return r.set("Content-Type","application/json"),e(n,g(g({},i),{},{headers:r,body:JSON.stringify(o)}))}}var vc=(As=new WeakMap,js=new WeakMap,Ps=new WeakMap,Cs=new WeakMap,Is=new WeakMap,Os=new WeakMap,Rs=new WeakMap,Us=new WeakMap,Ns=new WeakMap,zs=new WeakMap,Ls=new WeakMap,Ms=new WeakSet,class{constructor(e){var t;if(m(this,Ms),d(this,As,void 0),d(this,js,void 0),d(this,Ps,void 0),d(this,Cs,void 0),d(this,Is,void 0),d(this,Os,void 0),d(this,Rs,void 0),d(this,Us,void 0),d(this,Ns,void 0),d(this,zs,void 0),d(this,Ls,void 0),f(this,"mfa",void 0),f(this,"passkey",void 0),f(this,"passwordless",void 0),f(this,"database",void 0),f(this,"anonymous",void 0),h(Is,this,e),e.useMtls&&!e.customFetch)throw new qs("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");h(Rs,this,br(e.telemetry)),h(Os,this,yr(null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)},u(Rs,this)));const n=sc(e.discoveryCache);h(Ns,this,rc.createDiscoveryCache(n)),h(zs,this,new Map),h(Ls,this,rc.createJwksCache()),this.mfa=new kr({domain:u(Is,this).domain,clientId:u(Is,this).clientId,clientSecret:u(Is,this).clientSecret,customFetch:u(Os,this),telemetryConfig:u(Rs,this),getConfiguration:async e=>(await c(Ms,this,wc).call(this,e)).configuration,createCaptureConfiguration:async e=>{const t=(await c(Ms,this,xc).call(this)).serverMetadata;return c(Ms,this,yc).call(this,t,e)}}),this.passkey=new Ir({domain:u(Is,this).domain,clientId:u(Is,this).clientId,clientSecret:u(Is,this).clientSecret,useMtls:u(Is,this).useMtls,customFetch:u(Os,this),telemetryConfig:u(Rs,this),grantRequest:async(e,t,n,i)=>{const a=(await c(Ms,this,xc).call(this)).serverMetadata,o=c(Ms,this,bc).call(this,n);if(i){const n=wr(o),i=await c(Ms,this,yc).call(this,a,n);i[xa]=fc(n,e);const s=await Ka(i,e,t),r=gr.fromTokenEndpointResponse(s),p=n.getCapturedResponse();if(!p)throw new ar;return{data:r,response:p}}const s=await c(Ms,this,yc).call(this,a);s[xa]=fc(o,e);const r=await Ka(s,e,t);return gr.fromTokenEndpointResponse(r)}}),this.passwordless=new qr({domain:u(Is,this).domain,clientId:u(Is,this).clientId,customFetch:u(Os,this),telemetryConfig:u(Rs,this),clientSecret:u(Is,this).clientSecret,clientAssertionSigningKey:u(Is,this).clientAssertionSigningKey,clientAssertionSigningAlg:u(Is,this).clientAssertionSigningAlg,useMtls:u(Is,this).useMtls,grantRequest:async(e,t,n,i)=>{const a=(await c(Ms,this,wc).call(this,n)).configuration;if(i){var o;const n=wr(null!==(o=a[xa])&&void 0!==o?o:u(Os,this)),i=await c(Ms,this,yc).call(this,a.serverMetadata(),n),s=await Ka(i,e,t),r=gr.fromTokenEndpointResponse(s),p=n.getCapturedResponse();if(!p)throw new ar;return{data:r,response:p}}try{const n=await Ka(a,e,t);return gr.fromTokenEndpointResponse(n)}catch(e){const t=e,n={};throw sr(n,e),t._statusCode=n.statusCode,t._headers=n.headers,e}}}),this.database=new Br({domain:u(Is,this).domain,clientId:u(Is,this).clientId,customFetch:u(Os,this),telemetryConfig:u(Rs,this)}),this.anonymous=new tc({domain:u(Is,this).domain,clientId:u(Is,this).clientId,clientSecret:u(Is,this).clientSecret,clientAssertionSigningKey:u(Is,this).clientAssertionSigningKey,clientAssertionSigningAlg:u(Is,this).clientAssertionSigningAlg,useMtls:u(Is,this).useMtls,customFetch:u(Os,this)})}async getServerMetadata(){return(await c(Ms,this,xc).call(this)).serverMetadata}async buildAuthorizationUrl(e){const t=(await c(Ms,this,xc).call(this)).serverMetadata;if(null!=e&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new qs("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await c(Ms,this,jc).call(this,e)}catch(e){throw new Qs(e)}}async buildLinkUserUrl(e){try{const t=await c(Ms,this,jc).call(this,{authorizationParams:g(g({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new er(e)}}async buildUnlinkUserUrl(e){try{const t=await c(Ms,this,jc).call(this,{authorizationParams:g(g({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new tr(e)}}async backchannelAuthentication(e,t){var n;const i=await c(Ms,this,wc).call(this,t),a=i.configuration,o=i.serverMetadata,s=rr(g(g({},u(Is,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(g(g({scope:cc},s),{},{client_id:u(Is,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:e.loginHint.sub})}));if(e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails)),e.fullResponse){var p;const e=wr(null!==(p=a[xa])&&void 0!==p?p:u(Os,this)),n=await c(Ms,this,yc).call(this,a.serverMetadata(),e);try{const t=await Ra(a,r),i=await Ua(n,t),o=e.getCapturedResponse();if(!o)throw new ar;return{data:gr.fromTokenEndpointResponse(i),response:o}}catch(t){if(t instanceof ar)throw t;const n=new Ys(t);throw sr(n,t,e.getCapturedResponse()),n}}const l=wr(null!==(n=a[xa])&&void 0!==n?n:u(Os,this)),d=await c(Ms,this,yc).call(this,a.serverMetadata(),l);try{const e=await Ra(a,r),t=await Ua(d,e);return gr.fromTokenEndpointResponse(t)}catch(e){const t=new Ys(e);throw sr(t,e,l.getCapturedResponse()),t}}async initiateBackchannelAuthentication(e,t){var n;const i=await c(Ms,this,wc).call(this,t),a=i.configuration,o=i.serverMetadata,s=rr(g(g({},u(Is,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(g(g({scope:cc},s),{},{client_id:u(Is,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));const p=wr(null!==(n=a[xa])&&void 0!==n?n:u(Os,this)),l=await c(Ms,this,yc).call(this,a.serverMetadata(),p);try{const e=await Ra(l,r);return{authReqId:e.auth_req_id,expiresIn:e.expires_in,interval:e.interval}}catch(e){const t=new Ys(e),n=p.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}}async backchannelAuthenticationGrant(e,t){var n;let i=e.authReqId;const a=(await c(Ms,this,wc).call(this,t)).configuration,o=new URLSearchParams({auth_req_id:i}),s=wr(null!==(n=a[xa])&&void 0!==n?n:u(Os,this)),r=await c(Ms,this,yc).call(this,a.serverMetadata(),s);try{const e=await Ka(r,"urn:openid:params:grant-type:ciba",o);return gr.fromTokenEndpointResponse(e)}catch(e){const t=new Ys(e),n=s.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}}async getTokenForConnection(e,t){var n;if(e.refreshToken&&e.accessToken)throw new Vs("Either a refresh or access token should be specified, but not both.");const i=null!==(n=e.accessToken)&&void 0!==n?n:e.refreshToken;if(!i)throw new Vs("Either a refresh or access token must be specified.");try{return await this.exchangeToken(g({connection:e.connection,subjectToken:i,subjectTokenType:e.accessToken?mc:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint},e.fullResponse?{fullResponse:!0}:{}),t)}catch(e){if(e instanceof Zs){const t=new Vs(e.message,e.cause);throw t.statusCode=e.statusCode,t.headers=e.headers,t}throw e}}async exchangeToken(e,t){return e.fullResponse?"connection"in e?c(Ms,this,kc).call(this,e,t,!0):c(Ms,this,Sc).call(this,e,t,!0):"connection"in e?c(Ms,this,kc).call(this,e,t):c(Ms,this,Sc).call(this,e,t)}async getTokenByCode(e,t,n){var i;const a=(await c(Ms,this,wc).call(this,n)).configuration;if(void 0!==t.organization&&cr(t.organization),t.fullResponse){var o;const n=wr(null!==(o=a[xa])&&void 0!==o?o:u(Os,this)),i=await c(Ms,this,yc).call(this,a.serverMetadata(),n);let s,r;try{const a=await za(i,e,{pkceCodeVerifier:t.codeVerifier});if(s=gr.fromTokenEndpointResponse(a),r=n.getCapturedResponse(),!r)throw new ar}catch(e){if(e instanceof ar)throw e;const t=new $s("There was an error while trying to request a token.",Ws(e)),i=n.getCapturedResponse();throw t.statusCode=null==i?void 0:i.status,t.headers=i?or(i.headers):void 0,t}return t.organization&&pr(s.claims,t.organization),{data:s,response:r}}const s=wr(null!==(i=a[xa])&&void 0!==i?i:u(Os,this)),r=await c(Ms,this,yc).call(this,a.serverMetadata(),s);let p;try{const n=await za(r,e,{pkceCodeVerifier:t.codeVerifier});p=gr.fromTokenEndpointResponse(n)}catch(e){const t=new $s("There was an error while trying to request a token.",Ws(e)),n=s.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}return t.organization&&pr(p.claims,t.organization),p}async getTokenByMagicLinkCode(e,t,n){var i;const a=(await c(Ms,this,wc).call(this,n)).configuration;if(null!=t&&t.fullResponse){var o;const n=wr(null!==(o=a[xa])&&void 0!==o?o:u(Os,this)),i=await c(Ms,this,yc).call(this,a.serverMetadata(),n);try{const a=await za(i,e,{expectedState:null==t?void 0:t.expectedState}),o=gr.fromTokenEndpointResponse(a),s=n.getCapturedResponse();if(!s)throw new ar;return{data:o,response:s}}catch(e){if(e instanceof ar)throw e;const t=e instanceof Error&&e.message?e.message:"There was an error while trying to request a token.",i=new $s(t,e),a=n.getCapturedResponse();throw i.statusCode=null==a?void 0:a.status,i.headers=a?or(a.headers):void 0,i}}const s=wr(null!==(i=a[xa])&&void 0!==i?i:u(Os,this)),r=await c(Ms,this,yc).call(this,a.serverMetadata(),s);try{const n=await za(r,e,{expectedState:null==t?void 0:t.expectedState});return gr.fromTokenEndpointResponse(n)}catch(e){const t=e instanceof Error&&e.message?e.message:"There was an error while trying to request a token.",n=new $s(t,e),i=s.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?or(i.headers):void 0,n}}async getTokenByRefreshToken(e,t){var n;const i=(await c(Ms,this,wc).call(this,t)).configuration,a=new URLSearchParams;if(e.audience&&a.append("audience",e.audience),e.scope&&a.append("scope",e.scope),e.fullResponse){var o;const t=wr(null!==(o=i[xa])&&void 0!==o?o:u(Os,this)),n=await c(Ms,this,yc).call(this,i.serverMetadata(),t);try{const i=await La(n,e.refreshToken,a),o=gr.fromTokenEndpointResponse(i),s=t.getCapturedResponse();if(!s)throw new ar;return{data:o,response:s}}catch(e){if(e instanceof ar)throw e;const n=new Hs("The access token has expired and there was an error while trying to refresh it.",Ws(e)),i=t.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?or(i.headers):void 0,n}}const s=wr(null!==(n=i[xa])&&void 0!==n?n:u(Os,this)),r=await c(Ms,this,yc).call(this,i.serverMetadata(),s);try{const t=await La(r,e.refreshToken,a);return gr.fromTokenEndpointResponse(t)}catch(e){const t=new Hs("The access token has expired and there was an error while trying to refresh it.",Ws(e)),n=s.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}}async revokeToken(e,t){var n;const i=(await c(Ms,this,wc).call(this,t)).configuration,a={};e.tokenTypeHint&&(a.token_type_hint=e.tokenTypeHint);const o=wr(null!==(n=i[xa])&&void 0!==n?n:u(Os,this)),s=await c(Ms,this,yc).call(this,i.serverMetadata(),o);try{await async function(e,t,n){qa(e);const i=va(e),a=i.as,o=i.c,s=i.auth,r=i.fetch,c=i.tlsOnly,p=i.timeout;return async function(e,t,n,i,a){Yt(e),Qt(t),Ht(i,'"token"');const o=on(e,"revocation_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==a?void 0:a[St])),s=new URLSearchParams(null==a?void 0:a.additionalParameters);s.set("token",i);const r=qt(null==a?void 0:a.headers);return r.delete("accept"),xn(e,t,n,o,s,r,a)}(a,o,s,t,{[jt]:r,[St]:!c,additionalParameters:new URLSearchParams(n),headers:new Headers(ma),signal:Ja(p)}).then(ei).catch(Aa)}(s,e.token,a)}catch(e){const t=new Gs("An error occurred while trying to revoke the token.",Ws(e)),n=o.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}}async getUserInfo(e,t){const n=(await c(Ms,this,wc).call(this,t,!0)).configuration;try{var i;return await $a(n,e.accessToken,null!==(i=e.expectedSubject)&&void 0!==i?i:wa)}catch(e){throw new Bs("There was an error while trying to retrieve the user info.",Ws(e))}}async getTokenByPassword(e,t){var n;const i=(await c(Ms,this,wc).call(this,t)).configuration,a=new URLSearchParams({username:e.username,password:e.password});e.audience&&a.append("audience",e.audience),e.scope&&a.append("scope",e.scope),e.realm&&a.append("realm",e.realm);let o=i;if(e.auth0ForwardedFor){const t=await c(Ms,this,Ac).call(this);o=new Pa(i.serverMetadata(),u(Is,this).clientId,{client_secret:u(Is,this).clientSecret,use_mtls_endpoint_aliases:u(Is,this).useMtls},t);const n=i[xa];o[xa]=(t,i)=>n(t,g(g({},i),{},{headers:g(g({},i.headers),{},{"auth0-forwarded-for":e.auth0ForwardedFor})}))}if(e.fullResponse){var s;const e=wr(null!==(s=o[xa])&&void 0!==s?s:u(Os,this)),n=await c(Ms,this,yc).call(this,o.serverMetadata(),e);try{const t=await Ka(n,"password",a),i=gr.fromTokenEndpointResponse(t),o=e.getCapturedResponse();if(!o)throw new ar;return{data:i,response:o}}catch(t){if(t instanceof ar)throw t;const n=new Ks("There was an error while trying to request a token.",Ws(t)),i=e.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?or(i.headers):void 0,n}}const r=wr(null!==(n=o[xa])&&void 0!==n?n:u(Os,this)),p=await c(Ms,this,yc).call(this,o.serverMetadata(),r);try{const e=await Ka(p,"password",a);return gr.fromTokenEndpointResponse(e)}catch(e){const t=new Ks("There was an error while trying to request a token.",Ws(e)),n=r.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}}async getTokenByPasswordlessEmail(e,t){const n=new URLSearchParams({username:e.email,otp:e.code,realm:"email"});return e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),c(Ms,this,Ec).call(this,n,t,e.fullResponse)}async getTokenByPasswordlessSms(e,t){if(!Dr(e.phoneNumber))throw new zr("Phone number must be in E.164 format (e.g. +14155550100).");const n=new URLSearchParams({username:e.phoneNumber,otp:e.code,realm:"sms"});return e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),c(Ms,this,Ec).call(this,n,t,e.fullResponse)}async getTokenByClientCredentials(e,t){var n;const i=(await c(Ms,this,wc).call(this,t)).configuration;if(e.fullResponse){var a;const t=wr(null!==(a=i[xa])&&void 0!==a?a:u(Os,this)),n=await c(Ms,this,yc).call(this,i.serverMetadata(),t),o=new URLSearchParams({audience:e.audience});e.organization&&o.append("organization",e.organization);try{const e=await Ma(n,o),i=gr.fromTokenEndpointResponse(e),a=t.getCapturedResponse();if(!a)throw new ar;return{data:i,response:a}}catch(e){if(e instanceof ar)throw e;const n=new Fs("There was an error while trying to request a token.",Ws(e)),i=t.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?or(i.headers):void 0,n}}const o=wr(null!==(n=i[xa])&&void 0!==n?n:u(Os,this)),s=await c(Ms,this,yc).call(this,i.serverMetadata(),o);try{const t=new URLSearchParams({audience:e.audience});e.organization&&t.append("organization",e.organization);const n=await Ma(s,t);return gr.fromTokenEndpointResponse(n)}catch(e){const t=new Fs("There was an error while trying to request a token.",Ws(e)),n=o.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}}async buildLogoutUrl(e){const t=await c(Ms,this,xc).call(this),n=t.configuration;if(!t.serverMetadata.end_session_endpoint){const t=new URL("https://".concat(u(Is,this).domain,"/v2/logout"));return t.searchParams.set("returnTo",e.returnTo),t.searchParams.set("client_id",u(Is,this).clientId),e.federated&&t.searchParams.set("federated",""),t}const i={post_logout_redirect_uri:e.returnTo};return e.federated&&(i.federated=""),function(e,t){qa(e);const n=va(e),i=n.as,a=n.c,o=on(i,"end_session_endpoint",!1,n.tlsOnly);(t=new URLSearchParams(t)).has("client_id")||t.set("client_id",a.client_id);for(const e of t.entries()){var s=b(e,2);const t=s[0],n=s[1];o.searchParams.append(t,n)}return o}(n,i)}async verifyLogoutToken(e){const t=(await c(Ms,this,xc).call(this)).serverMetadata,n=sc(u(Is,this).discoveryCache),i=t.jwks_uri;u(Us,this)||h(Us,this,function(e,t){if(!(e instanceof URL))throw new TypeError("url must be an instance of URL");const n=new URL(e.href).href,i=null!=t?t:{},a=i.timeoutDuration;if("number"==typeof a&&(!Number.isInteger(a)||a<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');const o="number"==typeof a?a:5e3,s=Lo(i.cooldownDuration,3e4,"cooldownDuration"),r=Lo(i.cacheMaxAge,6e5,"cacheMaxAge"),c=new Headers(i.headers);Ro&&!c.has("User-Agent")&&c.set("User-Agent",Ro),c.has("accept")||c.set("accept","application/json, application/jwk-set+json");const p=i[Uo],l=i[No];let u,d,h,m=0,f=0;if(l&&"object"==typeof l){const e=l.uat,t=l.jwks;zo(e,r)&&Li(t)&&(u=e,h=Co(t))}const v=async()=>{if(d&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(d=void 0),!d){const e=++m,t=d=async function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fetch;const a=await i(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new Pi;throw e});if(200!==a.status)throw new bi("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch(e){throw new bi("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(n,c,AbortSignal.timeout(o),p).then(t=>{const n=Co(t);if(e<=f)return;h=n;const i=Date.now();l&&(l.uat=i,l.jwks=t),u=i,f=e}).finally(()=>{d===t&&(d=void 0)})}await d};return Object.defineProperties(async(e,t)=>{h&&zo(u,r)||await v();try{return await h(e,t)}catch(n){if(n instanceof Ai&&!zo(u,s))return await v(),h(e,t);throw n}},{coolingDown:{get:()=>zo(u,s),enumerable:!0},fresh:{get:()=>zo(u,r),enumerable:!0},reload:{value:v,enumerable:!0},reloading:{get:()=>!!d,enumerable:!0},jwks:{value:()=>{var e;return null===(e=h)||void 0===e?void 0:e.jwks()},enumerable:!0}})}(new URL(i),{cacheMaxAge:n.ttlMs,[Uo]:u(Os,this),[No]:u(Ls,this)}));const a=(await async function(e,t,n){const i=await async function(e,t,n){if(e instanceof Uint8Array&&(e=hi.decode(e)),"string"!=typeof e)throw new Ti("Compact JWS must be a string or Uint8Array");const i=e.split("."),a=i[0],o=i[1],s=i[2];if(3!==i.length)throw new Ti("Invalid Compact JWS");const r={payload:o,protected:a,signature:s},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0===e?{}:function(e,t,n){let i;try{i=JSON.parse(mi.decode(Ui(e)))}catch(e){throw new t(n)}if(!zi(i))throw new t(n);return i}(e,Ti,"JWS Protected Header is invalid");return t}(a),p=function(e,t,n){const i=ua(e,la(Ti,ca,n[1],e,t)),a=t.alg;if("string"!=typeof a||!a)throw new Ti('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(n[0]&&!n[0].has(a))throw new _i('"alg" (Algorithm) Header Parameter value not allowed');return[i,a]}(c,c,t),l=b(p,2),u=l[0],d=l[1],h=u?o:function(e){try{return vi(e)}catch(e){throw new Ti("JWS Compact Serialization payload must use only ASCII characters")}}(o);return async function(e,t,n,i,a,o,s){var r;let c=!1;"function"==typeof n&&(n=await n(a,e),c=!0);const p="string"==typeof s,l=to(o),u=fi(void 0!==i?vi(i):new Uint8Array,vi("."),p?null!==(r=t[2])&&void 0!==r?r:t[2]=function(e,t,n){try{return vi(e)}catch(e){throw new n("The ".concat("payload"," is not a valid base64url string"))}}(s,0,Ti):s),d=Mi(e.signature,"signature",Ti),h=await Bi(l,n,"verify");if(!await async function(e,t,n,i){const a=await Va(e,t,"verify");try{return await crypto.subtle.verify(e.signing,a,n,i)}catch(e){return!1}}(l,h,d,u))throw new Ci;return[p?Mi(s,"payload",Ti):s,a,p,h,c]}(r,t,n,a,c,d,h)}(e,function(e){return[e&&pa("algorithms",e.algorithms),null==e?void 0:e.crit]}(n),t);if(!i[2])throw new Si("JWTs MUST NOT use unencoded payload");const a={payload:fo(i[1],i[0],n),protectedHeader:i[1]};return"function"==typeof t?g(g({},a),{},{key:i[3]}):a}(e.logoutToken,u(Us,this),{issuer:t.issuer,audience:u(Is,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in a)&&!("sub"in a))throw new Xs('either "sid" or "sub" (or both) claims must be present');if("sid"in a&&"string"!=typeof a.sid)throw new Xs('"sid" claim must be a string');if("sub"in a&&"string"!=typeof a.sub)throw new Xs('"sub" claim must be a string');if("nonce"in a)throw new Xs('"nonce" claim is prohibited');if(!("events"in a))throw new Xs('"events" claim is missing');if("object"!=typeof a.events||null===a.events)throw new Xs('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in a.events))throw new Xs('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if("object"!=typeof a.events["http://schemas.openid.net/event/backchannel-logout"])throw new Xs('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:a.sid,sub:a.sub}}});function gc(){const e=u(Is,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(u(Is,this).useMtls?"1":"0")}async function yc(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=await c(Ms,this,Ac).call(this,n),a=new Pa(e,u(Is,this).clientId,{client_secret:u(Is,this).clientSecret,use_mtls_endpoint_aliases:u(Is,this).useMtls},i);return a[xa]=null!=t?t:u(Os,this),a}function bc(e){return xr(u(Os,this),e,u(Rs,this))}async function wc(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=await c(Ms,this,xc).call(this,t),i=n.configuration,a=n.serverMetadata;if(!e)return{configuration:i,serverMetadata:a};const o=c(Ms,this,bc).call(this,e);return{configuration:await c(Ms,this,yc).call(this,a,o,t),serverMetadata:a}}async function xc(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=u(e?js:As,this);if(t&&u(Ps,this))return{configuration:t,serverMetadata:u(Ps,this)};const n=c(Ms,this,gc).call(this);e||await c(Ms,this,Ac).call(this,!1);const i=u(Ns,this).get(n);if(i)return c(Ms,this,_c).call(this,i.serverMetadata,e);const a=u(zs,this).get(n);if(a){const t=await a;return c(Ms,this,_c).call(this,t.serverMetadata,e)}const o=(async()=>{const e=(await async function(e,t,n,i,a){const o=await async function(e,t){var n,i;if(!(e instanceof URL))throw Ta('"server" must be an instance of URL',ka);const a=!e.href.includes("/.well-known/"),o=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:30,s=AbortSignal.timeout(1e3*o),r=await(a?async function(e,t){return async function(e,t,n,i){if(!(e instanceof URL))throw Tt('"'.concat("issuerIdentifier",'" must be an instance of URL'),kt);nn(e,!0!==(null==i?void 0:i[St]));const a=n(new URL(e.href)),o=qt(null==i?void 0:i.headers);return o.set("accept","application/json"),((null==i?void 0:i[jt])||fetch)(a.href,{body:void 0,headers:Object.fromEntries(o.entries()),method:"GET",redirect:"manual",signal:Jt(a,null==i?void 0:i.signal)})}(e,0,e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":!function(e){e.pathname=$t("".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=$t("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw Tt('"options.algorithm" must be "oidc" (default), or "oauth2"',_t)}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[jt]:null==t?void 0:t[xa],[St]:null==t||null===(i=t.execute)||void 0===i?void 0:i.includes(Na),signal:s,headers:new Headers(ma)}):((null==t?void 0:t[xa])||fetch)((nn(e,null==t||null===(c=t.execute)||void 0===c||!c.includes(Na)),e.href),{headers:Object.fromEntries(new Headers(g({accept:"application/json"},ma)).entries()),body:void 0,method:"GET",redirect:"manual",signal:s})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==li)throw Tt('"expectedIssuerIdentifier" must be an instance of URL',kt);if(!xt(t,Response))throw Tt('"response" must be an instance of Response',kt);if(200!==t.status)throw Dt('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Kn,t);ti(t);const i=await pi(t);if(Ht(i.issuer,'"response" body "issuer" property',Fn,{body:i}),n!==li&&new URL(i.issuer).href!==n.href)throw Dt('"response" body "issuer" property does not match the expected value',Xn,{expected:n.href,body:i,attribute:"issuer"});return i}(li,e)).catch(Aa);var c;return a&&new URL(r.issuer).href!==e.href&&(function(e,t,n){return!("https://login.microsoftonline.com"!==e.origin||null!=n&&n.algorithm&&"oidc"!==n.algorithm||(t[ja]=!0,0))}(e,r,t)||function(e,t){return!(!e.hostname.endsWith(".b2clogin.com")||null!=t&&t.algorithm&&"oidc"!==t.algorithm)}(e,t)||(()=>{throw new Sa("discovered metadata issuer does not match the expected issuer",{code:Xn,cause:{expected:e.href,body:r,attribute:"issuer"}})})()),r}(e,a),s=new Pa(o,t,n,i);let r=va(s);if(null!=a&&a[xa]&&(r.fetch=a[xa]),null!=a&&a.timeout&&(r.timeout=a.timeout),null!=a&&a.execute)for(const e of a.execute)e(s);return s}(new URL("https://".concat(u(Is,this).domain)),u(Is,this).clientId,{use_mtls_endpoint_aliases:u(Is,this).useMtls},(e,t,n,i)=>{n.set("client_id",t.client_id)},{[xa]:u(Os,this)})).serverMetadata();return u(Ns,this).set(n,{serverMetadata:e}),{serverMetadata:e}})();o.catch(()=>{}),u(zs,this).set(n,o);try{const t=(await o).serverMetadata;return c(Ms,this,_c).call(this,t,e)}finally{u(zs,this).delete(n)}}async function _c(e,t){const n=await c(Ms,this,yc).call(this,e,void 0,t);return h(Ps,this,e),h(t?js:As,this,n),{configuration:n,serverMetadata:e}}async function kc(e,t,n){var i,a,o;const s=(await c(Ms,this,wc).call(this,t)).configuration;if("audience"in e||"resource"in e)throw new Zs("audience and resource parameters are not supported for Token Vault exchanges");lc(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==(i=e.subjectTokenType)&&void 0!==i?i:mc,requested_token_type:null!==(a=e.requestedTokenType)&&void 0!==a?a:"http://auth0.com/oauth/token-type/federated-connection-access-token"});if(e.loginHint&&r.append("login_hint",e.loginHint),e.scope&&r.append("scope",e.scope),uc(r,e.extra),n){var p;const t=wr(null!==(p=s[xa])&&void 0!==p?p:u(Os,this)),i=await c(Ms,this,yc).call(this,s.serverMetadata(),t);try{const e=await Ka(i,dc,r),n=gr.fromTokenEndpointResponse(e),a=t.getCapturedResponse();if(!a)throw new ar;return{data:n,response:a}}catch(n){if(n instanceof ar)throw n;const i=new Zs("Failed to exchange token for connection '".concat(e.connection,"'."),Ws(n)),a=t.getCapturedResponse();throw i.statusCode=null==a?void 0:a.status,i.headers=a?or(a.headers):void 0,i}}const l=wr(null!==(o=s[xa])&&void 0!==o?o:u(Os,this)),d=await c(Ms,this,yc).call(this,s.serverMetadata(),l);try{const e=await Ka(d,dc,r);return gr.fromTokenEndpointResponse(e)}catch(t){const n=new Zs("Failed to exchange token for connection '".concat(e.connection,"'."),Ws(t)),i=l.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?or(i.headers):void 0,n}}function Tc(e,t,n){var i;if(n.organization&&pr(e.claims,n.organization),n.actorToken)if(null!==(i=e.claims)&&void 0!==i&&i.act)e.act=e.claims.act;else try{e.act=function(e){if("string"!=typeof e)throw new Si("JWTs must use Compact JWS serialization, JWT must be a string");const t=e.split("."),n=t[1],i=t.length;if(5===i)throw new Si("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new Si("Invalid JWT");if(!n)throw new Si("JWTs must contain a payload");let a,o;try{a=Ui(n)}catch(e){throw new Si("Failed to base64url decode the payload")}try{o=JSON.parse(mi.decode(a))}catch(e){throw new Si("Failed to parse the decoded payload as JSON")}if(!zi(o))throw new Si("Invalid JWT Claims Set");return o}(t.access_token).act}catch(e){}return e}async function Sc(e,t,n){var i;const a=(await c(Ms,this,wc).call(this,t)).configuration;if(lc(e.subjectToken),void 0!==e.organization&&cr(e.organization),void 0!==e.actorToken&&void 0===e.actorTokenType)throw new Zs("actorTokenType is required when actorToken is provided");const o=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});if(e.audience&&o.append("audience",e.audience),e.scope&&o.append("scope",e.scope),e.requestedTokenType&&o.append("requested_token_type",e.requestedTokenType),e.organization&&o.append("organization",e.organization),e.actorToken&&o.append("actor_token",e.actorToken),e.actorTokenType&&o.append("actor_token_type",e.actorTokenType),uc(o,e.extra),n){var s;const t=wr(null!==(s=a[xa])&&void 0!==s?s:u(Os,this)),i=await c(Ms,this,yc).call(this,a.serverMetadata(),t);let r,p,l;try{if(p=await Ka(i,hc,o),r=gr.fromTokenEndpointResponse(p),l=t.getCapturedResponse(),!l)throw new ar}catch(n){if(n instanceof ar)throw n;const i=new Zs("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),Ws(n)),a=t.getCapturedResponse();throw i.statusCode=null==a?void 0:a.status,i.headers=a?or(a.headers):void 0,i}return c(Ms,this,Tc).call(this,r,p,e),{data:r,response:l}}const r=wr(null!==(i=a[xa])&&void 0!==i?i:u(Os,this)),p=await c(Ms,this,yc).call(this,a.serverMetadata(),r);let l,d;try{d=await Ka(p,hc,o),l=gr.fromTokenEndpointResponse(d)}catch(t){const n=new Zs("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),Ws(t)),i=r.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?or(i.headers):void 0,n}return c(Ms,this,Tc).call(this,l,d,e),l}async function Ec(e,t,n){var i;const a=(await c(Ms,this,wc).call(this,t)).configuration;if(n){var o;const t=wr(null!==(o=a[xa])&&void 0!==o?o:u(Os,this)),n=await c(Ms,this,yc).call(this,a.serverMetadata(),t);try{const i=await Ka(n,"http://auth0.com/oauth/grant-type/passwordless/otp",e),a=gr.fromTokenEndpointResponse(i),o=t.getCapturedResponse();if(!o)throw new ar;return{data:a,response:o}}catch(e){if(e instanceof ar)throw e;const n=new zr("There was an error while trying to request a token.",Ws(e)),i=t.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?or(i.headers):void 0,n}}const s=wr(null!==(i=a[xa])&&void 0!==i?i:u(Os,this)),r=await c(Ms,this,yc).call(this,a.serverMetadata(),s);try{const t=await Ka(r,"http://auth0.com/oauth/grant-type/passwordless/otp",e);return gr.fromTokenEndpointResponse(t)}catch(e){const t=new zr("There was an error while trying to request a token.",Ws(e)),n=s.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?or(n.headers):void 0,t}}async function Ac(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=!!u(Is,this).clientSecret||!!u(Is,this).clientAssertionSigningKey||!!u(Is,this).useMtls;return e&&!t?(e,t,n,i)=>{n.set("client_id",t.client_id)}:(u(Cs,this)||h(Cs,this,(async()=>{if(!u(Is,this).clientSecret&&!u(Is,this).clientAssertionSigningKey&&!u(Is,this).useMtls)throw new nr;if(u(Is,this).useMtls)return(e,t,n,i)=>{n.set("client_id",t.client_id)};let e=u(Is,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await Mo(e,u(Is,this).clientAssertionSigningAlg||"RS256")),e?function(e){return function(e,t){const n=(o=e)instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&Ht(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{},i=n.key,a=n.kid;var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw Tt("".concat(t," must be a CryptoKey"),kt)}(e,t),"private"!==e.type)throw Tt("".concat(t," must be a private CryptoKey"),_t)}(i,'"clientPrivateKey.key"'),async(e,n,o,s)=>{var r;const c={alg:Zt(i),kid:a},p=function(e,t){const n=Xt()+Gt(t);return{jti:Vt(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,n);null==t||null===(r=t[Pt])||void 0===r||r.call(t,c,p),o.set("client_id",n.client_id),o.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),o.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw Tt('CryptoKey instances used for signing assertions must include "sign" in their "usages"',_t);const i="".concat(zt(Rt(JSON.stringify(e))),".").concat(zt(Rt(JSON.stringify(t)))),a=zt(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:ii(e)};case"RSA-PSS":switch(ni(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 Lt("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return ni(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new Lt("unsupported CryptoKey algorithm name",{cause:e})}(n),n,Rt(i)));return"".concat(i,".").concat(a)}(c,p,i))}}(e,void 0)}(e):ba(u(Is,this).clientSecret)})().catch(e=>{throw h(Cs,this,void 0),e})),u(Cs,this))}async function jc(e){const t=(await c(Ms,this,xc).call(this)).configuration,n=Vt(),i=await function(e){return async function(e){return Ht(e,"codeVerifier"),zt(await crypto.subtle.digest("SHA-256",Rt(e)))}(e)}(n),a=rr(g(g({},u(Is,this).authorizationParams),null==e?void 0:e.authorizationParams)),o=new URLSearchParams(g(g({scope:cc},a),{},{client_id:u(Is,this).clientId,code_challenge:i,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Wa(t,o):await Da(t,o),codeVerifier:n}}var Pc,Cc,Ic=new ac(1e3,6e4);class Oc extends C{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Oc.prototype)}static fromPayload(e){let t=e.error,n=e.error_description;return new Oc(t,n)}}class Rc extends Oc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Rc.prototype)}}class Uc extends Oc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Uc.prototype)}}class Nc extends Oc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Nc.prototype)}}class zc extends Oc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,zc.prototype)}}class Lc extends Oc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Lc.prototype)}}class Mc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=e}set(e,t){this.cleanup(),this.contexts.set(e,Object.assign(Object.assign({},t),{createdAt:Date.now()}))}get(e){const t=this.contexts.get(e);if(t){if(!(Date.now()-t.createdAt>this.ttlMs))return t;this.contexts.delete(e)}}remove(e){this.contexts.delete(e)}cleanup(){const e=Date.now();for(const n of this.contexts){var t=b(n,2);const i=t[0];e-t[1].createdAt>this.ttlMs&&this.contexts.delete(i)}}get size(){return this.contexts.size}}class Dc{constructor(e,t){this.authJsMfaClient=e,this.auth0Client=t,this.contextManager=new Mc}setMFAAuthDetails(e,t,n,i){this.contextManager.set(e,{scope:t,audience:n,mfaRequirements:i})}async getAuthenticators(e){var t,n,i;const a=this.contextManager.get(e);if(!a)throw new Rc("invalid_request","MFA context not found for this MFA token");const o=null===(n=null===(t=a.mfaRequirements)||void 0===t?void 0:t.challenge)||void 0===n?void 0:n.map(e=>e.type);try{const t=await this.authJsMfaClient.listAuthenticators({mfaToken:e});return o&&0!==o.length?t.filter(e=>!!e.type&&o.includes(e.type)):t}catch(e){if(e instanceof ur)throw new Rc(null===(i=e.cause)||void 0===i?void 0:i.error,e.message);throw e}}async enroll(e){var t;const n=function(e){const t=gt[e.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:e.mfaToken,authenticatorTypes:t.authenticatorTypes},t.oobChannels&&{oobChannels:t.oobChannels}),"phoneNumber"in e&&{phoneNumber:e.phoneNumber}),"email"in e&&{email:e.email})}(e);try{return await this.authJsMfaClient.enrollAuthenticator(n)}catch(e){if(e instanceof dr)throw new Uc(null===(t=e.cause)||void 0===t?void 0:t.error,e.message);throw e}}async challenge(e){var t;try{const t={challengeType:e.challengeType,mfaToken:e.mfaToken};return e.authenticatorId&&(t.authenticatorId=e.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(t)}catch(e){if(e instanceof mr)throw new Nc(null===(t=e.cause)||void 0===t?void 0:t.error,e.message);throw e}}async getEnrollmentFactors(e){const t=this.contextManager.get(e);if(!t||!t.mfaRequirements)throw new Lc("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return t.mfaRequirements.enroll&&0!==t.mfaRequirements.enroll.length?t.mfaRequirements.enroll:[]}async verify(e){const t=this.contextManager.get(e.mfaToken);if(!t)throw new zc("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const n=function(e){return"otp"in e&&e.otp?"http://auth0.com/oauth/grant-type/mfa-otp":"oobCode"in e&&e.oobCode?"http://auth0.com/oauth/grant-type/mfa-oob":"recoveryCode"in e&&e.recoveryCode?"http://auth0.com/oauth/grant-type/mfa-recovery-code":void 0}(e);if(!n)throw new zc("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const i=t.scope,a=t.audience;try{const t=await this.auth0Client._requestTokenForMfa({grant_type:n,mfaToken:e.mfaToken,scope:i,audience:a,otp:e.otp,oob_code:e.oobCode,binding_code:e.bindingCode,recovery_code:e.recoveryCode});return this.contextManager.remove(e.mfaToken),t}catch(e){if(e instanceof zc)throw new zc(e.error,e.error_description);throw e}}}class Wc extends Error{constructor(e,t,n){super(t),this.name="PasskeyError",this.code=e,this.cause=n,Object.setPrototypeOf(this,Wc.prototype)}}class qc{constructor(e,t){Pc.set(this,void 0),Cc.set(this,void 0),o(this,Pc,e,"f"),o(this,Cc,t,"f")}async signup(e){if(!window.PublicKeyCredential)throw new Wc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e.scope,n=e.audience,o=i(e,["scope","audience"]),s=await a(this,Pc,"f").register(o),r=Fc(s.authnParamsPublicKey),c=await navigator.credentials.create({publicKey:r});if(!c)throw new Wc("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");const p=Kc(c);return a(this,Cc,"f")._requestTokenForPasskey({authSession:s.authSession,credential:p,realm:o.realm,organization:o.organization,scope:t,audience:n})}async login(e){if(!window.PublicKeyCredential)throw new Wc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e||{},n=t.scope,o=t.audience,s=i(t,["scope","audience"]),r=await a(this,Pc,"f").challenge(Object.keys(s).length>0?s:void 0),c=Hc(r.authnParamsPublicKey),p=await navigator.credentials.get({publicKey:c});if(!p)throw new Wc("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");const l=Vc(p);return a(this,Cc,"f")._requestTokenForPasskey({authSession:r.authSession,credential:l,realm:s.realm,organization:s.organization,scope:n,audience:o})}async getSignupChallenge(e){if(!window.PublicKeyCredential)throw new Wc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await a(this,Pc,"f").register(e);return{authSession:t.authSession,publicKey:Fc(t.authnParamsPublicKey)}}async getLoginChallenge(e){if(!window.PublicKeyCredential)throw new Wc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await a(this,Pc,"f").challenge(e);return{authSession:t.authSession,publicKey:Hc(t.authnParamsPublicKey)}}async getTokenWithPasskey(e){if(!window.PublicKeyCredential)throw new Wc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e.authSession,n=e.credential,i=e.realm,o=e.organization,s=e.scope,r=e.audience,c=n.response;let p;if(c instanceof AuthenticatorAttestationResponse)p=Kc(n);else{if(!(c instanceof AuthenticatorAssertionResponse))throw new Wc("passkey_invalid_credential","The provided credential is not a valid attestation or assertion response.");p=Vc(n)}return a(this,Cc,"f")._requestTokenForPasskey({authSession:t,credential:p,realm:i,organization:o,scope:s,audience:r})}}function Jc(e){const t=new Uint8Array(e),n=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function $c(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),i=atob(n),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);return a.buffer}function Fc(e){return Object.assign(Object.assign({},e),{challenge:$c(e.challenge),user:Object.assign(Object.assign({},e.user),{id:$c(e.user.id)}),pubKeyCredParams:e.pubKeyCredParams,authenticatorSelection:e.authenticatorSelection})}function Hc(e){return Object.assign(Object.assign({},e),{challenge:$c(e.challenge)})}function Kc(e){var t;const n=e.response;return{id:e.id,rawId:Jc(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:Jc(n.clientDataJSON),attestationObject:Jc(n.attestationObject)},clientExtensionResults:e.getClientExtensionResults()}}function Vc(e){var t;const n=e.response;return{id:e.id,rawId:Jc(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:Jc(n.clientDataJSON),authenticatorData:Jc(n.authenticatorData),signature:Jc(n.signature),userHandle:n.userHandle?Jc(n.userHandle):void 0},clientExtensionResults:e.getClientExtensionResults()}}function Zc(e){return{get(){try{const t=window.localStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}},set(t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}},remove(){try{window.localStorage.removeItem(e)}catch(e){}}}}function Gc(){let e=null;return{get:()=>e,set:t=>{e=t},remove:()=>{e=null}}}Pc=new WeakMap,Cc=new WeakMap;class Bc{constructor(e,t){this.slots=new Map,this.baseKey="".concat("@@auth0spajs@@","::").concat(e,"::anonymous"),this.useLocalStorage="localStorage"===t&&"undefined"!=typeof window&&!!window.localStorage,this.sessionKey="".concat(this.baseKey,"::").concat("session"),this.sessionStore=this.useLocalStorage?Zc(this.sessionKey):Gc();const n="".concat(this.baseKey,"::").concat("session_expired");this.expiredStore=this.useLocalStorage?Zc(n):Gc()}getStore(e,t){const n="".concat(this.baseKey,"::").concat(JSON.stringify([null!=e?e:"",null!=t?t:""]));return this.slots.has(n)||this.slots.set(n,this.useLocalStorage?Zc(n):Gc()),this.slots.get(n)}getSessionToken(){return this.sessionStore.get()}setSessionToken(e){this.sessionStore.set(e),this.expiredStore.remove()}isSessionExpired(){return!!this.expiredStore.get()}markSessionExpired(){this.expiredStore.set(!0)}removeAll(){if(this.sessionStore.remove(),this.expiredStore.remove(),this.slots.forEach(e=>e.remove()),this.slots.clear(),this.useLocalStorage)try{const e=this.baseKey+"::",t=[];for(let n=0;n<window.localStorage.length;n++){const i=window.localStorage.key(n);(null==i?void 0:i.startsWith(e))&&t.push(i)}t.forEach(e=>window.localStorage.removeItem(e))}catch(e){}}}class Xc{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"localStorage",i=arguments.length>3?arguments[3]:void 0;this.authJsClient=e,this.clientId=t,this.cache=new Bc(t,n),this.lockManager=null!=i?i:fe()}async createSession(e){const t=await this.authJsClient.createSession(e);return this.cache.setSessionToken(Object.assign({sessionToken:t.sessionToken},void 0!==t.sessionTokenExpiresAt&&{sessionTokenExpiresAt:t.sessionTokenExpiresAt})),this.cache.getStore(null==e?void 0:e.audience,null==e?void 0:e.scope).set(Object.assign({accessToken:t.accessToken,expiresAt:t.expiresAt},void 0!==t.scope&&{scope:t.scope})),t}async getTokenSilently(e){const t=this.cache.getStore(null==e?void 0:e.audience,null==e?void 0:e.scope),n=t.get();return n&&n.expiresAt-60>Date.now()/1e3?n:this.lockManager.runWithLock("anonymous::".concat(this.clientId),5e3,async()=>{var n;if(this.cache.isSessionExpired())throw new Yr("session_expired","The anonymous session has expired. Call createSession() to start a new one.");const i=t.get();if(i&&i.expiresAt-60>Date.now()/1e3)return i;const a=null===(n=this.cache.getSessionToken())||void 0===n?void 0:n.sessionToken;let o;try{o=await this.authJsClient.getAccessToken(Object.assign(Object.assign({},e),{sessionToken:a}))}catch(e){throw e instanceof Yr&&("session_expired"===e.code||"invalid_session_token"===e.code)&&(this.cache.removeAll(),this.cache.markSessionExpired()),e}return this.cache.getStore(null==e?void 0:e.audience,null==e?void 0:e.scope).set(Object.assign({accessToken:o.accessToken,expiresAt:o.expiresAt},void 0!==o.scope&&{scope:o.scope})),this.cache.getSessionToken()||this.cache.setSessionToken(Object.assign({sessionToken:o.sessionToken},void 0!==o.sessionTokenExpiresAt&&{sessionTokenExpiresAt:o.sessionTokenExpiresAt})),Object.assign({accessToken:o.accessToken,expiresAt:o.expiresAt},void 0!==o.scope&&{scope:o.scope})})}async mintTransferToken(){const e=this.cache.getSessionToken();return(null==e?void 0:e.sessionToken)?this.authJsClient.mintTransferToken(e.sessionToken):null}async logout(){await this.authJsClient.logout(),this.cache.removeAll()}hasSession(){var e;return!!(null===(e=this.cache.getSessionToken())||void 0===e?void 0:e.sessionToken)}getClaims(){return null}}class Yc{resolveOnlineAccess(e){if("online"!==e.refreshTokenMode)return!1;if(!0!==e.useRefreshTokens)throw new I('`refreshTokenMode: "online"` requires the refresh-token grant.',"Set `useRefreshTokens: true`.");if(!0!==e.useDpop)throw new I('`refreshTokenMode: "online"` requires DPoP, which is missing or disabled.',"Set `useDpop: true` (DPoP is mandatory for online access).");return!0}warnEnterpriseConnectConfig(e){var t,n;if(!0!==e.enterpriseConnect)return;const i=null===(t=e.authorizationParams)||void 0===t?void 0:t.scope;(!0===e.useRefreshTokens||"string"==typeof i&&i.includes("offline_access"))&&console.warn("Enterprise Connect issues no refresh token; `useRefreshTokens` and `offline_access` in `scope` have no effect."),(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)&&console.warn("Enterprise Connect resolves the organization from the email domain (Home Realm Discovery); a static `organization` breaks multi-customer setups.")}constructor(e){let t,n;if(this.userCache=(new qe).enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0,refreshTokenMode:"offline",anonymousSessionsCacheMode:"localStorage"},this.onlineAccess=this.resolveOnlineAccess(e),this.warnEnterpriseConnectConfig(e),this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!$())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===$().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),this.lockManager=fe(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(t=e.cacheLocation||T,!ct(t))throw new Error('Invalid cache location "'.concat(t,'"'));n=ct(t)()}var i;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:k,this.cookieStorage=!1===e.legacySameSiteCookie?Xe:Qe,this.orgHintCookieName=(i=this.options.clientId,"auth0.".concat(i,".organization_hint")),this.isAuthenticatedCookieName=(e=>"auth0.".concat(e,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:et;let o="";var s;this.onlineAccess?o=E:this.options.useRefreshTokens&&(o="offline_access"),this.scope=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];if("object"!=typeof e)return{[P]:Ne(t,e,...i)};let o={[P]:Ne(t,...i)};return Object.keys(e).forEach(n=>{const a=e[n];o[n]=Ne(t,a,...i)}),o}(this.options.authorizationParams.scope,"openid",o),this.transactionManager=new $e(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||j,this.cacheManager=new Je(n,n.allKeys?void 0:new ot(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new dt(this.options.clientId):void 0,this.domainUrl=(s=this.options.domain,/^https?:\/\//.test(s)?s:"https://".concat(s)),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:"https://".concat(e,"/"):"".concat(t,"/"))(this.options.issuer,this.domainUrl);const r="".concat(this.domainUrl,"/me/"),c=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:r},detailedResponse:!0})}}));this.myAccount=new ft(c,r),this.authJsClient=new vc({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new Dc(this.authJsClient.mfa,this),this.anonymous=new Xc(this.authJsClient.anonymous,this.options.clientId,this.options.anonymousSessionsCacheMode,this.lockManager),this.passkey=new qc(this.authJsClient.passkey,this),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&t===T&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new at,this.worker.postMessage({type:"init",allowedBaseUrl:this.domainUrl}))}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(e){const t=this.options.auth0Client||A,n=V(t,!0),i=encodeURIComponent(btoa(JSON.stringify(n)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(i)}_authorizeUrl(e){return this._url("/authorize?".concat(Z(e)))}async _verifyIdToken(e,t,n){const i=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),n=b(t,3),i=n[0],a=n[1],o=n[2];if(3!==t.length||!i||!a||!o)throw new Error("ID token could not be decoded");const s=JSON.parse(B(a)),r={__raw:e},c={};return Object.keys(s).forEach(e=>{r[e]=s[e],He.includes(e)||(c[e]=s[e])}),{encoded:{header:i,payload:a,signature:o},header:JSON.parse(B(i)),claims:r,user:c}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Fe(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!Fe(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Fe(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,i=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+n),i>a)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(i,") is after expiration time (").concat(a,")"));if(null!=t.claims.nbf&&Fe(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),i<e)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(i,") is before ").concat(e))}if(null!=t.claims.auth_time&&Fe(t.claims.auth_time)){const a=new Date(0);if(a.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),i>a)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (".concat(i,") is after last auth at ").concat(a))}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(e,'", found "').concat(t.claims.org_id,'"'))}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(e,'", found "').concat(t.claims.org_name,'"'))}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(a=this.options.authorizationParams.max_age,"string"!=typeof a?a:parseInt(a,10)||void 0),now:i});var a}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}_extractSessionTransferToken(e){return new URLSearchParams(window.location.search).get(e)||void 0}_clearSessionTransferTokenFromUrl(e){try{const t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState({},"",t.toString()))}catch(e){}}_applySessionTransferToken(e){const t=this.options.sessionTransferTokenQueryParamName;if(!t||e.session_transfer_token)return e;const n=this._extractSessionTransferToken(t);return n?(this._clearSessionTransferTokenFromUrl(t),Object.assign(Object.assign({},e),{session_transfer_token:n})):e}async _applyAnonTransferToken(e){const t=await this.anonymous.mintTransferToken();return t?Object.assign(Object.assign({},e),{anon_transfer_token:t}):e}async _prepareAuthorizeUrl(e,t,n){var i;const a=H(F()),o=H(F()),s=F(),r=await G(s),c=X(r),p=await(null===(i=this.dpop)||void 0===i?void 0:i.calculateThumbprint()),l=((e,t,n,i,a,o,s,r,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:ze(t,n.scope,n.audience),response_type:"code",response_mode:r||"query",state:i,nonce:a,redirect_uri:s||e.authorizationParams.redirect_uri,code_challenge:o,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,a,o,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,p),u=this._authorizeUrl(l);return{nonce:o,code_verifier:s,scope:l.scope,audience:l.audience||P,redirect_uri:l.redirect_uri,state:a,url:u}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup","left=".concat(e,",top=").concat(t,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(),!t.popup))throw new L;const i=await this._applyAnonTransferToken(this._applySessionTransferToken(e.authorizationParams||{})),a=await this._prepareAuthorizeUrl(i,{response_mode:"web_message"},window.location.origin);t.popup.location.href=a.url;const o=await((e,t)=>new Promise((n,i)=>{let a;const o=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(s),window.removeEventListener("message",a,!1),i(new z(e.popup)))},1e3),s=setTimeout(()=>{clearInterval(o),i(new N(e.popup)),window.removeEventListener("message",a,!1)},1e3*(e.timeoutInSeconds||60));a=function(r){if(r.origin===t&&r.data&&"authorization_response"===r.data.type){if(clearTimeout(s),clearInterval(o),window.removeEventListener("message",a,!1),!1!==e.closePopup&&e.popup.close(),r.data.response.error)return i(C.fromPayload(r.data.response));n(r.data.response)}},window.addEventListener("message",a)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(a.url).origin);if(a.state!==o.state)throw new C("state_mismatch","Invalid state");const s=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:s})}async getUser(){var e;if(await this._isSessionCeilingReached())return;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;if(await this._isSessionCeilingReached())return;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(){var e;const t=pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),n=t.openUrl,a=t.fragment,o=t.appState,s=i(t,["openUrl","fragment","appState"]),r=(null===(e=s.authorizationParams)||void 0===e?void 0:e.organization)||this.options.authorizationParams.organization,c=await this._applyAnonTransferToken(this._applySessionTransferToken(s.authorizationParams||{})),p=await this._prepareAuthorizeUrl(c),l=p.url,u=i(p,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},u),{appState:o,response_type:tt.Code}),r&&{organization:r}));const d=a?"".concat(l,"#").concat(a):l;n?await n(d):window.location.assign(d)}async handleRedirectCallback(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href).split("?").slice(1);if(0===e.length)throw new Error("There are no query params available for parsing.");const t=this.transactionManager.get();if(!t)throw new C("missing_transaction","Invalid state");this.transactionManager.remove();const n=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(e.join(""));return t.response_type===tt.ConnectCode?this._handleConnectAccountRedirectCallback(n,t):this._handleLoginRedirectCallback(n,t)}async _handleLoginRedirectCallback(e,t){const n=e.code,i=e.state,a=e.error,o=e.error_description;if(a)throw new O(a,o||a,i,t.appState);if(!t.code_verifier||t.state&&t.state!==i)throw new C("state_mismatch","Invalid state");const s=t.organization,r=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:r,organization:s}),{appState:t.appState,response_type:tt.Code}}async _handleConnectAccountRedirectCallback(e,t){const n=e.connect_code,i=e.state,a=e.error,o=e.error_description;if(a)throw new R(a,o||a,t.connection,i,t.appState);if(!n)throw new C("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===i))throw new C("state_mismatch","Invalid state");const s=await this.myAccount.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},s),{appState:t.appState,response_type:tt.ConnectCode})}async _maybeCreateAnonymousSession(){if(this.options.createAnonymousSessionOnFailedSilentAuth){if(this.anonymous.hasSession())return;try{await this.anonymous.getTokenSilently()}catch(e){console.debug("[auth0-spa-js] Anonymous session creation failed",e)}}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(st))return void await this._maybeCreateAnonymousSession();this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(st)}try{await this.getTokenSilently(e)}catch(e){e instanceof C&&"login_required"===e.error&&e.error_description!==S&&await this._maybeCreateAnonymousSession()}}async getTokenSilently(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t,n;const i=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ze(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),a=await this._getTokenSilently(i);return e.detailedResponse?a:null==a?void 0:a.access_token}async _getTokenSilently(e){const t=e.cacheMode,n=i(e,["cacheMode"]);if(await this._isSessionCeilingReached())return;if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||P,clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const a=(o=this.options.clientId,s=n.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(o,".").concat(s));var o,s;try{return await this.lockManager.runWithLock(a,5e3,async()=>{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||P,clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),i=e.id_token,a=e.token_type,o=e.access_token,s=e.oauthTokenScope,r=e.expires_in;return Object.assign(Object.assign({id_token:i,token_type:a,access_token:o},s?{scope:s}:null),{expires_in:r})})}catch(e){if(this._isInteractiveError(e)&&"popup"===this.options.interactiveErrorHandler)return await this._handleInteractiveErrorWithPopup(n);throw e}}_isInteractiveError(e){return e instanceof M||e instanceof C&&this._isIframeMfaError(e)}_isIframeMfaError(e){return"login_required"===e.error&&e.error_description===S}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});const t=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||P,clientId:this.options.clientId});if(!t)throw new C("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return t}catch(e){throw e}}async getTokenWithPopup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,i;const a=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ze(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(i=e.authorizationParams)||void 0===i?void 0:i.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},_),t),await this.loginWithPopup(a,t),(await this.cacheManager.get(new De({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||P,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},n=t.federated,a=i(t,["federated"]),o=n?"&federated":"";return this._url("/v2/logout?".concat(Z(Object.assign({clientId:e.clientId},a))))+o}async revokeRefreshToken(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.options.useRefreshTokens)return;const t=e.audience||this.options.authorizationParams.audience||P,n=await this.cacheManager.getRefreshTokensByAudience(t,this.options.clientId);await async function(e,t){let n=e.auth0Client,i=e.useFormData,a=e.refreshTokens,o=e.audience,s=e.client_id,r=e.onRefreshTokenRevoked;const c=e.timeout||k,p="refresh_token",l="".concat(e.baseUrl,"/oauth/revoke"),u={"Content-Type":i?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(V(n||A)))};if(t){const n={client_id:s,token_type_hint:p},a=i?Z(n):JSON.stringify(n);try{return await Ce({type:"revoke",timeout:c,fetchUrl:l,fetchOptions:{method:"POST",body:a,headers:u},useFormData:i,auth:{audience:null!=o?o:P}},t)}catch(e){throw new C("revoke_error",e.message)}}for(const t of a){const n={client_id:s,token_type_hint:p,token:t},a=i?Z(n):JSON.stringify(n),o=await Ie(l,{method:"POST",body:a,headers:u},c);if(!o.ok){let t,n;try{var d=JSON.parse(await o.text());t=d.error,n=d.error_description}catch(e){}throw new C(t||"revoke_error",n||"HTTP error ".concat(o.status))}await(null==r?void 0:r(t))}}({baseUrl:this.domainUrl,timeout:this.httpTimeoutMs,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,client_id:this.options.clientId,refreshTokens:n,audience:t,onRefreshTokenRevoked:e=>this.cacheManager.stripRefreshToken(e)},this.worker),this.onlineAccess&&await this._clearLocalSession()}async logout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;this.options.enterpriseConnect&&!0!==(null===(t=e.logoutParams)||void 0===t?void 0:t.federated)&&console.warn("Enterprise Connect logout without `federated: true` leaves the enterprise IdP session alive; the next login may silently reuse the previous user.");const n=pt(e),a=n.openUrl,o=i(n,["openUrl"]);await this._clearLocalSession(e.clientId);const s=this._buildLogoutUrl(o);a?await a(s):!1!==a&&window.location.assign(s)}async _getTokenFromIFrame(e){const t=(n=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(n));var n;try{return await this.lockManager.runWithLock(t,5e3,async()=>{const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const i=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin),a=i.url,o=i.state,s=i.nonce,r=i.code_verifier,c=i.redirect_uri,p=i.scope,l=i.audience;if(window.crossOriginIsolated)throw new C("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const u=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let d;try{d=new URL(this.domainUrl).origin}catch(e){d=this.domainUrl}const h=await function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60;return new Promise((i,a)=>{const o=window.document.createElement("iframe");o.setAttribute("width","0"),o.setAttribute("height","0"),o.style.display="none";const s=()=>{window.document.body.contains(o)&&(window.document.body.removeChild(o),window.removeEventListener("message",r,!1))};let r;const c=setTimeout(()=>{a(new U),s()},1e3*n);r=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?a(C.fromPayload(e.data.response)):i(e.data.response),clearTimeout(c),window.removeEventListener("message",r,!1),setTimeout(s,2e3)},window.addEventListener("message",r,!1),window.document.body.appendChild(o),o.setAttribute("src",e)})}(a,d,u);if(o!==h.state)throw new C("state_mismatch","Invalid state");const m=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:r,code:h.code,grant_type:"authorization_code",redirect_uri:c,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:s,organization:t.organization});return Object.assign(Object.assign({},m),{scope:p,oauthTokenScope:m.scope,audience:l})})}catch(e){throw"login_required"===e.error&&(e instanceof C&&this._isIframeMfaError(e)&&"popup"===this.options.interactiveErrorHandler||this.logout({openUrl:!1})),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new De({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||P,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new D(e.authorizationParams.audience||P,e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,i="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,a=((e,t,n,i)=>{var a;if(e&&n&&i){if(t.audience!==n)return t.scope;const e=i.split(" "),o=(null===(a=t.scope)||void 0===a?void 0:a.split(" "))||[],s=o.every(t=>e.includes(t));return e.length>=o.length&&s?i:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const p=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),i&&{timeout:i}),{scopesToRequest:a});if(await this._propagateRotatedRefreshToken(null==t?void 0:t.refresh_token,p.refresh_token),this.options.useMrrt&&(o=null==t?void 0:t.audience,s=null==t?void 0:t.scope,r=e.authorizationParams.audience,c=e.authorizationParams.scope,o!==r||!((e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))})(c,s))){const t=((e,t,n)=>{const i=(null==e?void 0:e.split(" "))||[],a=n?i.filter(e=>e!==E):i,o=(null==t?void 0:t.split(" "))||[];return a.filter(e=>-1==o.indexOf(e)).join(",")})(a,p.scope,this.onlineAccess);if(t){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope),new W(e.authorizationParams.audience||"default",t)}}return Object.assign(Object.assign({},p),{scope:e.authorizationParams.scope,oauthTokenScope:p.scope,audience:e.authorizationParams.audience||P})}catch(t){if(t.message){if(t.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),t;if((t.message.includes("Missing Refresh Token")||t.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e)}throw t}var o,s,r,c}async _propagateRotatedRefreshToken(e,t){!this.onlineAccess&&t&&e&&await this.cacheManager.updateEntry(e,t,this.options.clientId,this.options.useMrrt)}async _saveEntryInCache(e){const t=e.decodedToken.claims,n=t.session_expiry,a=t.iat;if(void 0!==n){if("number"!=typeof n)throw new C("invalid_token","Invalid session_expiry: value must be a number.");if(n>=1e10)throw new C("invalid_token","Invalid session_expiry: value appears to be in milliseconds; expected a Unix timestamp in seconds.");if(void 0===a||n<=a)throw new C("invalid_token","Invalid session_expiry: session ceiling is before or at the token issue time.")}const o=e.id_token,s=e.decodedToken,r=i(e,["id_token","decodedToken"]);this.userCache.set(Me,{id_token:o,decodedToken:s}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _clearLocalSession(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.clientId;var t;null===e?await this.cacheManager.clear():await this.cacheManager.clear(e),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove(Me);try{await(null===(t=this.dpop)||void 0===t?void 0:t.clear())}catch(e){}if(this.worker)try{await Ce({type:"clear"},this.worker)}catch(e){}}async _isSessionCeilingReached(){var e,t;const n=this.userCache.get(Me),i=null!=n?n:await this.cacheManager.getIdToken(new De({clientId:this.options.clientId})),a=null===(t=null===(e=null==i?void 0:i.decodedToken)||void 0===e?void 0:e.claims)||void 0===t?void 0:t.session_expiry;if(void 0===a)return!1;const o=await this.nowProvider();return Math.floor(o/1e3)>=a-30&&(await this._clearLocalSession(),!0)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||P,t=this.scope[e],n=await this.cacheManager.getIdToken(new De({clientId:this.options.clientId,audience:e,scope:t})),i=this.userCache.get(Me);return n&&n.id_token===(null==i?void 0:i.id_token)?i:(this.userCache.set(Me,n),n)}async _getEntryFromCache(e){let t=e.scope,n=e.audience,i=e.clientId,a=e.cacheMode;const o=await this.cacheManager.get(new De({scope:t,audience:n,clientId:i}),60,this.options.useMrrt,a);if(o&&o.access_token){const e=o.token_type,t=o.access_token,n=o.oauthTokenScope,i=o.expires_in,a=await this._getIdTokenFromCache();return a&&Object.assign(Object.assign({id_token:a.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:i})}}_storeMfaContext(e,t,n){e instanceof M&&this.mfa.setMFAAuthDetails(e.mfa_token,t,n,e.mfa_requirements)}async _requestToken(e,t){var n,i,a,o,s,r;const c=t||{},p=c.nonceIn,l=c.organization,u=c.scopesToRequest;try{const t=await Ue(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop,preserveRefreshToken:this.onlineAccess},e),{scope:u||e.scope}),this.worker);let c=await this._verifyIdToken(t.id_token,p,l);if("authorization_code"===e.grant_type){const e=await this._getIdTokenFromCache();(null===(i=null===(n=null==e?void 0:e.decodedToken)||void 0===n?void 0:n.claims)||void 0===i?void 0:i.sub)&&e.decodedToken.claims.sub!==c.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(Me))}if("authorization_code"!==e.grant_type){const e=await this._getIdTokenFromCache(),t=null===(o=null===(a=null==e?void 0:e.decodedToken)||void 0===a?void 0:a.claims)||void 0===o?void 0:o.session_expiry;void 0!==t&&(c=Object.assign(Object.assign({},c),{claims:Object.assign(Object.assign({},c.claims),{session_expiry:t})}))}return!t.refresh_token&&this.onlineAccess&&(t.refresh_token=null!==(s=e.refresh_token)&&void 0!==s?s:null===(r=await this.cacheManager.get(new De({scope:u||e.scope,audience:e.audience||P,clientId:this.options.clientId}),void 0,this.options.useMrrt))||void 0===r?void 0:r.refresh_token),await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},t),{decodedToken:c,scope:e.scope,audience:e.audience||P}),t.scope?{oauthTokenScope:t.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(l||c.claims.org_id),Object.assign(Object.assign({},t),{decodedToken:c})}catch(t){throw"authorization_code"!==e.grant_type&&this._storeMfaContext(t,u||e.scope,e.audience),t}}_buildTokenExchangeParams(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type}),e.actor_token&&{actor_token:e.actor_token}),e.actor_token_type&&{actor_token_type:e.actor_token_type}),{scope:ze(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}async loginWithCustomTokenExchange(e){const t=this._buildTokenExchangeParams(e);return this._requestToken(t,{organization:t.organization})}async customTokenExchange(e){const t=this._buildTokenExchangeParams(e);try{const n=await Ue(Object.assign(Object.assign({},t),{baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,dpop:this.dpop}),this.worker,!0);return n.id_token&&await this._verifyIdToken(n.id_token,void 0,e.organization),n}catch(e){throw this._storeMfaContext(e,t.scope,t.audience),e}}async exchangeToken(e){return this.loginWithCustomTokenExchange(e)}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new mt(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const t=e.openUrl,n=e.appState,i=e.connection,a=e.scopes,o=e.authorization_params,s=e.redirectUri,r=void 0===s?this.options.authorizationParams.redirect_uri||window.location.origin:s;if(!i)throw new Error("connection is required");const c=H(F()),p=F(),l=await G(p),u=X(l),d=await this.myAccount.connectAccount({connection:i,scopes:a,redirect_uri:r,state:c,code_challenge:u,code_challenge_method:"S256",authorization_params:o}),h=d.connect_uri,m=d.connect_params,f=d.auth_session;this.transactionManager.create({state:c,code_verifier:p,auth_session:f,redirect_uri:r,appState:n,connection:i,response_type:tt.ConnectCode});const v=new URL(h);v.searchParams.set("ticket",m.ticket),t?await t(v.toString()):window.location.assign(v)}async _requestTokenForPasskey(e){const t=e.audience||this.options.authorizationParams.audience,n=e.organization||this.options.authorizationParams.organization;return this._requestToken(Object.assign(Object.assign(Object.assign({grant_type:"urn:okta:params:oauth:grant-type:webauthn",auth_session:e.authSession,authn_response:e.credential},e.realm&&{realm:e.realm}),n&&{organization:n}),{scope:ze(this.scope,e.scope,t),audience:t}))}async _requestTokenForMfa(e,t){const n=e.mfaToken,a=i(e,["mfaToken"]),o=await this.cacheManager.get(new De({scope:a.scope,audience:a.audience||P,clientId:this.options.clientId}),void 0,this.options.useMrrt),s=await this._requestToken(Object.assign(Object.assign({},a),{mfa_token:n}),t);return await this._propagateRotatedRefreshToken(null==o?void 0:o.refresh_token,s.refresh_token),s}}function Qc(e,t,n){var i;return async function(e,t,n){const i=t.toLowerCase(),a=e.replace(/^https?:\/\//,""),o="".concat(a,"|").concat(i),s=Ic.get(o);if(void 0!==s)return s;try{var r;const e=new URL("https://".concat(a,"/.well-known/webfinger"));e.searchParams.set("resource","urn:auth0:discovery:domain:".concat(i)),e.searchParams.set("rel","http://openid.net/specs/connect/1.0/issuer");let t=null!==(r=null==n?void 0:n.customFetch)&&void 0!==r?r:globalThis.fetch;null!=n&&n.telemetry&&!1!==n.telemetry.enabled&&(t=yr(t,n.telemetry));const s=await t(e.toString());return s.ok?(Ic.set(o,!0),!0):404===s.status?(Ic.set(o,!1,15e3),!1):429===s.status&&(console.warn("[Auth0] isFederatedDomain: rate limit hit (429)"),!1)}catch(e){return!1}}(e.replace(/^https?:\/\//i,"").toLowerCase(),t.toLowerCase(),Object.assign(Object.assign({},n),{telemetry:null!==(i=null==n?void 0:n.telemetry)&&void 0!==i?i:A}))}async function ep(e){const t=new Yc(e);return await t.checkSession(),t}n.d(t,["RefreshTokenMode",0,{Offline:"offline",Online:"online"}])},991(e,t){"use strict";t.byteLength=function(e){var t=r(e),n=t[0],i=t[1];return 3*(n+i)/4-i},t.toByteArray=function(e){var t,n,o=r(e),s=o[0],c=o[1],p=new a(function(e,t,n){return 3*(t+n)/4-n}(0,s,c)),l=0,u=c>0?s-4:s;for(n=0;n<u;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],p[l++]=t>>16&255,p[l++]=t>>8&255,p[l++]=255&t;return 2===c&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,p[l++]=255&t),1===c&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,p[l++]=t>>8&255,p[l++]=255&t),p},t.fromByteArray=function(e){for(var t,i=e.length,a=i%3,o=[],s=16383,r=0,c=i-a;r<c;r+=s)o.push(p(e,r,r+s>c?c:r+s));return 1===a?(t=e[i-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[i-2]<<8)+e[i-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function r(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 p(e,t,n){for(var i,a=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(c(i));return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},318(e,t){t.read=function(e,t,n,i,a){var o,s,r=8*a-i-1,c=(1<<r)-1,p=c>>1,l=-7,u=n?a-1:0,d=n?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-l)-1,h>>=-l,l+=r;l>0;o=256*o+e[t+u],u+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=i;l>0;s=256*s+e[t+u],u+=d,l-=8);if(0===o)o=1-p;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,i),o-=p}return(h?-1:1)*s*Math.pow(2,o-i)},t.write=function(e,t,n,i,a,o){var s,r,c,p=8*o-a-1,l=(1<<p)-1,u=l>>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,m=i?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(s++,c/=2),s+u>=l?(r=0,s=l):s+u>=1?(r=(t*c-1)*Math.pow(2,a),s+=u):(r=t*Math.pow(2,u-1)*Math.pow(2,a),s=0));a>=8;e[n+h]=255&r,h+=m,r/=256,a-=8);for(s=s<<a|r,p+=a;p>0;e[n+h]=255&s,h+=m,s/=256,p-=8);e[n+h-m]|=128*f}},526(e,t,n){"use strict";var i=n(991),a=n(318),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;var s=2147483647;function r(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var 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 u(e)}return p(e,t,n)}function p(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),i=r(n),a=i.write(e,t);return a!==n&&(i=i.slice(0,a)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return c.from(i,t,n);var a=function(e){if(c.isBuffer(e)){var t=0|m(e.length),n=r(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?r(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(a)return a;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 u(e){return l(e),r(e<0?0:0|m(e))}function d(e){for(var t=e.length<0?0:0|m(e.length),n=r(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(i,c.prototype),i}function m(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function f(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);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(e).length;default:if(a)return i?-1:M(e).length;t=(""+t).toLowerCase(),a=!0}}function v(e,t,n){var i=!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 E(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function y(e,t,n,i,a){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),J(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,a);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,a){var o,s=1,r=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,r/=2,c/=2,n/=2}function p(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(a){var l=-1;for(o=n;o<r;o++)if(p(e,o)===p(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+c>r&&(n=r-c),o=n;o>=0;o--){for(var u=!0,d=0;d<c;d++)if(p(e,o+d)!==p(t,d)){u=!1;break}if(u)return o}return-1}function w(e,t,n,i){n=Number(n)||0;var a=e.length-n;i?(i=Number(i))>a&&(i=a):i=a;var o=t.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var r=parseInt(t.substr(2*s,2),16);if(J(r))return s;e[n+s]=r}return s}function x(e,t,n,i){return W(M(t,e.length-n),e,n,i)}function _(e,t,n,i){return W(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function k(e,t,n,i){return W(D(t),e,n,i)}function T(e,t,n,i){return W(function(e,t){for(var n,i,a,o=[],s=0;s<e.length&&!((t-=2)<0);++s)i=(n=e.charCodeAt(s))>>8,a=n%256,o.push(a),o.push(i);return o}(t,e.length-n),e,n,i)}function S(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var i=[],a=t;a<n;){var o,s,r,c,p=e[a],l=null,u=p>239?4:p>223?3:p>191?2:1;if(a+u<=n)switch(u){case 1:p<128&&(l=p);break;case 2:128==(192&(o=e[a+1]))&&(c=(31&p)<<6|63&o)>127&&(l=c);break;case 3:o=e[a+1],s=e[a+2],128==(192&o)&&128==(192&s)&&(c=(15&p)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[a+1],s=e[a+2],r=e[a+3],128==(192&o)&&128==(192&s)&&128==(192&r)&&(c=(15&p)<<18|(63&o)<<12|(63&s)<<6|63&r)>65535&&c<1114112&&(l=c)}null===l?(l=65533,u=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l),a+=u}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=A));return n}(i)}c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,n){return p(e,t,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,n){return function(e,t,n){return l(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}(e,t,n)},c.allocUnsafe=function(e){return u(e)},c.allocUnsafeSlow=function(e){return u(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=c.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(q(o,Uint8Array))a+o.length>i.length?c.from(o).copy(i,a):Uint8Array.prototype.set.call(i,o,a);else{if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a)}a+=o.length}return i},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):v.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",n=t.IS;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,i,a){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===i&&(i=0),void 0===a&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(i>>>=0),s=(n>>>=0)-(t>>>=0),r=Math.min(o,s),p=this.slice(i,a),l=e.slice(t,n),u=0;u<r;++u)if(p[u]!==l[u]){o=p[u],s=l[u];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},c.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return _(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function j(e,t,n){var i="";n=Math.min(e.length,n);for(var a=t;a<n;++a)i+=String.fromCharCode(127&e[a]);return i}function P(e,t,n){var i="";n=Math.min(e.length,n);for(var a=t;a<n;++a)i+=String.fromCharCode(e[a]);return i}function C(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var a="",o=t;o<n;++o)a+=$[e[o]];return a}function I(e,t,n){for(var i=e.slice(t,n),a="",o=0;o<i.length-1;o+=2)a+=String.fromCharCode(i[o]+256*i[o+1]);return a}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,i,a,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function U(e,t,n,i,a,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,i,o){return t=+t,n>>>=0,o||U(e,0,n,4),a.write(e,t,n,i,23,4),n+4}function z(e,t,n,i,o){return t=+t,n>>>=0,o||U(e,0,n,8),a.write(e,t,n,i,52,8),n+8}c.prototype.slice=function(e,t){var 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<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,c.prototype),i},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(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||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(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||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||R(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,o=0;for(this[t]=255&e;++o<n&&(a*=256);)this[t+o]=e/a&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||R(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(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||R(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||R(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||R(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||R(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.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*n-1);R(this,e,t,n,a-1,-a)}var o=0,s=1,r=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===r&&0!==this[t+o-1]&&(r=1),this[t+o]=(e/s|0)-r&255;return t+n},c.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*n-1);R(this,e,t,n,a-1,-a)}var o=n-1,s=1,r=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===r&&0!==this[t+o+1]&&(r=1),this[t+o]=(e/s|0)-r&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(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||R(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||R(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||R(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||R(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.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,i){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),a},c.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var a=e.charCodeAt(0);("utf8"===i&&a<128||"latin1"===i)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=c.isBuffer(e)?e:c.from(e,i),r=s.length;if(0===r)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%r]}return this};var L=/[^+/0-9A-Za-z-_]/g;function M(e,t){var n;t=t||1/0;for(var i=e.length,a=null,o=[],s=0;s<i;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.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;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function D(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,n,i){for(var a=0;a<i&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}var $=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var i=16*n,a=0;a<16;++a)t[i+a]=e[n]+e[a];return t}()},942(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,i="",a=0,o=-1,s=0,r=0;r<=e.length;++r){if(r<e.length)n=e.charCodeAt(r);else{if(47===n)break;n=47}if(47===n){if(o===r-1||1===s);else if(o!==r-1&&2===s){if(i.length<2||2!==a||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var c=i.lastIndexOf("/");if(c!==i.length-1){-1===c?(i="",a=0):a=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),o=r,s=0;continue}}else if(2===i.length||1===i.length){i="",a=0,o=r,s=0;continue}t&&(i.length>0?i+="/..":i="..",a=2)}else i.length>0?i+="/"+e.slice(o+1,r):i=e.slice(o+1,r),a=r-o-1;o=r,s=0}else 46===n&&-1!==s?++s:s=-1}return i}var i={resolve:function(){for(var e,i="",a=!1,o=arguments.length-1;o>=-1&&!a;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(i=s+"/"+i,a=47===s.charCodeAt(0))}return i=n(i,!a),a?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var i=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!i)).length||i||(e="."),e.length>0&&a&&(e+="/"),i?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var a=arguments[n];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":i.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=i.resolve(e))===(n=i.resolve(n)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var o=e.length,s=o-a,r=1;r<n.length&&47===n.charCodeAt(r);++r);for(var c=n.length-r,p=s<c?s:c,l=-1,u=0;u<=p;++u){if(u===p){if(c>p){if(47===n.charCodeAt(r+u))return n.slice(r+u+1);if(0===u)return n.slice(r+u)}else s>p&&(47===e.charCodeAt(a+u)?l=u:0===u&&(l=0));break}var d=e.charCodeAt(a+u);if(d!==n.charCodeAt(r+u))break;47===d&&(l=u)}var h="";for(u=a+l+1;u<=o;++u)u!==o&&47!==e.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(r+l):(r+=l,47===n.charCodeAt(r)&&++r,n.slice(r))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),i=47===n,a=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){a=s;break}}else o=!1;return-1===a?i?"/":".":i&&1===a?"//":e.slice(0,a)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var i,a=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var r=n.length-1,c=-1;for(i=e.length-1;i>=0;--i){var p=e.charCodeAt(i);if(47===p){if(!s){a=i+1;break}}else-1===c&&(s=!1,c=i+1),r>=0&&(p===n.charCodeAt(r)?-1===--r&&(o=i):(r=-1,o=c))}return a===o?o=c:-1===o&&(o=e.length),e.slice(a,o)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!s){a=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(a,o)},extname:function(e){t(e);for(var n=-1,i=0,a=-1,o=!0,s=0,r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47!==c)-1===a&&(o=!1,a=r+1),46===c?-1===n?n=r:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){i=r+1;break}}return-1===n||-1===a||0===s||1===s&&n===a-1&&n===i+1?"":e.slice(n,a)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+"/"+i:i}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var i,a=e.charCodeAt(0),o=47===a;o?(n.root="/",i=1):i=0;for(var s=-1,r=0,c=-1,p=!0,l=e.length-1,u=0;l>=i;--l)if(47!==(a=e.charCodeAt(l)))-1===c&&(p=!1,c=l+1),46===a?-1===s?s=l:1!==u&&(u=1):-1!==s&&(u=-1);else if(!p){r=l+1;break}return-1===s||-1===c||0===u||1===u&&s===c-1&&s===r+1?-1!==c&&(n.base=n.name=0===r&&o?e.slice(1,c):e.slice(r,c)):(0===r&&o?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(r,s),n.base=e.slice(r,c)),n.ext=e.slice(s,c)),r>0?n.dir=e.slice(0,r-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i},930(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,n,i){var a=i&&i.stringify||t;if("object"==typeof e&&null!==e){var o=n.length+1;if(1===o)return e;var s=new Array(o);s[0]=a(e);for(var r=1;r<o;r++)s[r]=a(n[r]);return s.join(" ")}if("string"!=typeof e)return e;var c=n.length;if(0===c)return e;for(var p="",l=0,u=-1,d=e&&e.length||0,h=0;h<d;){if(37===e.charCodeAt(h)&&h+1<d){switch(u=u>-1?u:0,e.charCodeAt(h+1)){case 100:case 102:if(l>=c)break;if(null==n[l])break;u<h&&(p+=e.slice(u,h)),p+=Number(n[l]),u=h+2,h++;break;case 105:if(l>=c)break;if(null==n[l])break;u<h&&(p+=e.slice(u,h)),p+=Math.floor(Number(n[l])),u=h+2,h++;break;case 79:case 111:case 106:if(l>=c)break;if(void 0===n[l])break;u<h&&(p+=e.slice(u,h));var m=typeof n[l];if("string"===m){p+="'"+n[l]+"'",u=h+2,h++;break}if("function"===m){p+=n[l].name||"<anonymous>",u=h+2,h++;break}p+=a(n[l]),u=h+2,h++;break;case 115:if(l>=c)break;u<h&&(p+=e.slice(u,h)),p+=String(n[l]),u=h+2,h++;break;case 37:u<h&&(p+=e.slice(u,h)),p+="%",u=h+2,h++,l--}++l}++h}return-1===u?e:(u<d&&(p+=e.slice(u)),p)}},48(e,t,n){var i,a,o;o=function(){return function(){return function(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i<e.length;i++){var a=e[i];if("string"!=typeof a)throw new TypeError("Url must be a string. Received "+a);""!==a&&(i>0&&(a=a.replace(/^[\/]+/,"")),a=i<e.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),t.push(a))}var o=t.join("/"),s=(o=o.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=o():void 0===(a="function"==typeof(i=o)?i.call(t,n,t,e):i)||(e.exports=a)},122(){},360(){},826(){},713(e,t,n){"use strict";const i=n(930);e.exports=u;const a=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},o={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:g,res:g,err:f,errWithCause:f};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}const r=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),p={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function l(e,t){const n={logger:t,parent:e[c]};t[c]=n}function u(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const n=e.browser.write||a;e.browser.write&&(e.browser.asObject=!0);const i=e.serializers||{},o=function(e,t){return Array.isArray(e)?e.filter(function(e){return"!stdSerializers.err"!==e}):!0===e&&Object.keys(t)}(e.browser.serialize,i);let c=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);const f=Object.keys(e.customLevels||{}),g=["error","fatal","warn","info","debug","trace"].concat(f);"function"==typeof n&&g.forEach(function(e){n[e]=n}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const y=e.level||"info",w=Object.create(n);w.log||(w.log=b),function(e,t,n){const i={};t.forEach(e=>{i[e]=n[e]?n[e]:a[e]||a[p[e]||"log"]||b}),e[r]=i}(w,g,n),l({},w),Object.defineProperty(w,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,x,w,"error"),d(this,x,w,"fatal"),d(this,x,w,"warn"),d(this,x,w,"info"),d(this,x,w,"debug"),d(this,x,w,"trace"),f.forEach(e=>{d(this,x,w,e)})}});const x={transmit:t,serialize:o,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:g,timestamp:v(e)};return w.levels=function(e){const t=e.customLevels||{};return{values:Object.assign({},u.levels.values,t),labels:Object.assign({},u.levels.labels,function(e){const t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}(t))}}(e),w.level=y,w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=b,w.serializers=i,w._serialize=o,w._stdErrSerialize=c,w.child=function(n,a){if(!n)throw new Error("missing bindings for child Pino");a=a||{},o&&n.serializers&&(a.serializers=n.serializers);const s=a.serializers;if(o&&s){var r=Object.assign({},i,s),c=!0===e.browser.serialize?Object.keys(r):o;delete n.serializers,h([n],c,r,this._stdErrSerialize)}function p(e){this._childLevel=1+(0|e._childLevel),this.bindings=n,r&&(this.serializers=r,this._serialize=c),t&&(this._logEvent=m([].concat(e._logEvent.bindings,n)))}p.prototype=this;const u=new p(this);return l(this,u),u.level=this.level,u},t&&(w._logEvent=m()),w}function d(e,t,n,o){if(Object.defineProperty(e,o,{value:s(e.level,n)>s(o,n)?b:n[r][o],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[o]===b)return;e[o]=function(e,t,n,o){return c=e[r][o],function(){const r=t.timestamp(),p=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===a?a:this;for(var u=0;u<p.length;u++)p[u]=arguments[u];if(t.serialize&&!t.asObject&&h(p,this._serialize,this.serializers,this._stdErrSerialize),t.asObject||t.formatters?c.call(l,function(e,t,n,a,o={}){const{level:s=()=>e.levels.values[t],log:r=e=>e}=o;e._serialize&&h(n,e._serialize,e.serializers,e._stdErrSerialize);const c=n.slice();let p=c[0];const l={};a&&(l.time=a),l.level=s(t,e.levels.values[t]);let u=1+(0|e._childLevel);if(u<1&&(u=1),null!==p&&"object"==typeof p){for(;u--&&"object"==typeof c[0];)Object.assign(l,c.shift());p=c.length?i(c.shift(),c):void 0}else"string"==typeof p&&(p=i(c.shift(),c));return void 0!==p&&(l.msg=p),r(l)}(this,o,p,r,t.formatters)):c.apply(l,p),t.transmit){const i=t.transmit.level||e._level,a=n.levels.values[i],c=n.levels.values[o];if(c<a)return;!function(e,t,n){const i=t.send,a=t.ts,o=t.methodLevel,s=t.methodValue,r=t.val,c=e._logEvent.bindings;h(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=n.filter(function(e){return-1===c.indexOf(e)}),e._logEvent.level.label=o,e._logEvent.level.value=s,i(o,e._logEvent,r),e._logEvent=m(c)}(this,{ts:r,methodLevel:o,methodValue:c,transmitLevel:i,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:s(e._level,n)},p)}};var c}(e,t,n,o);const p=function(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[c];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}(e);0!==p.length&&(e[o]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(p,e[o]))}function h(e,t,n,i){for(const a in e)if(i&&e[a]instanceof Error)e[a]=u.stdSerializers.err(e[a]);else if("object"==typeof e[a]&&!Array.isArray(e[a]))for(const i in e[a])t&&t.indexOf(i)>-1&&i in n&&(e[a][i]=n[i](e[a][i]))}function m(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function f(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function v(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?w:x}function g(){return{}}function y(e){return e}function b(){}function w(){return!1}function x(){return Date.now()}u.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},u.stdSerializers=o,u.stdTimeFunctions=Object.assign({},{nullTime:w,epochTime:x,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=u,e.exports.pino=u},797(e,t,n){"use strict";var i,a=n(526).hp,o=Object.create,s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,p=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>function(){return t||(0,e[c(e)[0]])((t={exports:{}}).exports,t),t.exports},d=(e,t,n,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of c(t))l.call(e,a)||a===n||s(e,a,{get:()=>t[a],enumerable:!(i=r(t,a))||i.enumerable});return e},h=(e,t,n)=>(n=null!=e?o(p(e)):{},d(!t&&e&&e.__esModule?n:s(n,"default",{value:e,enumerable:!0}),e)),m=u({"../../node_modules/mime-db/db.json"(e,t){t.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}}}),f=u({"../../node_modules/mime-db/index.js"(e,t){t.exports=m()}}),v=u({"../../node_modules/mime-types/index.js"(e){var t,i,a,o=f(),s=n(942).extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var t=r.exec(e),n=t&&o[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!c.test(t[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var i=e.charset(n);i&&(n+="; charset="+i.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=r.exec(t),i=n&&e.extensions[n[1].toLowerCase()];return!(!i||!i.length)&&i[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var n=s("x."+t).toLowerCase().substr(1);return n&&e.types[n]||!1},e.types=Object.create(null),t=e.extensions,i=e.types,a=["nginx","apache",void 0,"iana"],Object.keys(o).forEach(function(e){var n=o[e],s=n.extensions;if(s&&s.length){t[e]=s;for(var r=0;r<s.length;r++){var c=s[r];if(i[c]){var p=a.indexOf(o[i[c]].source),l=a.indexOf(n.source);if("application/octet-stream"!==i[c]&&(p>l||p===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}})}}),g={};function y(e){return e&&e.length>0?e:void 0}function b(e){const t=y(e.apiKey);if(void 0!==t)return{apiKey:t};const n=y(e.accessToken);return void 0!==n?{accessToken:n}:void 0!==e.session?{session:e.session}:void 0!==e.oAuth2?{oAuth2:e.oAuth2}:e.auth}function w(e){if(void 0!==e)return y(e.apiKey)}function x(e){if(void 0!==e)return y(e.accessToken)}((e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})})(g,{AbstractJob:()=>ae,AnnotationInclusionMode:()=>Ie,AnnotationType:()=>je,AreaType:()=>Ue,ArtifactType:()=>We,AssetInclusionMode:()=>Ce,AssetStatus:()=>Ae,AssetUrlType:()=>Ke,AutoAnnotateStatus:()=>Ee,AutoAnnotateTask:()=>Oe,ChangeType:()=>Je,ComputeAccountMismatchError:()=>j,ComputeApiError:()=>A,ContourType:()=>Y,DEFAULT_PREDICTION_VERSION:()=>K,DataApiType:()=>Te,DataEndpoint:()=>tt,DepthMap:()=>it,Endpoint:()=>ye,EndpointState:()=>U,EvaluationStatus:()=>Ve,ExportedBy:()=>De,EyePop:()=>dt,EyePopDataWebSocketError:()=>Qe,EyepopLineDecoder:()=>M,ForwardOperatorType:()=>G,InferenceType:()=>B,LoadFromAssetUuidJob:()=>ue,LoadFromGroupJob:()=>le,LoadFromJob:()=>ce,LoadMediaStreamJob:()=>de,ModelExportStatus:()=>Me,ModelFormat:()=>Fe,ModelPrecisionType:()=>He,ModelStatus:()=>Le,ModelTask:()=>ze,ModelTrainingStage:()=>qe,ModelType:()=>Ne,MotionModel:()=>X,PointCloud:()=>st,PopComponentType:()=>Z,PredictionVersion:()=>H,QUATERNION_TOLERANCE:()=>J,Semaphore:()=>fe,Stream:()=>z,TaskMode:()=>Ge,TaskType:()=>Ze,TranscodeMode:()=>Re,TransientPopId:()=>be,UploadGroupJob:()=>pe,UploadJob:()=>re,UserReview:()=>Pe,VideoMode:()=>V,VlmAbilityStatus:()=>Be,WebrtcBase:()=>ne,WebrtcWhep:()=>ht,WebrtcWhip:()=>ie,WorkerEndpoint:()=>_e,WorkflowPhase:()=>$e,accessTokenCredential:()=>x,apiKeyCredential:()=>w,cloudOfDepth:()=>lt,cloudOfObject:()=>pt,cloudsOfPrediction:()=>ut,decodeDepthMap:()=>at,decodePointCloud:()=>ct,default:()=>gt,encodeMultipartFormData:()=>q,getBaseUrl:()=>Se,randomMultipartBoundary:()=>W,readableStreamFromString:()=>D,resolveAuth:()=>b,validateCamera:()=>F,validatePop:()=>Q}),e.exports=(i=g,d(s({},"__esModule",{value:!0}),i));var _=new Set(["error","failed","stopped","pipeline_error","unknown"]),k=e=>new Promise(t=>setTimeout(t,e));function T(e){if(e.pipeline_uuid)return e.pipeline_uuid;const t=e.pipelines?.[0];return t?.id||t?.pipeline_id||null}function S(e,t){if(t.includes("application/json")){const t=JSON.parse(e);if(t&&"object"==typeof t)return!(!t.message||t.session_status)||"running"==t.session_status}return t.includes("text/plain")&&e.includes("I'm fine")}function E(e){if(e.access_token_expires_at){const t=Date.parse(e.access_token_expires_at);return Number.isNaN(t)?null:t}return e.access_token_expires_in?Date.now()+1e3*e.access_token_expires_in:null}var A=class extends Error{constructor(e,t,n){super(e),this.name="ComputeApiError",this.status=t,this.code=n}},j=class extends Error{constructor(e,t,n){super(`Compute session ${e} runs under account ${t||"(none)"}, not the configured account ${n}`),this.name="ComputeAccountMismatchError",this.sessionUuid=e,this.sessionAccountId=t,this.accountId=n}};async function P(e,t){const n=await async function(e){try{const t=C(await e.clone().json());if(!t||"object"!=typeof t)return;const n=t,i=C(n.error),a=i&&"object"==typeof i?i.code:n.code;return"string"==typeof a&&a.length>0?a:void 0}catch(e){return}}(e),i=await async function(e){if((e.headers.get("content-type")||"").includes("application/json"))try{const t=O(C(await e.clone().json()));if(t)return t}catch(e){}const t=await e.text();return O(t)||t}(e);return new A(`Unexpected status ${e.status} ${t}: ${i}`,e.status,n)}function C(e){if("string"==typeof e)try{return C(JSON.parse(e))}catch(t){const n=e.replace(/\\"/g,'"');if(n!=e)try{return C(JSON.parse(n))}catch(e){}return e}return e}async function I(e){return C(await e.json())}function O(e){if("string"==typeof(e=C(e)))return e;if(!e||"object"!=typeof e)return null;const t=e,n=C(t.error),i=O(n)||("string"==typeof n?n:null),a=[t.code,i,t.message,t.details].filter(e=>"string"==typeof e&&e.length>0).join(": ");if(a)return a;if(t.pipeline_error)return O(t.pipeline_error);if(n&&"object"==typeof n)return O(n);try{return JSON.stringify(e)}catch(e){return null}}var R=class{constructor(e){this.options=e}async resolve(){const e=this.options.sessionUuid?await this.getPermanentComputeSession(this.options.sessionUuid):await this.getOnDemandComputeSession(),t=function(e){if(e.pipeline_error){const n=[(t=e.pipeline_error).code,t.message,t.details].filter(e=>"string"==typeof e&&e.length>0).join(": ");return n?`Pipeline failed for compute session ${e.session_uuid}: ${n}`:`Pipeline failed for compute session ${e.session_uuid}`}var t;return"pipeline_error"==e.session_status?`Pipeline failed for compute session ${e.session_uuid}`:null}(e);if(t)throw new Error(t);const n=await this.sessionAuthorizationHeader(e);await this.waitUntilReady(e,n);const i=T(e);if(this.options.pop&&!i)throw new Error("Compute session did not provide a pipeline for the requested pop");return{session:e,pipelineId:i,accessToken:e.access_token||null,accessTokenValidUntil:E(e)}}async getOnDemandComputeSession(){let e=null;const t=`${this.options.computeUrl}/v1/sessions`,n={Authorization:await this.options.authorizationHeader()};let i;if(!this.options.pop){this.options.requestLogger?.debug("fetching sessions from: %s",t);const a=await this.options.httpClient.fetch(t,{headers:n});if(404==a.status)i=[];else{if(200!=a.status)throw await P(a,"fetching compute sessions");i=await I(a)}if(i.length>0){this.options.logger?.debug(`User has ${i.length} sessions, inspecting for usable session`);for(let t of i)if(!(_.has(t.session_status)||t.persistent||this.options.sessionName&&t.session_name!==this.options.sessionName||this.options.accountId&&t.account_uuid!==this.options.accountId)){e=t,this.options.logger?.debug(`Use active session ${t.session_uuid} with pipeline ${T(t)}`);break}}}if(!e){this.options.requestLogger?.debug("creating a new session at: %s",t);const a=function(e){const t={};return e.accountId&&(t.account_uuid=e.accountId),e.sessionName&&(t.session_name=e.sessionName),e.pipelineImage&&(t.pipeline_image=e.pipelineImage),e.pipelineVersion&&(t.pipeline_version=e.pipelineVersion),e.pop&&(t.pop=e.pop),Object.keys(t).length>0?JSON.stringify(t):void 0}(this.options),o={headers:{...n,...a?{"Content-Type":"application/json"}:{}},method:"POST"};a&&(o.body=a);const s="wait=true",r=await this.options.httpClient.fetch(`${t}?${s}`,o);if(200!=r.status)throw await P(r,"creating a compute session");if(i=await I(r),0==i.length)throw new Error("Unexpected, no compute session after attempt to create one");e=i[0]||null}if(!e)throw new Error("unexpected undefined session");return e}async getPermanentComputeSession(e){let t=null;const n=`${this.options.computeUrl}/v1/sessions/${e}`;this.options.requestLogger?.debug("fetching session from: %s",n);const i={Authorization:await this.options.authorizationHeader()};let a=await this.options.httpClient.fetch(n,{headers:i});if(404==a.status)throw new A(`Unexpected status ${a.status} compute sessions ${e} not found`,a.status);if(200!=a.status)throw await P(a,"fetching compute sessions");if(t=await I(a),this.options.accountId&&t.account_uuid!==this.options.accountId)throw new j(e,t.account_uuid,this.options.accountId);return t}async sessionAuthorizationHeader(e){return e.access_token?`Bearer ${e.access_token}`:this.options.authorizationHeader()}async waitUntilReady(e,t){let n=!1;const i=Date.now()+this.options.readyTimeoutMs;for(;!n;){const a=`${e.session_endpoint}/health`,o=await this.options.httpClient.fetch(a,{headers:{Authorization:t,Accept:"application/json"}});if(200==o.status){const t=o.headers.get("content-type")||"",a=await o.text();try{n=S(a,t)}catch(t){this.options.logger?.debug(`session ${e.session_uuid} health check returned invalid JSON, wait and poll for update`)}if(!n&&Date.now()>i)throw new Error(`Created session ${e.session_uuid} did not become healthy after ${this.options.readyTimeoutMs/1e3} seconds`);n||(this.options.logger?.debug(`session ${e.session_uuid} health check not ready, wait and poll for update`),await k(250))}else{if(Date.now()>i)throw new Error(`Created session ${e.session_uuid} did not become healthy after ${this.options.readyTimeoutMs/1e3} seconds`);this.options.logger?.debug(`session ${e.session_uuid} health check status ${o.status}, wait and poll for update`),await k(250)}}}},U=(e=>(e.Idle="Idle",e.Busy="Busy",e.Authenticating="Authenticating",e.FetchConfig="FetchConfig",e.Error="Error",e.NotAvailable="NotAvailable",e))(U||{}),N=n(182),z=class e{constructor(e,t){this.iterator=e,this.controller=t}static iterFromReadableStream(e,t,n){let i=!1;return async function*(){if(i)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(const t of async function*(){const t=new M,n=function(e){if(e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();const t=e.getReader();return{async next(){try{const e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){const e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}(await e);for await(let e of n)for(const n of t.decode(e))yield n;for(const e of t.flush())yield e}())if(!a&&t){const e=JSON.parse(t),i=e.event;void 0!==i?await n(i):yield e}a=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{a||t.abort()}}()}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],n=[],i=this.iterator(),a=e=>({next:()=>{if(0===e.length){const e=i.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>a(t),this.controller),new e(()=>a(n),this.controller)]}},L=class e{constructor(){this.buffer=[],this.trailingCR=!1}decode(t){let n=this.decodeText(t);if(this.trailingCR&&(n="\r"+n,this.trailingCR=!1),n.endsWith("\r")&&(this.trailingCR=!0,n=n.slice(0,-1)),!n)return[];const i=e.NEWLINE_CHARS.has(n[n.length-1]||"");let a=n.split(e.NEWLINE_REGEXP);return 1!==a.length||i?(this.buffer.length>0&&(a=[this.buffer.join("")+a[0],...a.slice(1)],this.buffer=[]),i||(this.buffer=[a.pop()||""]),a):(this.buffer.push(a[0]),[])}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==a){if(e instanceof a)return e.toString();if(e instanceof Uint8Array)return a.from(e).toString();throw new Error(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new Error(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new Error("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){if(!this.buffer.length&&!this.trailingCR)return[];const e=[this.buffer.join("")];return this.buffer=[],this.trailingCR=!1,e}};L.NEWLINE_CHARS=new Set(["\n","\r","\v","\f","","","","
","\u2028","\u2029"]),L.NEWLINE_REGEXP=/\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;var M=L;function D(e){return new ReadableStream({start(t){t.enqueue(a.from(e)),t.close()}})}function W(){return`----formdata-boundary-${(0,N.v4)()}`}function q(e,t){const n=new TextEncoder;let i=0,a=null;return new ReadableStream({async pull(o){if(a){const{done:e,value:t}=await a.read();if(!e)return void o.enqueue(t);a=null,o.enqueue(n.encode("\r\n")),i++}if(i>=e.length)return o.enqueue(n.encode(`--${t}--\r\n`)),void o.close();const s=e[i];let r=`--${t}\r\nContent-Disposition: form-data; name="${s.name}"\r\n`;s.contentType&&(r+=`Content-Type: ${s.contentType}\r\n`),r+="\r\n",o.enqueue(n.encode(r)),"string"==typeof s.content?(o.enqueue(n.encode(s.content)),o.enqueue(n.encode("\r\n")),i++):a=function(e){if(e instanceof ReadableStream)return e;if(e instanceof Blob)return e.stream();const t=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);return new ReadableStream({start(e){e.enqueue(t),e.close()}})}(s.content).getReader()},async cancel(t){await(a?.cancel(t));const n=a?i+1:i;await Promise.all(e.slice(n).map(e=>async function(e,t){e instanceof ReadableStream&&await e.cancel(t)}(e.content,t)))}})}var J=.001;function $(e){return void 0===e||Number.isFinite(e)}function F(e){if(void 0!==e.intrinsics&&void 0!==e.hfovDegrees)throw new Error("camera.intrinsics and camera.hfovDegrees are alternatives, supply one");if(void 0===e.intrinsics&&void 0===e.hfovDegrees)throw new Error("camera requires either camera.intrinsics or camera.hfovDegrees");if(void 0!==e.hfovDegrees){if(!(e.hfovDegrees>0&&e.hfovDegrees<180))throw new Error("camera.hfovDegrees must be a horizontal field of view in (0, 180) degrees")}else{const t=e.intrinsics;for(const[e,n]of[["fx",t.fx],["fy",t.fy]])if(!(n>0&&Number.isFinite(n)))throw new Error(`camera.intrinsics.${e} must be a positive, finite focal length`);for(const[e,n,i]of[["cx",t.cx,"width"],["cy",t.cy,"height"]])if(!(n>=0&&n<=1))throw new Error(`camera.intrinsics.${e} must be within [0, 1] of the frame ${i}`)}if(void 0!==e.distortion)for(const t of["k1","k2","p1","p2","k3"])if(!$(e.distortion[t]))throw new Error(`camera.distortion.${t} must be a finite number`);if(void 0!==e.extrinsics){const t=e.extrinsics.translation;if(void 0!==t)for(const e of["x","y","z"])if(!Number.isFinite(t[e]))throw new Error(`camera.extrinsics.translation.${e} must be a finite number`);const n=e.extrinsics.rotation;if(void 0!==n){const e=Math.sqrt(n.w**2+n.x**2+n.y**2+n.z**2);if(!(Math.abs(e-1)<=J))throw new Error("camera.extrinsics.rotation must be a unit quaternion")}}}var H=(e=>(e[e.V1=1]="V1",e[e.V2=2]="V2",e))(H||{}),K=2,V=(e=>(e.STREAM="stream",e.BUFFER="buffer",e))(V||{}),Z=(e=>(e.FORWARD="forward",e.INFERENCE="inference",e.TRACKING="tracking",e.CONTOUR_FINDER="contour_finder",e.COMPONENT_FINDER="component_finder",e))(Z||{}),G=(e=>(e.FULL="full",e.CROP="crop",e.CROP_WITH_FULL_FALLBACK="crop_with_full_fallback",e))(G||{}),B=(e=>(e.IMAGE_CLASSIFICATION="image_classification",e.OBJECT_DETECTION="object_detection",e.KEY_POINTS="key_points",e.OCR="ocr",e.MESH="mesh",e.FEATURE_VECTOR="feature_vector",e.SEMANTIC_SEGMENTATION="semantic_segmentation",e.SEGMENTATION="segmentation",e))(B||{}),X=(e=>(e.RANDOM_WALK="random_walk",e.CONSTANT_VELOCITY="constant_velocity",e.CONSTANT_ACCELERATION="constant_acceleration",e))(X||{}),Y=(e=>(e.ALL_PIXELS="all_pixels",e.POLYGON="polygon",e.CONVEX_HULL="convex_hull",e.HOUGH_CIRCLES="hough_circles",e.CIRCLE="circle",e.TRIANGLE="triangle",e.RECTANGLE="rectangle",e))(Y||{});function Q(e){if(void 0!==e.depthMap&&void 0===e.depthMap.ability==(void 0===e.depthMap.abilityUuid))throw new Error("depthMap requires exactly one of ability or abilityUuid");void 0!==e.defaults?.camera&&F(e.defaults.camera)}var ee=n(182),te=h(n(942)),ne=class e{constructor(e,t,n,i,a,o){this._getSession=e,this._client=t,this._requestLogger=o,this._ingressId=n,this._urlPath=`${i}/${this._ingressId}`,this._is_pipeline_direct=a,this._pc=null,this._eTag="",this._location=null,this._queuedCandidates=[],this._offerData=null}async close(){const e=this._pc;if(this._pc=null,e)return e.close()}ingressId(){return this._ingressId}gresUrl(e,t=null){let n,i;if(this._is_pipeline_direct){if(!e.pipelineId)throw new Error("cannot connect with is_pipeline_direct=true but !session.pipelineId");n=te.default.join("pipelines",e.pipelineId,this._urlPath)}else n=this._urlPath;return t&&(n=te.default.join(n,t)),i=e.baseUrl?.endsWith("/")?e.baseUrl:e.baseUrl+"/",new URL(n,i)}async onLocalOffer(t){if(!this._pc)throw new Error("onLocalOffer no peer connection");if(!t.sdp)throw new Error("onLocalOffer no sdp");this._offerData=e.parseOffer(t.sdp),await this._pc.setLocalDescription(t);const n=await this._getSession(),i=this.gresUrl(n),a={...n.authenticationHeaders(),"Content-Type":"application/sdp"},o=await this._client.fetch(i,{headers:a,method:"POST",body:t.sdp});return o.status>=300?Promise.reject(`unknown status code for POST '${i}': ${o.status} (${o.statusText})`):(this._eTag=o.headers.get("ETag")??"",this._location=o.headers.get("Location"),await this.onRemoteAnswer(new RTCSessionDescription({type:"answer",sdp:await o.text()})))}async sendLocalCandidates(t){if(!this._offerData)throw new Error("sendLocalCandidates no offerData");const n=await this._getSession(),i=this.gresUrl(n,this._location),a={...n.authenticationHeaders(),"Content-Type":"application/trickle-ice-sdpfrag","If-Match":this._eTag},o=await this._client.fetch(i,{headers:a,method:"PATCH",body:e.generateSdpFragment(this._offerData,t)});return o.status>=300?Promise.reject(`unknown status code for PATCH '${i}': ${o.status} (${o.statusText})`):this}async onLocalCandidate(e){return null!==e.candidate&&(""===this._eTag?this._queuedCandidates.push(e.candidate):await this.sendLocalCandidates([e.candidate])),this}static linkToIceServers(e){return(null!==e?e.split(", ").map(e=>{let t=e.match(/^<(.+?)>; rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i);return t||(t=e.match(/^(.+?); rel="ice-server"(; username="(.*?)"; credential="(.*?)"; credential-type="password")?/i)),t?{urls:[t[1]],username:ie.unquoteCredential(t[3]),credential:ie.unquoteCredential(t[4])}:null}):[]).filter(function(e){return null!=e})}static editAnswer(e,t,n,i,a,o){const s=e.split("m=");for(let e=0;e<s.length;e++){const r=s[e];r&&r.startsWith("video")?s[e]=ie.setVideoBitrate(ie.setCodec(r,t),i):r&&r.startsWith("audio")&&(s[e]=ie.setAudioBitrate(ie.setCodec(r,n),a,o))}return s.join("m=")}static setCodec(e,t){const n=e.split("\r\n"),i=[],a=[];for(const e of n)e.startsWith("a=rtpmap:")?t&&e.toLowerCase().includes(t)&&(a.push(e.slice(9).split(" ")[0]),i.push(e)):i.push(e);const o=[];for(const e of i)e.startsWith("a=fmtp:")?a.includes(e.slice(7).split(" ")[0])&&o.push(e):e.startsWith("a=rtcp-fb:")?a.includes(e.slice(10).split(" ")[0])&&o.push(e):o.push(e);return o.join("\r\n")}static setVideoBitrate(e,t){let n=e.split("\r\n");for(let e=0;e<n.length;e++){const i=n[e];if(i&&i.startsWith("c=")){n=[...n.slice(0,e+1),"b=TIAS:"+(1024*t).toString(),...n.slice(e+1)];break}}return n.join("\r\n")}static setAudioBitrate(e,t,n){let i="",a=e.split("\r\n");for(let e=0;e<a.length;e++){const t=a[e];if(t&&t.startsWith("a=rtpmap:")&&t.toLowerCase().includes("opus/")){i=t.slice(9).split(" ")[0]||"";break}}if(""===i)return e;for(let e=0;e<a.length;e++){const o=a[e];o&&o.startsWith("a=fmtp:"+i+" ")&&(a[e]=n?"a=fmtp:"+i+" minptime=10;useinbandfec=1;maxaveragebitrate="+(1024*(t??0)).toString():"a=fmtp:"+i+" maxplaybackrate=48000;stereo=1;sprop-stereo=1;maxaveragebitrate"+(1024*(t??0)).toString())}return a.join("\r\n")}static parseOffer(e){let t=[],n="",i="";for(const a of e.split("\r\n"))a.startsWith("m=")?t.push(a.slice(2)):""===n&&a.startsWith("a=ice-ufrag:")?n=a.slice(12):""===i&&a.startsWith("a=ice-pwd:")&&(i=a.slice(10));return{iceUfrag:n,icePwd:i,medias:t}}static generateSdpFragment(e,t){const n=new Map;for(const e of t)if(null!==e.sdpMLineIndex){const t=e.sdpMLineIndex;let i=n.get(t);void 0===i&&(i=[],n.set(t,i)),i.push(e)}let i="a=ice-ufrag:"+e.iceUfrag+"\r\na=ice-pwd:"+e.icePwd+"\r\n",a=0;for(const t of e.medias){let e=n.get(a);if(void 0!==e){i+="m="+t+"\r\na=mid:"+a+"\r\n";for(const t of e)i+="a="+t.candidate+"\r\n"}a++}return i}static unquoteCredential(e){return e?JSON.parse(`"${e}"`):""}},ie=class extends ne{constructor(e,t,n,i,a){super(t,n,(0,ee.v4)().toString(),"liveIngress/whip",i,a),this._stream=e}async start(){const e=await this._getSession(),t=this.gresUrl(e),n=await this._client.fetch(t,{headers:e.authenticationHeaders(),method:"GET"});return n.status>=300?Promise.reject(`unknown status code for GET '${t}': ${n.status} (${n.statusText})`):await this.onIceServers(n)}async stream(){return this._stream?Promise.resolve(this._stream):Promise.reject("fetching stream failed")}async onRemoteAnswer(e){if(!this._pc)throw new Error("onLocalOffer no peer connection");return await this._pc.setRemoteDescription(new RTCSessionDescription(e)),0!==this._queuedCandidates.length&&(await this.sendLocalCandidates(this._queuedCandidates),this._queuedCandidates=[]),this}async onIceServers(e){if(!this._stream)throw new Error("onIceServers no stream");const t=this._stream,n=new RTCPeerConnection({iceServers:ne.linkToIceServers(e.headers.get("Link"))});return this._pc=n,n.onicecandidate=e=>this.onLocalCandidate(e),new Promise(async(e,i)=>{n.oniceconnectionstatechange=()=>{switch(n.iceConnectionState){case"failed":case"disconnected":i(`peer connection: ${n.iceConnectionState}`);break;case"connected":e(this)}},t.getTracks().forEach(e=>{this._requestLogger.debug("onIceServers our stream has track: %s",e),n.addTrack(e,t)}),t.addEventListener("addtrack",e=>{this._requestLogger.debug("onIceServers got lazy track: ",e.track),n.addTrack(e.track,t)}),await this.onLocalOffer(await n.createOffer())})}async close(){const e=this._stream;return this._stream=null,e&&e.getTracks().forEach(e=>{e.stop()}),super.close()}},ae=class{constructor(e,t,n,i,a=K){this._responseStream=null,this._controller=new AbortController,this._getSession=t,this._params=e,this._client=n,this._requestLogger=i,this._version=a}[Symbol.asyncIterator](){if(!this._responseStream)throw Error("logical bug");return z.iterFromReadableStream(this._responseStream,this._controller,async e=>await this.onEvent(e))}async startJob(){return Promise.reject("abstract class")}async onEvent(e){return"error"==e.type?Promise.reject(`Error event for source ${e.source_id}: ${e.message}`):Promise.resolve()}start(e,t){return this._responseStream=new Promise(async(n,i)=>{try{let e=1;for(;;)try{const a=await this.startJob();if(401==a.status){if(t(a.status),!e--){i(`response ${a.status}: ${a.statusText}`);break}this._requestLogger.info("received 401 response, attempt to reauthorize once")}else{if(404!=a.status){if(a.ok){if(a.body){n(a.body);break}{const e=await a.text();if(e){n(D(e));break}i("response body is empty");break}}i(`upload error ${a.status}: ${await a.text()}`);break}if(t(a.status),!e--){i(`response ${a.status}: ${a.statusText}`);break}this._requestLogger.info("received 404 response, attempt to restart pop")}}catch(n){if(!e--){t(500),i(n);break}this._requestLogger.info("unknown, attempt to restart pop (as if we received 404)",n),t(404)}}catch(e){i(e)}finally{e()}}),this}cancel(){this._controller.abort("cancelled")}};ae.n=0;var oe,se,re=class extends ae{get[Symbol.toStringTag](){return"uploadJob"}constructor(e,t,n,i,a,o,s,r,c){super(a,o,s,r),this._uploadStream=e,this._uploadBodyFactory=c,this._mimeType=t,this._size=n,this._videoMode=i,this._needsFullDuplex=!s.isFullDuplex()&&t.startsWith("video/")&&"stream"==i}async uploadBody(){return this._uploadBodyFactory?await this._uploadBodyFactory():this._uploadStream}async onEvent(e){if("prepared"==e.type){if(!e.source_id)return Promise.reject("did not get a prepared sourceId to simulate full duplex");const t=await this._getSession();if(!t.baseUrl)return Promise.reject("session.baseUrl must not ne null");let n;const i=new URLSearchParams({mode:"queue",processing:"async",sourceId:e.source_id});if(void 0!==this._videoMode&&i.set("videoMode",this._videoMode),void 0!==this._version&&i.set("version",this._version.toString()),this._params.motionDetect)for(const[e,t]of Object.entries(this._params.motionDetect))i.set(e,t);const a=`${t.baseUrl.replace(/\/+$/,"")}/pipelines/${t.pipelineId}/source?${i.toString()}`;if(this._params.componentParams||this._params.roi||this._params.camera){const e=new FormData;if(this._params.componentParams){const t=new Blob([JSON.stringify(this._params.componentParams)],{type:"application/json"});e.append("params",t)}if(this._params.roi){const t=new Blob([JSON.stringify(this._params.roi)],{type:"application/json"});e.append("roi",t)}if(this._params.fps){const t=new Blob([JSON.stringify(this._params.fps)],{type:"application/json"});e.append("fps",t)}if(this._params.camera){const t=new Blob([JSON.stringify(this._params.camera)],{type:"application/json"});e.append("camera",t)}const i=await new Response(await this.uploadBody()).blob();e.append("file",i);const o={...t.authenticationHeaders(),Accept:"application/jsonl"};n=this._client.fetch(a,{headers:o,method:"POST",body:e,signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}else{const e={...t.authenticationHeaders(),Accept:"application/jsonl","Content-Type":this._mimeType};this._size&&(e["Content-Length"]=`${this._size}`),n=this._client.fetch(a,{headers:e,method:"POST",body:await this.uploadBody(),signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}n.then(async e=>{204!=e.status&&this._requestLogger.debug(`unexpected status ${e.status} (${await e.text()}) for POST ${a}`)}).catch(e=>{this._requestLogger.debug(`error ${e} for POST ${a}`)})}return Promise.resolve()}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not be null");let t;if(this._needsFullDuplex){const n=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/prepareSource?timeout=10s`,i={...e.authenticationHeaders(),Accept:"application/jsonl"};t=await this._client.fetch(n,{headers:i,method:"POST",signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}else{const n=new URLSearchParams({mode:"queue",processing:"sync"});if(void 0!==this._videoMode&&n.set("videoMode",this._videoMode),void 0!==this._version&&n.set("version",this._version.toString()),this._params.motionDetect)for(const[e,t]of Object.entries(this._params.motionDetect))n.set(e,t);const i=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?${n.toString()}`;if(this._params.componentParams||this._params.roi||this._params.camera){const n=new FormData;if(this._params.componentParams){const e=new Blob([JSON.stringify(this._params.componentParams)],{type:"application/json"});n.append("params",e)}if(this._params.roi){const e=new Blob([JSON.stringify(this._params.roi)],{type:"application/json"});n.append("roi",e)}if(this._params.fps){const e=new Blob([JSON.stringify(this._params.fps)],{type:"application/json"});n.append("fps",e)}if(this._params.camera){const e=new Blob([JSON.stringify(this._params.camera)],{type:"application/json"});n.append("camera",e)}const a=await new Response(await this.uploadBody()).blob();n.append("file",a);const o={...e.authenticationHeaders(),Accept:"application/jsonl"};t=await this._client.fetch(i,{headers:o,method:"POST",body:n,signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}else{const n={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":this._mimeType};this._size&&(n["Content-Length"]=`${this._size}`),t=await this._client.fetch(i,{headers:n,method:"POST",body:await this.uploadBody(),signal:this._controller.signal,duplex:"half"})}}return t}},ce=class extends ae{constructor(e,t,n,i,a){super(t,n,i,a),this._location=e}get[Symbol.toStringTag](){return"loadFromJob"}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not ne null");const t={sourceType:"URL",url:this._location,params:this._params.componentParams,roi:this._params.roi,fps:this._params.fps,camera:this._params.camera,version:this._version,rtspForceNonCompliantUrl:this._params.rtspForceNonCompliantUrl};this._params.motionDetect&&Object.assign(t,this._params.motionDetect);const n={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},i=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=queue&processing=sync`;return await this._client.fetch(i,{headers:n,method:"PATCH",body:JSON.stringify(t),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}},pe=class extends ae{get[Symbol.toStringTag](){return"uploadGroupJob"}constructor(e,t,n,i,a){if(super(t,n,i,a),0===e.length)throw new Error("upload group requires at least one source");this._sources=e}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject(new Error("session.baseUrl must not be null"));const t=new URLSearchParams({mode:"queue",processing:"sync"});if(void 0!==this._version&&t.set("version",this._version.toString()),this._params.motionDetect)for(const[e,n]of Object.entries(this._params.motionDetect))t.set(e,n);const n=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?${t.toString()}`,i=[];this._params.componentParams&&i.push({name:"params",contentType:"application/json",content:JSON.stringify(this._params.componentParams)}),this._params.roi&&i.push({name:"roi",contentType:"application/json",content:JSON.stringify(this._params.roi)}),this._params.fps&&i.push({name:"fps",contentType:"application/json",content:JSON.stringify(this._params.fps)}),this._params.camera&&i.push({name:"camera",contentType:"application/json",content:JSON.stringify(this._params.camera)});for(const e of this._sources)i.push({name:"file",contentType:e.mimeType,content:e.stream});const a=W(),o={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":`multipart/form-data; boundary=${a}`};return await this._client.fetch(n,{headers:o,method:"POST",body:q(i,a),signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}},le=class extends ae{get[Symbol.toStringTag](){return"loadFromGroupJob"}constructor(e,t,n,i,a){if(super(t,n,i,a),0===e.length)throw new Error("load from group requires at least one url");this._urls=e}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject(new Error("session.baseUrl must not be null"));const t={sourceType:"GROUP",sources:this._urls.map(e=>({sourceType:"URL",url:e})),version:this._version};this._params.componentParams&&(t.params=this._params.componentParams),this._params.roi&&(t.roi=this._params.roi),this._params.camera&&(t.camera=this._params.camera),this._params.motionDetect&&Object.assign(t,this._params.motionDetect);const n={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},i=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=queue&processing=sync`;return await this._client.fetch(i,{headers:n,method:"PATCH",body:JSON.stringify(t),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}},ue=class extends ae{constructor(e,t,n,i,a){super(t,n,i,a),this._assetUuid=e}get[Symbol.toStringTag](){return"loadFromAssetUuidJob"}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not ne null");const t={sourceType:"ASSET_UUID",assetUuid:this._assetUuid,params:this._params.componentParams,roi:this._params.roi,fps:this._params.fps,camera:this._params.camera,version:this._version};this._params.motionDetect&&Object.assign(t,this._params.motionDetect);const n={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},i=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=queue&processing=sync`;return await this._client.fetch(i,{headers:n,method:"PATCH",body:JSON.stringify(t),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}},de=class extends ae{constructor(e,t,n,i,a){super(t,n,i,a),this._mediaStream=e}get[Symbol.toStringTag](){return"loadLiveIngressJob"}async startJob(){const e=await this._getSession();if(!e.baseUrl)return Promise.reject("session.baseUrl must not ne null");const t=new ie(this._mediaStream,async()=>e,this._client,!0,this._requestLogger);t.start().then(e=>{this._requestLogger.debug("direct whip for ingressId=%s successful",t.ingressId())}).catch(e=>{this._controller.abort(e)});const n={sourceType:"WHIP",whipIngressId:t.ingressId(),params:this._params.componentParams,roi:this._params.roi,fps:this._params.fps,camera:this._params.camera,version:this._version};this._params.motionDetect&&Object.assign(n,this._params.motionDetect);const i={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":"application/json"},a=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=preempt&processing=sync`;return await this._client.fetch(a,{headers:i,method:"PATCH",body:JSON.stringify(n),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}};if("document"in globalThis&&"implementation"in globalThis.document)oe=async(e,t)=>{throw new DOMException("resolving a path to a file is not supported in browser")};else{let yt=function(e){return new ReadableStream({async pull(t){const{value:n,done:i}=await e.next();i?t.close():t.enqueue(new Uint8Array(n))}})};async function*bt(e){for await(const t of e)yield t}oe=async(e,t)=>{const i=v(),a=n(122),o=bt((await a.open(e.path,"r")).createReadStream());return{stream:yt(o),mimeType:e.mimeType?e.mimeType:i.lookup(e.path)||"image/*"}}}function he(e,t){const n=e instanceof Request?e.url:e;return`${e instanceof Request?e.method:t?.method||(void 0!==t?.body?"POST":"GET")} ${n}`}if("document"in globalThis&&"implementation"in globalThis.document){class wt{constructor(e){this._logger=e}async fetch(e,t){const n=he(e,t);this._logger.debug(`Browser fetch() BEFORE ${n}`);const i=await fetch(e,t);return this._logger.debug(`AFTER ${n} -> ${i.status}`),i}async close(){}isFullDuplex(){return!1}}se=async e=>new wt(e)}else{class xt{constructor(e,t,n){this._agent=e,this._fetch=t,this._logger=n}async fetch(e,t){t||(t={}),t.dispatcher=this._agent;const n=he(e,t);this._logger.debug(`Node fetch() BEFORE ${n}`);const i=await this._fetch(e,t);return this._logger.debug(`AFTER ${n} -> ${i.status}`),i}async close(){return this._agent.close()}isFullDuplex(){return!1}}se=async e=>{const t=n(360),i=new t.Agent({keepAliveTimeout:1e4,connections:5,pipelining:0});return e.debug("Using node fetch with undici agent as http client"),new xt(i,t.fetch,e)}}var me,fe=class{constructor(e){this.promiseResolverQueue=[],this.permits=e}getPermits(){return this.permits}async wait(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(e=>this.promiseResolverQueue.push(e))}async acquire(){return this.wait()}async waitFor(e){if(this.permits>0)return this.permits-=1,Promise.resolve(!0);let t=e=>{};const n=new Promise(e=>{t=e});return this.promiseResolverQueue.push(t),setTimeout(()=>{const e=this.promiseResolverQueue.indexOf(t);-1!==e?this.promiseResolverQueue.splice(e,1):console.warn("Semaphore.waitFor couldn't find its promise resolver in the queue"),t(!1)},e),n}tryAcquire(){return this.permits>0&&(this.permits-=1,!0)}drainPermits(){if(this.permits>0){const e=this.permits;return this.permits=0,e}return 0}signal(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Semaphore.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}release(){this.signal()}async execute(e){await this.wait();try{return await e()}finally{this.signal()}}},ve=n(713),ge=n(262);me="document"in globalThis&&"implementation"in globalThis.document?async(e,t)=>{if(null==t.eyepopUrl)return Promise.reject("options.eyepopUrl cannot be null");const n={clientId:e.clientId,domain:e.domain,authorizationParams:{scope:e.scope,audience:e.audience}},i=await(0,ge.createAuth0Client)(n);await i.isAuthenticated()||await i.loginWithPopup();const a=await i.getTokenSilently();if(!a)return Promise.reject("auth0 login failed");let o;const s=t;return o=void 0!==s.popId?{eyepopUrl:t.eyepopUrl,accessToken:a,validUntil:Date.now()+36e5,popId:s.popId,baseUrl:void 0,pipelineId:void 0,authenticationHeaders:()=>({Authorization:`Bearer ${a}`})}:{eyepopUrl:t.eyepopUrl,accessToken:a,validUntil:Date.now()+36e5},o}:(e,t)=>Promise.reject("auth0 login not supported server-side");var ye=class{constructor(e){let t;this._options=e,this._token=null,this._expire_token_time=null,this._client=null,this._statusRetryHandlers=new Map,this._statusRetryHandlers.set(401,this.statusHandler401),this._limit=new fe(this._options.jobQueueLength??1024),this._state="Idle",this._message=null,this._stateChangeHandler=null,t=e.logger?e.logger:(0,ve.pino)(),this._logger=t.child({module:"eyepop"}),this._requestLogger=this._logger.child({module:"requests"})}setStatusRetryHandlers(e=void 0){this._statusRetryHandlers=new Map(e),this._statusRetryHandlers.set(401,this.statusHandler401)}eyepopUrl(){return this._options.eyepopUrl?this._options.eyepopUrl.replace(/\/+$/,""):"https://compute.eyepop.ai"}eyepopWebApiUrl(){return this._options.eyepopUrl?this._options.eyepopUrl.replace(/\/+$/,"").replace(/compute\./,"web-api."):"https://api.eyepop.ai"}pendingJobs(){return(this._options.jobQueueLength??1024)-this._limit.getPermits()}state(){return this._state}lastMessage(){return this._message}onStateChanged(e){return this._stateChangeHandler=e,this}updateState(e=void 0,t=void 0){const n=this._state;null==e&&(e=this._limit.getPermits()==this._options.jobQueueLength?"Idle":"Busy"),this._state=e,this._message=t||null,this._stateChangeHandler&&this._stateChangeHandler(n,this._state)}async connect(){if(this._client)return this._logger.warn("endpoint already connected"),this;if(!this._options.eyepopUrl)return Promise.reject("option eyepopUrl or environment variable EYEPOP_URL is required");const e=b(this._options);if(void 0===e)return Promise.reject("cannot connect without defined auth option");if(void 0!==e.session)this._token=e.session.accessToken,this._expire_token_time=e.session.validUntil/1e3;else if(void 0!==e.oAuth2);else if(void 0!==x(e));else if(void 0!==w(e));else if(void 0===e.isLocal)return Promise.reject("option apiKey/accessToken or environment variable EYEPOP_API_KEY is required");return void 0!==this._options.platformSupport?.createHttpClient?this._client=await this._options.platformSupport.createHttpClient(this._requestLogger):this._client=await se(this._requestLogger),await this.reconnect()}async disconnect(e=!0){if(e&&this._limit)for(let e=0;e<this._options.jobQueueLength;e++)await this._limit.acquire();this._limit=new fe(this._options.jobQueueLength??1024),this._client&&(await this._client.close(),this._client=null)}async session(){return await this.currentAccessToken(),null==this._token||null==this._expire_token_time?Promise.reject("endpoint not connected"):{eyepopUrl:this._options.eyepopUrl,accessToken:this._token,validUntil:1e3*this._expire_token_time}}statusHandler401(e){this._token=null,this._expire_token_time=null}async fetchWithRetry(e,t=1){for(;;)try{const n=await e();if(n.ok)return n;{const e=this._statusRetryHandlers.get(n.status);if(null==e)return n;if(e(n.status),!t--)return n;this._requestLogger.info("received %d response, retry",n.status)}}catch(e){const n=this._statusRetryHandlers.get(404);if(null==n)return Promise.reject(`error ${e}`);if(n(e),!t--)return Promise.reject(`error ${e}`);this._requestLogger.info("error %s, retry",e)}}async reconnect(){throw new Error("reconnect() not implemented")}async authorizationHeader(){return void 0!==b(this._options)?.isLocal?"Implicit":`Bearer ${await this.currentAccessToken()}`}async currentAccessToken(){const e=Date.now()/1e3;if(!this._token||this._expire_token_time<e){this.updateState("Authenticating");try{const t=b(this._options);if(!this._client)return Promise.reject("endpoint not connected");if(void 0!==t?.isLocal)this._token="implicit",this._expire_token_time=Number.MAX_VALUE;else{if(void 0!==t?.session)return Promise.reject("temporary access token expired");if(void 0!==t?.oAuth2&&this._options.eyepopUrl){const e=await me(t.oAuth2,this._options);this._token=e.accessToken,this._expire_token_time=e.validUntil/1e3}else if(void 0!==x(t))this._token=x(t),this._expire_token_time=Number.MAX_VALUE;else{if(!this._options.eyepopUrl)return Promise.reject("no valid auth option");{const n=w(t);if(void 0===n)return Promise.reject("no valid auth option");const i={Authorization:`Bearer ${n}`},a=`${this.eyepopUrl()}/v1/auth/authenticate`,o=await this._client.fetch(a,{method:"POST",headers:i});if(200!=o.status){const e=await o.text();return Promise.reject(`Unexpected status ${o.status}: ${e}`)}const s=await o.json();this._token=s.access_token,this._expire_token_time=e+s.expires_in-60}}}}finally{this.updateState()}}return this._logger.debug("using access token, valid for at least %d seconds",this._expire_token_time-e),this._token}},be=(e=>(e.Transient="transient",e))(be||{}),we=class e extends ye{constructor(e){super(e),this.setStatusRetryHandlers(new Map([[404,e=>this.statusHandler404(e)]])),this._baseUrl=null,this._pipelineId=null,this._popName=null,this._sessionAccessToken=null,this._sessionAccessTokenValidUntil=null,this._accountId=void 0,this._pipeline=null,this._pipelineCreatePromise=null}options(){return this._options}async disconnect(e=!0){if("transient"==this.options().popId&&this._pipelineId){const e=`${this._baseUrl}/pipelines/${this._pipelineId}`,t={Authorization:await this.authorizationHeader()};let n=await(this._client?.fetch(e,{method:"DELETE",headers:t}));if(204!=n?.status){const e=await(n?.text());this._logger.info(`stopping pipeline failed, status ${n?.status}: ${e}`)}}return super.disconnect(e)}statusHandler404(e){this._pipelineId=null,this._baseUrl=null}async session(){let e=null;return null==this._baseUrl&&(await this.reconnect(),null==this._baseUrl)?Promise.reject("endpoint not connected"):(e=this._sessionAccessToken?{eyepopUrl:this.options().eyepopUrl,accessToken:this._sessionAccessToken,validUntil:this._sessionAccessTokenValidUntil||Number.MAX_VALUE}:await super.session(),{eyepopUrl:e.eyepopUrl,accessToken:e.accessToken,validUntil:e.validUntil,popId:this.options().popId,accountId:this._accountId??this.options().accountId,baseUrl:this._baseUrl,pipelineId:this._pipelineId||void 0,authenticationHeaders:()=>this._authenticationHeaders(e)})}popName(){return this._popName}pop(){return this._pipeline?this._pipeline.pop||null:this.options().pop||null}async changePop(e){if(Q(e),"transient"==this.options().popId)return void await this.changeTransientPop(e);const t=this._client;if(!this._baseUrl||!t)return Promise.reject("endpoint not connected, use connect()");let n=await this.fetchWithRetry(async()=>{const n=await this.session();let i={"Content-Type":"application/json",...this._authenticationHeaders(n)};const a=`${n.baseUrl}/pipelines/${n.pipelineId}/pop`;return await t.fetch(a,{method:"PATCH",body:JSON.stringify(e),headers:i})});if(204!=n.status){const e=await n.text();throw new Error(`Unexpected status ${n.status}: ${e}`)}this.options().pop=e,this._pipeline?this._pipeline.pop=e:this._pipeline={id:this._pipelineId||"unknown",state:"idle",startTime:(new Date).toString(),pop:e}}_authenticationHeaders(e){return void 0!==b(this._options)?.isLocal?{}:{Authorization:`Bearer ${e.accessToken}`}}popId(){return this.options().popId||null}async process(e,t){return void 0!==e.source?await this.processV2(e):await this.processV1(e,t)}async processV1(e,t){return void 0!==e.file?this.uploadFile(e,{componentParams:t}):void 0!==e.stream?this.uploadStream(e,{componentParams:t}):void 0!==e.path?this.uploadPath(e,{componentParams:t}):void 0!==e.url?this.loadFrom(e,{componentParams:t}):void 0!==e.assetUuid?this.loadFromAssetUuid(e,{componentParams:t}):void 0!==e.mediaStream?this.loadMediaStream(e,{componentParams:t}):Promise.reject("unknown source type")}validateProcessParams(e){void 0!==e.camera&&F(e.camera)}async processV2(e){return this.validateProcessParams(e),void 0!==e.source.file?this.uploadFile(e.source,e):void 0!==e.source.stream?this.uploadStream(e.source,e):void 0!==e.source.path?this.uploadPath(e.source,e):void 0!==e.source.url?this.loadFrom(e.source,e):void 0!==e.source.assetUuid?this.loadFromAssetUuid(e.source,e):void 0!==e.source.mediaStream?this.loadMediaStream(e.source,e):Promise.reject("unknown source type")}async uploadGroup(e,t={}){if(0===e.length)throw new Error("upload group requires at least one path");if(this.validateProcessParams(t),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=await Promise.all(e.map(async e=>{let t;return t=this._options.platformSupport?.resolvePath?await this._options.platformSupport.resolvePath({path:e},this._logger):await oe({path:e},this._logger),{stream:t.stream,mimeType:t.mimeType}})),i=new pe(n,t,async()=>this.session(),this._client,this._requestLogger);return i.start(()=>{this.jobDone(i)},e=>{this.jobStatus(i,e)})}catch(e){throw this._limit.release(),e}}async uploadStreamGroup(e,t,n={}){if(0===e.length)throw new Error("upload stream group requires at least one stream");if(void 0!==t&&t.length!==e.length)throw new Error("mimeTypes must have the same length as streams");if(this.validateProcessParams(n),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const i=e.map((e,n)=>({stream:e,mimeType:t?.[n]??null})),a=new pe(i,n,async()=>this.session(),this._client,this._requestLogger);return a.start(()=>{this.jobDone(a)},e=>{this.jobStatus(a,e)})}catch(e){throw this._limit.release(),e}}async loadFromGroup(e,t={}){if(0===e.length)throw new Error("load from group requires at least one url");if(this.validateProcessParams(t),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=new le(e,t,async()=>this.session(),this._client,this._requestLogger);return n.start(()=>{this.jobDone(n)},e=>{this.jobStatus(n,e)})}catch(e){throw this._limit.release(),e}}async uploadFile(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))return Promise.reject("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=new re(e.file,e.file.type,e.file.size,e.videoMode,t,async()=>this.session(),this._client,this._requestLogger);return n.start(()=>{this.jobDone(n)},e=>{this.jobStatus(n,e)})}catch(e){throw this._limit.release(),e}}async uploadStream(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))return Promise.reject("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=new re(e.stream,e.mimeType,e.size,e.videoMode,t,async()=>this.session(),this._client,this._requestLogger);return n.start(()=>{this.jobDone(n)},e=>{this.jobStatus(n,e)})}catch(e){throw this._limit.release(),e}}async uploadPath(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=async()=>this._options.platformSupport?.resolvePath?await this._options.platformSupport.resolvePath(e,this._logger):await oe(e,this._logger),i=await n();let a=!0;const o=async()=>a?(a=!1,i.stream):(await n()).stream,s=new re(i.stream,i.mimeType,i.size,e.videoMode,t,async()=>this.session(),this._client,this._requestLogger,o);return s.start(()=>{this.jobDone(s)},e=>{this.jobStatus(s,e)})}catch(e){throw this._limit.release(),e}}async loadFrom(e,t){if(e.url.startsWith("file://"))return await this.uploadPath({path:e.url.substring(7)},t);if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=new ce(e.url,t,async()=>this.session(),this._client,this._requestLogger);return n.start(()=>{this.jobDone(n)},e=>{this.jobStatus(n,e)})}catch(e){throw this._limit.release(),e}}async loadFromAssetUuid(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=new ue(e.assetUuid,t,async()=>this.session(),this._client,this._requestLogger);return n.start(()=>{this.jobDone(n)},e=>{this.jobStatus(n,e)})}catch(e){throw this._limit.release(),e}}async loadMediaStream(e,t){if(await this.ensureTransientPipelineStarted(),!(this._baseUrl&&this._pipelineId&&this._client&&this._limit))throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=new de(e.mediaStream,t,async()=>this.session(),this._client,this._requestLogger);return n.start(()=>{this.jobDone(n)},e=>{this.jobStatus(n,e)})}catch(e){throw this._limit.release(),e}}jobDone(e){this._limit?.release(),this.updateState()}jobStatus(e,t){404==t?this.statusHandler404(t):401==t&&this.statusHandler401(t)}async reconnect(){return"transient"==this.options().popId?(await this.getComputeSession(),this.options().pop&&this.setTransientPipelinePop()):this.options().sessionUuid?await this.getComputeSession():await this.startWebApiSessionWithPopId(),this.updateState(),Promise.resolve(this)}async startWebApiSessionWithPopId(){if(!this._client)throw new Error("endpoint not initialized");const e=`${this.eyepopWebApiUrl()}/pops/${this.options().popId}/config?auto_start=false`,t={Authorization:await this.authorizationHeader()};this.updateState("FetchConfig");let n=await this._client.fetch(e,{headers:t});if(401==n.status){this._requestLogger.debug("GET %s: 401, about to retry with fresh access token",e),this.statusHandler401(n.status);const t={Authorization:await this.authorizationHeader()};this.updateState("FetchConfig"),n=await this._client.fetch(e,{headers:t})}if(200!=n.status){const e=await n.text();throw 429==n.status?this.updateState("NotAvailable",e):this.updateState("Error",e),new Error(`Unexpected status ${n.status}: ${e}`)}let i=await n.json();if(!i.base_url&&this.options().autoStart){const e=`${this.eyepopWebApiUrl()}/pops/${this.options().popId}/config?auto_start=true`;this._requestLogger.debug("pop was not running, trying to autostart with: %s",e);const t={Authorization:await this.authorizationHeader()};if(n=await this._client.fetch(e,{headers:t}),200!=n.status){this.updateState("Error");const e=await n.text();throw new Error(`Unexpected status ${n.status}: ${e}`)}i=await n.json()}const a=new URL(i.base_url,this.eyepopUrl());if(this._baseUrl=a.toString(),this._baseUrl){if(this._baseUrl=this._baseUrl.replace(/\/+$/,""),this._pipelineId=i.pipeline_id,this._popName=i.name,!this._pipelineId||!this._baseUrl)throw new Error("Pop not started");const e=`${this._baseUrl}/pipelines/${this._pipelineId}`,t={Authorization:await this.authorizationHeader()};let n=await this._client.fetch(e,{method:"GET",headers:t});if(n.status>200){const e=await n.text();throw new Error(`Unexpected status ${n.status}: ${e}`)}if(this._pipeline=await n.json(),this.options().stopJobs){const e={sourceType:"NONE"},t={Authorization:await this.authorizationHeader(),"Content-Type":"application/json"},n=`${this._baseUrl}/pipelines/${this._pipeline.id}/source?mode=preempt&processing=sync`;let i=await this._client.fetch(n,{method:"PATCH",headers:t,body:JSON.stringify(e)});if(i.status>=300){const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}}}}sessionReadyTimeoutMs(){const t=this.options().sessionReadyTimeoutSeconds;return"number"==typeof t&&Number.isFinite(t)&&t>0?1e3*t:e.WAIT_FOR_IS_READY}async getComputeSession(){if(!this._client)throw new Error("endpoint not initialized");let e;try{e=await new R({computeUrl:this.eyepopUrl(),httpClient:this._client,authorizationHeader:()=>this.computeAuthorizationHeader(),sessionUuid:this.options().sessionUuid,sessionName:this.options().sessionName,accountId:this.options().accountId,pipelineImage:this.options().pipelineImage,pipelineVersion:this.options().pipelineVersion,pop:this.options().pop,readyTimeoutMs:this.sessionReadyTimeoutMs(),logger:this._logger,requestLogger:this._requestLogger}).resolve()}catch(e){throw this.updateState("Error"),e}this._sessionAccessToken=e.accessToken,this._sessionAccessTokenValidUntil=e.accessTokenValidUntil,this._baseUrl=e.session.session_endpoint,this._accountId=e.session.account_uuid||void 0,this._pipeline=null,this._pipelineId=e.pipelineId,this.options().pop&&this.setTransientPipelinePop()}async startTransientPipeline(){const e=this._client,t=this._baseUrl;if(null==e||null==t)throw new Error("endpoint not initialized");let n;if(this.options().pop)n=this.options().pop;else{if(!this._pipeline||!this._pipeline.pop)throw new Error("Cannot start a transient pipeline without a pop");n=this._pipeline.pop}const i={pop:n,source:{sourceType:"NONE"},idleTimeoutSeconds:30,logging:["out_meta"],videoOutput:"no_output"},a=`${t.replace(/\/+$/,"")}/pipelines`,o=await this.fetchWithRetry(async()=>{let t={Accept:"application/json","Content-Type":"application/json",Authorization:await this.authorizationHeader()};return e.fetch(a,{method:"POST",body:JSON.stringify(i),headers:t})});if(200!=o.status){const e=await o.text();throw new Error(`Unexpected status ${o.status} starting transient pipeline: ${e.slice(0,300)}`)}return(await o.json()).id}async ensureTransientPipelineStarted(){if("transient"==this.options().popId&&!this._pipelineId&&this.options().pop&&(this._baseUrl||await this.reconnect(),!this._pipelineId))if(this.options().pop){if(await this.reconnect(),!this._pipelineId)throw new Error("Compute session did not provide a pipeline for the requested pop")}else{this._pipelineCreatePromise||(this._pipelineCreatePromise=this.startTransientPipeline());try{this._pipelineId=await this._pipelineCreatePromise,this.setTransientPipelinePop()}finally{this._pipelineCreatePromise=null}}}async changeTransientPop(e){if(!this._client)throw new Error("endpoint not initialized");const t=this.options().pop,n=this._baseUrl,i=this._sessionAccessToken,a=this._sessionAccessTokenValidUntil;this._pipelineId&&(await this.deleteTransientPipeline(this._pipelineId),this._pipelineId=null),this._pipeline=null;try{this.options().pop=e,await this.getComputeSession()}catch(e){throw this.options().pop=t,this._pipeline=null,this._pipelineId=null,this._baseUrl=t?null:n,this._sessionAccessToken=i,this._sessionAccessTokenValidUntil=a,e}if(!this._pipelineId)throw new Error("Compute session did not provide a pipeline for the requested pop");this.setTransientPipelinePop()}async deleteTransientPipeline(e){if(!this._client||!this._baseUrl)return;const t=`${this._baseUrl}/pipelines/${e}`,n={Authorization:await this.authorizationHeader()};let i=await this._client.fetch(t,{method:"DELETE",headers:n});if(i.status>=300){const e=await i.text();this._logger.info(`stopping pipeline failed, status ${i.status}: ${e}`)}}async authorizationHeader(){return this._sessionAccessToken?`Bearer ${this._sessionAccessToken}`:super.authorizationHeader()}async computeAuthorizationHeader(){const e=b(this.options());if(void 0!==e?.isLocal)return"Implicit";const t=w(e)??x(e);return void 0!==t?`Bearer ${t}`:super.authorizationHeader()}setTransientPipelinePop(){const e=this.options().pop;e&&this._pipelineId&&(this._pipeline={id:this._pipelineId,state:"idle",startTime:(new Date).toString(),pop:e})}};we.WAIT_FOR_IS_READY=6e4;var xe,_e=we;xe="document"in globalThis&&"implementation"in globalThis.document?(e,t)=>new WebSocket(e,t):(e,t)=>new(n(826).WebSocket)(e,t);var ke=h(n(48)),Te=(e=>(e.dataset="dataset",e.vlm="vlm",e))(Te||{});function Se(e,t){switch(t){case"dataset":return e.datasetApiUrl??"";case"vlm":return e.vlmApiUrl??"";default:throw new Error(`unsupported type ${t}`)}}var Ee=(e=>(e.error="error",e.requested="requested",e.in_progress="in_progress",e.completed="completed",e))(Ee||{}),Ae=(e=>(e.rejected="rejected",e.upload_in_progress="upload_in_progress",e.upload_failed="upload_failed",e.transform_failed="transform_failed",e.transform_in_progress="transform_in_progress",e.accepted="accepted",e))(Ae||{}),je=(e=>(e.ground_truth="ground_truth",e.prediction="prediction",e.auto="auto",e))(je||{}),Pe=(e=>(e.approved="approved",e.rejected="rejected",e.unknown="unknown",e))(Pe||{}),Ce=(e=>(e.all_assets="all_assets",e.annotated_only="annotated_only",e.manual_annotated_only="manual_annotated_only",e.auto_annotated_only="auto_annotated_only",e))(Ce||{}),Ie=(e=>(e.all="all",e.user_reviewed="user_reviewed",e.user_approved="user_approved",e.ground_truth="ground_truth",e))(Ie||{}),Oe=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e))(Oe||{}),Re=(e=>(e.original="original",e.video_original_size="video_original_size",e.image_original_size="image_original_size",e.image_fit_1024="image_fit_1024",e.image_fit_640="image_fit_640",e.image_fit_224="image_fit_224",e.image_cover_1024="image_cover_1024",e.image_cover_640="image_cover_640",e.image_cover_224="image_cover_224",e))(Re||{}),Ue=(e=>(e.RECTANGLE="rectangle",e.CONTOUR="contour",e))(Ue||{}),Ne=(e=>(e.epdet_b1="epdet_b1",e.imported="imported",e.vlm_ability="vlm_ability",e))(Ne||{}),ze=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e.keypoint_detection="keypoint_detection",e))(ze||{}),Le=(e=>(e.error="error",e.draft="draft",e.requested="requested",e.in_progress="in_progress",e.available="available",e.published="published",e))(Le||{}),Me=(e=>(e.in_progress="in_progress",e.finished="finished",e.error="error",e))(Me||{}),De=(e=>(e.eyepop="eyepop",e.qc_ai_hub="qc_ai_hub",e))(De||{}),We=(e=>(e.eyepop_bundle="eyepop_bundle",e.weights_file="weights_file",e))(We||{}),qe=(e=>(e.waiting="waiting",e.scheduling="scheduling",e.preparing="preparing",e.training="training",e.exporting="exporting",e))(qe||{}),Je=(e=>(e.dataset_added="dataset_added",e.dataset_removed="dataset_removed",e.dataset_modified="dataset_modified",e.dataset_version_modified="dataset_version_modified",e.asset_added="asset_added",e.asset_removed="asset_removed",e.asset_status_modified="asset_status_modified",e.asset_annotation_modified="asset_annotation_modified",e.model_added="model_added",e.model_removed="model_removed",e.model_modified="model_modified",e.model_status_modified="model_status_modified",e.model_progress="model_progress",e.events_lost="events_lost",e.workflow_started="workflow_started",e.workflow_succeeded="workflow_succeeded",e.workflow_failed="workflow_failed",e.workflow_task_started="workflow_task_started",e.workflow_task_succeeded="workflow_task_succeeded",e.workflow_task_failed="workflow_task_failed",e))(Je||{}),$e=(e=>(e.unknown="Unknown",e.pending="Pending",e.running="Running",e.succeeded="Succeeded",e.failed="Failed",e.error="Error",e))($e||{}),Fe=(e=>(e.TensorFlowLite="TensorFlowLite",e.TensorFlowGraphDef="TensorFlowGraphDef",e.ONNX="ONNX",e.TorchScript="TorchScript",e.TorchScriptCpu="TorchScriptCpu",e.TorchScriptCuda="TorchScriptCuda",e.PyTorch="PyTorch",e.ModelLess="ModelLess",e))(Fe||{}),He=(e=>(e.float32="float32",e.float16="float16",e.int32="int32",e.int8="int8",e.uint8="uint8",e))(He||{}),Ke=(e=>(e.gcs="gcs",e.s3="s3",e.https_signed="https_signed",e))(Ke||{}),Ve=(e=>(e.success="success",e.failed="failed",e))(Ve||{}),Ze=(e=>(e.classification="classification",e))(Ze||{}),Ge=(e=>(e.image="image",e.video="video",e))(Ge||{}),Be=(e=>(e.in_progress="in_progress",e.draft="draft",e.published="published",e))(Be||{}),Xe=class{constructor(e,t,n,i){this._response=null,this._runInfo=null,this._controller=new AbortController,this._vlmFetch=n,this._assetUrl=e,this._inferRequest=t,this._requestLogger=i}[Symbol.asyncIterator](){if(!this._response)throw Error("logical bug");let e=!1;const t=this._response,n=this._controller;return async function*(){if(e)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");e=!0;let i=!1;try{const e=await t;if(e)for(let t of e)yield t;i=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{i||n.abort()}}()}start(e){return this._response=new Promise(async(t,n)=>{try{let e=null;for(;;){let i=null;if(e)i=await this._vlmFetch(`/api/v1/requests/${e}?timeout=20`,{method:"POST"});else{const e=new Map(Object.entries(this._inferRequest));e.set("url",this._assetUrl);const t=new FormData;t.append("infer_request",JSON.stringify(Object.fromEntries(e))),i=await this._vlmFetch("/api/v1/infer?timeout=20",{method:"POST",body:t})}const a=i.predictions,o=i.run_info;if(a){this._runInfo=o,t(a);break}if(e=i.request_id,!e){n(`missing request_id in response: ${JSON.stringify(i)}`);break}}}catch(e){n(e)}finally{e()}}),this}cancel(){this._controller.abort("cancelled")}},Ye=class{constructor(e,t,n,i){this._response=null,this._controller=new AbortController,this._vlmFetch=n,this._evaluateRequest=e,this._workerRelease=t,this._requestLogger=i}async response(){if(!this._response)throw Error("logical bug");return await this._response}start(e){return this._response=new Promise(async(t,n)=>{try{let e=null;for(;;){let i=null;if(e)i=await this._vlmFetch(`/api/v1/evaluations/${e}?timeout=20`,{method:"GET"});else{const e=this._workerRelease?`&worker_release=${this._workerRelease}`:"";i=await this._vlmFetch(`/api/v1/evaluations?timeout=20${e}`,{method:"POST",body:JSON.stringify(this._evaluateRequest),headers:{"Content-Type":"application/json"}})}if(i.run_info){t(i);break}if(e=i.request_id,!e){n(`missing request_id in response: ${JSON.stringify(i)}`);break}}}catch(e){n(e)}finally{e()}}),this}cancel(){this._controller.abort("cancelled")}},Qe=class extends Error{constructor(e,t){const n=t?.error??t,i=function(e,t){return t instanceof Error?t.message:"string"==typeof t?t:e?.message??""}(t,n);super(i?`EyePop Dataset event WebSocket connection failed: ${i}`:"EyePop Dataset event WebSocket connection failed"),this.code="DATA_WEBSOCKET_CONNECTION_FAILED",this.name="EyePopDataWebSocketError",this.endpoint=function(e){try{return new URL(e).origin}catch{return e}}(e),this.sourceError=n}};function et(e,t){if(null!==t)return t}var tt=class extends ye{constructor(e){super(e),this.datasetApiUrl=null,this.vlmApiUrl=null,this._ws=null,this._ws_current_reconnect_delay=null,this._ws_reconnect_timeout=null,this._ws_reconnect_enabled=!1,this._ws_connecting=null,this._accountId=e.accountId||null,this._account_event_handlers=[],this._dataset_uuid_to_event_handlers=new Map;const t=b(e);if(void 0!==t?.session){const e=t.session;e.accountId&&(this._accountId=e.accountId)}}async session(){const e=await super.session();return{eyepopUrl:e.eyepopUrl,accessToken:e.accessToken,validUntil:e.validUntil,accountId:this.options().accountId,datasetApiUrl:this.datasetApiUrl,vlmApiUrl:this.vlmApiUrl}}async disconnect(e=!0){this._ws_reconnect_enabled=!1,this._ws_reconnect_timeout&&(clearTimeout(this._ws_reconnect_timeout),this._ws_reconnect_timeout=null),this.datasetApiUrl=null,this.vlmApiUrl=null,this._ws&&(this.close_ws(this._ws,"unsubscribe"),this._ws=null),await super.disconnect(e)}async reconnect(){if(!this._client)return Promise.reject("endpoint not initialized");const e=this._accountId?`?account_uuid=${this._accountId}`:"",t=`${this.eyepopUrl()}/v1/configs${e}`;let n={Authorization:await this.authorizationHeader()};this.updateState("FetchConfig");let i=await this._client.fetch(t,{headers:n});if(401==i.status&&(this._requestLogger.debug("GET %s: 401, about to retry with fresh access token",t),this.statusHandler401(i.status),n={Authorization:await this.authorizationHeader()},this.updateState("FetchConfig"),i=await this._client.fetch(t,{headers:n})),200!=i.status){this.updateState("Error");const e=await i.text();return Promise.reject(`Unexpected status ${i.status} for ${t}: ${e}`)}let a=await i.json();const o=new URL(a.dataset_api_url,this.eyepopUrl());this.datasetApiUrl=o.toString();const s=new URL(a.vlm_api_url,this.eyepopUrl());if(this.vlmApiUrl=s.toString(),this.options().disableWs?(this._ws_reconnect_enabled=!1,this._logger.info("disabled ws connection")):await this.reconnect_ws(),this.options().useCookie){const e=this._client,t=(0,ke.default)(this.datasetApiUrl,"security","check?set_cookie=true"),n={Authorization:await this.authorizationHeader()};if(i=await e.fetch(t,{headers:n}),204!=i.status){this.updateState("Error");const e=await i.text();return Promise.reject(`Unexpected status ${i.status}: ${e}`)}}return this.updateState(),Promise.resolve(this)}async reconnect_ws(){if(this._ws_connecting)return this._ws_connecting;const e=this.open_ws();this._ws_connecting=e;try{await e}finally{this._ws_connecting=null}}async open_ws(){this._ws&&(this.close_ws(this._ws,"unsubscribe"),this._ws=null);const e=this.datasetApiUrl?.replace("https://","wss://").replace("http://","ws://");if(!e)return;const t=(0,ke.default)(e,"events");return this._requestLogger.debug("about to connect ws to: %s",t),new Promise((e,n)=>{let i=!1;const a=()=>{i=!0,e()},o=e=>{i=!0,n(e)},s=xe(t);if(!s)return a();this._ws=s,s.onopen=()=>{this.authorizationHeader().then(e=>{if(this._ws!==s)return this.close_ws(s,"unsubscribe"),void a();let t=JSON.stringify({authorization:e});this._requestLogger.debug("ws send: %s",t),s.send(t),t=JSON.stringify({subscribe:{account_uuid:this._accountId}}),this._requestLogger.debug("ws send: %s",t),s.send(t);for(const e of this._dataset_uuid_to_event_handlers.keys()){const t=JSON.stringify({subscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",t),s.send(t)}this._ws_current_reconnect_delay=1e3,this._ws_reconnect_enabled=!0,a()}).catch(e=>{this.close_ws(s,"authorization failed",1011),o(e)})},s.onmessage=e=>{const t=JSON.parse(e.data);this._requestLogger.debug("received ws: %s",JSON.stringify(t));const n=t;this.dispatchChangeEvent(n)},s.onclose=e=>{const{code:n,reason:a}=e;this._requestLogger.debug("ws closed: %d %s",n,a),i||o(new Qe(t,new Error(`closed before the connection was established: ${n} ${a}`))),this._ws===s&&(this._ws=null,this.schedule_ws_reconnect())},s.onerror=e=>{const n=new Qe(t,e);return this._logger.error({err:n},"dataset event WebSocket connection failed"),o(n),null}})}close_ws(e,t,n=1e3){try{e.close(n,t)}catch(e){this._logger.warn({err:e},"ignored exception closing the dataset event WebSocket")}}schedule_ws_reconnect(){this._ws_reconnect_enabled&&!this._ws_reconnect_timeout&&(this._ws_current_reconnect_delay?this._ws_current_reconnect_delay<6e4&&(this._ws_current_reconnect_delay*=1.5):this._ws_current_reconnect_delay=1e3,this._ws_reconnect_timeout=setTimeout(()=>{this._ws_reconnect_enabled?this.reconnect_ws().catch(e=>{this._requestLogger.debug("dataset event WebSocket reconnect failed: %s",e)}).finally(()=>{this._ws_reconnect_timeout=null,this._ws||this.schedule_ws_reconnect()}):this._ws_reconnect_timeout=null},this._ws_current_reconnect_delay))}options(){return this._options}async request(e,t={},n=!1,i="dataset"){const a=this._client;if(!a)return Promise.reject("endpoint not connected");let o=await this.fetchWithRetry(async()=>{const o=await this.session(),s=Se(o,i),r={...n?{}:{Authorization:`Bearer ${o.accessToken}`},...t.headers||{}};t.body||(t.body=null);const c={headers:r,method:t.method||"GET",body:t.body};return this._requestLogger.debug("Request - "+c.method+" "+e+" BODY: "+(c.body?c.body:"")),await a.fetch((0,ke.default)(s??"",e),c)});if(204===o.status)return null;const s=o.headers.get("Content-Type");if(this._requestLogger.debug("Response - "+o.status+" "+o.statusText),!o.ok)throw s&&(s.toLowerCase().startsWith("application/json")||s.toLowerCase().startsWith("text/"))?new Error(`Request failed with ${o.status} ${o.statusText}: ${await o.text()}`):new Error(`Request failed with ${o.status} ${o.statusText}`);return s&&s.toLowerCase().startsWith("application/json")?await o.json():await o.blob()}async listDatasets(e=!0,t){const n=void 0!==t?`&modifiable_version_only=${t}`:"";return this.request(`/datasets?account_uuid=${this._accountId}&include_stats=${e}${n}`,{method:"GET"})}async createDataset(e){return this.request(`/datasets?account_uuid=${this._accountId}`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async getDataset(e,t=!0,n,i){const a=n?`&dataset_version=${n}`:"",o=void 0!==i?`&modifiable_version_only=${i}`:"";return this.request(`/datasets/${e}?include_stats=${t}${a}${o}`,{method:"GET"})}async updateDataset(e,t,n=!0){return this.request(`/datasets/${e}?start_auto_annotate=${n}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async updateDatasetHeroAsset(e,t){return this.request(`/datasets/${e}/hero_asset`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteDataset(e){return this.request(`/datasets/${e}`,{method:"DELETE"})}async freezeDatasetVersion(e,t){const n=t?`&dataset_version=${t}`:"";return this.request(`/datasets/${e}/freeze?${n}`,{method:"POST"})}async analyzeDatasetVersion(e,t){const n=t?`&dataset_version=${t}`:"";return this.request(`/datasets/${e}/analyze?${n}`,{method:"POST"})}async autoAnnotateDatasetVersion(e,t,n){const i=t?`&dataset_version=${t}`:"",a=n?`&max_assets=${n}`:"";return this.request(`/datasets/${e}/auto_annotate?${i}${a}`,{method:"POST"})}async deleteDatasetVersion(e,t){return this.request(`/datasets/${e}/versions?dataset_version=${t}`,{method:"DELETE"})}async deleteAnnotations(e,t,n=["unknown"]){let i="";for(let e in n)i+=`&user_review=${e}`;await this.request(`/datasets/${e}/annotations?dataset_version=${t}${i}`,{method:"DELETE"})}async createDatasetAutoAnnotate(e,t,n){const i=n?`dataset_version=${n}&`:"";return this.request(`/datasets/${t}/auto_annotates?${i}`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async updateDatasetAutoAnnotate(e,t,n,i,a){const o=a?`dataset_version=${a}&`:"";return this.request(`/datasets/${t}/auto_annotates?auto_annotate=${n}&source=${encodeURIComponent(i)}&${o}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async listDatasetAutoAnnotates(e,t,n,i){const a=i?`dataset_version=${i}&`:"",o=t?`auto_annotate=${t}&`:"",s=n?`source=${n}&`:"";return this.request(`/datasets/${e}/auto_annotates?${a}&${o}&${s}`,{method:"GET"})}async uploadAsset(e,t,n,i=void 0){const a=t?`&dataset_version=${t}`:"";let o;return o=i?`/assets?dataset_uuid=${e}${a}&external_id=${i}`:`/assets?dataset_uuid=${e}${a}`,this.request(o,{method:"POST",body:n,headers:{"Content-Type":n.type||"application/octet-stream"}})}async importAsset(e,t,n,i=void 0){const a=t?`&dataset_version=${t}`:"";let o;return o=i?`/assets/imports?dataset_uuid=${e}${a}&external_id=${i}`:`/assets/imports?dataset_uuid=${e}${a}`,this.request(o,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async listAssets(e,t,n=!1,i,a,o,s,r,c){const p=new URLSearchParams;p.set("dataset_uuid",e),null!=t&&p.set("dataset_version",String(t)),n&&p.set("include_annotations","true"),null!=a&&p.set("inclusion_mode",a),null!=o&&p.set("annotation_inclusion_mode",o);for(const e of s??[])p.append("include_partition",e);for(const e of r??[])p.append("include_auto_annotate",e);for(const e of c??[])p.append("include_source",e);return null!=i&&p.set("top_k",String(i)),this.request(`/assets?${p.toString()}`,{method:"GET"})}async getAsset(e,t,n,i=!1,a){const o=n?`&dataset_version=${n}`:"",s=i?"&include_annotations=true":"",r=t?`&dataset_uuid=${t}`:"",c=a?`&top_k=${a}`:"";return this.request(`/assets/${e}?${r}${o}${s}${c}`,{method:"GET"})}async deleteAsset(e,t,n){const i=n?`&dataset_version=${n}`:"",a=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}?${a}${i}`,{method:"DELETE"})}async resurrectAsset(e,t,n,i){const a=i?`&into_dataset_version=${i}`:"";return this.request(`/assets/${e}/resurrect?dataset_uuid=${t}&from_dataset_version=${n}${a}`,{method:"POST"})}async updateAssetGroundTruth(e,t,n,i){const a=n?`&dataset_version=${n}`:"",o=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${o}${a}`,{method:"PATCH",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async deleteAssetGroundTruth(e,t,n){const i=n?`&dataset_version=${n}`:"",a=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${a}${i}`,{method:"DELETE"})}async updateAutoAnnotationStatus(e,t,n,i){if(!["approved","rejected","unknown"].includes(n))throw new Error("Invalid status");const a=i?`?approved_threshold=${i}`:"";return this.request(`/assets/${e}/auto_annotations/${t}/user_review/${n}${a}`,{method:"PATCH"})}async addAssetAnnotation(e,t,n,i,a,o,s,r){const c=t?`dataset_uuid=${t}&`:"",p=n?`&dataset_version=${n}&`:"",l=a?`&auto_annotate=${a}&`:"",u=o?`&source=${encodeURIComponent(o)}&`:"",d=s?`&user_review=${s}&`:"",h=void 0!==r?`&approved_threshold=${r}&`:"";return this.request(`/assets/${e}/annotations?${c}${p}${l}${u}${d}${h}`,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async updateAssetAnnotationApproval(e,t,n,i,a,o,s){const r=t?`dataset_uuid=${t}&`:"",c=n?`&dataset_version=${n}&`:"",p=i?`&auto_annotate=${i}&`:"",l=a?`&source=${encodeURIComponent(a)}&`:"",u=o?`&user_review=${o}&`:"",d=s?`&approved_threshold=${s}&`:"";return this.request(`/assets/${e}/annotations?${r}${c}${p}${l}${u}${d}`,{method:"PATCH"})}async downloadAsset(e,t,n,i="original",a,o,s){const r=n?`&dataset_version=${n}`:"",c=t?`&dataset_uuid=${t}`:"",p=a?`&start_timestamp=${a}`:"",l=o?`&end_timestamp=${o}`:"",u=s?`&url_type=${s}`:"";return this.request(`/assets/${e}/download?transcode_mode=${i}${c}${r}${p}${l}${u}`,{method:"GET"})}async previewAutoAnnotateAsset(e,t,n){return this.request(`/assets/${e}/preview_auto_annotate?auto_annotate=${t}`,{method:"POST",body:n?JSON.stringify(n):null,headers:n?{"Content-Type":"application/json"}:{}})}async addAssetRoi(e,t,n,i,a){const o=i?`&dataset_version=${i}`:"",s=n?`&dataset_uuid=${n}`:"";return this.request(`/assets/${e}/rois?${s}${o}`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteAssetRoi(e,t,n,i){const a=i?`&dataset_version=${i}`:"",o=n?`&dataset_uuid=${n}`:"";return this.request(`/assets/${e}/rois/${encodeURIComponent(t)}?${o}${a}`,{method:"DELETE"})}async listModels(){return this.request(`/models?account_uuid=${this._accountId}`,{method:"GET"})}async findModelsForDataset(e){return this.request(`/models?dataset_uuid=${e}`,{method:"GET"})}async createModel(e,t,n,i=!0){return this.request(`/models?dataset_uuid=${e}&dataset_version=${t}&start_training=${i}`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async getModel(e){return this.request(`/models/${e}`,{method:"GET"})}async getModelTrainingProgress(e){return this.request(`/models/${e}/progress`,{method:"GET"})}async updateModel(e,t){return this.request(`/models/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteModel(e){return this.request(`/models/${e}`,{method:"DELETE"})}async trainModel(e){return this.request(`/models/${e}/train`,{method:"POST"})}async publishModel(e){return this.request(`/models/${e}/publish`,{method:"POST"})}async exportModel(e,t,n){if("qc_ai_hub"!=t)return Promise.reject(`Unexpected export_by ${t}, must be 'qc_ai_hub'`);await this.request(`/models/${e}/exports/qc_ai_hub`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async downloadModelArtifacts(e,t,n,i){const a=i?`artifact_type=${i}&`:"",o=n?`device_name=${encodeURIComponent(n)}&`:"";let s="";if(t)for(const e of t)s+=`model_format=${e}&`;return this.request(`/exports/model_artifacts/?model_uuid=${e}&${a}${o}${s}`,{method:"GET"})}addAccountEventHandler(e){this._account_event_handlers.push(e)}removeAccountEventHandler(e){this._account_event_handlers=this._account_event_handlers.filter(t=>t!==e)}addDatasetEventHandler(e,t){let n=this._dataset_uuid_to_event_handlers.get(e);if(this._logger.debug("addDatasetEventHandler %s",n),void 0===n){n=[],this._dataset_uuid_to_event_handlers.set(e,n);const t=this._ws;if(t){const n=JSON.stringify({subscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",n),t.send(n)}}n.find(e=>e===t)!==t&&(this._logger.debug("addDatasetEventHandler event_handlers=%s",n),n.push(t))}removeDatasetEventHandler(e,t){let n=this._dataset_uuid_to_event_handlers.get(e);if(void 0!==n&&(n=n.filter(e=>e!==t),0==n.length)){const t=this._ws;if(t){const n=JSON.stringify({unsubscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",n),t.send(n)}this._dataset_uuid_to_event_handlers.delete(e)}}removeAllDatasetEventHandlers(e){if(void 0===this._dataset_uuid_to_event_handlers.get(e))return;const t=this._ws;if(t){const n=JSON.stringify({unsubscribe:{dataset_uuid:e}});this._requestLogger.debug("ws send: %s",n),t.send(n)}this._dataset_uuid_to_event_handlers.delete(e)}async startWorkflow(e,t,n){return this.request(`/workflows?account_uuid=${e}&template_name=${t}`,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async getWorkflow(e,t){return this.request(`/workflows/${e}?account_uuid=${t}`,{method:"GET"})}async listWorkflows(e,t,n,i){const a=[t?.map(e=>`dataset_uuid=${e}`).join("&")||"",n?.map(e=>`model_uuid=${e}`).join("&")||"",i?.map(e=>`phase=${e}`).join("&")||""].filter(e=>e).join("&");return this.request(`/workflows?account_uuid=${e}${a?`&${a}`:""}`,{method:"GET"})}async inferAsset(e,t,n,i,a,o,s){const r=`ai.eyepop://data/assets/${e}?${a?`transcode_mode=${a}&`:""}${n?`dataset_uuid=${n}&`:""}${i?`dataset_version=${i}&`:""}${o?`start_timestamp=${o}&`:""}${s?`end_timestamp=${s}&`:""}`;if(!this.vlmApiUrl||!this._client||!this._limit)throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const e=new Xe(r,t,async(e,t)=>await this.request(e,t,!1,"vlm"),this._requestLogger);return e.start(()=>{this.jobDone(e)})}catch(e){throw this._limit.release(),e}}async evaluateDataset(e,t){if(!this.vlmApiUrl||!this._client||!this._limit)throw new Error("endpoint not connected, use connect()");await this._limit.acquire();try{this.updateState();const n=new Ye(e,t??null,async(e,t)=>await this.request(e,t,!1,"vlm"),this._requestLogger);return n.start(()=>{this.jobDone(n)})}catch(e){throw this._limit.release(),e}}jobDone(e){this._limit?.release()}async dispatchChangeEvent(e){switch(e.change_type){case"dataset_added":case"dataset_modified":case"dataset_removed":case"dataset_version_modified":case"workflow_started":case"workflow_succeeded":case"workflow_failed":case"workflow_task_started":case"workflow_task_succeeded":case"workflow_task_failed":this._logger.debug("dispatchChangeEvent account_event_handlers=%s",this._account_event_handlers);for(let t of this._account_event_handlers)await t(e);break;case"asset_added":case"asset_removed":case"asset_status_modified":case"asset_annotation_modified":case"model_added":case"model_modified":case"model_removed":case"model_status_modified":case"model_progress":const t=this._dataset_uuid_to_event_handlers.get(e.dataset_uuid);if(this._logger.debug("dispatchChangeEvent event_handlers=%s",t),void 0!==t)for(let n of t)await n(e)}}async listVlmAbilityGroups(){return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`,{method:"GET"})}async createVlmAbilityGroup(e){return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`,{method:"POST",body:JSON.stringify(e,et),headers:{"Content-Type":"application/json"}})}async getVlmAbilityGroup(e){return this.request(`/vlm_ability_groups/${e}`,{method:"GET"})}async deleteVlmAbilityGroup(e){return this.request(`/vlm_ability_groups/${e}`,{method:"DELETE"})}async updateVlmAbilityGroup(e,t){return this.request(`/vlm_ability_groups/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async listVlmAbilities(){return this.request(`/vlm_abilities?account_uuid=${this._accountId}`,{method:"GET"})}async createVlmAbility(e,t){const n=t?`&vlm_ability_group_uuid=${t}`:"";return this.request(`/vlm_abilities?account_uuid=${this._accountId}${n}`,{method:"POST",body:JSON.stringify(e,et),headers:{"Content-Type":"application/json"}})}async getVlmAbility(e){return this.request(`/vlm_abilities/${e}`,{method:"GET"})}async deleteVlmAbility(e){return this.request(`/vlm_abilities/${e}`,{method:"DELETE"})}async updateVlmAbility(e,t){return this.request(`/vlm_abilities/${e}`,{method:"PATCH",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async refineVlmAbility(e,t,n){return void 0!==t?this.request(`/vlm_abilities/${e}/refine`,{method:"POST",body:JSON.stringify(t,et),headers:{"Content-Type":"application/json"}}):void 0!==n?this.request(`/vlm_abilities/${e}/refine_task`,{method:"POST",body:JSON.stringify(n,et),headers:{"Content-Type":"application/json"}}):Promise.reject("refine vlm ability requires auto_prompt or auto_config parameter")}async cloneVlmAbility(e,t,n,i){const a=new URLSearchParams;return t?a.set("account_uuid",t):this._accountId&&a.set("account_uuid",this._accountId),n&&a.set("name",n),i&&a.set("default_alias_name",i),this.request(`/vlm_abilities/${e}/clone?${a.toString()}`,{method:"POST"})}async publishVlmAbility(e,t,n){const i=t?`alias_name=${encodeURIComponent(t)}&`:"",a=n?`tag_name=${encodeURIComponent(n)}&`:"";return this.request(`/vlm_abilities/${e}/publish?${i}${a}`,{method:"POST"})}async addVlmAbilityAlias(e,t,n){return this.request(`/vlm_abilities/${e}/alias/${encodeURIComponent(t)}/tag/${n?encodeURIComponent(n):""}`,{method:"POST"})}async removeVlmAbilityAlias(e,t,n){return this.request(`/vlm_abilities/${e}/alias/${encodeURIComponent(t)}/tag/${encodeURIComponent(n)}`,{method:"DELETE"})}async listVlmAbilityEvaluations(e){return this.request(`/vlm_abilities/${e}/evaluations`,{method:"GET"})}async getVlmAbilityEvaluation(e,t){return this.request(`/vlm_abilities/${e}/evaluations/${t}`,{method:"GET"})}async startVlmAbilityEvaluation(e,t){return this.request(`/vlm_abilities/${e}/evaluations`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async resolveAliases(e){const t=new URLSearchParams;return e.forEach(e=>{t.append("alias",e)}),this.request(`/exports/aliases?${t.toString()}`,{method:"GET"})}},nt=1===new Uint8Array(new Uint16Array([1]).buffer)[0],it=class{constructor(e,t,n){this.width=e,this.height=t,this.values=n}at(e,t,n,i){let a=e,o=t;n&&i&&(a=e*this.width/n,o=t*this.height/i);const s=Math.min(Math.max(Math.floor(a),0),this.width-1),r=Math.min(Math.max(Math.floor(o),0),this.height-1);return this.values[r*this.width+s]}isSky(e,t,n,i){return this.at(e,t,n,i)===Number.POSITIVE_INFINITY}get finiteMin(){return this.computeFiniteRange(),this._finiteMin}get finiteMax(){return this.computeFiniteRange(),this._finiteMax}computeFiniteRange(){if(void 0!==this._finiteMin||void 0!==this._finiteMax)return;let e=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY;for(let n=0;n<this.values.length;n++){const i=this.values[n];Number.isFinite(i)&&(i<e&&(e=i),i>t&&(t=i))}t>=e&&(this._finiteMin=e,this._finiteMax=t)}};function at(e){if(!Number.isSafeInteger(e.width)||e.width<=0||!Number.isSafeInteger(e.height)||e.height<=0||!Number.isSafeInteger(e.width*e.height*4))throw new Error(`invalid depth dimensions: ${e.width}x${e.height}`);const t=function(e){if(void 0!==a){const t=a.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e.values),n=e.width*e.height;if(t.byteLength!==4*n)throw new Error(`depth values hold ${t.byteLength} bytes, expected ${4*n} for ${e.width}x${e.height} float32`);let i;if(nt){const e=new Uint8Array(t);i=new Float32Array(e.buffer,0,n)}else{const e=new DataView(t.buffer,t.byteOffset,t.byteLength);i=new Float32Array(n);for(let t=0;t<n;t++)i[t]=e.getFloat32(4*t,!0)}return new it(e.width,e.height,i)}var ot=1===new Uint8Array(new Uint16Array([1]).buffer)[0],st=class{constructor(e,t,n,i){this.width=e,this.height=t,this.points=n,this.box=i}at(e,t){if(!(e>=0&&e<this.width&&t>=0&&t<this.height))throw new Error(`(${e}, ${t}) is outside a ${this.width}x${this.height} cloud`);const n=3*(t*this.width+e),i=this.points[n],a=this.points[n+1],o=this.points[n+2];if(!(Number.isNaN(i)||Number.isNaN(a)||Number.isNaN(o)))return{x:i,y:a,z:o}}atSource(e,t){if(void 0===this.box)throw new Error("atSource needs a box; build with cloudOfObject or cloudOfDepth");if(!(this.box.width>0&&this.box.height>0))throw new Error(`invalid bounding box extent: ${this.box.width}x${this.box.height}`);const n=Math.min(Math.max(Math.floor((e-this.box.x)/this.box.width*this.width),0),this.width-1),i=Math.min(Math.max(Math.floor((t-this.box.y)/this.box.height*this.height),0),this.height-1);return this.at(n,i)}isPlaced(e,t){return void 0!==this.at(e,t)}get placedPoints(){const e=[];for(let t=0;t<this.points.length;t+=3){const n=this.points[t],i=this.points[t+1],a=this.points[t+2];Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(a)||e.push({x:n,y:i,z:a})}return e}get bounds(){let e=!1;const t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,z:Number.POSITIVE_INFINITY},n={x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY,z:Number.NEGATIVE_INFINITY};for(let i=0;i<this.points.length;i+=3){const a=this.points[i],o=this.points[i+1],s=this.points[i+2];Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s)||(e=!0,t.x=Math.min(t.x,a),t.y=Math.min(t.y,o),t.z=Math.min(t.z,s),n.x=Math.max(n.x,a),n.y=Math.max(n.y,o),n.z=Math.max(n.z,s))}return e?{min:t,max:n}:void 0}};function rt(e,t,n,i){if(!Number.isSafeInteger(e)||e<=0||!Number.isSafeInteger(t)||t<=0)throw new Error(`invalid point cloud dimensions: ${e}x${t}`);const o=function(e){if(void 0!==a){const t=a.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(n),s=e*t*3;if(o.byteLength!==4*s)throw new Error(`'world' holds ${o.byteLength} bytes, expected ${4*s} for ${e}x${t} xyz float32`);let r;if(ot){const e=new Uint8Array(o);r=new Float32Array(e.buffer,0,s)}else{const e=new DataView(o.buffer,o.byteOffset,o.byteLength);r=new Float32Array(s);for(let t=0;t<s;t++)r[t]=e.getFloat32(4*t,!0)}return new st(e,t,r,i)}function ct(e,t){if(void 0!==e&&void 0!==e.world)return rt(e.width,e.height,e.world,t)}function pt(e){if(void 0!==e&&void 0!==e.mask)return ct(e.mask,{x:e.x,y:e.y,width:e.width,height:e.height})}function lt(e,t,n){if(void 0===e||void 0===e.world)return;const i=t&&n?{x:0,y:0,width:t,height:n}:void 0;return rt(e.width,e.height,e.world,i)}function ut(e){const t=[];if(void 0===e)return t;const n=e=>{for(const i of e??[]){const e=pt(i);void 0!==e&&t.push(e),n(i.objects)}};n(e.objects);const i=lt(e.depth,e.source_width,e.source_height);return void 0!==i&&t.push(i),t}var dt,ht=class extends ne{constructor(e,t,n,i){super(t,n,e,"liveIngress/whep",!1,i),this._stream=null}async close(){const e=this._stream;return this._stream=null,e&&e.getTracks().forEach(e=>{e.stop()}),super.close()}async stream(){return this._stream?Promise.resolve(this._stream):Promise.reject("fetching stream failed")}async start(){const e=await this._getSession(),t=this.gresUrl(e),n=await this._client.fetch(t,{headers:e.authenticationHeaders(),method:"GET"});return n.status>=300?Promise.reject(`unknown status code for GET '${t}': ${n.status} (${n.statusText})`):this.onIceServers(n)}async onRemoteAnswer(e){if(!this._pc)throw new Error("onLocalOffer no peer connection");return await this._pc.setRemoteDescription(new RTCSessionDescription(e)),0!==this._queuedCandidates.length&&(await this.sendLocalCandidates(this._queuedCandidates),this._queuedCandidates=[]),this}async onIceServers(e){if(this._stream)throw new Error("onIceServers has stream");const t=new RTCPeerConnection({iceServers:ne.linkToIceServers(e.headers.get("Link"))});return t.addTransceiver("video",{direction:"sendrecv"}),t.onicecandidate=e=>this.onLocalCandidate(e),this._pc=t,this._requestLogger.info(`onIceServers ${t.iceConnectionState}`),new Promise(async(e,n)=>{t.ontrack=t=>{this._requestLogger.debug(`new track: ${t.track.kind}`),this._stream=t.streams[0]||null,e(this)},t.oniceconnectionstatechange=()=>{switch(t.iceConnectionState){case"failed":case"disconnected":this._requestLogger.debug("oniceconnectionstatechange disconnected"),n(`peer connection: ${t.iceConnectionState}`);break;case"connected":this._requestLogger.debug("oniceconnectionstatechange connected")}},await this.onLocalOffer(await t.createOffer())})}},mt=e=>{if("undefined"!=typeof process)return process.env?.[e]??void 0},ft=!1,vt=()=>{const e=mt("EYEPOP_ACCOUNT_UUID");if(void 0!==e)return e;const t=mt("EYEPOP_ACCOUNT_ID");return void 0===t||ft||(ft=!0,console.warn("EYEPOP_ACCOUNT_ID is deprecated, use EYEPOP_ACCOUNT_UUID instead")),t};(e=>{const t=mt("EYEPOP_API_KEY"),n=t?{apiKey:t}:void 0;function i(e={}){const t={...e};if(void 0!==t.pop&&Q(t.pop),void 0===t.isLocalMode&&(t.isLocalMode=(e=>{if(void 0===e)return!1;const t=e.toLowerCase();return"true"==t||"yes"==t})(mt("EYEPOP_LOCAL_MODE"))),t.isLocalMode&&(t.eyepopUrl="http://127.0.0.1:8080"),a(t),void 0===b(t)){if(!t.isLocalMode)throw new Error("apiKey/accessToken/session/oAuth2 option or EYEPOP_API_KEY environment variable is required");t.auth={isLocal:!0}}void 0===t.sessionUuid&&(t.sessionUuid=mt("EYEPOP_SESSION_UUID")),void 0===t.sessionName&&(t.sessionName=mt("EYEPOP_SESSION_NAME")),void 0===t.accountId&&(t.accountId=vt()),void 0===t.pipelineImage&&(t.pipelineImage=mt("EYEPOP_PIPELINE_IMAGE")),void 0===t.pipelineVersion&&(t.pipelineVersion=mt("EYEPOP_PIPELINE_VERSION")),void 0===t.popId&&void 0===t.sessionUuid&&(t.popId=mt("EYEPOP_POP_ID")||"transient"),void 0===t.autoStart&&(t.autoStart=!0),void 0===t.stopJobs&&(t.stopJobs=!0);const n=b(t);return void 0!==n&&void 0!==n.session&&void 0!==n.session&&(n.session.popId&&(t.popId=n.session.popId),n.session.accountId&&(t.accountId=n.session.accountId)),new _e(t)}function a(e){void 0===b(e)&&n&&(e.apiKey=n.apiKey);const t=b(e);if(!e.eyepopUrl&&t&&t.session&&t.session.eyepopUrl&&(e.eyepopUrl=t.session.eyepopUrl),e.eyepopUrl||(e.eyepopUrl=mt("EYEPOP_URL")),e.eyepopUrl||(e.eyepopUrl="https://compute.eyepop.ai"),t&&void 0!==t.oAuth2&&"boolean"==typeof t.oAuth2){const t=e.eyepopUrl&&e.eyepopUrl.match(/https:(.*).staging.eyepop.xyz/i)?{oAuth2:{domain:"dev-eyepop.us.auth0.com",clientId:"jktx3YO2UnbkNPvr05PQWf26t1kNTJyg",audience:"https://dev-app.eyepop.ai",scope:"admin:clouds access:inference-api access:datasets"}}:{oAuth2:{domain:"eyepop.us.auth0.com",clientId:"Lb9ubA9Hf3jlaqWLUx8XgA0zvotgViCl",audience:"https://api.eyepop.ai",scope:"admin:clouds access:inference-api access:datasets"}};void 0!==e.oAuth2?e.oAuth2=t.oAuth2:e.auth=t}e.jobQueueLength||(e.jobQueueLength=128)}e.endpoint=i,e.workerEndpoint=i,e.dataEndpoint=function(e={}){a(e);const t=b(e);if(void 0===t)throw new Error("apiKey/accessToken/session/oAuth2 option or EYEPOP_API_KEY environment variable is required");return void 0===e.accountId&&(e.accountId=vt()),void 0!==t.session&&void 0!==t.session&&t.session.accountId&&(e.accountId=t.session.accountId),new tt(e)}})(dt||(dt={}));var gt=dt},182(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.validate=t.v7=t.v6ToV1=t.v6=t.v5=t.v4=t.v3=t.v1ToV6=t.v1=t.stringify=t.parse=t.NIL=t.MAX=void 0;var i=n(196);Object.defineProperty(t,"MAX",{enumerable:!0,get:function(){return i.default}});var a=n(465);Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}});var o=n(178);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return o.default}});var s=n(11);Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.default}});var r=n(425);Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return r.default}});var c=n(568);Object.defineProperty(t,"v1ToV6",{enumerable:!0,get:function(){return c.default}});var p=n(591);Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return p.default}});var l=n(286);Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return l.default}});var u=n(557);Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return u.default}});var d=n(356);Object.defineProperty(t,"v6",{enumerable:!0,get:function(){return d.default}});var h=n(268);Object.defineProperty(t,"v6ToV1",{enumerable:!0,get:function(){return h.default}});var m=n(299);Object.defineProperty(t,"v7",{enumerable:!0,get:function(){return m.default}});var f=n(746);Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return f.default}});var v=n(770);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return v.default}})},196(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="ffffffff-ffff-ffff-ffff-ffffffffffff"},338(e,t){"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function i(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,a,o,s){return i((r=i(i(t,e),i(a,s)))<<(c=o)|r>>>32-c,n);var r,c}function o(e,t,n,i,o,s,r){return a(t&n|~t&i,e,t,o,s,r)}function s(e,t,n,i,o,s,r){return a(t&i|n&~i,e,t,o,s,r)}function r(e,t,n,i,o,s,r){return a(t^n^i,e,t,o,s,r)}function c(e,t,n,i,o,s,r){return a(n^(t|~i),e,t,o,s,r)}t.default=function(e){return function(e){const t=new Uint8Array(4*e.length);for(let n=0;n<4*e.length;n++)t[n]=e[n>>2]>>>n%4*8&255;return t}(function(e,t){const a=new Uint32Array(n(t)).fill(0);a.set(e),a[t>>5]|=128<<t%32,a[a.length-1]=t,e=a;let p=1732584193,l=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=p,a=l,h=u,m=d;p=o(p,l,u,d,e[t],7,-680876936),d=o(d,p,l,u,e[t+1],12,-389564586),u=o(u,d,p,l,e[t+2],17,606105819),l=o(l,u,d,p,e[t+3],22,-1044525330),p=o(p,l,u,d,e[t+4],7,-176418897),d=o(d,p,l,u,e[t+5],12,1200080426),u=o(u,d,p,l,e[t+6],17,-1473231341),l=o(l,u,d,p,e[t+7],22,-45705983),p=o(p,l,u,d,e[t+8],7,1770035416),d=o(d,p,l,u,e[t+9],12,-1958414417),u=o(u,d,p,l,e[t+10],17,-42063),l=o(l,u,d,p,e[t+11],22,-1990404162),p=o(p,l,u,d,e[t+12],7,1804603682),d=o(d,p,l,u,e[t+13],12,-40341101),u=o(u,d,p,l,e[t+14],17,-1502002290),l=o(l,u,d,p,e[t+15],22,1236535329),p=s(p,l,u,d,e[t+1],5,-165796510),d=s(d,p,l,u,e[t+6],9,-1069501632),u=s(u,d,p,l,e[t+11],14,643717713),l=s(l,u,d,p,e[t],20,-373897302),p=s(p,l,u,d,e[t+5],5,-701558691),d=s(d,p,l,u,e[t+10],9,38016083),u=s(u,d,p,l,e[t+15],14,-660478335),l=s(l,u,d,p,e[t+4],20,-405537848),p=s(p,l,u,d,e[t+9],5,568446438),d=s(d,p,l,u,e[t+14],9,-1019803690),u=s(u,d,p,l,e[t+3],14,-187363961),l=s(l,u,d,p,e[t+8],20,1163531501),p=s(p,l,u,d,e[t+13],5,-1444681467),d=s(d,p,l,u,e[t+2],9,-51403784),u=s(u,d,p,l,e[t+7],14,1735328473),l=s(l,u,d,p,e[t+12],20,-1926607734),p=r(p,l,u,d,e[t+5],4,-378558),d=r(d,p,l,u,e[t+8],11,-2022574463),u=r(u,d,p,l,e[t+11],16,1839030562),l=r(l,u,d,p,e[t+14],23,-35309556),p=r(p,l,u,d,e[t+1],4,-1530992060),d=r(d,p,l,u,e[t+4],11,1272893353),u=r(u,d,p,l,e[t+7],16,-155497632),l=r(l,u,d,p,e[t+10],23,-1094730640),p=r(p,l,u,d,e[t+13],4,681279174),d=r(d,p,l,u,e[t],11,-358537222),u=r(u,d,p,l,e[t+3],16,-722521979),l=r(l,u,d,p,e[t+6],23,76029189),p=r(p,l,u,d,e[t+9],4,-640364487),d=r(d,p,l,u,e[t+12],11,-421815835),u=r(u,d,p,l,e[t+15],16,530742520),l=r(l,u,d,p,e[t+2],23,-995338651),p=c(p,l,u,d,e[t],6,-198630844),d=c(d,p,l,u,e[t+7],10,1126891415),u=c(u,d,p,l,e[t+14],15,-1416354905),l=c(l,u,d,p,e[t+5],21,-57434055),p=c(p,l,u,d,e[t+12],6,1700485571),d=c(d,p,l,u,e[t+3],10,-1894986606),u=c(u,d,p,l,e[t+10],15,-1051523),l=c(l,u,d,p,e[t+1],21,-2054922799),p=c(p,l,u,d,e[t+8],6,1873313359),d=c(d,p,l,u,e[t+15],10,-30611744),u=c(u,d,p,l,e[t+6],15,-1560198380),l=c(l,u,d,p,e[t+13],21,1309151649),p=c(p,l,u,d,e[t+4],6,-145523070),d=c(d,p,l,u,e[t+11],10,-1120210379),u=c(u,d,p,l,e[t+2],15,718787259),l=c(l,u,d,p,e[t+9],21,-343485551),p=i(p,n),l=i(l,a),u=i(u,h),d=i(d,m)}return Uint32Array.of(p,l,u,d)}(function(e){if(0===e.length)return new Uint32Array;const t=new Uint32Array(n(8*e.length)).fill(0);for(let n=0;n<e.length;n++)t[n>>2]|=(255&e[n])<<n%4*8;return t}(e),8*e.length))}},779(e,t){"use strict";const n="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);t.default={randomUUID:n}},465(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="00000000-0000-0000-0000-000000000000"},178(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(746);t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,255&t,(t=parseInt(e.slice(9,13),16))>>>8,255&t,(t=parseInt(e.slice(14,18),16))>>>8,255&t,(t=parseInt(e.slice(19,23),16))>>>8,255&t,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,255&t)}},697(e,t){"use strict";t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i},291(e,t){"use strict";let n;const i=new Uint8Array(16);t.default=function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(i)}},829(e,t){"use strict";function n(e,t,n,i){switch(e){case 0:return t&n^~t&i;case 1:case 3:return t^n^i;case 2:return t&n^t&i^n&i}}function i(e,t){return e<<t|e>>>32-t}t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520],o=new Uint8Array(e.length+1);o.set(e),o[e.length]=128;const s=(e=o).length/4+2,r=Math.ceil(s/16),c=new Array(r);for(let t=0;t<r;++t){const n=new Uint32Array(16);for(let i=0;i<16;++i)n[i]=e[64*t+4*i]<<24|e[64*t+4*i+1]<<16|e[64*t+4*i+2]<<8|e[64*t+4*i+3];c[t]=n}c[r-1][14]=8*(e.length-1)/Math.pow(2,32),c[r-1][14]=Math.floor(c[r-1][14]),c[r-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<r;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=c[e][t];for(let e=16;e<80;++e)o[e]=i(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=a[0],r=a[1],p=a[2],l=a[3],u=a[4];for(let e=0;e<80;++e){const a=Math.floor(e/20),c=i(s,5)+n(a,r,p,l)+u+t[a]+o[e]>>>0;u=l,l=p,p=i(r,30)>>>0,r=s,s=c}a[0]=a[0]+s>>>0,a[1]=a[1]+r>>>0,a[2]=a[2]+p>>>0,a[3]=a[3]+l>>>0,a[4]=a[4]+u>>>0}return Uint8Array.of(a[0]>>24,a[0]>>16,a[0]>>8,a[0],a[1]>>24,a[1]>>16,a[1]>>8,a[1],a[2]>>24,a[2]>>16,a[2]>>8,a[2],a[3]>>24,a[3]>>16,a[3]>>8,a[3],a[4]>>24,a[4]>>16,a[4]>>8,a[4])}},11(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unsafeStringify=void 0;const i=n(746),a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function o(e,t=0){return(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase()}t.unsafeStringify=o,t.default=function(e,t=0){const n=o(e,t);if(!(0,i.default)(n))throw TypeError("Stringified UUID is invalid");return n}},425(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV1State=void 0;const i=n(291),a=n(11),o={};function s(e,t,n){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=n.slice(10,16),e.node[0]|=1,e.clockseq=16383&(n[8]<<8|n[9])),e.msecs=t,e}function r(e,t,n,i,a,o,s=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(o){if(s<0||s+16>o.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`)}else o=new Uint8Array(16),s=0;t??=Date.now(),n??=0,i??=16383&(e[8]<<8|e[9]),a??=e.slice(10,16);const r=(1e4*(268435455&(t+=122192928e5))+n)%4294967296;o[s++]=r>>>24&255,o[s++]=r>>>16&255,o[s++]=r>>>8&255,o[s++]=255&r;const c=t/4294967296*1e4&268435455;o[s++]=c>>>8&255,o[s++]=255&c,o[s++]=c>>>24&15|16,o[s++]=c>>>16&255,o[s++]=i>>>8|128,o[s++]=255&i;for(let e=0;e<6;++e)o[s++]=a[e];return o}t.updateV1State=s,t.default=function(e,t,n){let c;const p=e?._v6??!1;if(e){const t=Object.keys(e);1===t.length&&"_v6"===t[0]&&(e=void 0)}if(e)c=r(e.random??e.rng?.()??(0,i.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,n);else{const e=Date.now(),a=(0,i.default)();s(o,e,a),c=r(a,o.msecs,o.nsecs,p?void 0:o.clockseq,p?void 0:o.node,t,n)}return t??(0,a.unsafeStringify)(c)}},568(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(178),a=n(11);t.default=function(e){const t=(n="string"==typeof e?(0,i.default)(e):e,Uint8Array.of((15&n[6])<<4|n[7]>>4&15,(15&n[7])<<4|(240&n[4])>>4,(15&n[4])<<4|(240&n[5])>>4,(15&n[5])<<4|(240&n[0])>>4,(15&n[0])<<4|(240&n[1])>>4,(15&n[1])<<4|(240&n[2])>>4,96|15&n[2],n[3],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]));var n;return"string"==typeof e?(0,a.unsafeStringify)(t):t}},591(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const i=n(338),a=n(988);var o=n(988);function s(e,t,n,o){return(0,a.default)(48,i.default,e,t,n,o)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return o.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return o.URL}}),s.DNS=a.DNS,s.URL=a.URL,t.default=s},988(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=t.stringToBytes=void 0;const i=n(178),a=n(11);function o(e){e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}t.stringToBytes=o,t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t.default=function(e,t,n,s,r,c){const p="string"==typeof n?o(n):n,l="string"==typeof s?(0,i.default)(s):s;if("string"==typeof s&&(s=(0,i.default)(s)),16!==s?.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+p.length);if(u.set(l),u.set(p,l.length),u=t(u),u[6]=15&u[6]|e,u[8]=63&u[8]|128,r){if((c=c||0)<0||c+16>r.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let e=0;e<16;++e)r[c+e]=u[e];return r}return(0,a.unsafeStringify)(u)}},286(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(779),a=n(291),o=n(11);t.default=function(e,t,n){if(i.default.randomUUID&&!t&&!e)return i.default.randomUUID();const s=(e=e||{}).random??e.rng?.()??(0,a.default)();if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=s[e];return t}return(0,o.unsafeStringify)(s)}},557(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const i=n(829),a=n(988);var o=n(988);function s(e,t,n,o){return(0,a.default)(80,i.default,e,t,n,o)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return o.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return o.URL}}),s.DNS=a.DNS,s.URL=a.URL,t.default=s},356(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(11),a=n(425),o=n(568);t.default=function(e,t,n){e??={},n??=0;let s=(0,a.default)({...e,_v6:!0},new Uint8Array(16));if(s=(0,o.default)(s),t){if(n<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;e++)t[n+e]=s[e];return t}return(0,i.unsafeStringify)(s)}},268(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(178),a=n(11);t.default=function(e){const t=(n="string"==typeof e?(0,i.default)(e):e,Uint8Array.of((15&n[3])<<4|n[4]>>4&15,(15&n[4])<<4|(240&n[5])>>4,(15&n[5])<<4|15&n[6],n[7],(15&n[1])<<4|(240&n[2])>>4,(15&n[2])<<4|(240&n[3])>>4,16|(240&n[0])>>4,(15&n[0])<<4|(240&n[1])>>4,n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]));var n;return"string"==typeof e?(0,a.unsafeStringify)(t):t}},299(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV7State=void 0;const i=n(291),a=n(11),o={};function s(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++),e}function r(e,t,n,i,a=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(i){if(a<0||a+16>i.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`)}else i=new Uint8Array(16),a=0;return t??=Date.now(),n??=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9],i[a++]=t/1099511627776&255,i[a++]=t/4294967296&255,i[a++]=t/16777216&255,i[a++]=t/65536&255,i[a++]=t/256&255,i[a++]=255&t,i[a++]=112|n>>>28&15,i[a++]=n>>>20&255,i[a++]=128|n>>>14&63,i[a++]=n>>>6&255,i[a++]=n<<2&255|3&e[10],i[a++]=e[11],i[a++]=e[12],i[a++]=e[13],i[a++]=e[14],i[a++]=e[15],i}t.updateV7State=s,t.default=function(e,t,n){let c;if(e)c=r(e.random??e.rng?.()??(0,i.default)(),e.msecs,e.seq,t,n);else{const e=Date.now(),a=(0,i.default)();s(o,e,a),c=r(a,o.msecs,o.seq,t,n)}return t??(0,a.unsafeStringify)(c)}},746(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(697);t.default=function(e){return"string"==typeof e&&i.default.test(e)}},770(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(746);t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}}};const t={};function n(i){const a=t[i];if(void 0!==a)return a.exports;const o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}return n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var a=t[i++],o=t[i++],s=0===o?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:o};n.o(e,a)||Object.defineProperty(e,a,s)}else for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},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=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(797)})()),"undefined"!=typeof globalThis&&globalThis.EyePopSdk&&(globalThis.EyePop=globalThis.EyePopSdk.EyePop,globalThis.PopComponentType=globalThis.EyePopSdk.PopComponentType);
|