@eyepop.ai/eyepop 3.25.1 → 3.25.2
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.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,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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}function o(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 s(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n}function a(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 l(e){return new a(e,0)}function p(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){p(e,t),t.set(e,n)}function h(e,t,n){return e.set(c(e,t),n),n}function m(e,t){p(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,o=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 s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}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,o,s,a,r=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=s.call(n)).done)&&(r.push(i.value),r.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}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 s=e[t](n),r=s.value,c=r instanceof a;Promise.resolve(c?r.v:r).then(function(n){if(c){var a="return"===t&&r.k?t:"next";if(!r.k||n.done)return i(a,n);n=e[a](n).value}o(!!s.done,n)},function(e){i("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(s,a){var r={key:e,arg:o,resolve:s,reject:a,next:null};n?n=n.next=r:(t=n=r,i(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}n.r(t),n.d(t,{AnonymousSessionApiClient:()=>Qc,AnonymousSessionClient:()=>nc,AnonymousSessionError:()=>Qr,Auth0Client:()=>el,AuthenticationError:()=>O,CacheKey:()=>De,ConnectError:()=>U,GenericError:()=>C,InMemoryCache:()=>$e,InvalidConfigurationError:()=>I,LocalStorageCache:()=>We,MfaApiClient:()=>Wc,MfaChallengeError:()=>zc,MfaEnrollmentError:()=>Nc,MfaEnrollmentFactorsError:()=>qc,MfaError:()=>Rc,MfaListAuthenticatorsError:()=>Lc,MfaRequiredError:()=>M,MfaVerifyError:()=>Mc,MissingRefreshTokenError:()=>D,MissingScopesError:()=>W,MyAccountApiClient:()=>vt,MyAccountApiError:()=>gt,PasskeyApiClient:()=>Jc,PasskeyChallengeError:()=>Ar,PasskeyError:()=>$c,PasskeyGetTokenError:()=>jr,PasskeyRegisterError:()=>Pr,PasskeyVerificationRequiredError:()=>q,PopupCancelledError:()=>N,PopupOpenError:()=>z,PopupTimeoutError:()=>L,ResponseType:()=>nt,TimeoutError:()=>R,UseDpopNonceError:()=>$,User:()=>it,createAuth0Client:()=>nl,isFederatedDomain:()=>tl}),"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",P={name:"auth0-spa-js",version:"2.29.0"},A=()=>Date.now(),j="default";class C extends Error{constructor(e,t,n){super(t),this.error=e,this.error_description=t,this.data=n,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 U extends C{constructor(e,t,n,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(e,t),this.connection=n,this.state=i,this.appState=o,Object.setPrototypeOf(this,U.prototype)}}class R extends C{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,R.prototype)}}class L extends R{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,L.prototype)}}class N extends C{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,N.prototype)}}class z extends C{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,z.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 q extends C{constructor(e){super("verification_required","Identifier verification is required before passkey creation. Collect OTP codes for each identifier and call passkey.continueSignup()."),this.verificationRequired=e,Object.setPrototypeOf(this,q.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 $ extends C{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,$.prototype)}}function J(e){return e&&!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).includes(e)?e:""}const F=()=>window.crypto,H=()=>{let e="";for(;e.length<43;){const t=F().getRandomValues(new Uint8Array(43-e.length));for(const n of t)e.length<43&&n<198&&(e+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~."[n%66])}return e},K=e=>btoa(e),V=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],B=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 o=V.find(e=>e.key===i);return o&&o.type.includes(typeof e[i])&&(n[i]=e[i]),n},{})},G=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()},Z=async e=>{const t=F().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},X=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),Y=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 Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},ee={},te={};Object.defineProperty(te,"__esModule",{value:!0});var ne=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}();te.default=function(){return ne.getInstance()};var ie=Q&&Q.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,s){function a(e){try{c(i.next(e))}catch(e){s(e)}}function r(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,r)}c((i=i.apply(e,t||[])).next())})},oe=Q&&Q.__generator||function(e,t){var n,i,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function r(s){return function(r){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,r])}}},se=Q;Object.defineProperty(ee,"__esModule",{value:!0});var ae=te,re="browser-tabs-lock-key",ce={key:function(e){return ie(se,void 0,void 0,function(){return oe(this,function(e){throw new Error("Unsupported")})})},getItem:function(e){return ie(se,void 0,void 0,function(){return oe(this,function(e){throw new Error("Unsupported")})})},clear:function(){return ie(se,void 0,void 0,function(){return oe(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return ie(se,void 0,void 0,function(){return oe(this,function(e){throw new Error("Unsupported")})})},setItem:function(e,t){return ie(se,void 0,void 0,function(){return oe(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 le(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 ue=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),ie(this,void 0,void 0,function(){var i,o,s,a,r,c,l;return oe(this,function(p){switch(p.label){case 0:i=Date.now()+pe(4),o=Date.now()+n,s=re+"-"+t,a=void 0===this.storageHandler?ce:this.storageHandler,p.label=1;case 1:return Date.now()<o?[4,le(30)]:[3,8];case 2:return p.sent(),null!==a.getItemSync(s)?[3,5]:(r=this.id+"-"+t+"-"+i,[4,le(Math.floor(25*Math.random()))]);case 3:return p.sent(),a.setItemSync(s,JSON.stringify({id:this.id,iat:i,timeoutKey:r,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,le(30)];case 4:return p.sent(),null!==(c=a.getItemSync(s))&&(l=JSON.parse(c)).id===this.id&&l.iat===i?(this.acquiredIatSet.add(i),this.refreshLockWhileAcquired(s,i),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?ce:this.storageHandler),[4,this.waitForSomethingToChange(o)];case 6:p.sent(),p.label=7;case 7:return i=Date.now()+pe(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return ie(this,void 0,void 0,function(){var n=this;return oe(this,function(i){return setTimeout(function(){return ie(n,void 0,void 0,function(){var n,i,o;return oe(this,function(s){switch(s.label){case 0:return[4,ae.default().lock(t)];case 1:return s.sent(),this.acquiredIatSet.has(t)?(n=void 0===this.storageHandler?ce:this.storageHandler,null===(i=n.getItemSync(e))?(ae.default().unlock(t),[2]):((o=JSON.parse(i)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(o)),ae.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(ae.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return ie(this,void 0,void 0,function(){return oe(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var i=!1,o=Date.now(),s=!1;function a(){if(s||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(r),s=!0),!i){i=!0;var t=50-(Date.now()-o);t>0?setTimeout(n,t):n(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var r=setTimeout(a,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return ie(this,void 0,void 0,function(){return oe(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 ie(this,void 0,void 0,function(){var n,i,o,s;return oe(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?ce:this.storageHandler,i=re+"-"+t,null===(o=n.getItemSync(i))?[2]:(s=JSON.parse(o)).id!==this.id?[3,2]:[4,ae.default().lock(s.iat)];case 1:a.sent(),this.acquiredIatSet.delete(s.iat),n.removeItemSync(i),ae.default().unlock(s.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,i=t,o=[],s=0;;){var a=i.keySync(s);if(null===a)break;o.push(a),s++}for(var r=!1,c=0;c<o.length;c++){var l=o[c];if(l.includes(re)){var p=i.getItemSync(l);if(null!==p){var u=JSON.parse(p);(void 0===u.timeRefreshed&&u.timeAcquired<n||void 0!==u.timeRefreshed&&u.timeRefreshed<n)&&(i.removeItemSync(l),r=!0)}}}r&&e.notifyWaiters()},e.waiters=void 0,e}(),de=ee.default=ue;class he{async runWithLock(e,t,n){const i=new AbortController,o=setTimeout(()=>i.abort(),t);try{return await navigator.locks.request(e,{mode:"exclusive",signal:i.signal},async e=>{if(clearTimeout(o),!e)throw new Error("Lock not available");return await n()})}catch(e){if(clearTimeout(o),i.signal.aborted&&"AbortError"===(null==e?void 0:e.name))throw new R;throw e}}}class me{constructor(){this.activeLocks=new Set,this.lock=new de,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 R;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 fe=null;function ve(){return fe||(fe=function(){return"undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.locks)||void 0===e?void 0:e.request)?new he:new me;var e}()),fe}const ge=new TextEncoder,ye=new TextDecoder;function be(e){return"string"==typeof e?ge.encode(e):ye.decode(e)}function we(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new Te(`${e.name} modulusLength must be at least 2048 bits`)}let xe;if(Uint8Array.prototype.toBase64)xe=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;xe=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 _e(e){return xe(e)}class ke 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 Te 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 Se(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){if("SHA-256"===e.algorithm.hash.name)return"PS256";throw new ke("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(e){if("SHA-256"===e.algorithm.hash.name)return"RS256";throw new ke("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(e){if("P-256"===e.algorithm.namedCurve)return"ES256";throw new ke("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new ke("unsupported CryptoKey algorithm name")}}function Ee(e){return e instanceof CryptoKey}function Pe(e){return Ee(e)&&"public"===e.type}async function Ae(e){const{kty:t,e:n,n:i,x:o,y:s,crv:a}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:a,e:n,n:i,x:o,y:s}}const je="dpop-nonce",Ce=["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"],Ie=(e,t)=>new Promise(function(n,i){const o=new MessageChannel;o.port1.onmessage=function(e){e.data.error?i(new Error(e.data.error)):n(e.data),o.port1.close()},t.postMessage(e,[o.port2])}),Oe=(e,t,n)=>{const i=new AbortController;let o;return t.signal=i.signal,Promise.race([fetch(e,t),new Promise((e,t)=>{o=setTimeout(()=>{i.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})},Ue=async function(e,t,n,i,o,s){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:k;return o?(async(e,t,n,i,o,s,a,r,c,l)=>Ie({type:"refresh",auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:i,useFormData:a,useMrrt:r,skipTokenStorage:c,preserveRefreshToken:l},s))(e,t,n,i,a,o,s,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 Oe(e,t,n);return{ok:i.ok,json:await i.json(),headers:(o=i.headers,[...o].reduce((e,t)=>{let n=b(t,2),i=n[0],o=n[1];return e[i]=o,e},{}))};var o})(e,i,a)};async function Re(e,t,n,o,s,a,r,c,l,p,u,d){if(l){const t=await l.generateProof({url:e,method:s.method||"GET",nonce:await l.getNonce()});s.headers=Object.assign(Object.assign({},s.headers),{dpop:t})}let h,m=null;for(let i=0;i<3;i++)try{h=await Ue(e,n,o,s,a,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(l&&(_=w[je],_&&await l.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,o);if("use_dpop_nonce"===v){if(!l||!_||p)throw new $(_);return Re(e,t,n,o,s,a,r,c,l,!0,u,d)}throw new C(v||"request_error",i,y)}return y}async function Le(e,t,n){var o=e.baseUrl,s=e.timeout,a=e.audience,r=e.scope,c=e.auth0Client,l=e.useFormData,p=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&&p,g=m||f||v,y=Object.assign(Object.assign(Object.assign({},h),g&&a&&{audience:a}),g&&r&&{scope:r}),b=f||!l,w=b?JSON.stringify(y):G(y),x=(_=h.grant_type,Ce.includes(_));var _;return await Re("".concat(o,"/oauth/token"),s,a||j,r,{method:"POST",body:w,headers:{"Content-Type":b?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(B(c||P)))}},t,l,p,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[j]),Ne(i,t)},Me="@@auth0spajs@@",qe="@@user@@";class De{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Me,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],o=t[2],s=t[3];return new De({clientId:i,scope:s,audience:o},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(Me))}}class $e{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||A}async setIdToken(e,t,n){var i;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(i=this.keyManifest)||void 0===i?void 0:i.add(o))}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 o;let s=await this.cache.get(e.toKey()),a=e;if(!s){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(s=await this.cache.get(o),a=De.fromKey(o)),!s&&n&&"cache-only"!==i)return this.getEntryWithRefreshToken(e,t)}if(!s)return;const r=await this.nowProvider(),c=Math.floor(r/1e3);return s.expiresAt-t<c?s.body.refresh_token?this.modifiedCachedEntry(s,a):(await this.cache.remove(a.toKey()),void await(null===(o=this.keyManifest)||void 0===o?void 0:o.remove(a.toKey()))):s.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},Me,qe).toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const i=De.fromKey(t),o=new Set(i.scope&&i.scope.split(" ")),s=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=i.scope&&s.reduce((e,t)=>e&&o.has(t),!0);return i.prefix===Me&&i.clientId===e.clientId&&i.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(const i of t){const t=De.fromKey(i);if(t.prefix===Me&&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 o=new Set;for(const s of i){const i=De.fromKey(s);if(i.prefix===Me&&i.clientId===t&&i.audience===e){const e=await this.cache.get(s);(null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.refresh_token)&&o.add(e.body.refresh_token)}}return Array.from(o)}async updateEntry(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=await this.getCacheKeys();if(o)for(const s of o){if(De.fromKey(s).clientId!==n)continue;const o=await this.cache.get(s);if(!(null==o?void 0:o.body))continue;const a=o.body.refresh_token;a&&(i||a===e)&&(o.body.refresh_token=t,await this.cache.set(s,o))}}}class Fe{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 He=e=>"number"==typeof e,Ke=["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 Ve=Q&&Q.__assign||function(){return Ve=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ve.apply(this,arguments)};function Be(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function Ge(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 Be("Expires",e.expires?e.expires.toUTCString():"")+Be("Domain",e.domain)+Be("Path",e.path)+Be("Secure",e.secure)+Be("SameSite",e.sameSite)}(n)}(e,t,Ve({path:"/"},n))}var Ze=Ge,Xe=function(e,t){Ge(e,"",Ve(Ve({},t),{expires:-1}))};const Ye={get(e){const t=function(e){return function(e){for(var t={},n=e?e.split("; "):[],i=/(%[\dA-F]{2})+/gi,o=0;o<n.length;o++){var s=n[o].split("="),a=s.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[s[0].replace(i,decodeURIComponent)]=a.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),Ze(e,JSON.stringify(t),i)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Xe(e,n)}},Qe="_legacy_",et={get:e=>Ye.get(e)||Ye.get("".concat(Qe).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),Ze("".concat(Qe).concat(e),JSON.stringify(t),i),Ye.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Xe(e,n),Ye.remove(e,t),Ye.remove("".concat(Qe).concat(e),t)}},tt={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 nt;!function(e){e.Code="code",e.ConnectCode="connect_code"}(nt||(nt={}));class it{}var ot,st=function(e){return ot=ot||function(){var e=function(e){var t=atob(e);return t}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxhLGk9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihpLnB1c2goby52YWx1ZSksaS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoYT1yLnJldHVybigpLE9iamVjdChhKSE9PWEpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGl9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQsbyl7c3VwZXIodCksdGhpcy5lcnJvcj1lLHRoaXMuZXJyb3JfZGVzY3JpcHRpb249dCx0aGlzLmRhdGE9byxPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxyLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKGUpe2xldCB0PWUuZXJyb3Isbz1lLmVycm9yX2Rlc2NyaXB0aW9uO3JldHVybiBuZXcgcih0LG8pfX1jbGFzcyBvIGV4dGVuZHMgcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKCJtaXNzaW5nX3JlZnJlc2hfdG9rZW4iLCJNaXNzaW5nIFJlZnJlc2ggVG9rZW4gKGF1ZGllbmNlOiAnIi5jb25jYXQobihlLFsiZGVmYXVsdCJdKSwiJywgc2NvcGU6ICciKS5jb25jYXQobih0KSwiJykiKSksdGhpcy5hdWRpZW5jZT1lLHRoaXMuc2NvcGU9dCxPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxvLnByb3RvdHlwZSl9fWZ1bmN0aW9uIG4oZSl7cmV0dXJuIGUmJiEoYXJndW1lbnRzLmxlbmd0aD4xJiZ2b2lkIDAhPT1hcmd1bWVudHNbMV0/YXJndW1lbnRzWzFdOltdKS5pbmNsdWRlcyhlKT9lOiIifSJmdW5jdGlvbiI9PXR5cGVvZiBTdXBwcmVzc2VkRXJyb3ImJlN1cHByZXNzZWRFcnJvcjtjb25zdCBzPWU9Pnt2YXIgdD1lLmNsaWVudElkLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIG8gaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxvKSYmdC5pbmRleE9mKG8pPDAmJihyW29dPWVbb10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbj0wO2ZvcihvPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bjxvLmxlbmd0aDtuKyspdC5pbmRleE9mKG9bbl0pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLG9bbl0pJiYocltvW25dXT1lW29bbl1dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIodD0+dm9pZCAwIT09ZVt0XSkucmVkdWNlKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkse30pKShPYmplY3QuYXNzaWduKHtjbGllbnRfaWQ6dH0scikpKS50b1N0cmluZygpfTtsZXQgYT17fSxpPW51bGw7Y29uc3QgYz0oZSx0KT0+IiIuY29uY2F0KGUsInwiKS5jb25jYXQodCksbD0oZSx0KT0+dC5zdGFydHNXaXRoKCIiLmNvbmNhdChlLCJ8IikpLHU9KGUsdCk9PmFbYyhlLHQpXSxmPWU9PntPYmplY3QuZW50cmllcyhhKS5mb3JFYWNoKHI9PntsZXQgbz10KHIsMiksbj1vWzBdO29bMV09PT1lJiZkZWxldGUgYVtuXX0pfSxoPWU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKChlLHQpPT57clt0XT1lfSkscn0sZD1hc3luYyBlPT57bGV0IHIsbixpPWUuZGF0YSxmPWkudGltZW91dCxkPWkuYXV0aCxwPWkuZmV0Y2hVcmwseT1pLmZldGNoT3B0aW9ucyxnPWkudXNlRm9ybURhdGEsYj1pLnVzZU1ycnQsTz1pLnNraXBUb2tlblN0b3JhZ2Usaz1pLnByZXNlcnZlUmVmcmVzaFRva2VuLG09dChlLnBvcnRzLDEpWzBdLGo9e307Y29uc3Qgdj1kfHx7fSxfPXYuYXVkaWVuY2Usdz12LnNjb3BlO3RyeXtjb25zdCBlPWc/aCh5LmJvZHkpOkpTT04ucGFyc2UoeS5ib2R5KTtpZihlLnJlZnJlc2hfdG9rZW58fCJyZWZyZXNoX3Rva2VuIiE9PWUuZ3JhbnRfdHlwZSllLm1mYV90b2tlbiYmKG49dShfLHcpLCFuJiZiJiYobj1hLmxhdGVzdF9yZWZyZXNoX3Rva2VuKSk7ZWxzZXtpZihuPXUoXyx3KSwhbiYmYil7Y29uc3QgZT1hLmxhdGVzdF9yZWZyZXNoX3Rva2VuLHQ9KChlLHQpPT4hIU9iamVjdC5rZXlzKGEpLmZpbmQocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBvPWwodCxyKSxuPXIuc3BsaXQoInwiKVsxXS5zcGxpdCgiICIpLHM9ZS5zcGxpdCgiICIpLmV2ZXJ5KGU9Pm4uaW5jbHVkZXMoZSkpO3JldHVybiBvJiZzfX0pKSh3LF8pO2UmJiF0JiYobj1lKX1pZighbil0aHJvdyBuZXcgbyhfLHcpO3kuYm9keT1nP3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSl9bGV0IGksZDsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYoaT1uZXcgQWJvcnRDb250cm9sbGVyLHkuc2lnbmFsPWkuc2lnbmFsKTt0cnl7ZD1hd2FpdCBQcm9taXNlLnJhY2UoWyhQPWYsbmV3IFByb21pc2UoZT0+c2V0VGltZW91dChlLFApKSksZmV0Y2gocCxPYmplY3QuYXNzaWduKHt9LHkpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIG0ucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFkKXJldHVybiBpJiZpLmFib3J0KCksdm9pZCBtLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2lmKFU9ZC5oZWFkZXJzLGo9Wy4uLlVdLnJlZHVjZSgoZSxyKT0+e2xldCBvPXQociwyKSxuPW9bMF0scz1vWzFdO3JldHVybiBlW25dPXMsZX0se30pLHI9YXdhaXQgZC5qc29uKCksTylyZXR1cm4gZGVsZXRlIHIucmVmcmVzaF90b2tlbix2b2lkIG0ucG9zdE1lc3NhZ2Uoe29rOmQub2ssanNvbjpyLGhlYWRlcnM6an0pO3IucmVmcmVzaF90b2tlbj8oYiYmKGEubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLFM9bixNPXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhhKS5mb3JFYWNoKGU9PntsZXQgcj10KGUsMiksbz1yWzBdO3JbMV09PT1TJiYoYVtvXT1NKX0pKSwoKGUsdCxyKT0+e2FbYyh0LHIpXT1lfSkoci5yZWZyZXNoX3Rva2VuLF8sdyksZGVsZXRlIHIucmVmcmVzaF90b2tlbik6a3x8KChlLHQpPT57ZGVsZXRlIGFbYyhlLHQpXX0pKF8sdyksbS5wb3N0TWVzc2FnZSh7b2s6ZC5vayxqc29uOnIsaGVhZGVyczpqfSl9Y2F0Y2goZSl7bS5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9LGhlYWRlcnM6an0pfXZhciBTLE0sVSxQfSxwPWFzeW5jIGU9PntsZXQgcj1lLmRhdGEsbz1yLnRpbWVvdXQsbj1yLmF1dGgsaT1yLmZldGNoVXJsLGM9ci5mZXRjaE9wdGlvbnMsdT1yLnVzZUZvcm1EYXRhLGQ9dChlLnBvcnRzLDEpWzBdO2NvbnN0IHA9KG58fHt9KS5hdWRpZW5jZTt0cnl7Y29uc3QgZT0oZT0+e2NvbnN0IHI9bmV3IFNldDtyZXR1cm4gT2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChvPT57bGV0IG49dChvLDIpLHM9blswXSxhPW5bMV07bChlLHMpJiZyLmFkZChhKX0pLEFycmF5LmZyb20ocil9KShwKTtpZigwPT09ZS5sZW5ndGgpcmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7b2s6ITB9KTtjb25zdCByPXU/aChjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtmb3IoY29uc3QgdCBvZiBlKXtjb25zdCBlPXU/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3Rva2VuOnR9KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpO2xldCBuLGEsbCxoOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihuPW5ldyBBYm9ydENvbnRyb2xsZXIsYT1uLnNpZ25hbCk7dHJ5e2g9YXdhaXQgUHJvbWlzZS5yYWNlKFtuZXcgUHJvbWlzZShlPT57bD1zZXRUaW1lb3V0KGUsbyl9KSxmZXRjaChpLE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxjKSx7Ym9keTplLHNpZ25hbDphfSkpXSkuZmluYWxseSgoKT0+Y2xlYXJUaW1lb3V0KGwpKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBkLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighaClyZXR1cm4gbiYmbi5hYm9ydCgpLHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZighaC5vayl7bGV0IGU7dHJ5e2NvbnN0IHQ9SlNPTi5wYXJzZShhd2FpdCBoLnRleHQoKSk7ZT10LmVycm9yX2Rlc2NyaXB0aW9ufWNhdGNoKGUpe31yZXR1cm4gdm9pZCBkLnBvc3RNZXNzYWdlKHtlcnJvcjplfHwiSFRUUCBlcnJvciAiLmNvbmNhdChoLnN0YXR1cyl9KX1mKHQpfWQucG9zdE1lc3NhZ2Uoe29rOiEwfSl9Y2F0Y2goZSl7ZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfHwiVW5rbm93biBlcnJvciBkdXJpbmcgdG9rZW4gcmV2b2NhdGlvbiJ9KX19LHk9KGUsdCk9PntpZighaSlyZXR1cm4hMTt0cnl7Y29uc3Qgcj1uZXcgVVJMKGkpLm9yaWdpbixvPW5ldyBVUkwoZS5mZXRjaFVybCk7cmV0dXJuIG8ub3JpZ2luPT09ciYmby5wYXRobmFtZT09PXR9Y2F0Y2goZSl7cmV0dXJuITF9fTthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixlPT57Y29uc3Qgcj1lLmRhdGEsbz10KGUucG9ydHMsMSlbMF07aWYoISgidHlwZSJpbiByKXx8ImluaXQiIT09ci50eXBlKXJldHVybiJ0eXBlImluIHImJiJjbGVhciI9PT1yLnR5cGU/KGE9e30sdm9pZChudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMH0pKSk6InR5cGUiaW4gciYmInJldm9rZSI9PT1yLnR5cGU/eShyLCIvb2F1dGgvcmV2b2tlIik/dm9pZCBwKGUpOnZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ImludmFsaWRfZmV0Y2hfdXJsIixlcnJvcl9kZXNjcmlwdGlvbjoiVW5hdXRob3JpemVkIGZldGNoIFVSTCJ9LGhlYWRlcnM6e319KSk6dm9pZCgiZmV0Y2hVcmwiaW4gciYmeShyLCIvb2F1dGgvdG9rZW4iKT9kKGUpOm51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpO2lmKG51bGw9PT1pKXRyeXtuZXcgVVJMKHIuYWxsb3dlZEJhc2VVcmwpLGk9ci5hbGxvd2VkQmFzZVVybH1jYXRjaChlKXtyZXR1cm59fSl9KCk7Cgo="),t=e.indexOf("\n",10)+1,n=e.substring(t)+"",i=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(i)}(),new Worker(ot,e)};class at{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(Me,"::").concat(e)}}const rt="auth0.is.authenticated",ct={memory:()=>(new $e).enclosedCache,localstorage:()=>new We},lt=e=>ct[e],pt=e=>{const t=e.openUrl,n=e.onRedirect,o=i(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:!1===t||t?t:n})},ut={NONCE:"nonce",KEYPAIR:"keypair"};class dt{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(ut).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(ut.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(ut.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(ut.NONCE,this.buildKey(e))}findKeyPair(){return this.find(ut.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(ut.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(ut.KEYPAIR,this.clientId)}}class ht{constructor(e){this.storage=new dt(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,o=e.nonce,s=e.accessToken;const a=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(n);return async function(e,t,n,i,o,s){const a=null==e?void 0:e.privateKey,r=null==e?void 0:e.publicKey;if(!Ee(c=a)||"private"!==c.type)throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!Pe(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!==o&&"string"!=typeof o)throw new TypeError('"accessToken" must be a string or undefined');if(void 0!==s&&("object"!=typeof s||null===s||Array.isArray(s)))throw new TypeError('"additional" must be an object');const l=Object.assign(Object.create(null),s,{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:i,htu:t,ath:o?_e(await crypto.subtle.digest("SHA-256",be(o))):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=`${_e(be(JSON.stringify(e)))}.${_e(be(JSON.stringify(t)))}`;return`${i}.${_e(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return we(e.algorithm),{name:e.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return we(e.algorithm),{name:e.algorithm.name};case"Ed25519":return{name:e.algorithm.name}}throw new ke}(n),n,be(i)))}`}({alg:Se(a),typ:"dpop+jwt",jwk:await Ae(r)},l,a)}(t,a,i,o,s)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!Pe(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 ke("unsupported JWK kty")}return _e(await crypto.subtle.digest({name:"SHA-256"},be(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var mt;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(mt||(mt={}));class ft{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]:mt.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,o;"string"==typeof n?(i=this.config.dpopNonceId?mt.DPoP:mt.Bearer,o=n):(i=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,i),i===mt.DPoP&&await this.setDpopProofHeader(e,o)}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 $(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,i){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,i);const s=await this.config.fetch(o);return this.handleResponse(s,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 vt{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),o=null!==(t=n.headers.get("location"))&&void 0!==t?t:"",s=decodeURIComponent(o.split("/").pop()||"");return Object.assign(Object.assign({},i),{id:s,location:o})}async enrollmentVerify(e){const t=e,n=t.location;t.type;const o=i(t,["location","type"]),s=await this.myAccountFetcher.fetchWithAuth("".concat(n,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)},{scope:["create:me:authentication_methods"]});return this._handleResponse(s)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new gt({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new gt(t)}}class gt extends Error{constructor(e){let t=e.type,n=e.status,i=e.title,o=e.detail,s=e.validation_errors;super(o),this.name="MyAccountApiError",this.type=t,this.status=n,this.title=i,this.detail=o,this.validation_errors=s,Object.setPrototypeOf(this,gt.prototype)}}const yt={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}};var bt,wt;let xt;if("undefined"==typeof navigator||null===(bt=navigator.userAgent)||void 0===bt||null===(wt=bt.startsWith)||void 0===wt||!wt.call(bt,"Mozilla/5.0 ")){const e="v3.8.6";xt="".concat("oauth4webapi","/").concat(e)}function _t(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 kt="ERR_INVALID_ARG_VALUE",Tt="ERR_INVALID_ARG_TYPE";function St(e,t,n){const i=new TypeError(e,{cause:n});return Object.assign(i,{code:t}),i}const Et=Symbol(),Pt=Symbol(),At=Symbol(),jt=Symbol(),Ct=Symbol(),It=Symbol(),Ot=new TextEncoder,Ut=new TextDecoder;function Rt(e){return"string"==typeof e?Ot.encode(e):Ut.decode(e)}let Lt,Nt;if(Uint8Array.prototype.toBase64)Lt=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;Lt=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):Lt(e)}Nt=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw St("The input to be decoded is not correctly encoded.",kt,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 St("The input to be decoded is not correctly encoded.",kt,e)}};class Mt 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 qt 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 qt(e,{code:t,cause:n})}function Wt(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function $t(e){_t(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(null!=e?e:{});if(xt&&!t.has("user-agent")&&t.set("user-agent",xt),t.has("authorization"))throw St('"options.headers" must not include the "authorization" header name',kt);return t}function Jt(e,t){if(void 0!==t){if("function"==typeof t&&(t=t(e.href)),!(t instanceof AbortSignal))throw St('"options.signal" must return or be an instance of AbortSignal',Tt);return t}}function Ft(e){return e.includes("//")?e.replace("//","/"):e}function Ht(e,t,n,i,o){try{if("number"!=typeof e||!Number.isFinite(e))throw St("".concat(n," must be a number"),Tt,o);if(e>0)return;if(t){if(0!==e)throw St("".concat(n," must be a non-negative number"),kt,o);return}throw St("".concat(n," must be a positive number"),kt,o)}catch(e){if(i)throw Dt(e.message,i,o);throw e}}function Kt(e,t,n,i){try{if("string"!=typeof e)throw St("".concat(t," must be a string"),Tt,i);if(0===e.length)throw St("".concat(t," must not be empty"),kt,i)}catch(e){if(n)throw Dt(e.message,n,i);throw e}}function Vt(e){!function(e,t){if(wn(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),o=1;o<n;o++)i[o-1]=arguments[o];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,Kn,e)}(e,t)}(e,"application/json")}function Bt(){return zt(crypto.getRandomValues(new Uint8Array(32)))}function Gt(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 Mt("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 Mt("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 Mt("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 Mt("unsupported CryptoKey algorithm name",{cause:e})}}function Zt(e){const t=null==e?void 0:e[Pt];return"number"==typeof t&&Number.isFinite(t)?t:0}function Xt(e){const t=null==e?void 0:e[At];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Yt(){return Math.floor(Date.now()/1e3)}function Qt(e){if("object"!=typeof e||null===e)throw St('"as" must be an object',Tt);Kt(e.issuer,'"as.issuer"')}function en(e){if("object"!=typeof e||null===e)throw St('"client" must be an object',Tt);Kt(e.client_id,'"client.client_id"')}function tn(e){return Kt(e,'"clientSecret"'),(t,n,i,o)=>{i.set("client_id",n.client_id),i.set("client_secret",e)}}const nn=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function on(e,t){if(t&&"https:"!==e.protocol)throw Dt("only requests to HTTPS are allowed",Bn,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw Dt("only HTTP and HTTPS requests are allowed",Gn,e)}function sn(e,t,n,i){let o;if("string"!=typeof e||!(o=nn(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?Qn:ei,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return on(o,i),o}function an(e,t,n,i){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?sn(e.mtls_endpoint_aliases[t],t,n,i):sn(e[t],t,n,i)}class rn 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 cn 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=$n,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 ln 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=qn,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!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",un="("+pn+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',dn="("+pn+")\\s*=\\s*("+pn+")",hn=new RegExp("^[,\\s]*("+pn+")"),mn=new RegExp("^[,\\s]*"+un+"[,\\s]*(.*)"),fn=new RegExp("^[,\\s]*"+dn+"[,\\s]*(.*)"),vn=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function gn(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){ni(e),Vt(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 rn("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)"),Vn,e)}}function yn(e){if(!Un.has(e))throw St('"options.DPoP" is not a valid DPoPHandle',kt)}const bn=Symbol();function wn(e){var t;return null===(t=e.headers.get("content-type"))||void 0===t?void 0:t.split(";")[0]}async function xn(e,t,n,i,o){if(Qt(e),en(t),!_t(i,Response))throw St('"response" must be an instance of Response',Tt);if(An(i),200!==i.status)throw Dt('"response" is not a conform UserInfo Endpoint response (unexpected HTTP status code)',Vn,i);let s;if(ni(i),"application/jwt"===wn(i)){const n=await si(await i.text(),ai.bind(void 0,t.userinfo_signed_response_alg,e.userinfo_signing_alg_values_supported,void 0),Zt(t),Xt(t),null==o?void 0:o[It]).then(jn.bind(void 0,t.client_id)).then(In.bind(void 0,e)),a=n.claims,r=n.jwt;Sn.set(i,r),s=a}else{if(t.userinfo_signed_response_alg)throw Dt("JWT UserInfo Response expected",Jn,i);s=await pi(i)}if(Kt(s.sub,'"response" body "sub" property',Hn,{body:s}),n===bn);else if(Kt(n,'"expectedSubject"'),s.sub!==n)throw Dt('unexpected "response" body "sub" property value',Yn,{expected:n,body:s,attribute:"sub"});return s}async function _n(e,t,n,i,o,s,a){return await n(e,t,o,s),s.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[jt])||fetch)(i.href,{body:o,headers:Object.fromEntries(s.entries()),method:"POST",redirect:"manual",signal:Jt(i,null==a?void 0:a.signal)})}async function kn(e,t,n,i,o,s){var a;const r=an(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==s?void 0:s[Et]));o.set("grant_type",i);const c=$t(null==s?void 0:s.headers);c.set("accept","application/json"),void 0!==(null==s?void 0:s.DPoP)&&(yn(s.DPoP),await s.DPoP.addProof(r,c,"POST"));const l=await _n(e,t,n,r,o,c,s);return null==s||null===(a=s.DPoP)||void 0===a||a.cacheNonce(l,r),l}const Tn=new WeakMap,Sn=new WeakMap;function En(e){if(!e.id_token)return;const t=Tn.get(e);if(!t)throw St('"ref" was already garbage collected or did not resolve from the proper sources',kt);return t}async function Pn(e,t,n,i,o,s){if(Qt(e),en(t),!_t(n,Response))throw St('"response" must be an instance of Response',Tt);await gn(n,200,"Token Endpoint"),ni(n);const a=await pi(n);if(Kt(a.access_token,'"response" body "access_token" property',Hn,{body:a}),Kt(a.token_type,'"response" body "token_type" property',Hn,{body:a}),a.token_type=a.token_type.toLowerCase(),void 0!==a.expires_in){let e="number"!=typeof a.expires_in?parseFloat(a.expires_in):a.expires_in;Ht(e,!0,'"response" body "expires_in" property',Hn,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&Kt(a.refresh_token,'"response" body "refresh_token" property',Hn,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw Dt('"response" body "scope" property must be a string',Hn,{body:a});if(void 0!==a.id_token){Kt(a.id_token,'"response" body "id_token" property',Hn,{body:a});const s=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&s.push("auth_time"),void 0!==t.default_max_age&&(Ht(t.default_max_age,!0,'"client.default_max_age"'),s.push("auth_time")),null!=i&&i.length&&s.push(...i);const r=await si(a.id_token,ai.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Zt(t),Xt(t),o).then(Nn.bind(void 0,s)).then(On.bind(void 0,e)).then(Cn.bind(void 0,t.client_id)),c=r.claims,l=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',Xn,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw Dt('unexpected ID Token "azp" (authorized party) claim value',Xn,{expected:t.client_id,claims:c,claim:"azp"})}void 0!==c.auth_time&&Ht(c.auth_time,!0,'ID Token "auth_time" (authentication time)',Hn,{claims:c}),Sn.set(n,l),Tn.set(a,c)}if(void 0!==(null==s?void 0:s[a.token_type]))s[a.token_type](n,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new Mt("unsupported `token_type` value",{cause:{body:a}});return a}function An(e){let t;if(t=function(e){if(!_t(e,Response))throw St('"response" must be an instance of Response',Tt);const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let i=t;for(;i;){var o;let t=i.match(hn);const c=null===(o=t)||void 0===o?void 0:o[1].toLowerCase();if(!c)return;const l=i.substring(t[0].length);if(l&&!l.match(/^[\s,]/))return;const p=l.match(/^\s+(.*)$/),u=!!p;i=p?p[1]:void 0;const d={};let h;if(u)for(;i;){let n,o;if(t=i.match(mn)){var s=b(t,4);if(n=s[1],o=s[2],i=s[3],o.includes("\\"))try{o=JSON.parse('"'.concat(o,'"'))}catch(e){}d[n.toLowerCase()]=o}else{if(!(t=i.match(fn))){if(t=i.match(vn)){if(Object.keys(d).length)break;var a=b(t,3);h=a[1],i=a[2];break}return}var r=b(t,4);n=r[1],o=r[2],i=r[3],d[n.toLowerCase()]=o}}else i=l||void 0;const m={scheme:c,parameters:d};h&&(m.token68=h),n.push(m)}return n.length?n:void 0}(e))throw new ln("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?Cn(e,t):t}function Cn(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw Dt('unexpected JWT "aud" (audience) claim value',Xn,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw Dt('unexpected JWT "aud" (audience) claim value',Xn,{expected:e,claims:t.claims,claim:"aud"});return t}function In(e,t){return void 0!==t.claims.iss?On(e,t):t}function On(e,t){var n,i;const o=null!==(n=null===(i=e[di])||void 0===i?void 0:i.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw Dt('unexpected JWT "iss" (issuer) claim value',Xn,{expected:o,claims:t.claims,claim:"iss"});return t}const Un=new WeakSet,Rn=Symbol(),Ln={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(Ln[n],") claim missing"),Hn,{claims:t.claims});return t}const zn=Symbol(),Mn=Symbol(),qn="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Dn="OAUTH_RESPONSE_BODY_ERROR",Wn="OAUTH_UNSUPPORTED_OPERATION",$n="OAUTH_AUTHORIZATION_RESPONSE_ERROR",Jn="OAUTH_JWT_USERINFO_EXPECTED",Fn="OAUTH_PARSE_ERROR",Hn="OAUTH_INVALID_RESPONSE",Kn="OAUTH_RESPONSE_IS_NOT_JSON",Vn="OAUTH_RESPONSE_IS_NOT_CONFORM",Bn="OAUTH_HTTP_REQUEST_FORBIDDEN",Gn="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Zn="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Xn="OAUTH_JWT_CLAIM_COMPARISON_FAILED",Yn="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",Qn="OAUTH_MISSING_SERVER_METADATA",ei="OAUTH_INVALID_SERVER_METADATA";async function ti(e){if(!_t(e,Response))throw St('"response" must be an instance of Response',Tt);await gn(e,200,"Revocation Endpoint")}function ni(e){if(e.bodyUsed)throw St('"response" body has been used already',kt)}function ii(e){const t=e.algorithm;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new Mt("unsupported ".concat(t.name," modulusLength"),{cause:e})}function oi(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 Mt("unsupported ECDSA namedCurve",{cause:e})}}async function si(e,t,n,i,o){let s,a,r=e.split("."),c=r[0],l=r[1],p=r.length;if(5===p){if(void 0===o)throw new Mt("JWE decryption is not configured",{cause:e});var u=(e=await o(e)).split(".");c=u[0],l=u[1],p=u.length}if(3!==p)throw Dt("Invalid JWT",Hn,e);try{s=JSON.parse(Rt(zt(c)))}catch(e){throw Dt("failed to parse JWT Header body as base64url encoded JSON",Fn,e)}if(!Wt(s))throw Dt("JWT Header must be a top level object",Hn,e);if(t(s),void 0!==s.crit)throw new Mt('no JWT "crit" header parameter extensions are supported',{cause:{header:s}});try{a=JSON.parse(Rt(zt(l)))}catch(e){throw Dt("failed to parse JWT Payload body as base64url encoded JSON",Fn,e)}if(!Wt(a))throw Dt("JWT Payload must be a top level object",Hn,e);const d=Yt()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw Dt('unexpected JWT "exp" (expiration time) claim type',Hn,{claims:a});if(a.exp<=d-i)throw Dt('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Zn,{claims:a,now:d,tolerance:i,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw Dt('unexpected JWT "iat" (issued at) claim type',Hn,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw Dt('unexpected JWT "iss" (issuer) claim type',Hn,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw Dt('unexpected JWT "nbf" (not before) claim type',Hn,{claims:a});if(a.nbf>d+i)throw Dt('unexpected JWT "nbf" (not before) claim value',Zn,{claims:a,now:d,tolerance:i,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw Dt('unexpected JWT "aud" (audience) claim type',Hn,{claims:a});return{header:s,claims:a,jwt:e}}function ai(e,t,n,i){if(void 0===e)if(Array.isArray(t)){if(!t.includes(i.alg))throw Dt('unexpected JWT "alg" header parameter',Hn,{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',Hn,{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',Hn,{header:i,expected:e,reason:"client configuration"})}function ri(e,t){const n=e.getAll(t),i=n[0];if(n.length>1)throw Dt('"'.concat(t,'" parameter must be provided only once'),Hn);return i}const ci=Symbol(),li=Symbol();async function pi(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vt;try{t=await e.json()}catch(t){throw n(e),Dt('failed to parse "response" body as JSON',Fn,t)}if(!Wt(t))throw Dt('"response" body must be a top level object',Hn,{body:t});return t}const ui=Symbol(),di=Symbol(),hi=new TextEncoder,mi=new TextDecoder,fi=new TextDecoder("utf-8",{fatal:!0});function vi(){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),o=new Uint8Array(i);let s=0;for(const e of t)o.set(e,s),s+=e.length;return o}function gi(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 yi=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))},bi=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];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 s;null!==(s=t.constructor)&&void 0!==s&&s.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}("Key for the ".concat(e," algorithm must be "),t,...i)};class wi 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(wi,"code","ERR_JOSE_GENERIC");class xi extends wi{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(xi,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class _i extends wi{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(_i,"code","ERR_JWT_EXPIRED");class ki extends wi{constructor(){super(...arguments),f(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}f(ki,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Ti extends wi{constructor(){super(...arguments),f(this,"code","ERR_JOSE_NOT_SUPPORTED")}}f(Ti,"code","ERR_JOSE_NOT_SUPPORTED"),f(class extends wi{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 wi{constructor(){super(...arguments),f(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Si extends wi{constructor(){super(...arguments),f(this,"code","ERR_JWS_INVALID")}}f(Si,"code","ERR_JWS_INVALID");class Ei extends wi{constructor(){super(...arguments),f(this,"code","ERR_JWT_INVALID")}}f(Ei,"code","ERR_JWT_INVALID"),f(class extends wi{constructor(){super(...arguments),f(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Pi extends wi{constructor(){super(...arguments),f(this,"code","ERR_JWKS_INVALID")}}f(Pi,"code","ERR_JWKS_INVALID");class Ai extends wi{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 wi{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 Ci extends wi{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(Ci,"code","ERR_JWKS_TIMEOUT");class Ii extends wi{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(Ii,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Oi=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}};function Ui(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 Li(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64("string"==typeof e?e:mi.decode(e),{alphabet:"base64url"})}catch(e){throw new TypeError(Ri,{cause:e})}let t=e;if(t instanceof Uint8Array&&(t=mi.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError(Ri);t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Ui(t)}catch(e){throw new TypeError(Ri)}}function Ni(e){let t=e;return"string"==typeof t&&(t=hi.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 Mi(e){return zi(e)&&Array.isArray(e.keys)&&Array.from(e.keys).every(zi)}function qi(e,t,n){try{return Li(e)}catch(e){throw new n("Failed to base64url decode the ".concat(t))}}async function Di(e,t){var n,i,o,s;if("RSA"===t.kty&&"oth"in t&&void 0!==t.oth)throw new Ti('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');if(!e.kty.includes(t.kty))throw new Ti('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');const a=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,a,null!==(o=t.ext)&&void 0!==o?o:!r,null!==(s=t.key_ops)&&void 0!==s?s:e.usages[r?1:0])}function Wi(e){return g({__proto__:null},e)}const $i=e=>e[Symbol.toStringTag];const Ji=0,Fi=1,Hi=2,Ki=3;let Vi;const Bi={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function Gi(e,t,n){Vi||(Vi=new WeakMap);const i=Vi.get(e);return n&&(i?i[t]=n:Vi.set(e,{[t]:n})),null!=n?n:null==i?void 0:i[t]}const Zi=async(e,t,n)=>{var i;return null!==(i=Gi(e,n.alg))&&void 0!==i?i:Gi(e,n.alg,await Di(n,g(g({},t),{},{alg:n.alg})))};async function Xi(e,t,n){const i=function(e,t,n){const i=e.alg,o=e.secret,s="decrypt"===n||"sign"===n;if(o&&t instanceof Uint8Array)return[Ji,t];if(zi(t)){const a=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 a.kty)throw new TypeError(o?bi(i,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):bi(i,t,"CryptoKey","KeyObject","JSON Web Key"));if(!(o?"oct"===a.kty&&"string"==typeof a.k:"oct"!==a.kty&&(s?"AKP"===a.kty&&"string"==typeof a.priv||"string"==typeof a.d:void 0===a.d&&void 0===a.priv)))throw new TypeError(o?'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(s?"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 o;const i="encrypt"===n||"decrypt"===n?null===(o=e.ops)||void 0===o?void 0:o["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,a,n),[Ki,t,a]}if(!(e=>Oi(e)||(e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]))(e))(t))throw new TypeError(o?bi(i,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):bi(i,t,"CryptoKey","KeyObject","JSON Web Key"));if(o){if("secret"!==t.type)throw new TypeError("".concat($i(t),' instances for symmetric algorithms must be of type "secret"'))}else{if("secret"===t.type)throw new TypeError("".concat($i(t),' instances for asymmetric algorithms must not be of type "secret"'));const e=s?"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($i(t)," instances for asymmetric algorithm ").concat(i,' must be of type "').concat(e,'"'))}}return Oi(t)?[Fi,t]:[Hi,t]}(e,t,n);switch(i[0]){case Ji:case Fi:return i[1];case Ki:{const t=i[1],n=i[2];if("oct"===n.kty)return Li(n.k);if(!Object.isFrozen(t)){const e=t.key_ops;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}return Zi(t,n,e)}case Hi:{const t=i[1];return"secret"===t.type?t.export():"toCryptoKey"in t&&"function"==typeof t.toCryptoKey?((e,t)=>{var n,i,o;const s=Gi(e,t.alg);if(s)return s;const a="public"===e.type,r=t.usages[a?0:1],c=e.asymmetricKeyType,l=Bi[null===(n=e.asymmetricKeyDetails)||void 0===n?void 0:n.namedCurve],p=null!==(i=null===(o=t.resolve)||void 0===o?void 0:o.call(t,{crv:l,asymmetricKeyType:c}))&&void 0!==i?i:t.subtle;return Gi(e,t.alg,e.toCryptoKey(p,a,r))})(t,e):Zi(t,t.export({format:"jwk"}),e)}}}function Yi(e){const t={__proto__:null};for(const n in e)t[n]=g(g({},e[n]),{},{alg:n});return t}const Qi=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],eo=[[],["deriveBits"]],to=[[],[]];function no(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:"SHA-".concat(e)},usages:Qi,ops:["wrapKey","unwrapKey"]}}function io(){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 Ti('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:n}},usages:eo,ops:[void 0,"deriveBits"]}}function oo(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:to,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function so(){return{kty:["oct"],secret:!0,subtle:{name:"PBKDF2"},usages:to,ops:["deriveBits","deriveBits"]}}const ao=Yi({dir:{kty:["oct"],secret:!0,subtle:{name:"AES-GCM"},usages:to,ops:["encrypt","decrypt"]},"RSA-OAEP":no(1),"RSA-OAEP-256":no(256),"RSA-OAEP-384":no(384),"RSA-OAEP-512":no(512),"ECDH-ES":io(),"ECDH-ES+A128KW":io(),"ECDH-ES+A192KW":io(),"ECDH-ES+A256KW":io(),A128KW:oo(128),A192KW:oo(192),A256KW:oo(256),A128GCMKW:oo(128,!0),A192GCMKW:oo(192,!0),A256GCMKW:oo(256,!0),"PBES2-HS256+A128KW":so(),"PBES2-HS384+A192KW":so(),"PBES2-HS512+A256KW":so()}),ro=["encrypt","decrypt"];function co(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:to,ops:ro,cekBits:e,ivBits:t?128:96,cbc:t}}Yi({A128GCM:co(128),A192GCM:co(192),A256GCM:co(256),"A128CBC-HS256":co(256,!0),"A192CBC-HS384":co(384,!0),"A256CBC-HS512":co(512,!0)});const lo={__proto__:null,b64:!0};function po(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 uo(e,t,n,i,o){if(void 0!==o.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 s=void 0===n?t:g(g({__proto__:null},n),t);for(const t of i.crit){if(!(t in s))throw new Ti('Extension Header Parameter "'.concat(t,'" is not recognized'));if(!Object.hasOwn(o,t)||void 0===o[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(s[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 ho(e,t){if(t.includes("b64")){const t=e.b64;if("boolean"!=typeof t)throw new Si('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}var mo,fo;let vo,go;if("undefined"==typeof navigator||null===(mo=navigator.userAgent)||void 0===mo||null===(fo=mo.startsWith)||void 0===fo||!fo.call(mo,"Mozilla/5.0 ")){const e="v6.8.4";go="".concat("openid-client","/").concat(e),vo={"user-agent":go}}const yo=e=>bo.get(e);let bo,wo;function xo(e){return void 0!==e?tn(e):(wo||(wo=new WeakMap),(e,t,n,i)=>{let o;return(o=wo.get(t))||(function(e,t){if("string"!=typeof e)throw Eo("".concat(t," must be a string"),So);if(0===e.length)throw Eo("".concat(t," must not be empty"),To)}(t.client_secret,'"metadata.client_secret"'),o=tn(t.client_secret),wo.set(t,o)),o(e,t,n,i)})}const _o=bn,ko=jt,To="ERR_INVALID_ARG_VALUE",So="ERR_INVALID_ARG_TYPE";function Eo(e,t,n){const i=new TypeError(e,{cause:n});return Object.assign(i,{code:t}),i}class Po 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 Ao(e,t,n){return new Po(e,{cause:t,code:n})}function jo(e){if(e instanceof TypeError||e instanceof Po||e instanceof rn||e instanceof cn||e instanceof ln)throw e;if(e instanceof qt)switch(e.code){case Bn:throw Ao("only requests to HTTPS are allowed",e,e.code);case Gn:throw Ao("only requests to HTTP or HTTPS are allowed",e,e.code);case Vn:throw Ao("unexpected HTTP response status code",e.cause,e.code);case Kn:throw Ao("unexpected response content-type",e.cause,e.code);case Fn:throw Ao("parsing error occured",e,e.code);case Hn:throw Ao("invalid response encountered",e,e.code);case Xn:throw Ao("unexpected JWT claim value encountered",e,e.code);case Yn:throw Ao("unexpected JSON attribute value encountered",e,e.code);case Zn:throw Ao("JWT timestamp claim value failed validation",e,e.code);default:throw Ao(e.message,e,e.code)}if(e instanceof Mt)throw Ao("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Ao("runtime operation error",e,Wn);case"NotSupportedError":throw Ao("runtime unsupported operation",e,Wn);case"TimeoutError":throw Ao("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Ao("operation aborted",e,"OAUTH_ABORT")}throw new Po("something went wrong",{cause:e})}new TextDecoder;const Co=Symbol();class Io{constructor(e,t,n,i){var o,s,a,r,c;if("string"!=typeof t||!t.length)throw Eo('"clientId" must be a non-empty string',So);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null===(o=n)||void 0===o?void 0:o.client_id)&&t!==n.client_id)throw Eo('"clientId" and "metadata.client_id" must be the same',To);const l=g(g({},structuredClone(n)),{},{client_id:t});let p;l[Pt]=null!==(s=null===(a=n)||void 0===a?void 0:a[Pt])&&void 0!==s?s:0,l[At]=null!==(r=null===(c=n)||void 0===c?void 0:c[At])&&void 0!==r?r:30,p=i||("string"==typeof l.client_secret&&l.client_secret.length?xo(l.client_secret):(e,t,n,i)=>{n.set("client_id",t.client_id)});let u=Object.freeze(l);const d=structuredClone(e);Co in e&&(d[di]=t=>{let n=t.claims.tid;return e.issuer.replace("{tenantid}",n)});let h=Object.freeze(d);bo||(bo=new WeakMap),bo.set(this,{__proto__:null,as:h,c:u,auth:p,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(yo(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(yo(this).c)}get timeout(){return yo(this).timeout}set timeout(e){yo(this).timeout=e}get[ko](){return yo(this).fetch}set[ko](e){yo(this).fetch=e}}function Oo(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 En(this)}catch(e){return}}}}}(e))}async function Uo(e,t,n){var i;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=null===(i=e.headers.get("retry-after"))||void 0===i?void 0:i.trim();if(void 0===s)return;let a;if(/^\d+$/.test(s))a=parseInt(s,10);else{const e=new Date(s);if(Number.isFinite(e.getTime())){const t=new Date,n=e.getTime()-t.getTime();n>0&&(a=Math.ceil(n/1e3))}}if(o&&!Number.isFinite(a))throw new qt("invalid Retry-After header value",{cause:e});a>t&&await Ro(a-t,n)}function Ro(e,t){return new Promise((n,i)=>{const o=e=>{try{t.throwIfAborted()}catch(e){return void i(e)}if(e<=0)return void n();const s=Math.min(e,5);setTimeout(()=>o(e-s),1e3*s)};o(e)})}async function Lo(e,t){Jo(e);const n=yo(e),i=n.as,o=n.c,s=n.auth,a=n.fetch,r=n.tlsOnly,c=n.timeout;return async function(e,t,n,i,o){Qt(e),en(t);const s=an(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[Et])),a=new URLSearchParams(i);a.set("client_id",t.client_id);const r=$t(null==o?void 0:o.headers);return r.set("accept","application/json"),_n(e,t,n,s,a,r,o)}(i,o,s,t,{[jt]:a,[Et]:!r,headers:new Headers(vo),signal:Fo(c)}).then(e=>async function(e,t,n){if(Qt(e),en(t),!_t(n,Response))throw St('"response" must be an instance of Response',Tt);await gn(n,200,"Backchannel Authentication Endpoint"),ni(n);const i=await pi(n);Kt(i.auth_req_id,'"response" body "auth_req_id" property',Hn,{body:i});let o="number"!=typeof i.expires_in?parseFloat(i.expires_in):i.expires_in;return Ht(o,!0,'"response" body "expires_in" property',Hn,{body:i}),i.expires_in=o,void 0!==i.interval&&Ht(i.interval,!1,'"response" body "interval" property',Hn,{body:i}),i}(i,o,e)).catch(jo)}async function No(e,t,n,i){var o,s;Jo(e),n=new URLSearchParams(n);let a=null!==(o=t.interval)&&void 0!==o?o:5;const r=null!==(s=null==i?void 0:i.signal)&&void 0!==s?s:AbortSignal.timeout(1e3*t.expires_in);try{await Ro(a,r)}catch(e){jo(e)}const c=yo(e),l=c.as,p=c.c,u=c.auth,d=c.fetch,h=c.tlsOnly,m=c.nonRepudiation,f=c.timeout,v=c.decrypt,y=(o,s)=>No(e,g(g({},t),{},{interval:o}),n,g(g({},i),{},{signal:r,flag:s})),b=function(e,t){const n=Fo(t);if(!n)return{signal:e,cleanup(){}};const i=new AbortController,o=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",o,{once:!0}),n.addEventListener("abort",o,{once:!0})),{signal:i.signal,cleanup(){e.removeEventListener("abort",o),n.removeEventListener("abort",o)}}}(r,f),w=await async function(e,t,n,i,o){Qt(e),en(t),Kt(i,'"authReqId"');const s=new URLSearchParams(null==o?void 0:o.additionalParameters);return s.set("auth_req_id",i),kn(e,t,n,"urn:openid:params:grant-type:ciba",s,o)}(l,p,u,t.auth_req_id,{[jt]:d,[Et]:!h,additionalParameters:n,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:b.signal}).catch(jo).finally(b.cleanup);var x;if(503===w.status&&w.headers.has("retry-after"))return await Uo(w,a,r,!0),await(null===(x=w.body)||void 0===x?void 0:x.cancel()),y(a);const _=async function(e,t,n,i){return Pn(e,t,n,void 0,null==i?void 0:i[It],null==i?void 0:i.recognizedTokenTypes)}(l,p,w,{[It]:v});let k;try{k=await _}catch(e){if(Ko(e,i))return y(a,Vo);if(e instanceof rn)switch(e.error){case"slow_down":a+=5;case"authorization_pending":return await Uo(e.response,a,r),y(a)}jo(e)}return k.id_token&&await(null==m?void 0:m(w)),Oo(k),k}function zo(e){yo(e).tlsOnly=!1}async function Mo(e,t,n,i,o){if(Jo(e),!((null==o?void 0:o.flag)===Vo||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw Eo('"currentUrl" must be an instance of URL, or Request',So);let s,a;const r=yo(e),c=r.as,l=r.c,p=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==o?void 0:o.flag)===Vo)s=o.authResponse,a=o.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 St("form_post responses are expected to use the POST method",kt,{cause:e});if("application/x-www-form-urlencoded"!==wn(e))throw St("form_post responses are expected to use the application/x-www-form-urlencoded content-type",kt,{cause:e});return async function(e){if(e.bodyUsed)throw St("form_post Request instances must contain a readable body",kt,{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 Eo("unexpected Request HTTP method",To)}}switch(a=function(e){return(e=new URL(e)).search="",e.hash="",e.href}(t),!0){case!!h:s=await h(t,null==n?void 0:n.expectedState);break;case!!m:s=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{s=function(e,t,n,i){if(Qt(e),en(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw St('"parameters" must be an instance of URLSearchParams, or URL',Tt);if(ri(n,"response"))throw Dt('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Hn,{parameters:n});const o=ri(n,"iss"),s=ri(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw Dt('response parameter "iss" (issuer) missing',Hn,{parameters:n});if(o&&o!==e.issuer)throw Dt('unexpected "iss" (issuer) response parameter value',Hn,{expected:e.issuer,parameters:n});switch(i){case void 0:case li:if(void 0!==s)throw Dt('unexpected "state" response parameter encountered',Hn,{expected:void 0,parameters:n});break;case ci:break;default:if(Kt(i,'"expectedState" argument'),s!==i)throw Dt(void 0===s?'response parameter "state" missing':'unexpected "state" response parameter value',Hn,{expected:i,parameters:n})}if(ri(n,"error"))throw new cn("authorization response from the server is an error",{cause:n});const a=ri(n,"id_token"),r=ri(n,"token");if(void 0!==a||void 0!==r)throw new Mt("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),Un.add(c),c;var c}(c,l,t.searchParams,null==n?void 0:n.expectedState)}catch(e){jo(e)}}}const _=await async function(e,t,n,i,o,s,a){if(Qt(e),en(t),!Un.has(i))throw St('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',kt);Kt(o,'"redirectUri"');const r=ri(i,"code");if(!r)throw Dt('no authorization code in "callbackParameters"',Hn);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",r),s!==Rn&&(Kt(s,'"codeVerifier"'),c.set("code_verifier",s)),kn(e,t,n,"authorization_code",c,a)}(c,l,p,s,a,(null==n?void 0:n.pkceCodeVerifier)||Rn,{additionalParameters:i,[jt]:u,[Et]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(vo),signal:Fo(v)}).catch(jo);"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,o,s,a){const r=[];switch(i){case void 0:i=zn;break;case zn:break;default:Kt(i,'"expectedNonce" argument'),r.push("nonce")}switch(null!=o||(o=t.default_max_age),o){case void 0:o=Mn;break;case Mn:break;default:Ht(o,!0,'"maxAge" argument'),r.push("auth_time")}const c=await Pn(e,t,n,r,s,a);Kt(c.id_token,'"response" body "id_token" property',Hn,{body:c});const l=En(c);if(o!==Mn){const e=Yt()+Zt(t),n=Xt(t);if(l.auth_time+o<e-n)throw Dt("too much time has elapsed since the last End-User authentication",Zn,{claims:l,now:e,tolerance:n,claim:"auth_time"})}if(i===zn){if(void 0!==l.nonce)throw Dt('unexpected ID Token "nonce" claim value',Xn,{expected:void 0,claims:l,claim:"nonce"})}else if(l.nonce!==i)throw Dt('unexpected ID Token "nonce" claim value',Xn,{expected:i,claims:l,claim:"nonce"});return c}(e,t,n,i.expectedNonce,i.maxAge,i[It],i.recognizedTokenTypes):async function(e,t,n,i,o){const s=await Pn(e,t,n,void 0,i,o),a=En(s);if(a){if(void 0!==t.default_max_age){Ht(t.default_max_age,!0,'"client.default_max_age"');const e=Yt()+Zt(t),n=Xt(t);if(a.auth_time+t.default_max_age<e-n)throw Dt("too much time has elapsed since the last End-User authentication",Zn,{claims:a,now:e,tolerance:n,claim:"auth_time"})}if(void 0!==a.nonce)throw Dt('unexpected ID Token "nonce" claim value',Xn,{expected:void 0,claims:a,claim:"nonce"})}return s}(e,t,n,null==i?void 0:i[It],null==i?void 0:i.recognizedTokenTypes)}(c,l,_,{expectedNonce:null==n?void 0:n.expectedNonce,maxAge:null==n?void 0:n.maxAge,requireIdToken:null==n?void 0:n.idTokenExpected,[It]:y});let T;try{T=await k}catch(t){if(Ko(t,o))return Mo(e,void 0,n,i,g(g({},o),{},{flag:Vo,authResponse:s,redirectUri:a}));jo(t)}return T.id_token&&await(null==f?void 0:f(_)),Oo(T),T}async function qo(e,t,n,i){Jo(e),n=new URLSearchParams(n);const o=yo(e),s=o.as,a=o.c,r=o.auth,c=o.fetch,l=o.tlsOnly,p=o.nonRepudiation,u=o.timeout,d=o.decrypt,h=await async function(e,t,n,i,o){Qt(e),en(t),Kt(i,'"refreshToken"');const s=new URLSearchParams(null==o?void 0:o.additionalParameters);return s.set("refresh_token",i),kn(e,t,n,"refresh_token",s,o)}(s,a,r,t,{[jt]:c,[Et]:!l,additionalParameters:n,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:Fo(u)}).catch(jo),m=async function(e,t,n,i){return Pn(e,t,n,void 0,null==i?void 0:i[It],null==i?void 0:i.recognizedTokenTypes)}(s,a,h,{[It]:d});let f;try{f=await m}catch(o){if(Ko(o,i))return qo(e,t,n,g(g({},i),{},{flag:Vo}));jo(o)}return f.id_token&&await(null==p?void 0:p(h)),Oo(f),f}async function Do(e,t,n){Jo(e),t=new URLSearchParams(t);const i=yo(e),o=i.as,s=i.c,a=i.auth,r=i.fetch,c=i.tlsOnly,l=i.timeout,p=await async function(e,t,n,i,o){return Qt(e),en(t),kn(e,t,n,"client_credentials",new URLSearchParams(i),o)}(o,s,a,t,{[jt]:r,[Et]:!c,DPoP:null==n?void 0:n.DPoP,headers:new Headers(vo),signal:Fo(l)}).catch(jo),u=async function(e,t,n){return Pn(e,t,n,void 0,void 0,void 0)}(o,s,p);let d;try{d=await u}catch(i){if(Ko(i,n))return Do(e,t,g(g({},n),{},{flag:Vo}));jo(i)}return Oo(d),d}function Wo(e,t){Jo(e);const n=yo(e),i=n.as,o=n.c,s=n.tlsOnly,a=n.hybrid,r=n.jarm,c=n.implicit,l=an(i,"authorization_endpoint",!1,s);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",a?"code id_token":c?"id_token":"code"),c&&!t.has("nonce"))throw Eo("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",To);r&&t.set("response_mode","jwt")}for(const e of t.entries()){var p=b(e,2);const t=p[0],n=p[1];l.searchParams.append(t,n)}return l}async function $o(e,t,n){Jo(e);const i=Wo(e,t),o=yo(e),s=o.as,a=o.c,r=o.auth,c=o.fetch,l=o.tlsOnly,p=o.timeout,u=await async function(e,t,n,i,o){var s;Qt(e),en(t);const a=an(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[Et])),r=new URLSearchParams(i);r.set("client_id",t.client_id);const c=$t(null==o?void 0:o.headers);c.set("accept","application/json"),void 0!==(null==o?void 0:o.DPoP)&&(yn(o.DPoP),await o.DPoP.addProof(a,c,"POST"));const l=await _n(e,t,n,a,r,c,o);return null==o||null===(s=o.DPoP)||void 0===s||s.cacheNonce(l,a),l}(s,a,r,i.searchParams,{[jt]:c,[Et]:!l,DPoP:null==n?void 0:n.DPoP,headers:new Headers(vo),signal:Fo(p)}).catch(jo),d=async function(e,t,n){if(Qt(e),en(t),!_t(n,Response))throw St('"response" must be an instance of Response',Tt);await gn(n,201,"Pushed Authorization Request Endpoint"),ni(n);const i=await pi(n);Kt(i.request_uri,'"response" body "request_uri" property',Hn,{body:i});let o="number"!=typeof i.expires_in?parseFloat(i.expires_in):i.expires_in;return Ht(o,!0,'"response" body "expires_in" property',Hn,{body:i}),i.expires_in=o,i}(s,a,u);let h;try{h=await d}catch(i){if(Ko(i,n))return $o(e,t,g(g({},n),{},{flag:Vo}));jo(i)}return Wo(e,{request_uri:h.request_uri})}function Jo(e){if(!(e instanceof Io))throw Eo('"config" must be an instance of Configuration',So);if(Object.getPrototypeOf(e)!==Io.prototype)throw Eo("subclassing Configuration is not allowed",To)}function Fo(e){return e?AbortSignal.timeout(1e3*e):void 0}async function Ho(e,t,n,i){Jo(e);const o=yo(e),s=o.as,a=o.c,r=o.fetch,c=o.tlsOnly,l=o.nonRepudiation,p=o.timeout,u=o.decrypt,d=await async function(e,t,n,i){Qt(e),en(t);const o=an(e,"userinfo_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[Et])),s=$t(null==i?void 0:i.headers);return t.userinfo_signed_response_alg?s.set("accept","application/jwt"):(s.set("accept","application/json"),s.append("accept","application/jwt")),async function(e,t,n,i,o,s){var a;if(Kt(e,'"accessToken"'),!(n instanceof URL))throw St('"url" must be an instance of URL',Tt);on(n,!0!==(null==s?void 0:s[Et])),i=$t(i),null!=s&&s.DPoP&&(yn(s.DPoP),await s.DPoP.addProof(n,i,"GET".toUpperCase(),e)),i.set("authorization","".concat(i.has("dpop")?"DPoP":"Bearer"," ").concat(e));const r=await((null==s?void 0:s[jt])||fetch)(n.href,{duplex:_t(null,ReadableStream)?"half":void 0,body:null,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:Jt(n,null==s?void 0:s.signal)});return null==s||null===(a=s.DPoP)||void 0===a||a.cacheNonce(r,n),r}(n,0,o,s,0,g(g({},i),{},{[Pt]:Zt(t)}))}(s,a,t,{[jt]:r,[Et]:!c,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:Fo(p)}).catch(jo);let h,m=xn(s,a,n,d,{[It]:u});try{h=await m}catch(o){if(Ko(o,i))return Ho(e,t,n,g(g({},i),{},{flag:Vo}));jo(o)}return"application/jwt"===wn(d)&&await(null==l?void 0:l(d)),h}function Ko(e,t){return!(null==t||!t.DPoP||t.flag===Vo)&&function(e){if(e instanceof ln){const t=e.cause,n=t[0];return 1===t.length&&"dpop"===n.scheme&&"use_dpop_nonce"===n.parameters.error}return e instanceof rn&&"use_dpop_nonce"===e.error}(e)}Object.freeze(Io.prototype);const Vo=Symbol();async function Bo(e,t,n,i){Jo(e);const o=yo(e),s=o.as,a=o.c,r=o.auth,c=o.fetch,l=o.tlsOnly,p=o.timeout,u=o.decrypt,d=o.nonRepudiation,h=await async function(e,t,n,i,o,s){return Qt(e),en(t),Kt(i,'"grantType"'),kn(e,t,n,i,new URLSearchParams(o),s)}(s,a,r,t,new URLSearchParams(n),{[jt]:c,[Et]:!l,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:Fo(p)}).catch(jo);let m;"urn:ietf:params:oauth:grant-type:token-exchange"===t&&(m={n_a:()=>{}});const f=async function(e,t,n,i){return Pn(e,t,n,void 0,null==i?void 0:i[It],null==i?void 0:i.recognizedTokenTypes)}(s,a,h,{[It]:u,recognizedTokenTypes:m});let v;try{v=await f}catch(o){if(Ko(o,i))return Bo(e,t,n,g(g({},i),{},{flag:Vo}));jo(o)}return v.id_token&&await(null==d?void 0:d(h)),Oo(v),v}async function Go(e,t,n){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[n]):(function(e,t,n){var i;const o=e.algorithm;if(o.name!==t.name)throw yi(t.name);if(t.hash&&(null===(i=o.hash)||void 0===i?void 0:i.name)!==t.hash)throw yi(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw yi(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&o.length!==t.length)throw yi(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 Zo=[["verify"],["sign"]];function Xo(e){const t={name:"HMAC",hash:"SHA-".concat(e)};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:Zo}}function Yo(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:Zo,minRsaBits:2048}}function Qo(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:"SHA-".concat(t)},usages:Zo}}function es(){const e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:Zo}}function ts(e){const t={name:"ML-DSA-".concat(e)};return{kty:["AKP"],subtle:t,signing:t,usages:Zo}}const ns=Yi({HS256:Xo(256),HS384:Xo(384),HS512:Xo(512),RS256:Yo(256),RS384:Yo(384),RS512:Yo(512),PS256:Yo(256,32),PS384:Yo(384,48),PS512:Yo(512,64),ES256:Qo("P-256",256),ES384:Qo("P-384",384),ES512:Qo("P-521",512),EdDSA:es(),Ed25519:es(),"ML-DSA-44":ts(44),"ML-DSA-65":ts(65),"ML-DSA-87":ts(87)});function is(e){const t="string"==typeof e?ns[e]:void 0;if(!t)throw new Ti("alg ".concat(e," is not supported either by JOSE or your javascript runtime"));return t}const os=e=>Math.floor(e.getTime()/1e3),ss={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},as=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,rs="check_failed";function cs(){throw new TypeError("Invalid time period format")}function ls(e){"string"!=typeof e&&cs();const t=as.exec(e);(!t||t[4]&&t[1])&&cs();const n=parseFloat(t[2]),i=Math.round(n*ss[t[3][0].toLowerCase()]);return Number.isFinite(i)||cs(),"-"===t[1]||"ago"===t[4]?-i:i}function ps(e,t){if(!Number.isFinite(t))throw new TypeError("Invalid ".concat(e," input"));return t}function us(e,t){if("string"!=typeof t)throw new TypeError('"'.concat(e,'" claim must be a string'))}function ds(e,t){return"number"==typeof e?ps(t,e):e instanceof Date?ps(t,os(e)):os(new Date)+ls(e)}const hs=e=>{const t=e.toLowerCase();return e.includes("/")?t:"application/".concat(t)};function ms(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 xi('"'.concat(t,'" claim must be a number'),e,t,"invalid");return i}}function fs(e,t){throw new xi('unexpected "'.concat(t,'" claim value'),e,t,rs)}function vs(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{n=JSON.parse(fi.decode(t))}catch(e){}if(!zi(n))throw new Ei("JWT Claims Set must be a top-level JSON object");const o=i.typ;if(void 0!==o&&("string"!=typeof e.typ||hs(e.typ)!==hs(o)))throw new xi('unexpected "typ" JWT header value',n,"typ",rs);const s=i.requiredClaims,a=void 0===s?[]:s,r=i.issuer,c=i.subject,l=i.audience,p=i.maxTokenAge,u=[...a];void 0!==p&&u.push("iat"),void 0!==l&&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 xi('missing required "'.concat(e,'" claim'),n,e,"missing");var d,h;void 0===r||(Array.isArray(r)?r:[r]).includes(n.iss)||fs(n,"iss"),void 0!==c&&n.sub!==c&&fs(n,"sub"),void 0===l||(h="string"==typeof l?[l]:l,"string"==typeof(d=n.aud)?h.includes(d):Array.isArray(d)&&h.some(e=>d.includes(e)))||fs(n,"aud");const m=i.clockTolerance;let f=0;if("string"==typeof m)f=ls(m);else if(void 0!==m){if("number"!=typeof m)throw new TypeError("Invalid clockTolerance option type");f=m}ps("clockTolerance option",f);const v=i.currentDate,g=ps("currentDate option",os(void 0===v?new Date:v)),y=ms(n,"iat",void 0!==p),b=ms(n,"nbf");if(void 0!==b&&b>g+f)throw new xi('"nbf" claim timestamp check failed',n,"nbf",rs);const w=ms(n,"exp");if(void 0!==w&&w<=g-f)throw new _i('"exp" claim timestamp check failed',n,"exp",rs);if(void 0!==p){const e=g-y;if(e-f>ps("maxTokenAge option","number"==typeof p?p:ls(p)))throw new _i('"iat" claim timestamp check failed (too far in the past)',n,"iat",rs);if(e<-f)throw new xi('"iat" claim timestamp check failed (it should be in the past)',n,"iat",rs)}return n}let gs;function ys(e){return gs.get(e)}const bs=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");(gs||(gs=new WeakMap)).set(this,structuredClone(e))}setIssuer(e){return us("iss",e),ys(this).iss=e,this}setSubject(e){return us("sub",e),ys(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),ys(this).aud=e,this}setJti(e){return us("jti",e),ys(this).jti=e,this}setNotBefore(e){return ys(this).nbf=ds(e,"setNotBefore"),this}setExpirationTime(e){return ys(this).exp=ds(e,"setExpirationTime"),this}setIssuedAt(e){return ys(this).iat=void 0===e?os(new Date):"string"==typeof e?ps("setIssuedAt",os(new Date)+ls(e)):ds(e,"setIssuedAt"),this}};var ws=new WeakMap;class xs extends bs{constructor(){super(...arguments),d(this,ws,void 0)}setProtectedHeader(e){return function(e){if(void 0!==e)throw new TypeError("".concat("setProtectedHeader"," can only be called once"))}(u(ws,this)),h(ws,this,e),this}async sign(e,t){return async function(e,t,n,i,o){const s=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]}(Si,e);return[t[0],Ni(t[1])]}(t),2),a=s[0],r=s[1];if(!a)throw new Si("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')}(Si,e),ho(e,uo(Si,lo,n,e,t))})(a,a,n)||o();const c=function(e){const t=e.alg;if("string"!=typeof t||!t)throw new Si('JWS "alg" (Algorithm) Header Parameter missing or invalid');return is(t)}(a),l=Ni(e),p=await async function(e,t,n,i){const o=vi(gi(e),gi("."),t),s=await Xi(n,i,"sign");return Ni(await async function(e,t,n){const i=await Go(e,t,"sign"),o=await crypto.subtle.sign(e.signing,i,n);return new Uint8Array(o)}(n,s,o))}(r,gi(l),c,i);return"".concat(r,".").concat(l,".").concat(p)}(function(e){const t=ys(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 hi.encode(JSON.stringify(t))}(this),u(ws,this),null==t?void 0:t.crit,e,()=>{throw new Ei("JWTs MUST NOT use unencoded payload")})}}const _s='"alg" (Algorithm)';function ks(){throw new Ti("Invalid or unsupported ".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:'JWK "alg" (Algorithm) Parameter'," value"))}const Ts=(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},Ss=e=>{const t=e.data[e.pos++];if(void 0===t)throw new Error("Unexpected end of ASN.1 input");return t},Es=e=>{const t=Ss(e);if(128&t){const n=127&t;let i=0;for(let t=0;t<n;t++)i=i<<8|Ss(e);return i}return t},Ps=(e,t,n)=>{if(Ss(e)!==t)throw new Error(n)},As=(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},js=e=>{const t=(e=>{Ps(e,6,"Expected algorithm OID");const t=Es(e);return As(e,t)})(e);if(Ts(t,[43,101,110]))return"X25519";if(!Ts(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Ps(e,6,"Expected curve OID");const n=Es(e),i=As(e,n);if(Ts(i,[42,134,72,206,61,3,1,7]))return"P-256";if(Ts(i,[43,129,4,0,34]))return"P-384";if(Ts(i,[43,129,4,0,35]))return"P-521";throw new Error("Unsupported named curve")};async function Cs(e,t,n){const i=e.get(t)||e.set(t,{}).get(t),o=n.alg;if(void 0===i[o]){const e=await Di(n,g(g({},t),{},{alg:o,ext:!0}));if("public"!==e.type)throw new Pi("JSON Web Key Set members must be public keys");i[o]=e}return i[o]}function Is(e){let t;try{t=structuredClone(e)}catch(e){}if(!Mi(t))throw new Pi("JSON Web Key Set malformed");const n=new WeakMap;return Object.defineProperty(async(e,i)=>{const o=g(g({},e),null==i?void 0:i.header),s=o.alg,a=o.kid,r="string"==typeof s?ns[s]:void 0;if(!r||r.secret)throw new Ti('Unsupported "alg" value for a JSON Web Key Set');const c=t.keys.filter(e=>function(e,t,n,i){const o=Wi(e),s=o.kty,a=o.key_ops,r=o.ext,c=o.kid,l=o.alg,p=o.use,u=o.crv,d=Array.isArray(a)?[...a]:a;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(s)&&(void 0===i||"string"==typeof i&&i===c)&&(void 0===l?"AKP"!==s:n===l)&&(void 0===p||"sig"===p)&&(!t.crv||u===t.crv)}(e,r,s,a)),p=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 l(Cs(n,e,r))}catch(e){}}),e}return Cs(n,p,r)},"jwks",{value:()=>structuredClone(t)})}var Os,Us;let Rs;if("undefined"==typeof navigator||null===(Os=navigator.userAgent)||void 0===Os||null===(Us=Os.startsWith)||void 0===Us||!Us.call(Os,"Mozilla/5.0 ")){const e="v6.2.10";Rs="".concat("jose","/").concat(e)}const Ls=Symbol(),Ns=Symbol();function zs(e,t){return Number.isFinite(e)&&Date.now()<e+t}function Ms(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 qs(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=>Ui(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);return(async(e,t,n,i)=>{const o=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),s=function(e,t){var n,i;return null!==(n="string"==typeof e?null!==(i=ns[e])&&void 0!==i?i:ao[e]:void 0)&&void 0!==n?n:ks(t)}(n,_s);s.secret&&ks(_s);const a=!1;let r;if(s.resolve)try{const e={data:t,pos:0};!function(e){Ps(e,48,"Invalid ".concat("PKCS#8"," structure")),Es(e);{Ps(e,2,"Expected version field");const t=Es(e);e.pos+=t}Ps(e,48,"Expected algorithm identifier"),Es(e)}(e),r=s.resolve({crv:js(e)})}catch(e){throw new Ti("Invalid or unsupported key format")}else r=s.subtle;return crypto.subtle.importKey(e,t,r,null!=o?o:a,s.usages[1])})("pkcs8",i,t,n)})(e,t,n)}const Ds=["mfaToken"],Ws=["mfaToken"];var $s,Js,Fs,Hs,Ks,Vs,Bs,Gs,Zs,Xs,Ys,Qs,ea,ta,na,ia,oa,sa,aa,ra,ca,la,pa,ua,da,ha,ma,fa,va,ga,ya,ba,wa,xa,_a,ka,Ta,Sa,Ea,Pa,Aa,ja,Ca,Ia,Oa,Ua,Ra,La,Na,za,Ma,qa;function Da(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 Wa(e){var t,n;if("object"!=typeof e||null===e)return{error:"unknown_error",error_description:String(e)};const i=e;let o;if(i.response instanceof Response)try{o=new Headers(i.response.headers),o.delete("set-cookie")}catch(e){o=void 0}const s={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:o};if("mfa_required"===i.error&&i.cause){s.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&&(s.mfa_requirements=e)}return s}var $a=class extends Error{constructor(e,t){super(t),f(this,"code",void 0),this.name="NotSupportedError",this.code=e}},Ja=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=Da(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Fa=class extends Ja{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Ha=class extends Ja{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Ka=class extends Ja{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Va=class extends Ja{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},Ba=class extends Ja{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Ga=class extends Ja{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Za=class extends Ja{constructor(e,t){super("token_revocation_error",e,t),this.name="TokenRevocationError"}},Xa=class extends Ja{constructor(e,t){super("user_info_error",e,t),this.name="UserInfoError"}},Ya=class extends Error{constructor(e){super(e),f(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Qa=class extends Ja{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"}},er=class extends Ja{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},tr=class extends Ja{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},nr=class extends Ja{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},ir=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"}},or=class extends Error{constructor(e){super(e),f(this,"code","organization_validation_error"),this.name="OrganizationValidationError"}},sr=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 ar(e){try{const t=new Headers(e);return t.delete("set-cookie"),t}catch(e){return new Headers}}function rr(e,t,n){var i;const o="object"==typeof t&&null!==t?t:void 0,s=null!==(i=null==o?void 0:o.response)&&void 0!==i?i:n,a="number"==typeof(null==o?void 0:o.status)?o.status:null==s?void 0:s.status;"number"==typeof a&&(e.statusCode=a),null!=s&&s.headers&&(e.headers=ar(s.headers))}function cr(e){return Object.entries(e).filter(e=>void 0!==b(e,2)[1]).reduce((e,t)=>g(g({},e),{},{[t[0]]:t[1]}),{})}function lr(e){if(!e.trim())throw new or("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 or("Organization Id (org_id) claim must be a string present in the ID token");if(t!==n)throw new or('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 or("Organization Name (org_name) claim must be a string present in the ID token");if(t.toLowerCase()!==n.toLowerCase())throw new or('Organization Name (org_name) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(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),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message};const i=Da(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},dr=class extends ur{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},hr=class extends ur{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},mr=class extends ur{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},fr=class extends ur{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}},vr=class extends ur{constructor(e,t){super("mfa_verify_error",e,t),this.name="MfaVerifyError"}};function gr(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var yr=class e{constructor(e,t,n,i,o,s,a){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=o,this.claims=s,this.authorizationDetails=a}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 br(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 o=t instanceof Request?new Headers(t.headers):new Headers;return null!=n&&n.headers&&new Headers(n.headers).forEach((e,t)=>{o.set(t,e)}),o.set("Auth0-Client",i),e(t,g(g({},n),{},{headers:o}))}}function wr(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.17.0"}}function xr(e){let t;const n=async(n,i)=>{const o=await e(n,i);return t=o.clone(),o};return n.getCapturedResponse=()=>t,n}function _r(e,t,n){if(!t)return e;const i=t.signal,o=t.headers,s=t.customFetch,a=s?br(s,n):e;return i||o?async(e,t)=>{const n=o?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)),o)for(const e of Object.entries(o)){var s=b(e,2);const t=s[0],i=s[1],o=t.toLowerCase();"authorization"!==o&&"auth0-client"!==o&&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],o=i.find(e=>e.aborted);if(o)return n.abort(o.reason),{signal:n.signal};const s=[],a=()=>{i.forEach((e,t)=>{const n=s[t];n&&e.removeEventListener("abort",n)})};return i.forEach((e,t)=>{const i=()=>{a(),n.abort(e.reason)};s[t]=i,e.addEventListener("abort",i,{once:!0})}),{signal:n.signal,cleanup:a}}(i,null==t?void 0:t.signal);try{return await a(e,g(g(g({},t),n&&{headers:n}),{},{signal:r.signal}))}finally{var c;null===(c=r.cleanup)||void 0===c||c.call(r)}}:a}var kr={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"},Tr=($s=new WeakMap,Js=new WeakMap,Fs=new WeakMap,Hs=new WeakMap,Ks=new WeakMap,Vs=new WeakMap,Bs=new WeakMap,Gs=new WeakSet,class{constructor(e){var t,n;m(this,Gs),d(this,$s,void 0),d(this,Js,void 0),d(this,Fs,void 0),d(this,Hs,void 0),d(this,Ks,void 0),d(this,Vs,void 0),d(this,Bs,void 0),h($s,this,"https://".concat(e.domain)),h(Js,this,e.clientId),h(Fs,this,e.clientSecret),h(Hs,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(Ks,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:wr()),h(Vs,this,e.getConfiguration),h(Bs,this,e.createCaptureConfiguration)}async listAuthenticators(e,t){const n="".concat(u($s,this),"/mfa/authenticators"),i=e.mfaToken,o=await c(Gs,this,Sr).call(this,t)(n,{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!o.ok){const e=await o.clone().text(),t=o.status,n=ar(o.headers);let s;try{s=JSON.parse(e)}catch(i){throw new dr("Failed to list authenticators",{error:"unknown_error",error_description:"Failed to list authenticators",statusCode:t,headers:n,body:e})}throw new dr(s.error_description||"Failed to list authenticators",g(g({},s),{},{statusCode:t,headers:n,body:e}))}return(await o.json()).map(gr)}async enrollAuthenticator(e,t){const n="".concat(u($s,this),"/mfa/associate"),i=e.mfaToken,o=y(e,Ds),s={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(s.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(s.phone_number=o.phoneNumber),"email"in o&&o.email&&(s.email=o.email);const a=await c(Gs,this,Sr).call(this,t)(n,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok){const e=await a.clone().text(),t=a.status,n=ar(a.headers);let o;try{o=JSON.parse(e)}catch(i){throw new hr("Failed to enroll authenticator",{error:"unknown_error",error_description:"Failed to enroll authenticator",statusCode:t,headers:n,body:e})}throw new hr(o.error_description||"Failed to enroll authenticator",g(g({},o),{},{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 a.json())}async deleteAuthenticator(e,t){const n=e.authenticatorId,i=e.mfaToken,o="".concat(u($s,this),"/mfa/authenticators/").concat(encodeURIComponent(n)),s=await c(Gs,this,Sr).call(this,t)(o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!s.ok){const e=await s.clone().text(),t=s.status,n=ar(s.headers);let o;try{o=JSON.parse(e)}catch(i){throw new mr("Failed to delete authenticator",{error:"unknown_error",error_description:"Failed to delete authenticator",statusCode:t,headers:n,body:e})}throw new mr(o.error_description||"Failed to delete authenticator",g(g({},o),{},{statusCode:t,headers:n,body:e}))}}async challengeAuthenticator(e,t){const n="".concat(u($s,this),"/mfa/challenge"),i=e.mfaToken,o=y(e,Ws),s={mfa_token:i,client_id:u(Js,this),challenge_type:o.challengeType};u(Fs,this)&&(s.client_secret=u(Fs,this)),o.authenticatorId&&(s.authenticator_id=o.authenticatorId);const a=await c(Gs,this,Sr).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok){const e=await a.clone().text(),t=a.status,n=ar(a.headers);let o;try{o=JSON.parse(e)}catch(i){throw new fr("Failed to challenge authenticator",{error:"unknown_error",error_description:"Failed to challenge authenticator",statusCode:t,headers:n,body:e})}throw new fr(o.error_description||"Failed to challenge authenticator",g(g({},o),{},{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 a.json())}async verify(e,t){if(!u(Vs,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(Bs,this))throw new Error("MFA verify fullResponse requires a capture-config factory (createCaptureConfiguration was not set)");const r=xr(null!==(i=(await u(Vs,this).call(this,t))[ko])&&void 0!==i?i:fetch),c=await u(Bs,this).call(this,r);try{const t=await Bo(c,kr[e.factorType],n),i=yr.fromTokenEndpointResponse(t);t.recovery_code&&(i.recoveryCode=t.recovery_code);const o=r.getCapturedResponse();if(!o)throw new sr;return{data:i,response:o}}catch(e){var o,s,a;if(e instanceof sr)throw e;if(e instanceof vr)throw e;const t=e,n=new vr(t.error_description||t.message||"Failed to verify MFA challenge",{error:null!==(o=t.error)&&void 0!==o?o:"mfa_verify_error",error_description:null!==(s=null!==(a=t.error_description)&&void 0!==a?a:t.message)&&void 0!==s?s:"Failed to verify MFA challenge"});throw rr(n,e,r.getCapturedResponse()),n}}const r=await u(Vs,this).call(this,t);try{const t=await Bo(r,kr[e.factorType],n),i=yr.fromTokenEndpointResponse(t);return t.recovery_code&&(i.recoveryCode=t.recovery_code),i}catch(e){var c,l,p;if(e instanceof vr)throw e;const t=e,n=new vr(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!==(l=null!==(p=t.error_description)&&void 0!==p?p:t.message)&&void 0!==l?l:"Failed to verify MFA challenge"});throw rr(n,e),n}}});function Sr(e){return _r(u(Hs,this),e,u(Ks,this))}var Er=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=Da(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Pr=class extends Er{constructor(e,t){super("passkey_register_error",e,t),this.name="PasskeyRegisterError"}},Ar=class extends Er{constructor(e,t){super("passkey_challenge_error",e,t),this.name="PasskeyChallengeError"}},jr=class extends Er{constructor(e,t){super("passkey_get_token_error",e,t),f(this,"isRetryable",void 0),f(this,"verificationRequired",void 0),f(this,"authSession",void 0),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,verification_required:t.verification_required,auth_session:t.auth_session},this.isRetryable="invalid_grant"===(null==t?void 0:t.error)&&null!=(null==t?void 0:t.auth_session),this.verificationRequired=null==t?void 0:t.verification_required,this.authSession=null==t?void 0:t.auth_session}};function Cr(e){return e.useMtls?{}:e.clientSecret?{client_secret:e.clientSecret}:{}}var Ir="urn:okta:params:oauth:grant-type:webauthn",Or=(Zs=new WeakMap,Xs=new WeakMap,Ys=new WeakMap,Qs=new WeakMap,ea=new WeakMap,ta=new WeakMap,na=new WeakSet,class{constructor(e){var t,n;m(this,na),d(this,Zs,void 0),d(this,Xs,void 0),d(this,Ys,void 0),d(this,Qs,void 0),d(this,ea,void 0),d(this,ta,void 0),h(Zs,this,"https://".concat(e.domain)),h(Xs,this,e.clientId),h(Ys,this,{clientSecret:e.clientSecret,useMtls:e.useMtls}),h(Qs,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(ea,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:wr()),h(ta,this,e.grantRequest)}async register(e,t){const n="".concat(u(Zs,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}),o=g(g({client_id:u(Xs,this)},Cr(u(Ys,this))),{},{user_profile:i});e.realm&&(o.realm=e.realm),e.organization&&(o.organization=e.organization),e.userMetadata&&(o.user_metadata=e.userMetadata),e.deliveryMethod&&(o.delivery_method=e.deliveryMethod);const s=await c(na,this,Ur).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok){const e=await c(na,this,Rr).call(this,s),t=new Pr(e.error_description||"Failed to request signup challenge",e);throw t.statusCode=s.status,t.headers=ar(s.headers),t}return g({authSession:(a=await s.json()).auth_session,authnParamsPublicKey:g({},a.authn_params_public_key)},a.verification_required&&{verificationRequired:a.verification_required});var a}async challenge(e,t){const n="".concat(u(Zs,this),"/passkey/challenge"),i=g({client_id:u(Xs,this)},Cr(u(Ys,this)));null!=e&&e.realm&&(i.realm=e.realm),null!=e&&e.organization&&(i.organization=e.organization);const o=await c(na,this,Ur).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok){const e=await c(na,this,Rr).call(this,o),t=new Ar(e.error_description||"Failed to request login challenge",e);throw t.statusCode=o.status,t.headers=ar(o.headers),t}return{authSession:(s=await o.json()).auth_session,authnParamsPublicKey:g({},s.authn_params_public_key)};var s}async getTokenByPasskey(e,t){void 0!==e.organization&&lr(e.organization);const n=new URLSearchParams({auth_session:e.authSession,authn_response:JSON.stringify(e.credential)});if(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),e.verification){const t=Object.fromEntries(Object.entries(e.verification).filter(e=>b(e,2)[1]));Object.keys(t).length>0&&n.append("verification",JSON.stringify(t))}let i;try{i=await u(ta,this).call(this,Ir,n,t,e.fullResponse)}catch(e){if(e instanceof sr)throw e;const t=null==e?void 0:e.cause,n=Wa(e),i=new jr(n.error_description||"Failed to exchange passkey credential for tokens.",g(g({},n),{},{verification_required:null==t?void 0:t.verification_required,auth_session:null==t?void 0:t.auth_session}));throw rr(i,e),i}if(e.fullResponse){const t=i;return e.organization&&pr(t.data.claims,e.organization),t}const o=i;return e.organization&&pr(o.claims,e.organization),o}});function Ur(e){return _r(u(Qs,this),e,u(ea,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:429===e.status?"Too many requests. Please try again later.":"HTTP ".concat(e.status," ").concat(e.statusText),statusCode:e.status,headers:e.headers,body: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),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=Da(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Nr=class extends Lr{constructor(e,t){super("passwordless_start_error",e,t),this.name="PasswordlessStartError"}},zr=class extends Lr{constructor(e,t){super("passwordless_verify_error",e,t),this.name="PasswordlessVerifyError"}},Mr=class extends Lr{constructor(e,t){super("passwordless_db_get_token_error",e,t),this.name="PasswordlessDbGetTokenError"}},qr=class extends Lr{constructor(e,t,n,i,o){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!=o?o: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 o=null!==(i=e.clientAssertionSigningAlg)&&void 0!==i?i:"RS256",s=e.clientAssertionSigningKey instanceof CryptoKey?e.clientAssertionSigningKey:await qs(e.clientAssertionSigningKey,o);return{client_assertion:await new xs({}).setProtectedHeader({alg:o}).setIssuer(t).setSubject(t).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(s),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}if(e.clientSecret)return{client_secret:e.clientSecret};throw new ir}var $r=(ia=new WeakMap,oa=new WeakMap,sa=new WeakMap,aa=new WeakMap,ra=new WeakMap,ca=new WeakMap,la=new WeakMap,pa=new WeakSet,class{constructor(e){var t,n;m(this,pa),d(this,ia,void 0),d(this,oa,void 0),d(this,sa,void 0),d(this,aa,void 0),d(this,ra,void 0),d(this,ca,void 0),d(this,la,void 0),h(oa,this,e.domain),h(ia,this,"https://".concat(e.domain)),h(sa,this,e.clientId),h(aa,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(ra,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:wr()),h(ca,this,{clientSecret:e.clientSecret,clientAssertionSigningKey:e.clientAssertionSigningKey,clientAssertionSigningAlg:e.clientAssertionSigningAlg,useMtls:e.useMtls}),h(la,this,e.grantRequest)}async sendEmail(e,t){const n=await c(pa,this,Fr).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(pa,this,Fr).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(pa,this,Hr).call(this,n,"Failed to request email OTP challenge",t)}async challengeWithPhoneNumber(e,t){if(!Dr(e.phoneNumber))throw new qr("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(pa,this,Hr).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(la,this))throw new Mr("Missing grant request delegate.",Wa(new Error("missing grantRequest")));try{return await u(la,this).call(this,"http://auth0.com/oauth/grant-type/passwordless/otp",n,t,e.fullResponse)}catch(e){if(e instanceof sr)throw e;const t=new Mr("There was an error while trying to request a token.",Wa(e)),n=e;throw t.statusCode=n._statusCode,t.headers=n._headers,t}}});function Jr(e){return _r(u(aa,this),e,u(ra,this))}async function Fr(e,t,n,i){var o;const s=await Wr(u(ca,this),u(sa,this),u(oa,this)),a=g(g({client_id:u(sa,this)},e),s);let r;try{r=await c(pa,this,Jr).call(this,i)("".concat(u(ia,this),"/passwordless/start"),{method:"POST",headers:g({"Content-Type":"application/json"},n?{"x-request-language":n}:{}),body:JSON.stringify(a)})}catch(e){throw new Nr("".concat(t,": a network error occurred."))}if(r.ok)return r;const l=await r.clone().text();let p;if(204!==r.status)try{p=JSON.parse(l)}catch(e){p=void 0}const d=new Nr((null===(o=p)||void 0===o?void 0:o.error_description)||t,p);throw d.statusCode=r.status,d.headers=ar(r.headers),d.body=l,d}async function Hr(e,t,n){var i,o;const s=await Wr(u(ca,this),u(sa,this),u(oa,this)),a=g(g({client_id:u(sa,this)},e),s);let r;try{r=await c(pa,this,Jr).call(this,n)("".concat(u(ia,this),"/otp/challenge"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(e){throw new qr("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 qr("".concat(t,": could not parse the response body."),r.status,void 0,void 0,ar(r.headers))}return{authSession:n.auth_session}}const l=await r.clone().text();let p;try{p=JSON.parse(l)}catch(e){p=void 0}const d=p?g(g({},p),{},{statusCode:r.status,headers:r.headers,body:l}):{error:"",error_description:"",statusCode:r.status,headers:r.headers,body:l};throw new qr((null===(i=p)||void 0===i?void 0:i.error_description)||t,r.status,d,null===(o=p)||void 0===o?void 0:o.validation_errors,ar(r.headers))}var Kr=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=Da(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Vr=class extends Kr{constructor(e,t){super("signup_error",e,t),this.name="SignUpError"}},Br=class extends Kr{constructor(e,t){super("change_password_error",e,t),this.name="ChangePasswordError"}};function Gr(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 Zr(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 Xr=(ua=new WeakMap,da=new WeakMap,ha=new WeakMap,ma=new WeakMap,fa=new WeakSet,class{constructor(e){var t,n;m(this,fa),d(this,ua,void 0),d(this,da,void 0),d(this,ha,void 0),d(this,ma,void 0),h(ua,this,"https://".concat(e.domain)),h(da,this,e.clientId),h(ha,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(ma,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:wr())}async signUp(e,t){var n;Gr(e,["email","password","connection"],Vr);const i=g({client_id:null!==(n=e.clientId)&&void 0!==n?n:u(da,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)),o=await c(fa,this,Yr).call(this,"/dbconnections/signup",i,Vr,"Failed to sign up",t);if(e.fullResponse){const e=o.clone();return{data:Zr(await o.json()),response:e}}return Zr(await o.json())}async changePassword(e,t){var n;if(Gr(e,["connection"],Br),!e.email&&!e.username)throw new Br('Either "email" or "username" is required.');const i=g({client_id:null!==(n=e.clientId)&&void 0!==n?n:u(da,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)),o=await c(fa,this,Yr).call(this,"/dbconnections/change_password",i,Br,"Failed to request a password change",t);if(e.fullResponse){const e=o.clone();return{data:await o.text(),response:e}}return o.text()}});async function Yr(e,t,n,i,o){const s=_r(u(ha,this),o,u(ma,this));let a;try{a=await s("".concat(u(ua,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(a.ok)return a;const r=await a.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}(a.clone()),l=new n((null==c?void 0:c.error_description)||i,null!=c?c:{error:"unknown_error",error_description:i});throw l.statusCode=a.status,l.headers=ar(a.headers),l.body=r,l}var Qr=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 ec(e,t,n){if(e.useMtls)return{};if(e.clientAssertionSigningKey){var i;const o=null!==(i=e.clientAssertionSigningAlg)&&void 0!==i?i:"RS256",s=e.clientAssertionSigningKey instanceof CryptoKey?e.clientAssertionSigningKey:await qs(e.clientAssertionSigningKey,o);return{client_assertion:await new xs({}).setProtectedHeader({alg:o}).setIssuer(t).setSubject(t).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(s),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}return e.clientSecret?{client_secret:e.clientSecret}:{}}async function tc(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 nc=(va=new WeakMap,ga=new WeakMap,ya=new WeakMap,ba=new WeakMap,wa=new WeakMap,xa=new WeakMap,_a=new WeakMap,ka=new WeakMap,Ta=new WeakSet,class{constructor(e){var t;m(this,Ta),d(this,va,void 0),d(this,ga,void 0),d(this,ya,void 0),d(this,ba,void 0),d(this,wa,void 0),d(this,xa,void 0),d(this,_a,void 0),d(this,ka,void 0),h(va,this,e.domain),h(ga,this,"https://".concat(e.domain)),h(ya,this,e.clientId),h(ba,this,e.clientSecret),h(wa,this,e.clientAssertionSigningKey),h(xa,this,e.clientAssertionSigningAlg),h(_a,this,e.useMtls),h(ka,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async createSession(e){const t={client_id:u(ya,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(Ta,this,oc).call(this,t);if(!n.sessionToken)throw new Qr("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(Ta,this,ic).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(ga,this),"/anonymous/logout"),t={client_id:u(ya,this)},n=await u(ka,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 tc(n);throw new Qr(e.error,e.error_description||"Failed to end anonymous session",e)}}async mintTransferToken(e){const t="".concat(u(ga,this),"/anonymous/token"),n={client_id:u(ya,this),session_token:e,audience:"urn:auth0:anon_transfer"};try{const e=await ec({clientSecret:u(ba,this),clientAssertionSigningKey:u(wa,this),clientAssertionSigningAlg:u(xa,this),useMtls:u(_a,this)},u(ya,this),u(va,this));Object.assign(n,e);const i=await u(ka,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},redirect:"error",body:JSON.stringify(n)});if(!i.ok)return null;const o=await i.json();return"string"==typeof o.anon_transfer_token?o.anon_transfer_token:null}catch(e){return null}}});async function ic(e,t){const n={client_id:u(ya,this),session_token:e};null!=t&&t.audience&&(n.audience=t.audience),null!=t&&t.scope&&(n.scope=t.scope);const i=await c(Ta,this,oc).call(this,n);return{sessionToken:e,accessToken:i.accessToken,expiresAt:i.expiresAt,sessionTokenExpiresAt:i.sessionTokenExpiresAt,scope:i.scope}}async function oc(e){const t="".concat(u(ga,this),"/anonymous/token"),n=await ec({clientSecret:u(ba,this),clientAssertionSigningKey:u(wa,this),clientAssertionSigningAlg:u(xa,this),useMtls:u(_a,this)},u(ya,this),u(va,this));Object.assign(e,n);const i=await u(ka,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 tc(i);throw new Qr(e.error,e.error_description||"Anonymous token request failed",e)}let o;try{o=await i.json()}catch(e){throw new Qr("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 Qr("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 Qr("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}}(o)}var sc=(Sa=new WeakMap,Ea=new WeakMap,Pa=new WeakMap,class{constructor(e,t){d(this,Sa,new Map),d(this,Ea,void 0),d(this,Pa,void 0),h(Pa,this,Math.max(1,Math.floor(e))),h(Ea,this,Math.max(0,Math.floor(t)))}get(e){const t=u(Sa,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return u(Sa,this).delete(e),u(Sa,this).set(e,t),t.value;u(Sa,this).delete(e)}}set(e,t,n){u(Sa,this).has(e)&&u(Sa,this).delete(e);const i=null!=n&&Number.isFinite(n)&&n>0?n:u(Ea,this);for(u(Sa,this).set(e,{value:t,expiresAt:Date.now()+i});u(Sa,this).size>u(Pa,this);){const e=u(Sa,this).keys().next().value;if(void 0===e)break;u(Sa,this).delete(e)}}}),ac=new Map;function rc(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 cc=class{static createDiscoveryCache(e){const t=(n=e.maxEntries,i=e.ttlMs,"".concat(n,":").concat(i));var n,i;let o=(s=t,ac.get(s));var s;return o||(o=new sc(e.maxEntries,e.ttlMs),ac.set(t,o)),o}static createJwksCache(){return{}}},lc="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 uc(e){if(null==e)throw new Ga("subject_token is required");if("string"!=typeof e)throw new Ga("subject_token must be a string");if(0===e.trim().length)throw new Ga("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Ga("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Ga("subject_token must not include the 'Bearer ' prefix")}function dc(e,t){if(t)for(const i of Object.entries(t)){var n=b(i,2);const t=n[0],o=n[1];if(!pc.has(t))if(Array.isArray(o)){if(o.length>20)throw new Ga("Parameter '".concat(t,"' exceeds maximum array size of ").concat(20));o.forEach(n=>{e.append(t,n)})}else e.append(t,o)}}var hc="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",mc="urn:ietf:params:oauth:grant-type:token-exchange",fc="urn:ietf:params:oauth:token-type:access_token";function vc(e,t){return(n,i)=>{const o=null==i?void 0:i.body;if(t!==Ir||!(o instanceof URLSearchParams))return e(n,i);const s={};for(const e of o){var a=b(e,2);const t=a[0],n=a[1];s[t]="authn_response"===t||"verification"===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(s)}))}}var gc=(Aa=new WeakMap,ja=new WeakMap,Ca=new WeakMap,Ia=new WeakMap,Oa=new WeakMap,Ua=new WeakMap,Ra=new WeakMap,La=new WeakMap,Na=new WeakMap,za=new WeakMap,Ma=new WeakMap,qa=new WeakSet,class{constructor(e){var t;if(m(this,qa),d(this,Aa,void 0),d(this,ja,void 0),d(this,Ca,void 0),d(this,Ia,void 0),d(this,Oa,void 0),d(this,Ua,void 0),d(this,Ra,void 0),d(this,La,void 0),d(this,Na,void 0),d(this,za,void 0),d(this,Ma,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(Oa,this,e),e.useMtls&&!e.customFetch)throw new $a("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");h(Ra,this,wr(e.telemetry)),h(Ua,this,br(null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)},u(Ra,this)));const n=rc(e.discoveryCache);h(Na,this,cc.createDiscoveryCache(n)),h(za,this,new Map),h(Ma,this,cc.createJwksCache()),this.mfa=new Tr({domain:u(Oa,this).domain,clientId:u(Oa,this).clientId,clientSecret:u(Oa,this).clientSecret,customFetch:u(Ua,this),telemetryConfig:u(Ra,this),getConfiguration:async e=>(await c(qa,this,xc).call(this,e)).configuration,createCaptureConfiguration:async e=>{const t=(await c(qa,this,_c).call(this)).serverMetadata;return c(qa,this,bc).call(this,t,e)}}),this.passkey=new Or({domain:u(Oa,this).domain,clientId:u(Oa,this).clientId,clientSecret:u(Oa,this).clientSecret,useMtls:u(Oa,this).useMtls,customFetch:u(Ua,this),telemetryConfig:u(Ra,this),grantRequest:async(e,t,n,i)=>{const o=(await c(qa,this,_c).call(this)).serverMetadata,s=c(qa,this,wc).call(this,n);if(i){const n=xr(s),i=await c(qa,this,bc).call(this,o,n);i[ko]=vc(n,e);const a=await Bo(i,e,t),r=yr.fromTokenEndpointResponse(a),l=n.getCapturedResponse();if(!l)throw new sr;return{data:r,response:l}}const a=await c(qa,this,bc).call(this,o);a[ko]=vc(s,e);const r=await Bo(a,e,t);return yr.fromTokenEndpointResponse(r)}}),this.passwordless=new $r({domain:u(Oa,this).domain,clientId:u(Oa,this).clientId,customFetch:u(Ua,this),telemetryConfig:u(Ra,this),clientSecret:u(Oa,this).clientSecret,clientAssertionSigningKey:u(Oa,this).clientAssertionSigningKey,clientAssertionSigningAlg:u(Oa,this).clientAssertionSigningAlg,useMtls:u(Oa,this).useMtls,grantRequest:async(e,t,n,i)=>{const o=(await c(qa,this,xc).call(this,n)).configuration;if(i){var s;const n=xr(null!==(s=o[ko])&&void 0!==s?s:u(Ua,this)),i=await c(qa,this,bc).call(this,o.serverMetadata(),n),a=await Bo(i,e,t),r=yr.fromTokenEndpointResponse(a),l=n.getCapturedResponse();if(!l)throw new sr;return{data:r,response:l}}try{const n=await Bo(o,e,t);return yr.fromTokenEndpointResponse(n)}catch(e){const t=e,n={};throw rr(n,e),t._statusCode=n.statusCode,t._headers=n.headers,e}}}),this.database=new Xr({domain:u(Oa,this).domain,clientId:u(Oa,this).clientId,customFetch:u(Ua,this),telemetryConfig:u(Ra,this)}),this.anonymous=new nc({domain:u(Oa,this).domain,clientId:u(Oa,this).clientId,clientSecret:u(Oa,this).clientSecret,clientAssertionSigningKey:u(Oa,this).clientAssertionSigningKey,clientAssertionSigningAlg:u(Oa,this).clientAssertionSigningAlg,useMtls:u(Oa,this).useMtls,customFetch:u(Ua,this)})}async getServerMetadata(){return(await c(qa,this,_c).call(this)).serverMetadata}async buildAuthorizationUrl(e){const t=(await c(qa,this,_c).call(this)).serverMetadata;if(null!=e&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new $a("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(qa,this,jc).call(this,e)}catch(e){throw new er(e)}}async buildLinkUserUrl(e){try{const t=await c(qa,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 tr(e)}}async buildUnlinkUserUrl(e){try{const t=await c(qa,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 nr(e)}}async backchannelAuthentication(e,t){var n;const i=await c(qa,this,xc).call(this,t),o=i.configuration,s=i.serverMetadata,a=cr(g(g({},u(Oa,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(g(g({scope:lc},a),{},{client_id:u(Oa,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:s.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 l;const e=xr(null!==(l=o[ko])&&void 0!==l?l:u(Ua,this)),n=await c(qa,this,bc).call(this,o.serverMetadata(),e);try{const t=await Lo(o,r),i=await No(n,t),s=e.getCapturedResponse();if(!s)throw new sr;return{data:yr.fromTokenEndpointResponse(i),response:s}}catch(t){if(t instanceof sr)throw t;const n=new Qa(t);throw rr(n,t,e.getCapturedResponse()),n}}const p=xr(null!==(n=o[ko])&&void 0!==n?n:u(Ua,this)),d=await c(qa,this,bc).call(this,o.serverMetadata(),p);try{const e=await Lo(o,r),t=await No(d,e);return yr.fromTokenEndpointResponse(t)}catch(e){const t=new Qa(e);throw rr(t,e,p.getCapturedResponse()),t}}async initiateBackchannelAuthentication(e,t){var n;const i=await c(qa,this,xc).call(this,t),o=i.configuration,s=i.serverMetadata,a=cr(g(g({},u(Oa,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(g(g({scope:lc},a),{},{client_id:u(Oa,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:s.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 l=xr(null!==(n=o[ko])&&void 0!==n?n:u(Ua,this)),p=await c(qa,this,bc).call(this,o.serverMetadata(),l);try{const e=await Lo(p,r);return{authReqId:e.auth_req_id,expiresIn:e.expires_in,interval:e.interval}}catch(e){const t=new Qa(e),n=l.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(n.headers):void 0,t}}async backchannelAuthenticationGrant(e,t){var n;let i=e.authReqId;const o=(await c(qa,this,xc).call(this,t)).configuration,s=new URLSearchParams({auth_req_id:i}),a=xr(null!==(n=o[ko])&&void 0!==n?n:u(Ua,this)),r=await c(qa,this,bc).call(this,o.serverMetadata(),a);try{const e=await Bo(r,"urn:openid:params:grant-type:ciba",s);return yr.fromTokenEndpointResponse(e)}catch(e){const t=new Qa(e),n=a.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(n.headers):void 0,t}}async getTokenForConnection(e,t){var n;if(e.refreshToken&&e.accessToken)throw new Ba("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 Ba("Either a refresh or access token must be specified.");try{return await this.exchangeToken(g({connection:e.connection,subjectToken:i,subjectTokenType:e.accessToken?fc:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint},e.fullResponse?{fullResponse:!0}:{}),t)}catch(e){if(e instanceof Ga){const t=new Ba(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(qa,this,Tc).call(this,e,t,!0):c(qa,this,Ec).call(this,e,t,!0):"connection"in e?c(qa,this,Tc).call(this,e,t):c(qa,this,Ec).call(this,e,t)}async getTokenByCode(e,t,n){var i;const o=(await c(qa,this,xc).call(this,n)).configuration;if(void 0!==t.organization&&lr(t.organization),t.fullResponse){var s;const n=xr(null!==(s=o[ko])&&void 0!==s?s:u(Ua,this)),i=await c(qa,this,bc).call(this,o.serverMetadata(),n);let a,r;try{const o=await Mo(i,e,{pkceCodeVerifier:t.codeVerifier});if(a=yr.fromTokenEndpointResponse(o),r=n.getCapturedResponse(),!r)throw new sr}catch(e){if(e instanceof sr)throw e;const t=new Fa("There was an error while trying to request a token.",Wa(e)),i=n.getCapturedResponse();throw t.statusCode=null==i?void 0:i.status,t.headers=i?ar(i.headers):void 0,t}return t.organization&&pr(a.claims,t.organization),{data:a,response:r}}const a=xr(null!==(i=o[ko])&&void 0!==i?i:u(Ua,this)),r=await c(qa,this,bc).call(this,o.serverMetadata(),a);let l;try{const n=await Mo(r,e,{pkceCodeVerifier:t.codeVerifier});l=yr.fromTokenEndpointResponse(n)}catch(e){const t=new Fa("There was an error while trying to request a token.",Wa(e)),n=a.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(n.headers):void 0,t}return t.organization&&pr(l.claims,t.organization),l}async getTokenByMagicLinkCode(e,t,n){var i;const o=(await c(qa,this,xc).call(this,n)).configuration;if(null!=t&&t.fullResponse){var s;const n=xr(null!==(s=o[ko])&&void 0!==s?s:u(Ua,this)),i=await c(qa,this,bc).call(this,o.serverMetadata(),n);try{const o=await Mo(i,e,{expectedState:null==t?void 0:t.expectedState}),s=yr.fromTokenEndpointResponse(o),a=n.getCapturedResponse();if(!a)throw new sr;return{data:s,response:a}}catch(e){if(e instanceof sr)throw e;const t=e instanceof Error&&e.message?e.message:"There was an error while trying to request a token.",i=new Fa(t,e),o=n.getCapturedResponse();throw i.statusCode=null==o?void 0:o.status,i.headers=o?ar(o.headers):void 0,i}}const a=xr(null!==(i=o[ko])&&void 0!==i?i:u(Ua,this)),r=await c(qa,this,bc).call(this,o.serverMetadata(),a);try{const n=await Mo(r,e,{expectedState:null==t?void 0:t.expectedState});return yr.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 Fa(t,e),i=a.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?ar(i.headers):void 0,n}}async getTokenByRefreshToken(e,t){var n;const i=(await c(qa,this,xc).call(this,t)).configuration,o=new URLSearchParams;if(e.audience&&o.append("audience",e.audience),e.scope&&o.append("scope",e.scope),e.fullResponse){var s;const t=xr(null!==(s=i[ko])&&void 0!==s?s:u(Ua,this)),n=await c(qa,this,bc).call(this,i.serverMetadata(),t);try{const i=await qo(n,e.refreshToken,o),s=yr.fromTokenEndpointResponse(i),a=t.getCapturedResponse();if(!a)throw new sr;return{data:s,response:a}}catch(e){if(e instanceof sr)throw e;const n=new Ka("The access token has expired and there was an error while trying to refresh it.",Wa(e)),i=t.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?ar(i.headers):void 0,n}}const a=xr(null!==(n=i[ko])&&void 0!==n?n:u(Ua,this)),r=await c(qa,this,bc).call(this,i.serverMetadata(),a);try{const t=await qo(r,e.refreshToken,o);return yr.fromTokenEndpointResponse(t)}catch(e){const t=new Ka("The access token has expired and there was an error while trying to refresh it.",Wa(e)),n=a.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(n.headers):void 0,t}}async revokeToken(e,t){var n;const i=(await c(qa,this,xc).call(this,t)).configuration,o={};e.tokenTypeHint&&(o.token_type_hint=e.tokenTypeHint);const s=xr(null!==(n=i[ko])&&void 0!==n?n:u(Ua,this)),a=await c(qa,this,bc).call(this,i.serverMetadata(),s);try{await async function(e,t,n){Jo(e);const i=yo(e),o=i.as,s=i.c,a=i.auth,r=i.fetch,c=i.tlsOnly,l=i.timeout;return async function(e,t,n,i,o){Qt(e),en(t),Kt(i,'"token"');const s=an(e,"revocation_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[Et])),a=new URLSearchParams(null==o?void 0:o.additionalParameters);a.set("token",i);const r=$t(null==o?void 0:o.headers);return r.delete("accept"),_n(e,t,n,s,a,r,o)}(o,s,a,t,{[jt]:r,[Et]:!c,additionalParameters:new URLSearchParams(n),headers:new Headers(vo),signal:Fo(l)}).then(ti).catch(jo)}(a,e.token,o)}catch(e){const t=new Za("An error occurred while trying to revoke the token.",Wa(e)),n=s.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(n.headers):void 0,t}}async getUserInfo(e,t){const n=(await c(qa,this,xc).call(this,t,!0)).configuration;try{var i;return await Ho(n,e.accessToken,null!==(i=e.expectedSubject)&&void 0!==i?i:_o)}catch(e){throw new Xa("There was an error while trying to retrieve the user info.",Wa(e))}}async getTokenByPassword(e,t){var n;const i=(await c(qa,this,xc).call(this,t)).configuration,o=new URLSearchParams({username:e.username,password:e.password});e.audience&&o.append("audience",e.audience),e.scope&&o.append("scope",e.scope),e.realm&&o.append("realm",e.realm);let s=i;if(e.auth0ForwardedFor){const t=await c(qa,this,Ac).call(this);s=new Io(i.serverMetadata(),u(Oa,this).clientId,{client_secret:u(Oa,this).clientSecret,use_mtls_endpoint_aliases:u(Oa,this).useMtls},t);const n=i[ko];s[ko]=(t,i)=>n(t,g(g({},i),{},{headers:g(g({},i.headers),{},{"auth0-forwarded-for":e.auth0ForwardedFor})}))}if(e.fullResponse){var a;const e=xr(null!==(a=s[ko])&&void 0!==a?a:u(Ua,this)),n=await c(qa,this,bc).call(this,s.serverMetadata(),e);try{const t=await Bo(n,"password",o),i=yr.fromTokenEndpointResponse(t),s=e.getCapturedResponse();if(!s)throw new sr;return{data:i,response:s}}catch(t){if(t instanceof sr)throw t;const n=new Va("There was an error while trying to request a token.",Wa(t)),i=e.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?ar(i.headers):void 0,n}}const r=xr(null!==(n=s[ko])&&void 0!==n?n:u(Ua,this)),l=await c(qa,this,bc).call(this,s.serverMetadata(),r);try{const e=await Bo(l,"password",o);return yr.fromTokenEndpointResponse(e)}catch(e){const t=new Va("There was an error while trying to request a token.",Wa(e)),n=r.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(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(qa,this,Pc).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(qa,this,Pc).call(this,n,t,e.fullResponse)}async getTokenByClientCredentials(e,t){var n;const i=(await c(qa,this,xc).call(this,t)).configuration;if(e.fullResponse){var o;const t=xr(null!==(o=i[ko])&&void 0!==o?o:u(Ua,this)),n=await c(qa,this,bc).call(this,i.serverMetadata(),t),s=new URLSearchParams({audience:e.audience});e.organization&&s.append("organization",e.organization);try{const e=await Do(n,s),i=yr.fromTokenEndpointResponse(e),o=t.getCapturedResponse();if(!o)throw new sr;return{data:i,response:o}}catch(e){if(e instanceof sr)throw e;const n=new Ha("There was an error while trying to request a token.",Wa(e)),i=t.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?ar(i.headers):void 0,n}}const s=xr(null!==(n=i[ko])&&void 0!==n?n:u(Ua,this)),a=await c(qa,this,bc).call(this,i.serverMetadata(),s);try{const t=new URLSearchParams({audience:e.audience});e.organization&&t.append("organization",e.organization);const n=await Do(a,t);return yr.fromTokenEndpointResponse(n)}catch(e){const t=new Ha("There was an error while trying to request a token.",Wa(e)),n=s.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(n.headers):void 0,t}}async buildLogoutUrl(e){const t=await c(qa,this,_c).call(this),n=t.configuration;if(!t.serverMetadata.end_session_endpoint){const t=new URL("https://".concat(u(Oa,this).domain,"/v2/logout"));return t.searchParams.set("returnTo",e.returnTo),t.searchParams.set("client_id",u(Oa,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){Jo(e);const n=yo(e),i=n.as,o=n.c,s=an(i,"end_session_endpoint",!1,n.tlsOnly);(t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id);for(const e of t.entries()){var a=b(e,2);const t=a[0],n=a[1];s.searchParams.append(t,n)}return s}(n,i)}async verifyLogoutToken(e){const t=(await c(qa,this,_c).call(this)).serverMetadata,n=rc(u(Oa,this).discoveryCache),i=t.jwks_uri;u(La,this)||h(La,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:{},o=i.timeoutDuration;if("number"==typeof o&&(!Number.isInteger(o)||o<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');const s="number"==typeof o?o:5e3,a=Ms(i.cooldownDuration,3e4,"cooldownDuration"),r=Ms(i.cacheMaxAge,6e5,"cacheMaxAge"),c=new Headers(i.headers);Rs&&!c.has("User-Agent")&&c.set("User-Agent",Rs),c.has("accept")||c.set("accept","application/json, application/jwk-set+json");const l=i[Ls],p=i[Ns];let u,d,h,m=0,f=0;if(p&&"object"==typeof p){const e=p.uat,t=p.jwks;zs(e,r)&&Mi(t)&&(u=e,h=Is(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 o=await i(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new Ci;throw e});if(200!==o.status)throw new wi("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new wi("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(n,c,AbortSignal.timeout(s),l).then(t=>{const n=Is(t);if(e<=f)return;h=n;const i=Date.now();p&&(p.uat=i,p.jwks=t),u=i,f=e}).finally(()=>{d===t&&(d=void 0)})}await d};return Object.defineProperties(async(e,t)=>{h&&zs(u,r)||await v();try{return await h(e,t)}catch(n){if(n instanceof Ai&&!zs(u,a))return await v(),h(e,t);throw n}},{coolingDown:{get:()=>zs(u,a),enumerable:!0},fresh:{get:()=>zs(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,[Ls]:u(Ua,this),[Ns]:u(Ma,this)}));const o=(await async function(e,t,n){const i=await async function(e,t,n){if(e instanceof Uint8Array&&(e=mi.decode(e)),"string"!=typeof e)throw new Si("Compact JWS must be a string or Uint8Array");const i=e.split("."),o=i[0],s=i[1],a=i[2];if(3!==i.length)throw new Si("Invalid Compact JWS");const r={payload:s,protected:o,signature:a},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(fi.decode(Li(e)))}catch(e){throw new t(n)}if(!zi(i))throw new t(n);return i}(e,Si,"JWS Protected Header is invalid");return t}(o),l=function(e,t,n){const i=ho(e,uo(Si,lo,n[1],e,t)),o=t.alg;if("string"!=typeof o||!o)throw new Si('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(n[0]&&!n[0].has(o))throw new ki('"alg" (Algorithm) Header Parameter value not allowed');return[i,o]}(c,c,t),p=b(l,2),u=p[0],d=p[1],h=u?s:function(e){try{return gi(e)}catch(e){throw new Si("JWS Compact Serialization payload must use only ASCII characters")}}(s);return async function(e,t,n,i,o,s,a){var r;let c=!1;"function"==typeof n&&(n=await n(o,e),c=!0);const l="string"==typeof a,p=is(s),u=vi(void 0!==i?gi(i):new Uint8Array,gi("."),l?null!==(r=t[2])&&void 0!==r?r:t[2]=function(e,t,n){try{return gi(e)}catch(e){throw new n("The ".concat("payload"," is not a valid base64url string"))}}(a,0,Si):a),d=qi(e.signature,"signature",Si),h=await Xi(p,n,"verify");if(!await async function(e,t,n,i){const o=await Go(e,t,"verify");try{return await crypto.subtle.verify(e.signing,o,n,i)}catch(e){return!1}}(p,h,d,u))throw new Ii;return[l?qi(a,"payload",Si):a,o,l,h,c]}(r,t,n,o,c,d,h)}(e,function(e){return[e&&po("algorithms",e.algorithms),null==e?void 0:e.crit]}(n),t);if(!i[2])throw new Ei("JWTs MUST NOT use unencoded payload");const o={payload:vs(i[1],i[0],n),protectedHeader:i[1]};return"function"==typeof t?g(g({},o),{},{key:i[3]}):o}(e.logoutToken,u(La,this),{issuer:t.issuer,audience:u(Oa,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in o)&&!("sub"in o))throw new Ya('either "sid" or "sub" (or both) claims must be present');if("sid"in o&&"string"!=typeof o.sid)throw new Ya('"sid" claim must be a string');if("sub"in o&&"string"!=typeof o.sub)throw new Ya('"sub" claim must be a string');if("nonce"in o)throw new Ya('"nonce" claim is prohibited');if(!("events"in o))throw new Ya('"events" claim is missing');if("object"!=typeof o.events||null===o.events)throw new Ya('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in o.events))throw new Ya('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if("object"!=typeof o.events["http://schemas.openid.net/event/backchannel-logout"])throw new Ya('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:o.sid,sub:o.sub}}});function yc(){const e=u(Oa,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(u(Oa,this).useMtls?"1":"0")}async function bc(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=await c(qa,this,Ac).call(this,n),o=new Io(e,u(Oa,this).clientId,{client_secret:u(Oa,this).clientSecret,use_mtls_endpoint_aliases:u(Oa,this).useMtls},i);return o[ko]=null!=t?t:u(Ua,this),o}function wc(e){return _r(u(Ua,this),e,u(Ra,this))}async function xc(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=await c(qa,this,_c).call(this,t),i=n.configuration,o=n.serverMetadata;if(!e)return{configuration:i,serverMetadata:o};const s=c(qa,this,wc).call(this,e);return{configuration:await c(qa,this,bc).call(this,o,s,t),serverMetadata:o}}async function _c(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=u(e?ja:Aa,this);if(t&&u(Ca,this))return{configuration:t,serverMetadata:u(Ca,this)};const n=c(qa,this,yc).call(this);e||await c(qa,this,Ac).call(this,!1);const i=u(Na,this).get(n);if(i)return c(qa,this,kc).call(this,i.serverMetadata,e);const o=u(za,this).get(n);if(o){const t=await o;return c(qa,this,kc).call(this,t.serverMetadata,e)}const s=(async()=>{const e=(await async function(e,t,n,i,o){const s=await async function(e,t){var n,i;if(!(e instanceof URL))throw Eo('"server" must be an instance of URL',So);const o=!e.href.includes("/.well-known/"),s=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:30,a=AbortSignal.timeout(1e3*s),r=await(o?async function(e,t){return async function(e,t,n,i){if(!(e instanceof URL))throw St('"'.concat("issuerIdentifier",'" must be an instance of URL'),Tt);on(e,!0!==(null==i?void 0:i[Et]));const o=n(new URL(e.href)),s=$t(null==i?void 0:i.headers);return s.set("accept","application/json"),((null==i?void 0:i[jt])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:Jt(o,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=Ft("".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=Ft("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw St('"options.algorithm" must be "oidc" (default), or "oauth2"',kt)}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[jt]:null==t?void 0:t[ko],[Et]:null==t||null===(i=t.execute)||void 0===i?void 0:i.includes(zo),signal:a,headers:new Headers(vo)}):((null==t?void 0:t[ko])||fetch)((on(e,null==t||null===(c=t.execute)||void 0===c||!c.includes(zo)),e.href),{headers:Object.fromEntries(new Headers(g({accept:"application/json"},vo)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==ui)throw St('"expectedIssuerIdentifier" must be an instance of URL',Tt);if(!_t(t,Response))throw St('"response" must be an instance of Response',Tt);if(200!==t.status)throw Dt('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Vn,t);ni(t);const i=await pi(t);if(Kt(i.issuer,'"response" body "issuer" property',Hn,{body:i}),n!==ui&&new URL(i.issuer).href!==n.href)throw Dt('"response" body "issuer" property does not match the expected value',Yn,{expected:n.href,body:i,attribute:"issuer"});return i}(ui,e)).catch(jo);var c;return o&&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[Co]=!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 Po("discovered metadata issuer does not match the expected issuer",{code:Yn,cause:{expected:e.href,body:r,attribute:"issuer"}})})()),r}(e,o),a=new Io(s,t,n,i);let r=yo(a);if(null!=o&&o[ko]&&(r.fetch=o[ko]),null!=o&&o.timeout&&(r.timeout=o.timeout),null!=o&&o.execute)for(const e of o.execute)e(a);return a}(new URL("https://".concat(u(Oa,this).domain)),u(Oa,this).clientId,{use_mtls_endpoint_aliases:u(Oa,this).useMtls},(e,t,n,i)=>{n.set("client_id",t.client_id)},{[ko]:u(Ua,this)})).serverMetadata();return u(Na,this).set(n,{serverMetadata:e}),{serverMetadata:e}})();s.catch(()=>{}),u(za,this).set(n,s);try{const t=(await s).serverMetadata;return c(qa,this,kc).call(this,t,e)}finally{u(za,this).delete(n)}}async function kc(e,t){const n=await c(qa,this,bc).call(this,e,void 0,t);return h(Ca,this,e),h(t?ja:Aa,this,n),{configuration:n,serverMetadata:e}}async function Tc(e,t,n){var i,o,s;const a=(await c(qa,this,xc).call(this,t)).configuration;if("audience"in e||"resource"in e)throw new Ga("audience and resource parameters are not supported for Token Vault exchanges");uc(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==(i=e.subjectTokenType)&&void 0!==i?i:fc,requested_token_type:null!==(o=e.requestedTokenType)&&void 0!==o?o:"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),dc(r,e.extra),n){var l;const t=xr(null!==(l=a[ko])&&void 0!==l?l:u(Ua,this)),i=await c(qa,this,bc).call(this,a.serverMetadata(),t);try{const e=await Bo(i,hc,r),n=yr.fromTokenEndpointResponse(e),o=t.getCapturedResponse();if(!o)throw new sr;return{data:n,response:o}}catch(n){if(n instanceof sr)throw n;const i=new Ga("Failed to exchange token for connection '".concat(e.connection,"'."),Wa(n)),o=t.getCapturedResponse();throw i.statusCode=null==o?void 0:o.status,i.headers=o?ar(o.headers):void 0,i}}const p=xr(null!==(s=a[ko])&&void 0!==s?s:u(Ua,this)),d=await c(qa,this,bc).call(this,a.serverMetadata(),p);try{const e=await Bo(d,hc,r);return yr.fromTokenEndpointResponse(e)}catch(t){const n=new Ga("Failed to exchange token for connection '".concat(e.connection,"'."),Wa(t)),i=p.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?ar(i.headers):void 0,n}}function Sc(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 Ei("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 Ei("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new Ei("Invalid JWT");if(!n)throw new Ei("JWTs must contain a payload");let o,s;try{o=Li(n)}catch(e){throw new Ei("Failed to base64url decode the payload")}try{s=JSON.parse(fi.decode(o))}catch(e){throw new Ei("Failed to parse the decoded payload as JSON")}if(!zi(s))throw new Ei("Invalid JWT Claims Set");return s}(t.access_token).act}catch(e){}return e}async function Ec(e,t,n){var i;const o=(await c(qa,this,xc).call(this,t)).configuration;if(uc(e.subjectToken),void 0!==e.organization&&lr(e.organization),void 0!==e.actorToken&&void 0===e.actorTokenType)throw new Ga("actorTokenType is required when actorToken is provided");const s=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});if(e.audience&&s.append("audience",e.audience),e.scope&&s.append("scope",e.scope),e.requestedTokenType&&s.append("requested_token_type",e.requestedTokenType),e.organization&&s.append("organization",e.organization),e.actorToken&&s.append("actor_token",e.actorToken),e.actorTokenType&&s.append("actor_token_type",e.actorTokenType),dc(s,e.extra),n){var a;const t=xr(null!==(a=o[ko])&&void 0!==a?a:u(Ua,this)),i=await c(qa,this,bc).call(this,o.serverMetadata(),t);let r,l,p;try{if(l=await Bo(i,mc,s),r=yr.fromTokenEndpointResponse(l),p=t.getCapturedResponse(),!p)throw new sr}catch(n){if(n instanceof sr)throw n;const i=new Ga("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),Wa(n)),o=t.getCapturedResponse();throw i.statusCode=null==o?void 0:o.status,i.headers=o?ar(o.headers):void 0,i}return c(qa,this,Sc).call(this,r,l,e),{data:r,response:p}}const r=xr(null!==(i=o[ko])&&void 0!==i?i:u(Ua,this)),l=await c(qa,this,bc).call(this,o.serverMetadata(),r);let p,d;try{d=await Bo(l,mc,s),p=yr.fromTokenEndpointResponse(d)}catch(t){const n=new Ga("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),Wa(t)),i=r.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?ar(i.headers):void 0,n}return c(qa,this,Sc).call(this,p,d,e),p}async function Pc(e,t,n){var i;const o=(await c(qa,this,xc).call(this,t)).configuration;if(n){var s;const t=xr(null!==(s=o[ko])&&void 0!==s?s:u(Ua,this)),n=await c(qa,this,bc).call(this,o.serverMetadata(),t);try{const i=await Bo(n,"http://auth0.com/oauth/grant-type/passwordless/otp",e),o=yr.fromTokenEndpointResponse(i),s=t.getCapturedResponse();if(!s)throw new sr;return{data:o,response:s}}catch(e){if(e instanceof sr)throw e;const n=new zr("There was an error while trying to request a token.",Wa(e)),i=t.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?ar(i.headers):void 0,n}}const a=xr(null!==(i=o[ko])&&void 0!==i?i:u(Ua,this)),r=await c(qa,this,bc).call(this,o.serverMetadata(),a);try{const t=await Bo(r,"http://auth0.com/oauth/grant-type/passwordless/otp",e);return yr.fromTokenEndpointResponse(t)}catch(e){const t=new zr("There was an error while trying to request a token.",Wa(e)),n=a.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?ar(n.headers):void 0,t}}async function Ac(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=!!u(Oa,this).clientSecret||!!u(Oa,this).clientAssertionSigningKey||!!u(Oa,this).useMtls;return e&&!t?(e,t,n,i)=>{n.set("client_id",t.client_id)}:(u(Ia,this)||h(Ia,this,(async()=>{if(!u(Oa,this).clientSecret&&!u(Oa,this).clientAssertionSigningKey&&!u(Oa,this).useMtls)throw new ir;if(u(Oa,this).useMtls)return(e,t,n,i)=>{n.set("client_id",t.client_id)};let e=u(Oa,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await qs(e,u(Oa,this).clientAssertionSigningAlg||"RS256")),e?function(e){return function(e,t){const n=(s=e)instanceof CryptoKey?{key:s}:(null==s?void 0:s.key)instanceof CryptoKey?(void 0!==s.kid&&Kt(s.kid,'"kid"'),{key:s.key,kid:s.kid}):{},i=n.key,o=n.kid;var s;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw St("".concat(t," must be a CryptoKey"),Tt)}(e,t),"private"!==e.type)throw St("".concat(t," must be a private CryptoKey"),kt)}(i,'"clientPrivateKey.key"'),async(e,n,s,a)=>{var r;const c={alg:Gt(i),kid:o},l=function(e,t){const n=Yt()+Zt(t);return{jti:Bt(),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[Ct])||void 0===r||r.call(t,c,l),s.set("client_id",n.client_id),s.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),s.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw St('CryptoKey instances used for signing assertions must include "sign" in their "usages"',kt);const i="".concat(zt(Rt(JSON.stringify(e))),".").concat(zt(Rt(JSON.stringify(t)))),o=zt(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:oi(e)};case"RSA-PSS":switch(ii(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 Mt("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return ii(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new Mt("unsupported CryptoKey algorithm name",{cause:e})}(n),n,Rt(i)));return"".concat(i,".").concat(o)}(c,l,i))}}(e,void 0)}(e):xo(u(Oa,this).clientSecret)})().catch(e=>{throw h(Ia,this,void 0),e})),u(Ia,this))}async function jc(e){const t=(await c(qa,this,_c).call(this)).configuration,n=Bt(),i=await function(e){return async function(e){return Kt(e,"codeVerifier"),zt(await crypto.subtle.digest("SHA-256",Rt(e)))}(e)}(n),o=cr(g(g({},u(Oa,this).authorizationParams),null==e?void 0:e.authorizationParams)),s=new URLSearchParams(g(g({scope:lc},o),{},{client_id:u(Oa,this).clientId,code_challenge:i,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await $o(t,s):await Wo(t,s),codeVerifier:n}}var Cc,Ic,Oc,Uc=new sc(1e3,6e4);class Rc extends C{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Rc.prototype)}static fromPayload(e){let t=e.error,n=e.error_description;return new Rc(t,n)}}class Lc extends Rc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Lc.prototype)}}class Nc extends Rc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Nc.prototype)}}class zc extends Rc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,zc.prototype)}}class Mc extends Rc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Mc.prototype)}}class qc extends Rc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,qc.prototype)}}class Dc{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 Wc{constructor(e,t){this.authJsMfaClient=e,this.auth0Client=t,this.contextManager=new Dc}setMFAAuthDetails(e,t,n,i){this.contextManager.set(e,{scope:t,audience:n,mfaRequirements:i})}async getAuthenticators(e){var t,n,i;const o=this.contextManager.get(e);if(!o)throw new Lc("invalid_request","MFA context not found for this MFA token");const s=null===(n=null===(t=o.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 s&&0!==s.length?t.filter(e=>!!e.type&&s.includes(e.type)):t}catch(e){if(e instanceof dr)throw new Lc(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=yt[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 hr)throw new Nc(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 fr)throw new zc(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 qc("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 Mc("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 Mc("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const i=t.scope,o=t.audience;try{const t=await this.auth0Client._requestTokenForMfa({grant_type:n,mfaToken:e.mfaToken,scope:i,audience:o,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 Mc)throw new Mc(e.error,e.error_description);throw e}}}class $c extends Error{constructor(e,t,n){super(t),this.name="PasskeyError",this.code=e,this.cause=n,Object.setPrototypeOf(this,$c.prototype)}}class Jc{constructor(e,t){Cc.set(this,void 0),Ic.set(this,void 0),Oc.set(this,null),s(this,Cc,e,"f"),s(this,Ic,t,"f")}async signup(e){if(!window.PublicKeyCredential)throw new $c("passkey_not_supported","WebAuthn is not supported in this browser.");s(this,Oc,null,"f");const t=e.scope,n=e.audience,a=i(e,["scope","audience"]),r=await o(this,Cc,"f").register(a);if(r.verificationRequired&&r.verificationRequired.length>0)throw s(this,Oc,{authSession:r.authSession,publicKey:Kc(r.authnParamsPublicKey),verificationRequired:r.verificationRequired,realm:a.realm,organization:a.organization,scope:t,audience:n},"f"),new q(r.verificationRequired);const c=Kc(r.authnParamsPublicKey),l=await navigator.credentials.create({publicKey:c});if(!l)throw new $c("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");const p=Bc(l);return o(this,Ic,"f")._requestTokenForPasskey({authSession:r.authSession,credential:p,realm:a.realm,organization:a.organization,scope:t,audience:n})}async login(e){if(!window.PublicKeyCredential)throw new $c("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e||{},n=t.scope,s=t.audience,a=i(t,["scope","audience"]),r=await o(this,Cc,"f").challenge(Object.keys(a).length>0?a:void 0),c=Vc(r.authnParamsPublicKey),l=await navigator.credentials.get({publicKey:c});if(!l)throw new $c("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");const p=Gc(l);return o(this,Ic,"f")._requestTokenForPasskey({authSession:r.authSession,credential:p,realm:a.realm,organization:a.organization,scope:n,audience:s})}async getSignupChallenge(e){if(!window.PublicKeyCredential)throw new $c("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await o(this,Cc,"f").register(e);return Object.assign({authSession:t.authSession,publicKey:Kc(t.authnParamsPublicKey)},t.verificationRequired&&{verificationRequired:t.verificationRequired})}async getLoginChallenge(e){if(!window.PublicKeyCredential)throw new $c("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await o(this,Cc,"f").challenge(e);return{authSession:t.authSession,publicKey:Vc(t.authnParamsPublicKey)}}async getTokenWithPasskey(e){if(!window.PublicKeyCredential)throw new $c("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e.authSession,n=e.credential,i=e.realm,s=e.organization,a=e.scope,r=e.audience,c=e.verification,l=null!=c?c:{};if(Object.keys(l).some(e=>""===l[e]))throw new $c("missing_verification_code","OTP codes in verification must not be empty.");const p=n.response;let u;if(p instanceof AuthenticatorAttestationResponse)u=Bc(n);else{if(!(p instanceof AuthenticatorAssertionResponse))throw new $c("passkey_invalid_credential","The provided credential is not a valid attestation or assertion response.");u=Gc(n)}return o(this,Ic,"f")._requestTokenForPasskey({authSession:t,credential:u,realm:i,organization:s,scope:a,audience:r,verification:c})}async continueSignup(e){if(!o(this,Oc,"f"))throw new $c("no_pending_signup","No pending signup found. Call signup() first and catch PasskeyVerificationRequiredError.");const t=o(this,Oc,"f").verificationRequired.filter(t=>!(null==e?void 0:e[t]));if(t.length>0)throw new $c("missing_verification_code","Missing OTP code for: ".concat(t.join(", "),". Pass a code for each identifier in verificationRequired."));const n=o(this,Oc,"f");s(this,Oc,null,"f");const i=n.authSession,a=n.publicKey,r=n.realm,c=n.organization,l=n.scope,p=n.audience;let u=n.credential;if(!u){let t;try{t=await navigator.credentials.create({publicKey:a})}catch(e){throw s(this,Oc,n,"f"),e}if(!t)throw s(this,Oc,n,"f"),new $c("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");u=Bc(t)}try{return await o(this,Ic,"f")._requestTokenForPasskey({authSession:i,credential:u,realm:r,organization:c,scope:l,audience:p,verification:e})}catch(e){throw e instanceof jr&&e.isRetryable&&s(this,Oc,Object.assign(Object.assign({},n),{authSession:e.authSession,verificationRequired:e.verificationRequired,credential:u}),"f"),e}}}function Fc(e){const t=new Uint8Array(e),n=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Hc(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),i=atob(n),o=new Uint8Array(i.length);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return o.buffer}function Kc(e){return Object.assign(Object.assign({},e),{challenge:Hc(e.challenge),user:Object.assign(Object.assign({},e.user),{id:Hc(e.user.id)}),pubKeyCredParams:e.pubKeyCredParams,authenticatorSelection:e.authenticatorSelection})}function Vc(e){return Object.assign(Object.assign({},e),{challenge:Hc(e.challenge)})}function Bc(e){var t;const n=e.response;return{id:e.id,rawId:Fc(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:Fc(n.clientDataJSON),attestationObject:Fc(n.attestationObject)},clientExtensionResults:e.getClientExtensionResults()}}function Gc(e){var t;const n=e.response;return{id:e.id,rawId:Fc(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:Fc(n.clientDataJSON),authenticatorData:Fc(n.authenticatorData),signature:Fc(n.signature),userHandle:n.userHandle?Fc(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 Xc(){let e=null;return{get:()=>e,set:t=>{e=t},remove:()=>{e=null}}}Cc=new WeakMap,Ic=new WeakMap,Oc=new WeakMap;class Yc{constructor(e,t){this.slots=new Map,this.baseKey="".concat("@@auth0spajs@@","::").concat(e,"::anonymous");try{this.useLocalStorage="localStorage"===t&&"undefined"!=typeof window&&!!window.localStorage}catch(e){this.useLocalStorage=!1}this.sessionKey="".concat(this.baseKey,"::").concat("session"),this.sessionStore=this.useLocalStorage?Zc(this.sessionKey):Xc();const n="".concat(this.baseKey,"::").concat("session_expired");this.expiredStore=this.useLocalStorage?Zc(n):Xc()}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):Xc()),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 Qc{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 Yc(t,n),this.lockManager=null!=i?i:ve()}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 Qr("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 o=null===(n=this.cache.getSessionToken())||void 0===n?void 0:n.sessionToken;let s;try{s=await this.authJsClient.getAccessToken(Object.assign(Object.assign({},e),{sessionToken:o}))}catch(e){throw e instanceof Qr&&("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:s.accessToken,expiresAt:s.expiresAt},void 0!==s.scope&&{scope:s.scope})),this.cache.getSessionToken()||this.cache.setSessionToken(Object.assign({sessionToken:s.sessionToken},void 0!==s.sessionTokenExpiresAt&&{sessionTokenExpiresAt:s.sessionTokenExpiresAt})),Object.assign({accessToken:s.accessToken,expiresAt:s.expiresAt},void 0!==s.scope&&{scope:s.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 el{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 $e).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(!F())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===F().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=ve(),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,!lt(t))throw new Error('Invalid cache location "'.concat(t,'"'));n=lt(t)()}var i;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:k,this.cookieStorage=!1===e.legacySameSiteCookie?Ye:et,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 o=e.useCookiesForTransactions?this.cookieStorage:tt;let s="";var a;this.onlineAccess?s=E:this.options.useRefreshTokens&&(s="offline_access"),this.scope=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];if("object"!=typeof e)return{[j]:Ne(t,e,...i)};let s={[j]:Ne(t,...i)};return Object.keys(e).forEach(n=>{const o=e[n];s[n]=Ne(t,o,...i)}),s}(this.options.authorizationParams.scope,"openid",s),this.transactionManager=new Fe(o,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||A,this.cacheManager=new Je(n,n.allKeys?void 0:new at(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new ht(this.options.clientId):void 0,this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),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 vt(c,r),this.authJsClient=new gc({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new Wc(this.authJsClient.mfa,this),this.anonymous=new Qc(this.authJsClient.anonymous,this.options.clientId,this.options.anonymousSessionsCacheMode,this.lockManager),this.passkey=new Jc(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 st,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||P,n=B(t,!0),i=encodeURIComponent(btoa(JSON.stringify(n)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(i)}_authorizeUrl(e){return this._url("/authorize?".concat(G(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],o=n[1],s=n[2];if(3!==t.length||!i||!o||!s)throw new Error("ID token could not be decoded");const a=JSON.parse(X(o)),r={__raw:e},c={};return Object.keys(a).forEach(e=>{r[e]=a[e],Ke.includes(e)||(c[e]=a[e])}),{encoded:{header:i,payload:o,signature:s},header:JSON.parse(X(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&&!He(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||!He(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!He(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()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),i>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(i,") is after expiration time (").concat(o,")"));if(null!=t.claims.nbf&&He(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&&He(t.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),i>o)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(o))}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:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:i});var o}_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 o=K(H()),s=K(H()),a=H(),r=await Z(a),c=Y(r),l=await(null===(i=this.dpop)||void 0===i?void 0:i.calculateThumbprint()),p=((e,t,n,i,o,s,a,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:o,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:s,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,o,s,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,l),u=this._authorizeUrl(p);return{nonce:s,code_verifier:a,scope:p.scope,audience:p.audience||j,redirect_uri:p.redirect_uri,state:o,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 z;const i=await this._applyAnonTransferToken(this._applySessionTransferToken(e.authorizationParams||{})),o=await this._prepareAuthorizeUrl(i,{response_mode:"web_message"},window.location.origin);t.popup.location.href=o.url;const s=await((e,t)=>new Promise((n,i)=>{let o;const s=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(s),clearTimeout(a),window.removeEventListener("message",o,!1),i(new N(e.popup)))},1e3),a=setTimeout(()=>{clearInterval(s),i(new L(e.popup)),window.removeEventListener("message",o,!1)},1e3*(e.timeoutInSeconds||60));o=function(r){if(r.origin===t&&r.data&&"authorization_response"===r.data.type){if(clearTimeout(a),clearInterval(s),window.removeEventListener("message",o,!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",o)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(o.url).origin);if(o.state!==s.state)throw new C("state_mismatch","Invalid state");const a=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:o.audience,scope:o.scope,code_verifier:o.code_verifier,grant_type:"authorization_code",code:s.code,redirect_uri:o.redirect_uri},{nonceIn:o.nonce,organization:a})}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,o=t.fragment,s=t.appState,a=i(t,["openUrl","fragment","appState"]),r=(null===(e=a.authorizationParams)||void 0===e?void 0:e.organization)||this.options.authorizationParams.organization,c=await this._applyAnonTransferToken(this._applySessionTransferToken(a.authorizationParams||{})),l=await this._prepareAuthorizeUrl(c),p=l.url,u=i(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},u),{appState:s,response_type:nt.Code}),r&&{organization:r}));const d=o?"".concat(p,"#").concat(o):p;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===nt.ConnectCode?this._handleConnectAccountRedirectCallback(n,t):this._handleLoginRedirectCallback(n,t)}async _handleLoginRedirectCallback(e,t){const n=e.code,i=e.state,o=e.error,s=e.error_description;if(o)throw new O(o,s||o,i,t.appState);if(!t.code_verifier||t.state&&t.state!==i)throw new C("state_mismatch","Invalid state");const a=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:a}),{appState:t.appState,response_type:nt.Code}}async _handleConnectAccountRedirectCallback(e,t){const n=e.connect_code,i=e.state,o=e.error,s=e.error_description;if(o)throw new U(o,s||o,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 a=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({},a),{appState:t.appState,response_type:nt.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(rt))return void await this._maybeCreateAnonymousSession();this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(rt)}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)})}),o=await this._getTokenSilently(i);return e.detailedResponse?o:null==o?void 0:o.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||j,clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const o=(s=this.options.clientId,a=n.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(s,".").concat(a));var s,a;try{return await this.lockManager.runWithLock(o,5e3,async()=>{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||j,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,o=e.token_type,s=e.access_token,a=e.oauthTokenScope,r=e.expires_in;return Object.assign(Object.assign({id_token:i,token_type:o,access_token:s},a?{scope:a}: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||j,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 o=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(o,t),(await this.cacheManager.get(new De({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||j,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,o=i(t,["federated"]),s=n?"&federated":"";return this._url("/v2/logout?".concat(G(Object.assign({clientId:e.clientId},o))))+s}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||j,n=await this.cacheManager.getRefreshTokensByAudience(t,this.options.clientId);await async function(e,t){let n=e.auth0Client,i=e.useFormData,o=e.refreshTokens,s=e.audience,a=e.client_id,r=e.onRefreshTokenRevoked;const c=e.timeout||k,l="refresh_token",p="".concat(e.baseUrl,"/oauth/revoke"),u={"Content-Type":i?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(B(n||P)))};if(t){const n={client_id:a,token_type_hint:l},o=i?G(n):JSON.stringify(n);try{return await Ie({type:"revoke",timeout:c,fetchUrl:p,fetchOptions:{method:"POST",body:o,headers:u},useFormData:i,auth:{audience:null!=s?s:j}},t)}catch(e){throw new C("revoke_error",e.message)}}for(const t of o){const n={client_id:a,token_type_hint:l,token:t},o=i?G(n):JSON.stringify(n),s=await Oe(p,{method:"POST",body:o,headers:u},c);if(!s.ok){let t,n;try{var d=JSON.parse(await s.text());t=d.error,n=d.error_description}catch(e){}throw new C(t||"revoke_error",n||"HTTP error ".concat(s.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),o=n.openUrl,s=i(n,["openUrl"]);await this._clearLocalSession(e.clientId);const a=this._buildLogoutUrl(s);o?await o(a):!1!==o&&window.location.assign(a)}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),o=i.url,s=i.state,a=i.nonce,r=i.code_verifier,c=i.redirect_uri,l=i.scope,p=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,o)=>{const s=window.document.createElement("iframe");s.setAttribute("width","0"),s.setAttribute("height","0"),s.style.display="none";const a=()=>{window.document.body.contains(s)&&(window.document.body.removeChild(s),window.removeEventListener("message",r,!1))};let r;const c=setTimeout(()=>{o(new R),a()},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?o(C.fromPayload(e.data.response)):i(e.data.response),clearTimeout(c),window.removeEventListener("message",r,!1),setTimeout(a,2e3)},window.addEventListener("message",r,!1),window.document.body.appendChild(s),s.setAttribute("src",e)})}(o,d,u);if(s!==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:a,organization:t.organization});return Object.assign(Object.assign({},m),{scope:l,oauthTokenScope:m.scope,audience:p})})}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||j,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||j,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,o=((e,t,n,i)=>{var o;if(e&&n&&i){if(t.audience!==n)return t.scope;const e=i.split(" "),s=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],a=s.every(t=>e.includes(t));return e.length>=s.length&&a?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 l=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:o});if(await this._propagateRotatedRefreshToken(null==t?void 0:t.refresh_token,l.refresh_token),this.options.useMrrt&&(s=null==t?void 0:t.audience,a=null==t?void 0:t.scope,r=e.authorizationParams.audience,c=e.authorizationParams.scope,s!==r||!((e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))})(c,a))){const t=((e,t,n)=>{const i=(null==e?void 0:e.split(" "))||[],o=n?i.filter(e=>e!==E):i,s=(null==t?void 0:t.split(" "))||[];return o.filter(e=>-1==s.indexOf(e)).join(",")})(o,l.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||j,e.authorizationParams.scope),new W(e.authorizationParams.audience||"default",t)}}return Object.assign(Object.assign({},l),{scope:e.authorizationParams.scope,oauthTokenScope:l.scope,audience:e.authorizationParams.audience||j})}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 s,a,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,o=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===o||n<=o)throw new C("invalid_token","Invalid session_expiry: session ceiling is before or at the token issue time.")}const s=e.id_token,a=e.decodedToken,r=i(e,["id_token","decodedToken"]);this.userCache.set(qe,{id_token:s,decodedToken:a}),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(qe);try{await(null===(t=this.dpop)||void 0===t?void 0:t.clear())}catch(e){}if(this.worker)try{await Ie({type:"clear"},this.worker)}catch(e){}}async _isSessionCeilingReached(){var e,t;const n=this.userCache.get(qe),i=null!=n?n:await this.cacheManager.getIdToken(new De({clientId:this.options.clientId})),o=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===o)return!1;const s=await this.nowProvider();return Math.floor(s/1e3)>=o-30&&(await this._clearLocalSession(),!0)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||j,t=this.scope[e],n=await this.cacheManager.getIdToken(new De({clientId:this.options.clientId,audience:e,scope:t})),i=this.userCache.get(qe);return n&&n.id_token===(null==i?void 0:i.id_token)?i:(this.userCache.set(qe,n),n)}async _getEntryFromCache(e){let t=e.scope,n=e.audience,i=e.clientId,o=e.cacheMode;const s=await this.cacheManager.get(new De({scope:t,audience:n,clientId:i}),60,this.options.useMrrt,o);if(s&&s.access_token){const e=s.token_type,t=s.access_token,n=s.oauthTokenScope,i=s.expires_in,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.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,o,s,a,r;const c=t||{},l=c.nonceIn,p=c.organization,u=c.scopesToRequest;try{const t=await Le(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,l,p);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(qe))}if("authorization_code"!==e.grant_type){const e=await this._getIdTokenFromCache(),t=null===(s=null===(o=null==e?void 0:e.decodedToken)||void 0===o?void 0:o.claims)||void 0===s?void 0:s.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!==(a=e.refresh_token)&&void 0!==a?a:null===(r=await this.cacheManager.get(new De({scope:u||e.scope,audience:e.audience||j,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||j}),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(p||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 Le(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 ft(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,o=e.scopes,s=e.authorization_params,a=e.redirectUri,r=void 0===a?this.options.authorizationParams.redirect_uri||window.location.origin:a;if(!i)throw new Error("connection is required");const c=K(H()),l=H(),p=await Z(l),u=Y(p),d=await this.myAccount.connectAccount({connection:i,scopes:o,redirect_uri:r,state:c,code_challenge:u,code_challenge_method:"S256",authorization_params:s}),h=d.connect_uri,m=d.connect_params,f=d.auth_session;this.transactionManager.create({state:c,code_verifier:l,auth_session:f,redirect_uri:r,appState:n,connection:i,response_type:nt.ConnectCode});const v=new URL(h);v.searchParams.set("ticket",m.ticket),t?await t(v.toString()):window.location.assign(v)}async _requestTokenForPasskey(e){var t;const n=e.audience||this.options.authorizationParams.audience,i=e.organization||this.options.authorizationParams.organization,o=!!e.verification&&Object.keys(e.verification).length>0;try{return await this._requestToken(Object.assign(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}),o&&{verification:e.verification}),{scope:ze(this.scope,e.scope,n),audience:n}))}catch(e){if(e instanceof C&&(null===(t=e.data)||void 0===t?void 0:t.auth_session)&&e.data.verification_required)throw new jr(e.error_description,{error:e.error,error_description:e.error_description,auth_session:e.data.auth_session,verification_required:e.data.verification_required});throw e}}async _requestTokenForMfa(e,t){const n=e.mfaToken,o=i(e,["mfaToken"]),s=await this.cacheManager.get(new De({scope:o.scope,audience:o.audience||j,clientId:this.options.clientId}),void 0,this.options.useMrrt),a=await this._requestToken(Object.assign(Object.assign({},o),{mfa_token:n}),t);return await this._propagateRotatedRefreshToken(null==s?void 0:s.refresh_token,a.refresh_token),a}}function tl(e,t,n){var i;return async function(e,t,n){const i=t.toLowerCase(),o=e.replace(/^https?:\/\//,""),s="".concat(o,"|").concat(i),a=Uc.get(s);if(void 0!==a)return a;try{var r;const e=new URL("https://".concat(o,"/.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=br(t,n.telemetry));const a=await t(e.toString());return a.ok?(Uc.set(s,!0),!0):404===a.status?(Uc.set(s,!1,15e3),!1):429===a.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:P}))}async function nl(e){const t=new el(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,s=r(e),a=s[0],c=s[1],l=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),p=0,u=c>0?a-4:a;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)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=255&t;return 2===c&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[p++]=255&t),1===c&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[p++]=t>>8&255,l[p++]=255&t),l},t.fromByteArray=function(e){for(var t,i=e.length,o=i%3,s=[],a=16383,r=0,c=i-o;r<c;r+=a)s.push(l(e,r,r+a>c?c:r+a));return 1===o?(t=e[i-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[i-2]<<8)+e[i-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;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 l(e,t,n){for(var i,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(c(i));return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},318(e,t){t.read=function(e,t,n,i,o){var s,a,r=8*o-i-1,c=(1<<r)-1,l=c>>1,p=-7,u=n?o-1:0,d=n?-1:1,h=e[t+u];for(u+=d,s=h&(1<<-p)-1,h>>=-p,p+=r;p>0;s=256*s+e[t+u],u+=d,p-=8);for(a=s&(1<<-p)-1,s>>=-p,p+=i;p>0;a=256*a+e[t+u],u+=d,p-=8);if(0===s)s=1-l;else{if(s===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,i),s-=l}return(h?-1:1)*a*Math.pow(2,s-i)},t.write=function(e,t,n,i,o,s){var a,r,c,l=8*s-o-1,p=(1<<l)-1,u=p>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-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,a=p):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(a++,c/=2),a+u>=p?(r=0,a=p):a+u>=1?(r=(t*c-1)*Math.pow(2,o),a+=u):(r=t*Math.pow(2,u-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&r,h+=m,r/=256,o-=8);for(a=a<<o|r,l+=o;l>0;e[n+h]=255&a,h+=m,a/=256,l-=8);e[n+h-m]|=128*f}},526(e,t,n){"use strict";var i=n(991),o=n(318),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;var a=2147483647;function r(e){if(e>a)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 l(e,t,n)}function l(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),o=i.write(e,t);return o!==n&&(i=i.slice(0,o)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(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(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(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 o=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||$(e.length)?r(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function p(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 p(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>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(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 o=!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 q(e).length;default:if(o)return i?-1:M(e).length;t=(""+t).toLowerCase(),o=!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 A(this,t,n);case"latin1":case"binary":return j(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,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,o){var s,a=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;a=2,r/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var p=-1;for(s=n;s<r;s++)if(l(e,s)===l(t,-1===p?0:s-p)){if(-1===p&&(p=s),s-p+1===c)return p*a}else-1!==p&&(s-=s-p),p=-1}else for(n+c>r&&(n=r-c),s=n;s>=0;s--){for(var u=!0,d=0;d<c;d++)if(l(e,s+d)!==l(t,d)){u=!1;break}if(u)return s}return-1}function w(e,t,n,i){n=Number(n)||0;var o=e.length-n;i?(i=Number(i))>o&&(i=o):i=o;var s=t.length;i>s/2&&(i=s/2);for(var a=0;a<i;++a){var r=parseInt(t.substr(2*a,2),16);if($(r))return a;e[n+a]=r}return a}function x(e,t,n,i){return D(M(t,e.length-n),e,n,i)}function _(e,t,n,i){return D(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 D(q(t),e,n,i)}function T(e,t,n,i){return D(function(e,t){for(var n,i,o,s=[],a=0;a<e.length&&!((t-=2)<0);++a)i=(n=e.charCodeAt(a))>>8,o=n%256,s.push(o),s.push(i);return s}(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=[],o=t;o<n;){var s,a,r,c,l=e[o],p=null,u=l>239?4:l>223?3:l>191?2:1;if(o+u<=n)switch(u){case 1:l<128&&(p=l);break;case 2:128==(192&(s=e[o+1]))&&(c=(31&l)<<6|63&s)>127&&(p=c);break;case 3:s=e[o+1],a=e[o+2],128==(192&s)&&128==(192&a)&&(c=(15&l)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:s=e[o+1],a=e[o+2],r=e[o+3],128==(192&s)&&128==(192&a)&&128==(192&r)&&(c=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&r)>65535&&c<1114112&&(p=c)}null===p?(p=65533,u=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),o+=u}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=P));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 l(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 p(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(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),W(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,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==t[o]){n=e[o],i=t[o];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),o=0;for(n=0;n<e.length;++n){var s=e[n];if(W(s,Uint8Array))o+s.length>i.length?c.from(s).copy(i,o):Uint8Array.prototype.set.call(i,s,o);else{if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o)}o+=s.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+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,n,i,o){if(W(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===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),r=Math.min(s,a),l=this.slice(i,o),p=e.slice(t,n),u=0;u<r;++u)if(l[u]!==p[u]){s=l[u],a=p[u];break}return s<a?-1:a<s?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 o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!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(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function A(e,t,n){var i="";n=Math.min(e.length,n);for(var o=t;o<n;++o)i+=String.fromCharCode(127&e[o]);return i}function j(e,t,n){var i="";n=Math.min(e.length,n);for(var o=t;o<n;++o)i+=String.fromCharCode(e[o]);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 o="",s=t;s<n;++s)o+=J[e[s]];return o}function I(e,t,n){for(var i=e.slice(t,n),o="",s=0;s<i.length-1;s+=2)o+=String.fromCharCode(i[s]+256*i[s+1]);return o}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 U(e,t,n,i,o,s){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function R(e,t,n,i,o,s){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,i,s){return t=+t,n>>>=0,s||R(e,0,n,4),o.write(e,t,n,i,23,4),n+4}function N(e,t,n,i,s){return t=+t,n>>>=0,s||R(e,0,n,8),o.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],o=1,s=0;++s<t&&(o*=256);)i+=this[e+s]*o;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],o=1;t>0&&(o*=256);)i+=this[e+--t]*o;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],o=1,s=0;++s<t&&(o*=256);)i+=this[e+s]*o;return i>=(o*=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,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},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),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||U(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||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,n){return e=+e,t>>>=0,n||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,n){return e=+e,t>>>=0,n||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,n){return e=+e,t>>>=0,n||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,n,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var s=0,a=1,r=0;for(this[t]=255&e;++s<n&&(a*=256);)e<0&&0===r&&0!==this[t+s-1]&&(r=1),this[t+s]=(e/a|0)-r&255;return t+n},c.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var s=n-1,a=1,r=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===r&&0!==this[t+s+1]&&(r=1),this[t+s]=(e/a|0)-r&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||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,n){return e=+e,t>>>=0,n||U(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||U(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||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,n){return e=+e,t>>>=0,n||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,n){return L(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return N(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 o=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),o},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 o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}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 s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=c.isBuffer(e)?e:c.from(e,i),r=a.length;if(0===r)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<n-t;++s)this[s+t]=a[s%r]}return this};var z=/[^+/0-9A-Za-z-_]/g;function M(e,t){var n;t=t||1/0;for(var i=e.length,o=null,s=[],a=0;a<i;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&s.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.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;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function q(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,n,i){for(var o=0;o<i&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}var J=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var i=16*n,o=0;o<16;++o)t[i+o]=e[n]+e[o];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="",o=0,s=-1,a=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(s===r-1||1===a);else if(s!==r-1&&2===a){if(i.length<2||2!==o||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="",o=0):o=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),s=r,a=0;continue}}else if(2===i.length||1===i.length){i="",o=0,s=r,a=0;continue}t&&(i.length>0?i+="/..":i="..",o=2)}else i.length>0?i+="/"+e.slice(s+1,r):i=e.slice(s+1,r),o=r-s-1;s=r,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var i={resolve:function(){for(var e,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var i=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!i)).length||i||(e="."),e.length>0&&o&&(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 o=arguments[n];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}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 o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length,a=s-o,r=1;r<n.length&&47===n.charCodeAt(r);++r);for(var c=n.length-r,l=a<c?a:c,p=-1,u=0;u<=l;++u){if(u===l){if(c>l){if(47===n.charCodeAt(r+u))return n.slice(r+u+1);if(0===u)return n.slice(r+u)}else a>l&&(47===e.charCodeAt(o+u)?p=u:0===u&&(p=0));break}var d=e.charCodeAt(o+u);if(d!==n.charCodeAt(r+u))break;47===d&&(p=u)}var h="";for(u=o+p+1;u<=s;++u)u!==s&&47!==e.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(r+p):(r+=p,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,o=-1,s=!0,a=e.length-1;a>=1;--a)if(47===(n=e.charCodeAt(a))){if(!s){o=a;break}}else s=!1;return-1===o?i?"/":".":i&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var i,o=0,s=-1,a=!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 l=e.charCodeAt(i);if(47===l){if(!a){o=i+1;break}}else-1===c&&(a=!1,c=i+1),r>=0&&(l===n.charCodeAt(r)?-1===--r&&(s=i):(r=-1,s=c))}return o===s?s=c:-1===s&&(s=e.length),e.slice(o,s)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!a){o=i+1;break}}else-1===s&&(a=!1,s=i+1);return-1===s?"":e.slice(o,s)},extname:function(e){t(e);for(var n=-1,i=0,o=-1,s=!0,a=0,r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47!==c)-1===o&&(s=!1,o=r+1),46===c?-1===n?n=r:1!==a&&(a=1):-1!==n&&(a=-1);else if(!s){i=r+1;break}}return-1===n||-1===o||0===a||1===a&&n===o-1&&n===i+1?"":e.slice(n,o)},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,o=e.charCodeAt(0),s=47===o;s?(n.root="/",i=1):i=0;for(var a=-1,r=0,c=-1,l=!0,p=e.length-1,u=0;p>=i;--p)if(47!==(o=e.charCodeAt(p)))-1===c&&(l=!1,c=p+1),46===o?-1===a?a=p:1!==u&&(u=1):-1!==a&&(u=-1);else if(!l){r=p+1;break}return-1===a||-1===c||0===u||1===u&&a===c-1&&a===r+1?-1!==c&&(n.base=n.name=0===r&&s?e.slice(1,c):e.slice(r,c)):(0===r&&s?(n.name=e.slice(1,a),n.base=e.slice(1,c)):(n.name=e.slice(r,a),n.base=e.slice(r,c)),n.ext=e.slice(a,c)),r>0?n.dir=e.slice(0,r-1):s&&(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 o=i&&i.stringify||t;if("object"==typeof e&&null!==e){var s=n.length+1;if(1===s)return e;var a=new Array(s);a[0]=o(e);for(var r=1;r<s;r++)a[r]=o(n[r]);return a.join(" ")}if("string"!=typeof e)return e;var c=n.length;if(0===c)return e;for(var l="",p=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(p>=c)break;if(null==n[p])break;u<h&&(l+=e.slice(u,h)),l+=Number(n[p]),u=h+2,h++;break;case 105:if(p>=c)break;if(null==n[p])break;u<h&&(l+=e.slice(u,h)),l+=Math.floor(Number(n[p])),u=h+2,h++;break;case 79:case 111:case 106:if(p>=c)break;if(void 0===n[p])break;u<h&&(l+=e.slice(u,h));var m=typeof n[p];if("string"===m){l+="'"+n[p]+"'",u=h+2,h++;break}if("function"===m){l+=n[p].name||"<anonymous>",u=h+2,h++;break}l+=o(n[p]),u=h+2,h++;break;case 115:if(p>=c)break;u<h&&(l+=e.slice(u,h)),l+=String(n[p]),u=h+2,h++;break;case 37:u<h&&(l+=e.slice(u,h)),l+="%",u=h+2,h++,p--}++p}++h}return-1===u?e:(u<d&&(l+=e.slice(u)),l)}},48(e,t,n){var i,o,s;s=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 o=e[i];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(i>0&&(o=o.replace(/^[\/]+/,"")),o=i<e.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),t.push(o))}var s=t.join("/"),a=(s=s.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return a.shift()+(a.length>0?"?":"")+a.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=s():void 0===(o="function"==typeof(i=s)?i.call(t,n,t,e):i)||(e.exports=o)},122(){},360(){},826(){},713(e,t,n){"use strict";const i=n(930);e.exports=u;const o=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||{},s={mapHttpRequest:g,mapHttpResponse:g,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:g,res:g,err:f,errWithCause:f};function a(e,t){return"silent"===e?1/0:t.levels.values[e]}const r=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),l={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function p(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||o;e.browser.write&&(e.browser.asObject=!0);const i=e.serializers||{},s=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]:o[e]||o[l[e]||"log"]||b}),e[r]=i}(w,g,n),p({},w),Object.defineProperty(w,"levelVal",{get:function(){return a(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:s,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=s,w._stdErrSerialize=c,w.child=function(n,o){if(!n)throw new Error("missing bindings for child Pino");o=o||{},s&&n.serializers&&(o.serializers=n.serializers);const a=o.serializers;if(s&&a){var r=Object.assign({},i,a),c=!0===e.browser.serialize?Object.keys(r):s;delete n.serializers,h([n],c,r,this._stdErrSerialize)}function l(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)))}l.prototype=this;const u=new l(this);return p(this,u),u.level=this.level,u},t&&(w._logEvent=m()),w}function d(e,t,n,s){if(Object.defineProperty(e,s,{value:a(e.level,n)>a(s,n)?b:n[r][s],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[s]===b)return;e[s]=function(e,t,n,s){return c=e[r][s],function(){const r=t.timestamp(),l=new Array(arguments.length),p=Object.getPrototypeOf&&Object.getPrototypeOf(this)===o?o:this;for(var u=0;u<l.length;u++)l[u]=arguments[u];if(t.serialize&&!t.asObject&&h(l,this._serialize,this.serializers,this._stdErrSerialize),t.asObject||t.formatters?c.call(p,function(e,t,n,o,s={}){const{level:a=()=>e.levels.values[t],log:r=e=>e}=s;e._serialize&&h(n,e._serialize,e.serializers,e._stdErrSerialize);const c=n.slice();let l=c[0];const p={};o&&(p.time=o),p.level=a(t,e.levels.values[t]);let u=1+(0|e._childLevel);if(u<1&&(u=1),null!==l&&"object"==typeof l){for(;u--&&"object"==typeof c[0];)Object.assign(p,c.shift());l=c.length?i(c.shift(),c):void 0}else"string"==typeof l&&(l=i(c.shift(),c));return void 0!==l&&(p.msg=l),r(p)}(this,s,l,r,t.formatters)):c.apply(p,l),t.transmit){const i=t.transmit.level||e._level,o=n.levels.values[i],c=n.levels.values[s];if(c<o)return;!function(e,t,n){const i=t.send,o=t.ts,s=t.methodLevel,a=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=o,e._logEvent.messages=n.filter(function(e){return-1===c.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=a,i(s,e._logEvent,r),e._logEvent=m(c)}(this,{ts:r,methodLevel:s,methodValue:c,transmitLevel:i,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:a(e._level,n)},l)}};var c}(e,t,n,s);const l=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!==l.length&&(e[s]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(l,e[s]))}function h(e,t,n,i){for(const o in e)if(i&&e[o]instanceof Error)e[o]=u.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o]))for(const i in e[o])t&&t.indexOf(i)>-1&&i in n&&(e[o][i]=n[i](e[o][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=s,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,o=n(526).hp,s=Object.create,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,p=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 o of c(t))p.call(e,o)||o===n||a(e,o,{get:()=>t[o],enumerable:!(i=r(t,o))||i.enumerable});return e},h=(e,t,n)=>(n=null!=e?s(l(e)):{},d(!t&&e&&e.__esModule?n:a(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,o,s=f(),a=n(942).extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=r.exec(e),n=t&&s[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!c.test(t[1]))&&"UTF-8"}e.charset=l,e.charsets={lookup:l},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=a("x."+t).toLowerCase().substr(1);return n&&e.types[n]||!1},e.types=Object.create(null),t=e.extensions,i=e.types,o=["nginx","apache",void 0,"iana"],Object.keys(s).forEach(function(e){var n=s[e],a=n.extensions;if(a&&a.length){t[e]=a;for(var r=0;r<a.length;r++){var c=a[r];if(i[c]){var l=o.indexOf(s[i[c]].source),p=o.indexOf(n.source);if("application/octet-stream"!==i[c]&&(l>p||l===p&&"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)a(e,n,{get:t[n],enumerable:!0})})(g,{AbstractJob:()=>ge,AnnotationInclusionMode:()=>ut,AnnotationType:()=>ct,AreaType:()=>mt,ArtifactType:()=>wt,AssetInclusionMode:()=>pt,AssetStatus:()=>rt,AssetUrlType:()=>Et,AutoAnnotateStatus:()=>at,AutoAnnotateTask:()=>dt,COMBINED_UPLOAD_MAX_BYTES:()=>Re,ChangeType:()=>_t,ComputeAccountMismatchError:()=>Q,ComputeApiError:()=>Y,ContourType:()=>$,DEFAULT_PREDICTION_VERSION:()=>R,DataApiType:()=>ot,DataEndpoint:()=>Lt,DepthMap:()=>zt,Endpoint:()=>j,EndpointState:()=>k,EvaluationStatus:()=>Pt,ExportedBy:()=>bt,EyePop:()=>Kt,EyePopDataWebSocketError:()=>Ut,EyepopLineDecoder:()=>ce,ForwardOperatorType:()=>z,InferenceType:()=>D,LoadFromAssetUuidJob:()=>ke,LoadFromGroupJob:()=>_e,LoadFromJob:()=>we,LoadMediaStreamJob:()=>Te,MAX_OPEN_SOURCES:()=>Ue,ModelExportStatus:()=>yt,ModelFormat:()=>Tt,ModelPrecisionType:()=>St,ModelStatus:()=>gt,ModelTask:()=>vt,ModelTrainingStage:()=>xt,ModelType:()=>ft,MotionModel:()=>W,PIPELINE_PATH:()=>Ie,PipelineBackend:()=>Ve,PipelineCommandError:()=>Me,PipelineConfigurationError:()=>Ne,PipelineJob:()=>Ke,PipelineSocketClosedError:()=>ze,PipelineSourceError:()=>qe,PointCloud:()=>Dt,PopComponentType:()=>N,PredictionVersion:()=>U,QUATERNION_TOLERANCE:()=>C,SUBPROTOCOL:()=>Oe,SelectMode:()=>M,Semaphore:()=>E,SessionBackend:()=>je,Stream:()=>ae,TaskMode:()=>jt,TaskType:()=>At,TranscodeMode:()=>ht,TransientPopId:()=>Se,UploadGroupJob:()=>xe,UploadJob:()=>be,UserReview:()=>lt,VideoMode:()=>L,VlmAbilityStatus:()=>Ct,WebrtcBase:()=>fe,WebrtcWhep:()=>Vt,WebrtcWhip:()=>ve,WorkerEndpoint:()=>nt,WorkflowPhase:()=>kt,accessTokenCredential:()=>x,apiKeyCredential:()=>w,cloudOfDepth:()=>Ft,cloudOfObject:()=>Jt,cloudsOfPrediction:()=>Ht,decodeDepthMap:()=>Mt,decodePointCloud:()=>$t,default:()=>Yt,encodeMultipartFormData:()=>de,getBaseUrl:()=>st,isSelectOperator:()=>q,popSelects:()=>F,randomMultipartBoundary:()=>pe,readableStreamFromString:()=>le,resolveAuth:()=>b,validateCamera:()=>O,validatePop:()=>J}),e.exports=(i=g,d(a({},"__esModule",{value:!0}),i));var _,k=(e=>(e.Idle="Idle",e.Busy="Busy",e.Authenticating="Authenticating",e.FetchConfig="FetchConfig",e.Error="Error",e.NotAvailable="NotAvailable",e))(k||{});function T(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 Qt{constructor(e){this._logger=e}async fetch(e,t){const n=T(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}}_=async e=>new Qt(e)}else{class en{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=T(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}}_=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 en(i,t.fetch,e)}}var S,E=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()}}},P=n(713),A=n(262);S="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,A.createAuth0Client)(n);await i.isAuthenticated()||await i.loginWithPopup();const o=await i.getTokenSilently();if(!o)return Promise.reject("auth0 login failed");let s;const a=t;return s=void 0!==a.popId?{eyepopUrl:t.eyepopUrl,accessToken:o,validUntil:Date.now()+36e5,popId:a.popId,baseUrl:void 0,pipelineId:void 0,isPipelineMode:a.isPipelineMode,authenticationHeaders:()=>({Authorization:`Bearer ${o}`})}:{eyepopUrl:t.eyepopUrl,accessToken:o,validUntil:Date.now()+36e5},s}:(e,t)=>Promise.reject("auth0 login not supported server-side");var j=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 E(this._options.jobQueueLength??1024),this._state="Idle",this._message=null,this._stateChangeHandler=null,t=e.logger?e.logger:(0,P.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 _(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 E(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 S(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}`},o=`${this.eyepopUrl()}/v1/auth/authenticate`,s=await this._client.fetch(o,{method:"POST",headers:i});if(200!=s.status){const e=await s.text();return Promise.reject(`Unexpected status ${s.status}: ${e}`)}const a=await s.json();this._token=a.access_token,this._expire_token_time=e+a.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}},C=.001;function I(e){return void 0===e||Number.isFinite(e)}function O(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(!I(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)<=C))throw new Error("camera.extrinsics.rotation must be a unit quaternion")}}}var U=(e=>(e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3",e))(U||{}),R=2,L=(e=>(e.STREAM="stream",e.BUFFER="buffer",e))(L||{}),N=(e=>(e.FORWARD="forward",e.INFERENCE="inference",e.TRACKING="tracking",e.CONTOUR_FINDER="contour_finder",e.COMPONENT_FINDER="component_finder",e))(N||{}),z=(e=>(e.FULL="full",e.CROP="crop",e.CROP_WITH_FULL_FALLBACK="crop_with_full_fallback",e.SELECT_CROP="select_crop",e.SELECT_FULL="select_full",e))(z||{}),M=(e=>(e.MOST_RELEVANT="most_relevant",e))(M||{});function q(e){return"select_crop"===e?.type||"select_full"===e?.type}var D=(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))(D||{}),W=(e=>(e.RANDOM_WALK="random_walk",e.CONSTANT_VELOCITY="constant_velocity",e.CONSTANT_ACCELERATION="constant_acceleration",e))(W||{}),$=(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))($||{});function J(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&&O(e.defaults.camera),H(e.components)}function F(e){const t=e=>(e??[]).some(e=>q(e.forward?.operator)||t(e.forward?.targets));return t(e?.components)}function H(e){for(const t of e??[]){const e=t.forward?.operator;void 0!==e&&K(e),H(t.forward?.targets)}}function K(e){if(!q(e)){if(void 0!==e.select)throw new Error("select is only valid with the select_crop or select_full operator");return}const t=e.select;if(void 0===t)throw new Error(`${e.type} requires a select block`);if(void 0!==t.mode&&"most_relevant"!==t.mode)throw new Error(`select mode ${t.mode} is not supported, the only mode is most_relevant`);if(void 0!==t.relevancyModel&&void 0!==t.relevancyModelUuid)throw new Error("select can only have one of relevancyModelUuid or relevancyModel");if(void 0!==t.minTrackLengthSeconds&&t.minTrackLengthSeconds<0)throw new Error("select minTrackLengthSeconds cannot be negative");if(void 0!==t.intervalSeconds&&t.intervalSeconds<=0)throw new Error("select intervalSeconds must be positive");if(void 0!==e.crop){if("select_crop"!==e.type)throw new Error(`crop options are only valid with select_crop, not ${e.type}`);if(void 0!==e.crop.maxItems)throw new Error("select_crop forwards one detection per selection, maxItems does not apply")}}var V=new Set(["error","failed","stopped","pipeline_error","unknown"]),B=e=>new Promise(t=>setTimeout(t,e));function G(e){if(e.pipeline_uuid)return e.pipeline_uuid;const t=e.pipelines?.[0];return t?.id||t?.pipeline_id||null}function Z(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 X(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 Y=class extends Error{constructor(e,t,n){super(e),this.name="ComputeApiError",this.status=t,this.code=n}},Q=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 ee(e,t){const n=await async function(e){try{const t=te(await e.clone().json());if(!t||"object"!=typeof t)return;const n=t,i=te(n.error),o=i&&"object"==typeof i?i.code:n.code;return"string"==typeof o&&o.length>0?o:void 0}catch(e){return}}(e),i=await async function(e){if((e.headers.get("content-type")||"").includes("application/json"))try{const t=ie(te(await e.clone().json()));if(t)return t}catch(e){}const t=await e.text();return ie(t)||t}(e);return new Y(`Unexpected status ${e.status} ${t}: ${i}`,e.status,n)}function te(e){if("string"==typeof e)try{return te(JSON.parse(e))}catch(t){const n=e.replace(/\\"/g,'"');if(n!=e)try{return te(JSON.parse(n))}catch(e){}return e}return e}async function ne(e){return te(await e.json())}function ie(e){if("string"==typeof(e=te(e)))return e;if(!e||"object"!=typeof e)return null;const t=e,n=te(t.error),i=ie(n)||("string"==typeof n?n:null),o=[t.code,i,t.message,t.details].filter(e=>"string"==typeof e&&e.length>0).join(": ");if(o)return o;if(t.pipeline_error)return ie(t.pipeline_error);if(n&&"object"==typeof n)return ie(n);try{return JSON.stringify(e)}catch(e){return null}}var oe=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=G(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:X(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 o=await this.options.httpClient.fetch(t,{headers:n});if(404==o.status)i=[];else{if(200!=o.status)throw await ee(o,"fetching compute sessions");i=await ne(o)}if(i.length>0){this.options.logger?.debug(`User has ${i.length} sessions, inspecting for usable session`);for(let t of i)if(!(V.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 ${G(t)}`);break}}}if(!e){this.options.requestLogger?.debug("creating a new session at: %s",t);const o=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),s={headers:{...n,...o?{"Content-Type":"application/json"}:{}},method:"POST"};o&&(s.body=o);const a="wait=true",r=await this.options.httpClient.fetch(`${t}?${a}`,s);if(200!=r.status)throw await ee(r,"creating a compute session");if(i=await ne(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 o=await this.options.httpClient.fetch(n,{headers:i});if(404==o.status)throw new Y(`Unexpected status ${o.status} compute sessions ${e} not found`,o.status);if(200!=o.status)throw await ee(o,"fetching compute sessions");if(t=await ne(o),this.options.accountId&&t.account_uuid!==this.options.accountId)throw new Q(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 o=`${e.session_endpoint}/health`,s=await this.options.httpClient.fetch(o,{headers:{Authorization:t,Accept:"application/json"}});if(200==s.status){const t=s.headers.get("content-type")||"",o=await s.text();try{n=Z(o,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 B(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 ${s.status}, wait and poll for update`),await B(250)}}}},se=n(182),ae=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 o=!1;try{for await(const t of async function*(){const t=new ce,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(!o&&t){const e=JSON.parse(t),i=e.event;void 0!==i?await n(i):yield e}o=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{o||t.abort()}}()}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],n=[],i=this.iterator(),o=e=>({next:()=>{if(0===e.length){const e=i.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>o(t),this.controller),new e(()=>o(n),this.controller)]}},re=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 o=n.split(e.NEWLINE_REGEXP);return 1!==o.length||i?(this.buffer.length>0&&(o=[this.buffer.join("")+o[0],...o.slice(1)],this.buffer=[]),i||(this.buffer=[o.pop()||""]),o):(this.buffer.push(o[0]),[])}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==o){if(e instanceof o)return e.toString();if(e instanceof Uint8Array)return o.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}};re.NEWLINE_CHARS=new Set(["\n","\r","\v","\f","","","","
","\u2028","\u2029"]),re.NEWLINE_REGEXP=/\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;var ce=re;function le(e){return new ReadableStream({start(t){t.enqueue(o.from(e)),t.close()}})}function pe(){return`----formdata-boundary-${(0,se.v4)()}`}function ue(e){return e.replace(/"/g,"%22").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function de(e,t){const n=new TextEncoder;let i=0,o=null;return new ReadableStream({async pull(s){if(o){const{done:e,value:t}=await o.read();if(!e)return void s.enqueue(t);o=null,s.enqueue(n.encode("\r\n")),i++}if(i>=e.length)return s.enqueue(n.encode(`--${t}--\r\n`)),void s.close();const a=e[i];let r=`--${t}\r\nContent-Disposition: form-data; name="${ue(a.name)}"`;void 0!==a.filename&&(r+=`; filename="${ue(a.filename)}"`),r+="\r\n",a.contentType&&(r+=`Content-Type: ${a.contentType}\r\n`),r+="\r\n",s.enqueue(n.encode(r)),"string"==typeof a.content?(s.enqueue(n.encode(a.content)),s.enqueue(n.encode("\r\n")),i++):o=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()}})}(a.content).getReader()},async cancel(t){await(o?.cancel(t));const n=o?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 he=n(182),me=h(n(942)),fe=class e{constructor(e,t,n,i,o,s){this._getSession=e,this._client=t,this._requestLogger=s,this._ingressId=n,this._urlPath=`${i}/${this._ingressId}`,this._is_pipeline_direct=o,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=me.default.join("pipelines",e.pipelineId,this._urlPath)}else n=this._urlPath;return t&&(n=me.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),o={...n.authenticationHeaders(),"Content-Type":"application/sdp"},s=await this._client.fetch(i,{headers:o,method:"POST",body:t.sdp});return s.status>=300?Promise.reject(`unknown status code for POST '${i}': ${s.status} (${s.statusText})`):(this._eTag=s.headers.get("ETag")??"",this._location=s.headers.get("Location"),await this.onRemoteAnswer(new RTCSessionDescription({type:"answer",sdp:await s.text()})))}async sendLocalCandidates(t){if(!this._offerData)throw new Error("sendLocalCandidates no offerData");const n=await this._getSession(),i=this.gresUrl(n,this._location),o={...n.authenticationHeaders(),"Content-Type":"application/trickle-ice-sdpfrag","If-Match":this._eTag},s=await this._client.fetch(i,{headers:o,method:"PATCH",body:e.generateSdpFragment(this._offerData,t)});return s.status>=300?Promise.reject(`unknown status code for PATCH '${i}': ${s.status} (${s.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:ve.unquoteCredential(t[3]),credential:ve.unquoteCredential(t[4])}:null}):[]).filter(function(e){return null!=e})}static editAnswer(e,t,n,i,o,s){const a=e.split("m=");for(let e=0;e<a.length;e++){const r=a[e];r&&r.startsWith("video")?a[e]=ve.setVideoBitrate(ve.setCodec(r,t),i):r&&r.startsWith("audio")&&(a[e]=ve.setAudioBitrate(ve.setCodec(r,n),o,s))}return a.join("m=")}static setCodec(e,t){const n=e.split("\r\n"),i=[],o=[];for(const e of n)e.startsWith("a=rtpmap:")?t&&e.toLowerCase().includes(t)&&(o.push(e.slice(9).split(" ")[0]),i.push(e)):i.push(e);const s=[];for(const e of i)e.startsWith("a=fmtp:")?o.includes(e.slice(7).split(" ")[0])&&s.push(e):e.startsWith("a=rtcp-fb:")?o.includes(e.slice(10).split(" ")[0])&&s.push(e):s.push(e);return s.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="",o=e.split("\r\n");for(let e=0;e<o.length;e++){const t=o[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<o.length;e++){const s=o[e];s&&s.startsWith("a=fmtp:"+i+" ")&&(o[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 o.join("\r\n")}static parseOffer(e){let t=[],n="",i="";for(const o of e.split("\r\n"))o.startsWith("m=")?t.push(o.slice(2)):""===n&&o.startsWith("a=ice-ufrag:")?n=o.slice(12):""===i&&o.startsWith("a=ice-pwd:")&&(i=o.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",o=0;for(const t of e.medias){let e=n.get(o);if(void 0!==e){i+="m="+t+"\r\na=mid:"+o+"\r\n";for(const t of e)i+="a="+t.candidate+"\r\n"}o++}return i}static unquoteCredential(e){return e?JSON.parse(`"${e}"`):""}},ve=class extends fe{constructor(e,t,n,i,o){super(t,n,(0,he.v4)().toString(),"liveIngress/whip",i,o),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:fe.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()}},ge=class{constructor(e,t,n,i,o=R){this._responseStream=null,this._controller=new AbortController,this._getSession=t,this._params=e,this._client=n,this._requestLogger=i,this._version=o}[Symbol.asyncIterator](){if(!this._responseStream)throw Error("logical bug");return ae.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 o=await this.startJob();if(401==o.status){if(t(o.status),!e--){i(`response ${o.status}: ${o.statusText}`);break}this._requestLogger.info("received 401 response, attempt to reauthorize once")}else{if(404!=o.status){if(o.ok){if(o.body){n(o.body);break}{const e=await o.text();if(e){n(le(e));break}i("response body is empty");break}}i(`upload error ${o.status}: ${await o.text()}`);break}if(t(o.status),!e--){i(`response ${o.status}: ${o.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")}};ge.n=0;var ye,be=class extends ge{get[Symbol.toStringTag](){return"uploadJob"}constructor(e,t,n,i,o,s,a,r,c,l=R){super(o,s,a,r,l),this._uploadStream=e,this._uploadBodyFactory=c,this._mimeType=t,this._size=n,this._videoMode=i,this._needsFullDuplex=!a.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 o=`${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 s={...t.authenticationHeaders(),Accept:"application/jsonl"};n=this._client.fetch(o,{headers:s,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(o,{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 ${o}`)}).catch(e=>{this._requestLogger.debug(`error ${e} for POST ${o}`)})}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 o=await new Response(await this.uploadBody()).blob();n.append("file",o);const s={...e.authenticationHeaders(),Accept:"application/jsonl"};t=await this._client.fetch(i,{headers:s,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}},we=class extends ge{constructor(e,t,n,i,o,s=R){super(t,n,i,o,s),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}})}},xe=class extends ge{get[Symbol.toStringTag](){return"uploadGroupJob"}constructor(e,t,n,i,o,s=R){if(super(t,n,i,o,s),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",filename:"blob",contentType:e.mimeType,content:e.stream});const o=pe(),s={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":`multipart/form-data; boundary=${o}`};return await this._client.fetch(n,{headers:s,method:"POST",body:de(i,o),signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}},_e=class extends ge{get[Symbol.toStringTag](){return"loadFromGroupJob"}constructor(e,t,n,i,o,s=R){if(super(t,n,i,o,s),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}})}},ke=class extends ge{constructor(e,t,n,i,o,s=R){super(t,n,i,o,s),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}})}},Te=class extends ge{constructor(e,t,n,i,o,s=R){super(t,n,i,o,s),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 ve(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"},o=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=preempt&processing=sync`;return await this._client.fetch(o,{headers:i,method:"PATCH",body:JSON.stringify(n),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}};if("document"in globalThis&&"implementation"in globalThis.document)ye=async(e,t)=>{throw new DOMException("resolving a path to a file is not supported in browser")};else{let tn=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*nn(e){for await(const t of e)yield t}ye=async(e,t)=>{const i=v(),o=n(122),s=await o.open(e.path,"r"),a=(await s.stat()).size,r=nn(s.createReadStream());return{stream:tn(r),mimeType:e.mimeType?e.mimeType:i.lookup(e.path)||"image/*",size:a}}}var Se=(e=>(e.Transient="transient",e))(Se||{}),Ee=class e{constructor(e){this.ctx=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}async disconnect(e){await this.deleteOwnPipeline(),await e()}async deleteOwnPipeline(){const e=this.ctx.client();if("transient"==this.ctx.options.popId&&this._pipelineId&&e){const t=`${this._baseUrl}/pipelines/${this._pipelineId}`,n={Authorization:await this.authorizationHeader()};let i=await e.fetch(t,{method:"DELETE",headers:n});if(204!=i?.status){const e=await(i?.text());this.ctx.logger.info(`stopping pipeline failed, status ${i?.status}: ${e}`)}}}onStatus(e){404==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.ctx.options.eyepopUrl,accessToken:this._sessionAccessToken,validUntil:this._sessionAccessTokenValidUntil||Number.MAX_VALUE}:await this.ctx.credentialSession(),{eyepopUrl:e.eyepopUrl,accessToken:e.accessToken,validUntil:e.validUntil,popId:this.ctx.options.popId,accountId:this._accountId??this.ctx.options.accountId,baseUrl:this._baseUrl,pipelineId:this._pipelineId||void 0,isPipelineMode:!1,authenticationHeaders:()=>this._authenticationHeaders(e)})}popName(){return this._popName}pop(){return this._pipeline?this._pipeline.pop||null:this.ctx.options.pop||null}predictionVersion(){return F(this.pop())?3:R}async changePop(e){if("transient"==this.ctx.options.popId)return void await this.changeTransientPop(e);const t=this.ctx.client();if(!this._baseUrl||!t)return Promise.reject("endpoint not connected, use connect()");let n=await this.ctx.fetchWithRetry(async()=>{const n=await this.session();let i={"Content-Type":"application/json",...this._authenticationHeaders(n)};const o=`${n.baseUrl}/pipelines/${n.pipelineId}/pop`;return await t.fetch(o,{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.ctx.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.ctx.options)?.isLocal?{}:{Authorization:`Bearer ${e.accessToken}`}}async submit(e){switch(e.kind){case"source":return await this.process(e.source,e.params);case"uploadGroup":return await this.uploadGroup(e.paths,e.params);case"uploadStreamGroup":return await this.uploadStreamGroup(e.streams,e.mimeTypes,e.params);case"loadFromGroup":return await this.loadFromGroup(e.urls,e.params)}}async process(e,t){return void 0!==e.file?this.uploadFile(e,t):void 0!==e.stream?this.uploadStream(e,t):void 0!==e.path?this.uploadPath(e,t):void 0!==e.url?this.loadFrom(e,t):void 0!==e.assetUuid?this.loadFromAssetUuid(e,t):void 0!==e.mediaStream?this.loadMediaStream(e,t):Promise.reject("unknown source type")}start(e){return e.start(()=>{this.ctx.jobDone()},e=>{404==e?this.onStatus(e):401==e&&this.ctx.forgetCredential()})}async uploadGroup(e,t){const n=this.ctx.client(),i=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!n)throw new Error("endpoint not connected, use connect()");await i.acquire();try{this.ctx.updateState();const i=await Promise.all(e.map(async e=>{const t=await this.resolvePath({path:e});return{stream:t.stream,mimeType:t.mimeType}}));return this.start(new xe(i,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}catch(e){throw i.release(),e}}async uploadStreamGroup(e,t,n){const i=this.ctx.client(),o=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!i)throw new Error("endpoint not connected, use connect()");await o.acquire();try{this.ctx.updateState();const o=e.map((e,n)=>({stream:e,mimeType:t?.[n]??null}));return this.start(new xe(o,n,async()=>this.session(),i,this.ctx.requestLogger,this.predictionVersion()))}catch(e){throw o.release(),e}}async loadFromGroup(e,t){const n=this.ctx.client(),i=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!n)throw new Error("endpoint not connected, use connect()");await i.acquire();try{return this.ctx.updateState(),this.start(new _e(e,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}catch(e){throw i.release(),e}}async resolvePath(e){return this.ctx.options.platformSupport?.resolvePath?await this.ctx.options.platformSupport.resolvePath(e,this.ctx.logger):await ye(e,this.ctx.logger)}async startConnected(e,t=!1){await this.ensureTransientPipelineStarted();const n=this.ctx.client(),i=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!n){if(t)return Promise.reject("endpoint not connected, use connect()");throw new Error("endpoint not connected, use connect()")}await i.acquire();try{return this.ctx.updateState(),this.start(await e(n))}catch(e){throw i.release(),e}}async uploadFile(e,t){return await this.startConnected(async n=>new be(e.file,e.file.type,e.file.size,e.videoMode,t,async()=>this.session(),n,this.ctx.requestLogger,void 0,this.predictionVersion()),!0)}async uploadStream(e,t){return await this.startConnected(async n=>new be(e.stream,e.mimeType,e.size,e.videoMode,t,async()=>this.session(),n,this.ctx.requestLogger,void 0,this.predictionVersion()),!0)}async uploadPath(e,t){return await this.startConnected(async n=>{const i=await this.resolvePath(e);let o=!0;return new be(i.stream,i.mimeType,i.size,e.videoMode,t,async()=>this.session(),n,this.ctx.requestLogger,async()=>o?(o=!1,i.stream):(await this.resolvePath(e)).stream,this.predictionVersion())})}async loadFrom(e,t){return e.url.startsWith("file://")?await this.uploadPath({path:e.url.substring(7)},t):await this.startConnected(async n=>new we(e.url,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}async loadFromAssetUuid(e,t){return await this.startConnected(async n=>new ke(e.assetUuid,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}async loadMediaStream(e,t){return await this.startConnected(async n=>new Te(e.mediaStream,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}async reconnect(){"transient"==this.ctx.options.popId?(await this.getComputeSession(),this.ctx.options.pop&&this.setTransientPipelinePop()):this.ctx.options.sessionUuid?await this.getComputeSession():await this.startWebApiSessionWithPopId(),this.ctx.updateState()}async startWebApiSessionWithPopId(){const e=this.ctx.client();if(!e)throw new Error("endpoint not initialized");const t=`${this.ctx.eyepopWebApiUrl()}/pops/${this.ctx.options.popId}/config?auto_start=false`,n={Authorization:await this.authorizationHeader()};this.ctx.updateState("FetchConfig");let i=await e.fetch(t,{headers:n});if(401==i.status){this.ctx.requestLogger.debug("GET %s: 401, about to retry with fresh access token",t),this.ctx.forgetCredential();const n={Authorization:await this.authorizationHeader()};this.ctx.updateState("FetchConfig"),i=await e.fetch(t,{headers:n})}if(200!=i.status){const e=await i.text();throw 429==i.status?this.ctx.updateState("NotAvailable",e):this.ctx.updateState("Error",e),new Error(`Unexpected status ${i.status}: ${e}`)}let o=await i.json();if(!o.base_url&&this.ctx.options.autoStart){const t=`${this.ctx.eyepopWebApiUrl()}/pops/${this.ctx.options.popId}/config?auto_start=true`;this.ctx.requestLogger.debug("pop was not running, trying to autostart with: %s",t);const n={Authorization:await this.authorizationHeader()};if(i=await e.fetch(t,{headers:n}),200!=i.status){this.ctx.updateState("Error");const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}o=await i.json()}const s=new URL(o.base_url,this.ctx.eyepopUrl());if(this._baseUrl=s.toString(),this._baseUrl){if(this._baseUrl=this._baseUrl.replace(/\/+$/,""),this._pipelineId=o.pipeline_id,this._popName=o.name,!this._pipelineId||!this._baseUrl)throw new Error("Pop not started");const t=`${this._baseUrl}/pipelines/${this._pipelineId}`,n={Authorization:await this.authorizationHeader()};let i=await e.fetch(t,{method:"GET",headers:n});if(i.status>200){const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}if(this._pipeline=await i.json(),this.ctx.options.stopJobs){const t={sourceType:"NONE"},n={Authorization:await this.authorizationHeader(),"Content-Type":"application/json"},i=`${this._baseUrl}/pipelines/${this._pipeline.id}/source?mode=preempt&processing=sync`;let o=await e.fetch(i,{method:"PATCH",headers:n,body:JSON.stringify(t)});if(o.status>=300){const e=await o.text();throw new Error(`Unexpected status ${o.status}: ${e}`)}}}}sessionReadyTimeoutMs(){const t=this.ctx.options.sessionReadyTimeoutSeconds;return"number"==typeof t&&Number.isFinite(t)&&t>0?1e3*t:e.WAIT_FOR_IS_READY}async getComputeSession(){const e=this.ctx.client();if(!e)throw new Error("endpoint not initialized");let t;try{t=await new oe({computeUrl:this.ctx.eyepopUrl(),httpClient:e,authorizationHeader:()=>this.computeAuthorizationHeader(),sessionUuid:this.ctx.options.sessionUuid,sessionName:this.ctx.options.sessionName,accountId:this.ctx.options.accountId,pipelineImage:this.ctx.options.pipelineImage,pipelineVersion:this.ctx.options.pipelineVersion,pop:this.ctx.options.pop,readyTimeoutMs:this.sessionReadyTimeoutMs(),logger:this.ctx.logger,requestLogger:this.ctx.requestLogger}).resolve()}catch(e){throw this.ctx.updateState("Error"),e}this._sessionAccessToken=t.accessToken,this._sessionAccessTokenValidUntil=t.accessTokenValidUntil,this._baseUrl=t.session.session_endpoint,this._accountId=t.session.account_uuid||void 0,this._pipeline=null,this._pipelineId=t.pipelineId,this.ctx.options.pop&&this.setTransientPipelinePop()}async startTransientPipeline(){const e=this.ctx.client(),t=this._baseUrl;if(null==e||null==t)throw new Error("endpoint not initialized");let n;if(this.ctx.options.pop)n=this.ctx.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"},o=`${t.replace(/\/+$/,"")}/pipelines`,s=await this.ctx.fetchWithRetry(async()=>{let t={Accept:"application/json","Content-Type":"application/json",Authorization:await this.authorizationHeader()};return e.fetch(o,{method:"POST",body:JSON.stringify(i),headers:t})});if(200!=s.status){const e=await s.text();throw new Error(`Unexpected status ${s.status} starting transient pipeline: ${e.slice(0,300)}`)}return(await s.json()).id}async ensureTransientPipelineStarted(){if("transient"==this.ctx.options.popId&&!this._pipelineId&&this.ctx.options.pop&&(this._baseUrl||await this.reconnect(),!this._pipelineId))if(this.ctx.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.ctx.client())throw new Error("endpoint not initialized");const t=this.ctx.options.pop,n=this._baseUrl,i=this._sessionAccessToken,o=this._sessionAccessTokenValidUntil;this._pipelineId&&(await this.deleteTransientPipeline(this._pipelineId),this._pipelineId=null),this._pipeline=null;try{this.ctx.options.pop=e,await this.getComputeSession()}catch(e){throw this.ctx.options.pop=t,this._pipeline=null,this._pipelineId=null,this._baseUrl=t?null:n,this._sessionAccessToken=i,this._sessionAccessTokenValidUntil=o,e}if(!this._pipelineId)throw new Error("Compute session did not provide a pipeline for the requested pop");this.setTransientPipelinePop()}async deleteTransientPipeline(e){const t=this.ctx.client();if(!t||!this._baseUrl)return;const n=`${this._baseUrl}/pipelines/${e}`,i={Authorization:await this.authorizationHeader()};let o=await t.fetch(n,{method:"DELETE",headers:i});if(o.status>=300){const e=await o.text();this.ctx.logger.info(`stopping pipeline failed, status ${o.status}: ${e}`)}}async authorizationHeader(){return this._sessionAccessToken?`Bearer ${this._sessionAccessToken}`:this.ctx.credentialHeader()}async computeAuthorizationHeader(){const e=b(this.ctx.options);if(void 0!==e?.isLocal)return"Implicit";const t=w(e)??x(e);return void 0!==t?`Bearer ${t}`:this.ctx.credentialHeader()}setTransientPipelinePop(){const e=this.ctx.options.pop;e&&this._pipelineId&&(this._pipeline={id:this._pipelineId,state:"idle",startTime:(new Date).toString(),pop:e})}};Ee.WAIT_FOR_IS_READY=6e4;var Pe,Ae,je=Ee,Ce=class extends Error{constructor(e,t,n){super(e),this.name="UpgradeError",this.status=t,this.retryAfter=n}};"document"in globalThis&&"implementation"in globalThis.document?(Pe=(e,t)=>new WebSocket(e,t),Ae=(e,t,n)=>{const i=new WebSocket(e,void 0===n?[t]:[t,`eyepop.bearer.${n}`]);return i.binaryType="arraybuffer",new Promise((t,n)=>{i.onopen=()=>t(i),i.onerror=()=>n(new Ce(`could not open ${e}`))})}):(Pe=(e,t)=>new(n(826).WebSocket)(e,t),Ae=(e,t,i)=>{const o=void 0===i?{}:{Authorization:`Bearer ${i}`},s=new(n(826).WebSocket)(e,[t],{headers:o,maxPayload:0});return s.binaryType="arraybuffer",new Promise((t,n)=>{s.once("open",()=>t(s)),s.once("unexpected-response",(e,t)=>{const i=Number.parseFloat(t.headers?.["retry-after"]);n(new Ce(`the pipeline API answered the upgrade ${t.statusCode}`,t.statusCode,Number.isFinite(i)?i:void 0)),t.resume(),s.terminate()}),s.once("error",t=>n(new Ce(`could not open ${e}: ${t.message}`)))})});var Ie="/api/v1/pipeline",Oe="eyepop.v1",Ue=256,Re=8388608,Le=new Set(["1008 credential_expired","1011 overloaded","1001 shutting_down"]),Ne=class extends Error{constructor(e,t,n=[]){super(t),this.name="PipelineConfigurationError",this.problem=e,this.options=n}},ze=class extends Error{constructor(e,t){super(`the pipeline API closed the socket: ${e??""} ${t}`.trim()),this.name="PipelineSocketClosedError",this.code=e,this.reason=t}},Me=class extends Error{constructor(e,t=""){super(`the pipeline API refused the command: ${e} ${t}`.trim()),this.name="PipelineCommandError",this.error=e,this.detail=t}},qe=class extends Error{constructor(e,t,n=""){super(`Error in source ${e}: ${t} ${n}`.trim()),this.name="PipelineSourceError",this.sourceId=e,this.reason=t,this.detail=n}},De=Symbol("cancelled"),We=class{constructor(){this._items=[],this._waiter=null}push(e){const t=this._waiter;t?(this._waiter=null,t(e)):this._items.push(e)}next(){const e=this._items.shift();return void 0!==e?Promise.resolve(e):new Promise(e=>this._waiter=e)}},$e=class extends Error{},Je=class{constructor(){this._credit=0,this._ended=!1,this._waiter=null}grant(e){this._credit+=e,this.wake()}end(){this._ended=!0,this.wake()}async take(e){for(;this._credit<=0&&!this._ended;)await new Promise(e=>this._waiter=e);if(this._ended)throw new $e;const t=Math.min(e,this._credit);return this._credit-=t,t}wake(){const e=this._waiter;this._waiter=null,e?.()}},Fe=class{constructor(e){this.id=e,this.inbox=new We,this.uploads=new Map}close(e){this.uploads.forEach(e=>e.end()),this.inbox.push(e)}},He=class{constructor(e){this.ws=e,this.sources=new Map,this.commands=new Map,this._closed=!1,this.closed=new Promise(e=>this._markClosed=e)}get open(){return!this._closed&&1===this.ws.readyState}markClosed(){this._closed=!0,this._markClosed()}sendJson(e){this.ws.send(JSON.stringify(e))}sendBytes(e){this.ws.send(e)}},Ke=class{constructor(e,t,n,i,o=void 0){this.source=e,this.media=t,this.live=n,this.params=i,this.mediaStream=o,this._results=new We,this._consumed=!1,this._cancelled=!1,this.openSource=null,this.stopOnPipeline=null}get cancelled(){return this._cancelled}command(e){const t={type:"setSource",id:e,...this.source};return void 0!==this.params.componentParams&&(t.params=this.params.componentParams),void 0!==this.params.roi&&(t.roi=this.params.roi),void 0!==this.params.camera&&(t.camera=this.params.camera),void 0!==this.params.fps&&(t.fps=this.params.fps),t}predicted(e){this._cancelled||this._results.push(e)}finish(e=null){null!==e&&this._results.push(e),this._results.push(null)}cancel(){this._cancelled||(this._cancelled=!0,this._results.push(null),this.openSource?.inbox.push(De),this.stopOnPipeline?.())}async*[Symbol.asyncIterator](){if(this._consumed)throw new Error("Cannot iterate over a consumed stream");for(this._consumed=!0;;){const e=await this._results.next();if(null===e)return;if(e instanceof Error)throw e;yield e}}},Ve=class{constructor(e){this.ctx=e,this._pipelineApiUrl=null,this._socket=null,this._connecting=null,this._sendChain=Promise.resolve(),this._disconnecting=!1,this._nextId=0,this._warned=new Set,this._heartbeat=null,this._reconnects=0,this._currentPop=e.options.pop??null}async reconnect(){this._disconnecting=!1,await this.inOrder(()=>this.ensureSocket()),this.ctx.updateState()}async disconnect(e){await e(),this._disconnecting=!0,null!==this._heartbeat&&(clearInterval(this._heartbeat),this._heartbeat=null);const t=this._socket;this._socket=null,null!==t&&(t.ws.close(1e3),await t.closed)}onStatus(e){}popName(){return null}async authorizationHeader(){return this.ctx.credentialHeader()}inOrder(e){const t=this._sendChain.then(e);return this._sendChain=t.catch(()=>{}),t}async ensureSocket(){return null!==this._socket&&this._socket.open?this._socket:(null===this._connecting&&(this._connecting=this.openSocket().finally(()=>this._connecting=null)),await this._connecting)}async openSocket(){if(null===this.ctx.client())throw new ze(void 0,"the endpoint is not connected");const e=await this.upgrade(await this.socketUrl()),t=new He(e);if(e.onmessage=e=>{if("string"==typeof e.data)try{this.dispatch(t,JSON.parse(e.data))}catch(e){this.ctx.logger.warn("unreadable message from the pipeline API: %s",e)}},e.onerror=()=>{},e.onclose=e=>this.closed(t,e.code,e.reason),this._socket=t,this.startHeartbeat(e),null!==this._currentPop)try{await this.setPopOn(t,this._currentPop)}catch(t){throw this._socket=null,e.close(1e3),t}return t}startHeartbeat(e){null!==this._heartbeat&&clearInterval(this._heartbeat);const t=e.ping;"function"==typeof t&&(this._heartbeat=setInterval(()=>{1===e.readyState&&t.call(e)},2e4),this._heartbeat.unref?.())}async socketUrl(){if(null===this._pipelineApiUrl){const e=this.ctx.options.isLocalMode?this.ctx.eyepopUrl():new URL(await this.configuredPipelineApiUrl(),this.ctx.eyepopUrl()+"/").toString();this._pipelineApiUrl=function(e){const t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new Ne("insecure_url",`the pipeline API url ${e} must be an http or https url`);if("http:"===t.protocol&&("localhost"!==(n=t.hostname)&&"[::1]"!==n&&"::1"!==n&&!/^127\.\d+\.\d+\.\d+$/.test(n)))throw new Ne("insecure_url",`the pipeline API url ${e} must use https unless its host is a loopback address`);var n;return e.replace(/\/+$/,"")}(e)}return"ws"+this._pipelineApiUrl.slice(4)+Ie}async configuredPipelineApiUrl(){const e=this.ctx.client();if(null===e)throw new Error("endpoint not connected");let t=`${this.ctx.eyepopUrl()}/v1/configs`;const n=this.ctx.options.accountId;n&&(t+=`?account_uuid=${encodeURIComponent(n)}`);const i=await this.ctx.fetchWithRetry(async()=>e.fetch(t,{headers:{Authorization:await this.ctx.credentialHeader()}}));if(!i.ok)throw new Error(`Unexpected status ${i.status} for GET ${t}: ${await i.text()}`);const o=await i.json(),s=o?.pipeline_api_url;if(!s)throw new Ne("no_pipeline_api_url",`${t} has no pipeline_api_url: this compute API serves no pipeline API`);return s}async token(){if(void 0===b(this.ctx.options)?.isLocal)return(await this.ctx.credentialHeader()).replace(/^Bearer /,"")}async upgrade(e){const t=Date.now()+3e4;let n=!1;for(;;)try{return this.ctx.requestLogger.debug("before upgrade %s",e),await Ae(e,Oe,await this.token())}catch(e){if(!(e instanceof Ce))throw e;if(401===e.status&&!n){this.ctx.requestLogger.debug("the pipeline API answered 401, authenticating again"),n=!0,this.ctx.forgetCredential();continue}const i=503===e.status&&void 0!==e.retryAfter?1e3*Math.max(e.retryAfter,1):void 0;if(void 0===i||Date.now()+i>t)throw e;this.ctx.requestLogger.info("the pipeline API answered 503, retrying in %d ms",i),await new Promise(e=>setTimeout(e,i))}}closed(e,t,n){e.markClosed(),this._socket===e&&(this._socket=null);const i=new ze(t,n);if(e.sources.forEach(e=>e.close(i)),e.commands.forEach(e=>e.reject(i)),e.commands.clear(),!this._disconnecting&&(this.ctx.requestLogger.debug("the pipeline API closed the socket: %s %s",t,n),Le.has(`${t} ${n}`))){"credential_expired"===n&&this.ctx.forgetCredential();const e=0===this._reconnects?0:Math.min(1e3*2**(this._reconnects-1),3e4);this._reconnects+=1,new Promise(t=>setTimeout(t,e)).then(()=>this._disconnecting?void 0:this.inOrder(()=>this.ensureSocket())).catch(e=>{this.ctx.requestLogger.info("could not reopen the pipeline API socket: %s",e)})}}dispatch(e,t){const n=t.type,i=t.id,o="string"==typeof i?e.sources.get(i):void 0;if("send"===n||"credit"===n){const e=o?.uploads.get(t.member??null);return void e?.grant(Number("send"===n?t.credit:t.bytes))}const s="string"==typeof i?e.commands.get(i):void 0;if(void 0!==s)return e.commands.delete(i),void("error"===n?s.reject(new Me(t.error??"",t.message??"")):s.resolve(t));void 0!==o?("start"===n&&(this._reconnects=0),"end"===n&&o.uploads.forEach(e=>e.end()),o.inbox.push(t)):"error"===n&&(void 0===i?this.ctx.logger.warn("the pipeline API refused a message: %s %s",t.error,t.message):this.ctx.requestLogger.debug("the pipeline API refused a command for %s: %s %s",i,t.error,t.message))}newId(e){return this._nextId+=1,`${e}-${this._nextId}`}command(e,t){const n=this.newId(t.type);return new Promise((i,o)=>{e.commands.set(n,{resolve:i,reject:o}),e.sendJson({...t,id:n})})}pop(){return this._currentPop}async changePop(e){null!==this.ctx.client()?await this.inOrder(async()=>{if(null!==this._socket&&this._socket.open)return await this.setPopOn(this._socket,e),void(this._currentPop=e);const t=this._currentPop;this._currentPop=e;try{await this.ensureSocket()}catch(e){throw this._currentPop=t,e}}):this._currentPop=e}async setPopOn(e,t){await this.command(e,{type:"setPop",pop:t})}async submit(e){if(null===this.ctx.client())throw new Error("endpoint not connected, use connect()");const t="source"===e.kind?e.source:void 0;this.notSent({motionDetect:e.params.motionDetect,videoMode:t?.videoMode,rtspForceNonCompliantUrl:e.params.rtspForceNonCompliantUrl});const n=await this.jobOf(e),i=this.ctx.limit();return await i.acquire(),this.ctx.updateState(),this.run(n).then(()=>n.finish(),e=>n.finish(e instanceof Error?e:new Error(String(e)))).finally(()=>this.ctx.jobDone()),n}notSent(e){for(const[t,n]of Object.entries(e)){if(void 0===n||this._warned.has(t))continue;this._warned.add(t);const e="rtspForceNonCompliantUrl"===t?"":" (AWSU-317)";this.ctx.logger.warn(`${t} is not sent to the pipeline API and has no effect in pipeline mode${e}`)}}async jobOf(e){switch(e.kind){case"source":return await this.sourceJob(e.source,e.params);case"uploadGroup":{const t=await Promise.all(e.paths.map(e=>this.pathMedia({path:e})));return new Ke(Xe(t),t,!1,e.params)}case"uploadStreamGroup":{const t=e.streams.map((t,n)=>Ze(t,e.mimeTypes?.[n]??"application/octet-stream",void 0));return new Ke(Xe(t),t,!1,e.params)}case"loadFromGroup":return new Ke({group:e.urls.map(e=>({url:e}))},[],!1,e.params)}}async sourceJob(e,t){if(void 0!==e.file){const n=e.file,i=Ze(n,n.type||"application/octet-stream",n.size);return new Ke({upload:{contentType:i.contentType}},[i],!1,t)}if(void 0!==e.stream){const n=e,i=Ze(n.stream,n.mimeType,n.size??Ge(n.stream));return new Ke({upload:{contentType:i.contentType}},[i],!1,t)}if(void 0!==e.path){const n=await this.pathMedia(e);return new Ke({upload:{contentType:n.contentType}},[n],!1,t)}if(void 0!==e.url){const n=e.url;return n.startsWith("file://")?await this.sourceJob({path:n.substring(7)},t):new Ke({url:n},[],/^(rtsp|rtmp):\/\//.test(n),t)}if(void 0!==e.assetUuid)return new Ke({assetUuid:e.assetUuid},[],!1,t);if(void 0!==e.mediaStream){const n=this.newId("whip");return new Ke({whip:{ingressId:n}},[],!0,t,e.mediaStream)}throw new Error("unknown source type")}async pathMedia(e){const t=this.ctx.options,n=async()=>t.platformSupport?.resolvePath?await t.platformSupport.resolvePath(e,this.ctx.logger):await ye(e,this.ctx.logger),i=await n();let o=!0;return{contentType:i.mimeType,size:i.size,open:async()=>o?(o=!1,i.stream):(await n()).stream}}async run(e){let t=!1;for(;;){const n=await this.inOrder(()=>this.setSource(e));if(null===n)return;const{socket:i,source:o}=n,s=o.uploads.size>0?this.upload(i,o,e):Promise.resolve();let a,r=null;try{a=await this.follow(e,o,()=>{if(void 0!==e.mediaStream){const t=t=>{e.stopOnPipeline?.(),o.inbox.push(t instanceof Error?t:new Error(String(t)))};r=new Be(e.mediaStream,e.source.whip.ingressId,e=>this.command(i,e),t,this.ctx.requestLogger),r.start().catch(t)}})}finally{e.openSource=null,e.stopOnPipeline=null,i.sources.delete(o.id),o.uploads.forEach(e=>e.end()),await s,await(r?.close())}if(!a)return;if(t||!e.live)throw new Me("overloaded","the pipeline API has no capacity for another live source");t=!0,await i.closed}}async setSource(e){if(e.cancelled)return null;const t=await async function(e){if(0===e.media.length||e.live||e.media.some(e=>void 0===e.size))return null;if(e.media.reduce((e,t)=>e+(t.size??0),0)>Re)return null;const t=[];for(const n of e.media)t.push(await Qe(await n.open()));return t}(e),n=await this.ensureSocket(),i=new Fe(this.newId("source"));null===t&&Ye(e).forEach(e=>i.uploads.set(e,new Je)),n.sources.set(i.id,i),e.openSource=i,e.stopOnPipeline=()=>{n.open&&n.sendJson({type:"stopSource",id:i.id})};const o=e.command(i.id);return null===t?n.sendJson(o):n.sendBytes(function(e,t){if(void 0!==e.group){let n=0;e={...e,group:e.group.map(e=>void 0!==e.upload?{upload:{...e.upload,bytes:t[n++].length}}:e)}}const n=(new TextEncoder).encode(JSON.stringify(e)),i=new Uint8Array(5);return i[0]=2,new DataView(i.buffer).setUint32(1,n.length,!1),et([i,n,...t])}(o,t)),{socket:n,source:i}}async follow(e,t,n){for(;;){if(e.cancelled)return!1;const i=await t.inbox.next();if(i===De)return!1;if(i instanceof Error)throw i;switch(i.type){case"result":n();break;case"prediction":e.predicted(i.prediction);break;case"end":if("eos"===i.reason)return!1;throw new qe(t.id,i.reason??"",i.message??"");case"error":if("overloaded"===i.error)return!0;throw new Me(i.error??"",i.message??"");case"dropped":this.ctx.requestLogger.debug("the pipeline API dropped %s predictions of a live source",i.count)}}}async upload(e,t,n){const i=Ye(n);try{for(let o=0;o<i.length;o++){const s=i[o],a=t.uploads.get(s);for await(let t of tt(await n.media[o].open()))for(;t.length>0;){const n=await a.take(Math.min(t.length,65536)),i=new Uint8Array(n+1);i[0]=1,i.set(t.subarray(0,n),1),e.sendBytes(i),t=t.subarray(n)}e.sendJson(null===s?{type:"uploaded",id:t.id}:{type:"uploaded",id:t.id,member:s})}}catch(n){n instanceof $e||e.open&&t.inbox.push(n instanceof Error?n:new Error(String(n)))}}async session(){const e=await this.token(),t=void 0===e?Number.MAX_VALUE:Math.min((await this.ctx.credentialSession()).validUntil,Number.MAX_VALUE);return{eyepopUrl:this.ctx.eyepopUrl(),accessToken:e??"",validUntil:t,popId:"transient",accountId:this.ctx.options.accountId,baseUrl:this._pipelineApiUrl??void 0,pipelineId:void 0,isPipelineMode:!0,authenticationHeaders:()=>void 0===e?{}:{Authorization:`Bearer ${e}`}}}},Be=class{constructor(e,t,n,i,o){this._stream=e,this._ingressId=t,this._command=n,this._fail=i,this._logger=o,this._pc=null,this._answered=!1,this._queued=[],this._offerData=null}async start(){const e=(await this._command({type:"whipIceServers",ingressId:this._ingressId})).iceServers??[];this._logger.debug("whip %s: ice servers %j",this._ingressId,e.map(e=>e.split(";")[0]));const t=new RTCPeerConnection({iceServers:fe.linkToIceServers(e.join(", ")||null)});this._pc=t,t.oniceconnectionstatechange=()=>{this._logger.debug("whip %s: ice connection %s",this._ingressId,t.iceConnectionState),"failed"===t.iceConnectionState&&this._pc===t&&this._fail(new Error(`the WebRTC connection of whip ingress ${this._ingressId} failed: no candidate pair connected, so the pipeline API is likely reachable through no STUN or TURN server (ice servers: ${e.length})`))},t.onicecandidate=e=>{null!==e.candidate&&this.candidate(e.candidate).catch(e=>this._logger.debug("whipIce failed: %s",e))},this._stream.getTracks().forEach(e=>t.addTrack(e,this._stream));const n=await t.createOffer();if(!n.sdp)throw new Error("the local offer has no sdp");this._offerData=fe.parseOffer(n.sdp),await t.setLocalDescription(n);const i=await this._command({type:"whipOffer",ingressId:this._ingressId,sdp:n.sdp});await t.setRemoteDescription({type:"answer",sdp:i.sdp}),this._answered=!0;const o=this._queued;this._queued=[],o.length>0&&await this.sendCandidates(o)}async candidate(e){this._answered?await this.sendCandidates([e]):this._queued.push(e)}async sendCandidates(e){null!==this._offerData&&await this._command({type:"whipIce",ingressId:this._ingressId,fragment:fe.generateSdpFragment(this._offerData,e)})}async close(){this._stream.getTracks().forEach(e=>e.stop());const e=this._pc;this._pc=null,e?.close()}};function Ge(e){return"undefined"!=typeof Blob&&e instanceof Blob?e.size:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?e.byteLength:void 0}function Ze(e,t,n){return{open:async()=>e,contentType:t,size:n??Ge(e)}}function Xe(e){return{group:e.map(e=>({upload:{contentType:e.contentType}}))}}function Ye(e){return void 0!==e.source.upload?[null]:(e.source.group??[]).flatMap((e,t)=>void 0!==e.upload?[t]:[])}async function Qe(e){const t=[];for await(const n of tt(e))t.push(n);return et(t)}function et(e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let n=0;for(const i of e)t.set(i,n),n+=i.length;return t}async function*tt(e){if("undefined"!=typeof Blob&&e instanceof Blob)yield*tt(e.stream());else if(e instanceof ArrayBuffer)yield new Uint8Array(e);else if(ArrayBuffer.isView(e))yield new Uint8Array(e.buffer,e.byteOffset,e.byteLength);else{const t=e.getReader();try{for(;;){const{value:e,done:n}=await t.read();if(n)return;void 0!==e&&e.length>0&&(yield e)}}finally{t.releaseLock()}}}var nt=class extends j{constructor(e){if(e.isPipelineMode&&(e={...e,jobQueueLength:e.jobQueueLength||Ue}).jobQueueLength>Ue)throw new Ne("job_queue_length",`jobQueueLength ${e.jobQueueLength} exceeds ${Ue}, the open sources a pipeline API socket takes`);super(e);const t={options:e,logger:this._logger,requestLogger:this._requestLogger,client:()=>this._client,limit:()=>this._limit,jobDone:()=>{this._limit.release(),this.updateState()},updateState:(e,t)=>this.updateState(e,t),eyepopUrl:()=>this.eyepopUrl(),eyepopWebApiUrl:()=>this.eyepopWebApiUrl(),credentialHeader:()=>super.authorizationHeader(),forgetCredential:()=>this.statusHandler401(401),fetchWithRetry:(e,t)=>this.fetchWithRetry(e,t),credentialSession:()=>super.session()};this._backend=e.isPipelineMode?new Ve(t):new je(t),this.setStatusRetryHandlers(new Map([[404,e=>this._backend.onStatus(e)]]))}options(){return this._options}backend(){return this._backend}async disconnect(e=!0){await this._backend.disconnect(()=>super.disconnect(e))}async session(){return await this._backend.session()}popName(){return this._backend.popName()}pop(){return this._backend.pop()}async changePop(e){J(e),await this._backend.changePop(e)}popId(){return this.options().popId||null}async process(e,t){if(void 0!==e.source){const t=e;return this.validateProcessParams(t),await this.submit({kind:"source",source:t.source,params:t})}return await this.submit({kind:"source",source:e,params:{componentParams:t}})}validateProcessParams(e){void 0!==e.camera&&O(e.camera)}async uploadGroup(e,t={}){if(0===e.length)throw new Error("upload group requires at least one path");return this.validateProcessParams(t),await this.submit({kind:"uploadGroup",paths:e,params:t})}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");return this.validateProcessParams(n),await this.submit({kind:"uploadStreamGroup",streams:e,mimeTypes:t,params:n})}async loadFromGroup(e,t={}){if(0===e.length)throw new Error("load from group requires at least one url");return this.validateProcessParams(t),await this.submit({kind:"loadFromGroup",urls:e,params:t})}async submit(e){return await this._backend.submit(e)}async reconnect(){return await this._backend.reconnect(),this}async authorizationHeader(){return await this._backend.authorizationHeader()}},it=h(n(48)),ot=(e=>(e.dataset="dataset",e.vlm="vlm",e))(ot||{});function st(e,t){switch(t){case"dataset":return e.datasetApiUrl??"";case"vlm":return e.vlmApiUrl??"";default:throw new Error(`unsupported type ${t}`)}}var at=(e=>(e.error="error",e.requested="requested",e.in_progress="in_progress",e.completed="completed",e))(at||{}),rt=(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))(rt||{}),ct=(e=>(e.ground_truth="ground_truth",e.prediction="prediction",e.auto="auto",e))(ct||{}),lt=(e=>(e.approved="approved",e.rejected="rejected",e.unknown="unknown",e))(lt||{}),pt=(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))(pt||{}),ut=(e=>(e.all="all",e.user_reviewed="user_reviewed",e.user_approved="user_approved",e.ground_truth="ground_truth",e))(ut||{}),dt=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e))(dt||{}),ht=(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))(ht||{}),mt=(e=>(e.RECTANGLE="rectangle",e.CONTOUR="contour",e))(mt||{}),ft=(e=>(e.epdet_b1="epdet_b1",e.imported="imported",e.vlm_ability="vlm_ability",e))(ft||{}),vt=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e.keypoint_detection="keypoint_detection",e))(vt||{}),gt=(e=>(e.error="error",e.draft="draft",e.requested="requested",e.in_progress="in_progress",e.available="available",e.published="published",e))(gt||{}),yt=(e=>(e.in_progress="in_progress",e.finished="finished",e.error="error",e))(yt||{}),bt=(e=>(e.eyepop="eyepop",e.qc_ai_hub="qc_ai_hub",e))(bt||{}),wt=(e=>(e.eyepop_bundle="eyepop_bundle",e.weights_file="weights_file",e))(wt||{}),xt=(e=>(e.waiting="waiting",e.scheduling="scheduling",e.preparing="preparing",e.training="training",e.exporting="exporting",e))(xt||{}),_t=(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))(_t||{}),kt=(e=>(e.unknown="Unknown",e.pending="Pending",e.running="Running",e.succeeded="Succeeded",e.failed="Failed",e.error="Error",e))(kt||{}),Tt=(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))(Tt||{}),St=(e=>(e.float32="float32",e.float16="float16",e.int32="int32",e.int8="int8",e.uint8="uint8",e))(St||{}),Et=(e=>(e.gcs="gcs",e.s3="s3",e.https_signed="https_signed",e))(Et||{}),Pt=(e=>(e.success="success",e.failed="failed",e))(Pt||{}),At=(e=>(e.classification="classification",e))(At||{}),jt=(e=>(e.image="image",e.video="video",e))(jt||{}),Ct=(e=>(e.in_progress="in_progress",e.draft="draft",e.published="published",e))(Ct||{}),It=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 o=i.predictions,s=i.run_info;if(o){this._runInfo=s,t(o);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")}},Ot=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")}},Ut=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 Rt(e,t){if(null!==t)return t}var Lt=class extends j{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 o=await i.json();const s=new URL(o.dataset_api_url,this.eyepopUrl());this.datasetApiUrl=s.toString();const a=new URL(o.vlm_api_url,this.eyepopUrl());if(this.vlmApiUrl=a.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,it.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,it.default)(e,"events");return this._requestLogger.debug("about to connect ws to: %s",t),new Promise((e,n)=>{let i=!1;const o=()=>{i=!0,e()},s=e=>{i=!0,n(e)},a=Pe(t);if(!a)return o();this._ws=a,a.onopen=()=>{this.authorizationHeader().then(e=>{if(this._ws!==a)return this.close_ws(a,"unsubscribe"),void o();let t=JSON.stringify({authorization:e});this._requestLogger.debug("ws send: %s",t),a.send(t),t=JSON.stringify({subscribe:{account_uuid:this._accountId}}),this._requestLogger.debug("ws send: %s",t),a.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),a.send(t)}this._ws_current_reconnect_delay=1e3,this._ws_reconnect_enabled=!0,o()}).catch(e=>{this.close_ws(a,"authorization failed",1011),s(e)})},a.onmessage=e=>{const t=JSON.parse(e.data);this._requestLogger.debug("received ws: %s",JSON.stringify(t));const n=t;this.dispatchChangeEvent(n)},a.onclose=e=>{const{code:n,reason:o}=e;this._requestLogger.debug("ws closed: %d %s",n,o),i||s(new Ut(t,new Error(`closed before the connection was established: ${n} ${o}`))),this._ws===a&&(this._ws=null,this.schedule_ws_reconnect())},a.onerror=e=>{const n=new Ut(t,e);return this._logger.error({err:n},"dataset event WebSocket connection failed"),s(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 o=this._client;if(!o)return Promise.reject("endpoint not connected");let s=await this.fetchWithRetry(async()=>{const s=await this.session(),a=st(s,i),r={...n?{}:{Authorization:`Bearer ${s.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 o.fetch((0,it.default)(a??"",e),c)});if(204===s.status)return null;const a=s.headers.get("Content-Type");if(this._requestLogger.debug("Response - "+s.status+" "+s.statusText),!s.ok)throw a&&(a.toLowerCase().startsWith("application/json")||a.toLowerCase().startsWith("text/"))?new Error(`Request failed with ${s.status} ${s.statusText}: ${await s.text()}`):new Error(`Request failed with ${s.status} ${s.statusText}`);return a&&a.toLowerCase().startsWith("application/json")?await s.json():await s.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 o=n?`&dataset_version=${n}`:"",s=void 0!==i?`&modifiable_version_only=${i}`:"";return this.request(`/datasets/${e}?include_stats=${t}${o}${s}`,{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}`:"",o=n?`&max_assets=${n}`:"";return this.request(`/datasets/${e}/auto_annotate?${i}${o}`,{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,o){const s=o?`dataset_version=${o}&`:"";return this.request(`/datasets/${t}/auto_annotates?auto_annotate=${n}&source=${encodeURIComponent(i)}&${s}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async listDatasetAutoAnnotates(e,t,n,i){const o=i?`dataset_version=${i}&`:"",s=t?`auto_annotate=${t}&`:"",a=n?`source=${n}&`:"";return this.request(`/datasets/${e}/auto_annotates?${o}&${s}&${a}`,{method:"GET"})}async uploadAsset(e,t,n,i=void 0){const o=t?`&dataset_version=${t}`:"";let s;return s=i?`/assets?dataset_uuid=${e}${o}&external_id=${i}`:`/assets?dataset_uuid=${e}${o}`,this.request(s,{method:"POST",body:n,headers:{"Content-Type":n.type||"application/octet-stream"}})}async importAsset(e,t,n,i=void 0){const o=t?`&dataset_version=${t}`:"";let s;return s=i?`/assets/imports?dataset_uuid=${e}${o}&external_id=${i}`:`/assets/imports?dataset_uuid=${e}${o}`,this.request(s,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async listAssets(e,t,n=!1,i,o,s,a,r,c){const l=new URLSearchParams;l.set("dataset_uuid",e),null!=t&&l.set("dataset_version",String(t)),n&&l.set("include_annotations","true"),null!=o&&l.set("inclusion_mode",o),null!=s&&l.set("annotation_inclusion_mode",s);for(const e of a??[])l.append("include_partition",e);for(const e of r??[])l.append("include_auto_annotate",e);for(const e of c??[])l.append("include_source",e);return null!=i&&l.set("top_k",String(i)),this.request(`/assets?${l.toString()}`,{method:"GET"})}async getAsset(e,t,n,i=!1,o){const s=n?`&dataset_version=${n}`:"",a=i?"&include_annotations=true":"",r=t?`&dataset_uuid=${t}`:"",c=o?`&top_k=${o}`:"";return this.request(`/assets/${e}?${r}${s}${a}${c}`,{method:"GET"})}async deleteAsset(e,t,n){const i=n?`&dataset_version=${n}`:"",o=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}?${o}${i}`,{method:"DELETE"})}async resurrectAsset(e,t,n,i){const o=i?`&into_dataset_version=${i}`:"";return this.request(`/assets/${e}/resurrect?dataset_uuid=${t}&from_dataset_version=${n}${o}`,{method:"POST"})}async updateAssetGroundTruth(e,t,n,i){const o=n?`&dataset_version=${n}`:"",s=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${s}${o}`,{method:"PATCH",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async deleteAssetGroundTruth(e,t,n){const i=n?`&dataset_version=${n}`:"",o=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${o}${i}`,{method:"DELETE"})}async updateAutoAnnotationStatus(e,t,n,i){if(!["approved","rejected","unknown"].includes(n))throw new Error("Invalid status");const o=i?`?approved_threshold=${i}`:"";return this.request(`/assets/${e}/auto_annotations/${t}/user_review/${n}${o}`,{method:"PATCH"})}async addAssetAnnotation(e,t,n,i,o,s,a,r){const c=t?`dataset_uuid=${t}&`:"",l=n?`&dataset_version=${n}&`:"",p=o?`&auto_annotate=${o}&`:"",u=s?`&source=${encodeURIComponent(s)}&`:"",d=a?`&user_review=${a}&`:"",h=void 0!==r?`&approved_threshold=${r}&`:"";return this.request(`/assets/${e}/annotations?${c}${l}${p}${u}${d}${h}`,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async updateAssetAnnotationApproval(e,t,n,i,o,s,a){const r=t?`dataset_uuid=${t}&`:"",c=n?`&dataset_version=${n}&`:"",l=i?`&auto_annotate=${i}&`:"",p=o?`&source=${encodeURIComponent(o)}&`:"",u=s?`&user_review=${s}&`:"",d=a?`&approved_threshold=${a}&`:"";return this.request(`/assets/${e}/annotations?${r}${c}${l}${p}${u}${d}`,{method:"PATCH"})}async downloadAsset(e,t,n,i="original",o,s,a){const r=n?`&dataset_version=${n}`:"",c=t?`&dataset_uuid=${t}`:"",l=o?`&start_timestamp=${o}`:"",p=s?`&end_timestamp=${s}`:"",u=a?`&url_type=${a}`:"";return this.request(`/assets/${e}/download?transcode_mode=${i}${c}${r}${l}${p}${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,o){const s=i?`&dataset_version=${i}`:"",a=n?`&dataset_uuid=${n}`:"";return this.request(`/assets/${e}/rois?${a}${s}`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteAssetRoi(e,t,n,i){const o=i?`&dataset_version=${i}`:"",s=n?`&dataset_uuid=${n}`:"";return this.request(`/assets/${e}/rois/${encodeURIComponent(t)}?${s}${o}`,{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 o=i?`artifact_type=${i}&`:"",s=n?`device_name=${encodeURIComponent(n)}&`:"";let a="";if(t)for(const e of t)a+=`model_format=${e}&`;return this.request(`/exports/model_artifacts/?model_uuid=${e}&${o}${s}${a}`,{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 o=[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}${o?`&${o}`:""}`,{method:"GET"})}async inferAsset(e,t,n,i,o,s,a){const r=`ai.eyepop://data/assets/${e}?${o?`transcode_mode=${o}&`:""}${n?`dataset_uuid=${n}&`:""}${i?`dataset_version=${i}&`:""}${s?`start_timestamp=${s}&`:""}${a?`end_timestamp=${a}&`:""}`;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 It(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 Ot(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,Rt),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,Rt),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,Rt),headers:{"Content-Type":"application/json"}}):void 0!==n?this.request(`/vlm_abilities/${e}/refine_task`,{method:"POST",body:JSON.stringify(n,Rt),headers:{"Content-Type":"application/json"}}):Promise.reject("refine vlm ability requires auto_prompt or auto_config parameter")}async cloneVlmAbility(e,t,n,i){const o=new URLSearchParams;return t?o.set("account_uuid",t):this._accountId&&o.set("account_uuid",this._accountId),n&&o.set("name",n),i&&o.set("default_alias_name",i),this.request(`/vlm_abilities/${e}/clone?${o.toString()}`,{method:"POST"})}async publishVlmAbility(e,t,n){const i=t?`alias_name=${encodeURIComponent(t)}&`:"",o=n?`tag_name=${encodeURIComponent(n)}&`:"";return this.request(`/vlm_abilities/${e}/publish?${i}${o}`,{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],zt=class{constructor(e,t,n){this.width=e,this.height=t,this.values=n}at(e,t,n,i){let o=e,s=t;n&&i&&(o=e*this.width/n,s=t*this.height/i);const a=Math.min(Math.max(Math.floor(o),0),this.width-1),r=Math.min(Math.max(Math.floor(s),0),this.height-1);return this.values[r*this.width+a]}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 Mt(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!==o){const t=o.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 zt(e.width,e.height,i)}var qt=1===new Uint8Array(new Uint16Array([1]).buffer)[0],Dt=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],o=this.points[n+1],s=this.points[n+2];if(!(Number.isNaN(i)||Number.isNaN(o)||Number.isNaN(s)))return{x:i,y:o,z:s}}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],o=this.points[t+2];Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(o)||e.push({x:n,y:i,z:o})}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 o=this.points[i],s=this.points[i+1],a=this.points[i+2];Number.isNaN(o)||Number.isNaN(s)||Number.isNaN(a)||(e=!0,t.x=Math.min(t.x,o),t.y=Math.min(t.y,s),t.z=Math.min(t.z,a),n.x=Math.max(n.x,o),n.y=Math.max(n.y,s),n.z=Math.max(n.z,a))}return e?{min:t,max:n}:void 0}};function Wt(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 s=function(e){if(void 0!==o){const t=o.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),a=e*t*3;if(s.byteLength!==4*a)throw new Error(`'world' holds ${s.byteLength} bytes, expected ${4*a} for ${e}x${t} xyz float32`);let r;if(qt){const e=new Uint8Array(s);r=new Float32Array(e.buffer,0,a)}else{const e=new DataView(s.buffer,s.byteOffset,s.byteLength);r=new Float32Array(a);for(let t=0;t<a;t++)r[t]=e.getFloat32(4*t,!0)}return new Dt(e,t,r,i)}function $t(e,t){if(void 0!==e&&void 0!==e.world)return Wt(e.width,e.height,e.world,t)}function Jt(e){if(void 0!==e&&void 0!==e.mask)return $t(e.mask,{x:e.x,y:e.y,width:e.width,height:e.height})}function Ft(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 Wt(e.width,e.height,e.world,i)}function Ht(e){const t=[];if(void 0===e)return t;const n=e=>{for(const i of e??[]){const e=Jt(i);void 0!==e&&t.push(e),n(i.objects)}};n(e.objects);const i=Ft(e.depth,e.source_width,e.source_height);return void 0!==i&&t.push(i),t}var Kt,Vt=class extends fe{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:fe.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())})}},Bt=e=>{if("undefined"!=typeof process)return process.env?.[e]??void 0},Gt=!1,Zt=()=>{const e=Bt("EYEPOP_ACCOUNT_UUID");if(void 0!==e)return e;const t=Bt("EYEPOP_ACCOUNT_ID");return void 0===t||Gt||(Gt=!0,console.warn("EYEPOP_ACCOUNT_ID is deprecated, use EYEPOP_ACCOUNT_UUID instead")),t},Xt=e=>{if(void 0===e)return!1;const t=e.toLowerCase();return"true"==t||"yes"==t};(e=>{const t=Bt("EYEPOP_API_KEY"),n=t?{apiKey:t}:void 0;function i(e={}){const t={...e};if(void 0!==t.pop&&J(t.pop),void 0===t.isLocalMode&&(t.isLocalMode=Xt(Bt("EYEPOP_LOCAL_MODE"))),void 0===t.isPipelineMode){const e=b(t)?.session;t.isPipelineMode=e?.isPipelineMode??Xt(Bt("EYEPOP_PIPELINE_MODE"))}if(t.isPipelineMode)return function(e){const t=e.popId??Bt("EYEPOP_POP_ID"),n={popId:"transient"===t?void 0:t,sessionUuid:e.sessionUuid??Bt("EYEPOP_SESSION_UUID"),sessionName:e.sessionName,pipelineImage:e.pipelineImage,pipelineVersion:e.pipelineVersion},i=Object.entries(n).filter(([,e])=>e).map(([e])=>e);if(i.length>0)throw new Ne("session_options",`pipeline mode runs no worker session; it takes no ${i.join(", ")}`,i);if(e.isLocalMode&&!e.eyepopUrl&&(e.eyepopUrl=Bt("EYEPOP_URL")||"http://127.0.0.1:9002"),e.jobQueueLength||(e.jobQueueLength=Ue),o(e),void 0===b(e)){if(!e.isLocalMode)throw new Error("apiKey/accessToken/session/oAuth2 option or EYEPOP_API_KEY environment variable is required");e.auth={isLocal:!0}}return void 0===e.accountId&&(e.accountId=b(e)?.session?.accountId??Zt()),new nt(e)}(t);if(t.isLocalMode&&(t.eyepopUrl="http://127.0.0.1:8080"),o(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=Bt("EYEPOP_SESSION_UUID")),void 0===t.sessionName&&(t.sessionName=Bt("EYEPOP_SESSION_NAME")),void 0===t.accountId&&(t.accountId=Zt()),void 0===t.pipelineImage&&(t.pipelineImage=Bt("EYEPOP_PIPELINE_IMAGE")),void 0===t.pipelineVersion&&(t.pipelineVersion=Bt("EYEPOP_PIPELINE_VERSION")),void 0===t.popId&&void 0===t.sessionUuid&&(t.popId=Bt("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 nt(t)}function o(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=Bt("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={}){o(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=Zt()),void 0!==t.session&&void 0!==t.session&&t.session.accountId&&(e.accountId=t.session.accountId),new Lt(e)}})(Kt||(Kt={}));var Yt=Kt},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 o=n(465);Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return o.default}});var s=n(178);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return s.default}});var a=n(11);Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.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 l=n(591);Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return l.default}});var p=n(286);Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return p.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 o(e,t,n,o,s,a){return i((r=i(i(t,e),i(o,a)))<<(c=s)|r>>>32-c,n);var r,c}function s(e,t,n,i,s,a,r){return o(t&n|~t&i,e,t,s,a,r)}function a(e,t,n,i,s,a,r){return o(t&i|n&~i,e,t,s,a,r)}function r(e,t,n,i,s,a,r){return o(t^n^i,e,t,s,a,r)}function c(e,t,n,i,s,a,r){return o(n^(t|~i),e,t,s,a,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 o=new Uint32Array(n(t)).fill(0);o.set(e),o[t>>5]|=128<<t%32,o[o.length-1]=t,e=o;let l=1732584193,p=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=l,o=p,h=u,m=d;l=s(l,p,u,d,e[t],7,-680876936),d=s(d,l,p,u,e[t+1],12,-389564586),u=s(u,d,l,p,e[t+2],17,606105819),p=s(p,u,d,l,e[t+3],22,-1044525330),l=s(l,p,u,d,e[t+4],7,-176418897),d=s(d,l,p,u,e[t+5],12,1200080426),u=s(u,d,l,p,e[t+6],17,-1473231341),p=s(p,u,d,l,e[t+7],22,-45705983),l=s(l,p,u,d,e[t+8],7,1770035416),d=s(d,l,p,u,e[t+9],12,-1958414417),u=s(u,d,l,p,e[t+10],17,-42063),p=s(p,u,d,l,e[t+11],22,-1990404162),l=s(l,p,u,d,e[t+12],7,1804603682),d=s(d,l,p,u,e[t+13],12,-40341101),u=s(u,d,l,p,e[t+14],17,-1502002290),p=s(p,u,d,l,e[t+15],22,1236535329),l=a(l,p,u,d,e[t+1],5,-165796510),d=a(d,l,p,u,e[t+6],9,-1069501632),u=a(u,d,l,p,e[t+11],14,643717713),p=a(p,u,d,l,e[t],20,-373897302),l=a(l,p,u,d,e[t+5],5,-701558691),d=a(d,l,p,u,e[t+10],9,38016083),u=a(u,d,l,p,e[t+15],14,-660478335),p=a(p,u,d,l,e[t+4],20,-405537848),l=a(l,p,u,d,e[t+9],5,568446438),d=a(d,l,p,u,e[t+14],9,-1019803690),u=a(u,d,l,p,e[t+3],14,-187363961),p=a(p,u,d,l,e[t+8],20,1163531501),l=a(l,p,u,d,e[t+13],5,-1444681467),d=a(d,l,p,u,e[t+2],9,-51403784),u=a(u,d,l,p,e[t+7],14,1735328473),p=a(p,u,d,l,e[t+12],20,-1926607734),l=r(l,p,u,d,e[t+5],4,-378558),d=r(d,l,p,u,e[t+8],11,-2022574463),u=r(u,d,l,p,e[t+11],16,1839030562),p=r(p,u,d,l,e[t+14],23,-35309556),l=r(l,p,u,d,e[t+1],4,-1530992060),d=r(d,l,p,u,e[t+4],11,1272893353),u=r(u,d,l,p,e[t+7],16,-155497632),p=r(p,u,d,l,e[t+10],23,-1094730640),l=r(l,p,u,d,e[t+13],4,681279174),d=r(d,l,p,u,e[t],11,-358537222),u=r(u,d,l,p,e[t+3],16,-722521979),p=r(p,u,d,l,e[t+6],23,76029189),l=r(l,p,u,d,e[t+9],4,-640364487),d=r(d,l,p,u,e[t+12],11,-421815835),u=r(u,d,l,p,e[t+15],16,530742520),p=r(p,u,d,l,e[t+2],23,-995338651),l=c(l,p,u,d,e[t],6,-198630844),d=c(d,l,p,u,e[t+7],10,1126891415),u=c(u,d,l,p,e[t+14],15,-1416354905),p=c(p,u,d,l,e[t+5],21,-57434055),l=c(l,p,u,d,e[t+12],6,1700485571),d=c(d,l,p,u,e[t+3],10,-1894986606),u=c(u,d,l,p,e[t+10],15,-1051523),p=c(p,u,d,l,e[t+1],21,-2054922799),l=c(l,p,u,d,e[t+8],6,1873313359),d=c(d,l,p,u,e[t+15],10,-30611744),u=c(u,d,l,p,e[t+6],15,-1560198380),p=c(p,u,d,l,e[t+13],21,1309151649),l=c(l,p,u,d,e[t+4],6,-145523070),d=c(d,l,p,u,e[t+11],10,-1120210379),u=c(u,d,l,p,e[t+2],15,718787259),p=c(p,u,d,l,e[t+9],21,-343485551),l=i(l,n),p=i(p,o),u=i(u,h),d=i(d,m)}return Uint32Array.of(l,p,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],o=[1732584193,4023233417,2562383102,271733878,3285377520],s=new Uint8Array(e.length+1);s.set(e),s[e.length]=128;const a=(e=s).length/4+2,r=Math.ceil(a/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 s=new Uint32Array(80);for(let t=0;t<16;++t)s[t]=c[e][t];for(let e=16;e<80;++e)s[e]=i(s[e-3]^s[e-8]^s[e-14]^s[e-16],1);let a=o[0],r=o[1],l=o[2],p=o[3],u=o[4];for(let e=0;e<80;++e){const o=Math.floor(e/20),c=i(a,5)+n(o,r,l,p)+u+t[o]+s[e]>>>0;u=p,p=l,l=i(r,30)>>>0,r=a,a=c}o[0]=o[0]+a>>>0,o[1]=o[1]+r>>>0,o[2]=o[2]+l>>>0,o[3]=o[3]+p>>>0,o[4]=o[4]+u>>>0}return Uint8Array.of(o[0]>>24,o[0]>>16,o[0]>>8,o[0],o[1]>>24,o[1]>>16,o[1]>>8,o[1],o[2]>>24,o[2]>>16,o[2]>>8,o[2],o[3]>>24,o[3]>>16,o[3]>>8,o[3],o[4]>>24,o[4]>>16,o[4]>>8,o[4])}},11(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unsafeStringify=void 0;const i=n(746),o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function s(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.unsafeStringify=s,t.default=function(e,t=0){const n=s(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),o=n(11),s={};function a(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,o,s,a=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(s){if(a<0||a+16>s.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`)}else s=new Uint8Array(16),a=0;t??=Date.now(),n??=0,i??=16383&(e[8]<<8|e[9]),o??=e.slice(10,16);const r=(1e4*(268435455&(t+=122192928e5))+n)%4294967296;s[a++]=r>>>24&255,s[a++]=r>>>16&255,s[a++]=r>>>8&255,s[a++]=255&r;const c=t/4294967296*1e4&268435455;s[a++]=c>>>8&255,s[a++]=255&c,s[a++]=c>>>24&15|16,s[a++]=c>>>16&255,s[a++]=i>>>8|128,s[a++]=255&i;for(let e=0;e<6;++e)s[a++]=o[e];return s}t.updateV1State=a,t.default=function(e,t,n){let c;const l=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(),o=(0,i.default)();a(s,e,o),c=r(o,s.msecs,s.nsecs,l?void 0:s.clockseq,l?void 0:s.node,t,n)}return t??(0,o.unsafeStringify)(c)}},568(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(178),o=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,o.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),o=n(988);var s=n(988);function a(e,t,n,s){return(0,o.default)(48,i.default,e,t,n,s)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return s.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return s.URL}}),a.DNS=o.DNS,a.URL=o.URL,t.default=a},988(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=t.stringToBytes=void 0;const i=n(178),o=n(11);function s(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=s,t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t.default=function(e,t,n,a,r,c){const l="string"==typeof n?s(n):n,p="string"==typeof a?(0,i.default)(a):a;if("string"==typeof a&&(a=(0,i.default)(a)),16!==a?.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+l.length);if(u.set(p),u.set(l,p.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,o.unsafeStringify)(u)}},286(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(779),o=n(291),s=n(11);t.default=function(e,t,n){if(i.default.randomUUID&&!t&&!e)return i.default.randomUUID();const a=(e=e||{}).random??e.rng?.()??(0,o.default)();if(a.length<16)throw new Error("Random bytes length must be >= 16");if(a[6]=15&a[6]|64,a[8]=63&a[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]=a[e];return t}return(0,s.unsafeStringify)(a)}},557(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const i=n(829),o=n(988);var s=n(988);function a(e,t,n,s){return(0,o.default)(80,i.default,e,t,n,s)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return s.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return s.URL}}),a.DNS=o.DNS,a.URL=o.URL,t.default=a},356(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(11),o=n(425),s=n(568);t.default=function(e,t,n){e??={},n??=0;let a=(0,o.default)({...e,_v6:!0},new Uint8Array(16));if(a=(0,s.default)(a),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]=a[e];return t}return(0,i.unsafeStringify)(a)}},268(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(178),o=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,o.unsafeStringify)(t):t}},299(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV7State=void 0;const i=n(291),o=n(11),s={};function a(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,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(i){if(o<0||o+16>i.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else i=new Uint8Array(16),o=0;return t??=Date.now(),n??=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9],i[o++]=t/1099511627776&255,i[o++]=t/4294967296&255,i[o++]=t/16777216&255,i[o++]=t/65536&255,i[o++]=t/256&255,i[o++]=255&t,i[o++]=112|n>>>28&15,i[o++]=n>>>20&255,i[o++]=128|n>>>14&63,i[o++]=n>>>6&255,i[o++]=n<<2&255|3&e[10],i[o++]=e[11],i[o++]=e[12],i[o++]=e[13],i[o++]=e[14],i[o++]=e[15],i}t.updateV7State=a,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(),o=(0,i.default)();a(s,e,o),c=r(o,s.msecs,s.seq,t,n)}return t??(0,o.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 o=t[i];if(void 0!==o)return o.exports;const s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,n),s.exports}return n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var o=t[i++],s=t[i++],a=0===s?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:s};n.o(e,o)||Object.defineProperty(e,o,a)}else for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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);
|
|
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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}function o(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 a(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.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 l(e){return new s(e,0)}function p(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){p(e,t),t.set(e,n)}function h(e,t,n){return e.set(c(e,t),n),n}function m(e,t){p(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,o=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 a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}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,o,a,s,r=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=a.call(n)).done)&&(r.push(i.value),r.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw o}}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 a=e[t](n),r=a.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}o(!!a.done,n)},function(e){i("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(a,s){var r={key:e,arg:o,resolve:a,reject:s,next:null};n?n=n.next=r:(t=n=r,i(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}n.r(t),n.d(t,{AnonymousSessionApiClient:()=>el,AnonymousSessionClient:()=>ic,AnonymousSessionError:()=>ec,Auth0Client:()=>tl,AuthenticationError:()=>O,CacheKey:()=>$e,ConnectError:()=>U,GenericError:()=>C,InMemoryCache:()=>Fe,InvalidConfigurationError:()=>I,LocalStorageCache:()=>Je,MfaApiClient:()=>$c,MfaChallengeError:()=>Mc,MfaEnrollmentError:()=>zc,MfaEnrollmentFactorsError:()=>Dc,MfaError:()=>Lc,MfaListAuthenticatorsError:()=>Nc,MfaRequiredError:()=>M,MfaVerifyError:()=>qc,MissingRefreshTokenError:()=>D,MissingScopesError:()=>W,MyAccountApiClient:()=>yt,MyAccountApiError:()=>bt,PasskeyApiClient:()=>Fc,PasskeyChallengeError:()=>jr,PasskeyError:()=>Jc,PasskeyGetTokenError:()=>Cr,PasskeyRegisterError:()=>Ar,PasskeyVerificationRequiredError:()=>q,PopupCancelledError:()=>N,PopupOpenError:()=>z,PopupTimeoutError:()=>L,ResponseType:()=>ot,TimeoutError:()=>R,UseDpopNonceError:()=>$,User:()=>at,createAuth0Client:()=>il,isFederatedDomain:()=>nl}),"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,S="memory",T="Multifactor authentication required",E="online_access",P={name:"auth0-spa-js",version:"2.30.0"},A=()=>Date.now(),j="default";class C extends Error{constructor(e,t,n){super(t),this.error=e,this.error_description=t,this.data=n,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 U extends C{constructor(e,t,n,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(e,t),this.connection=n,this.state=i,this.appState=o,Object.setPrototypeOf(this,U.prototype)}}class R extends C{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,R.prototype)}}class L extends R{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,L.prototype)}}class N extends C{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,N.prototype)}}class z extends C{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,z.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 q extends C{constructor(e){super("verification_required","Identifier verification is required before passkey creation. Collect OTP codes for each identifier and call passkey.continueSignup()."),this.verificationRequired=e,Object.setPrototypeOf(this,q.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 $ extends C{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,$.prototype)}}function J(e){return e&&!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).includes(e)?e:""}const F=()=>window.crypto,H=()=>{let e="";for(;e.length<43;){const t=F().getRandomValues(new Uint8Array(43-e.length));for(const n of t)e.length<43&&n<198&&(e+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~."[n%66])}return e},K=e=>btoa(e),V=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],B=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 o=V.find(e=>e.key===i);return o&&o.type.includes(typeof e[i])&&(n[i]=e[i]),n},{})},G=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()},Z=async e=>{const t=F().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},X=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),Y=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))},Q=e=>{if("string"!=typeof e)return e;const t=parseInt(e,10);return isNaN(t)?void 0:t};var ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},te={},ne={};Object.defineProperty(ne,"__esModule",{value:!0});var ie=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}();ne.default=function(){return ie.getInstance()};var oe=ee&&ee.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function r(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,r)}c((i=i.apply(e,t||[])).next())})},ae=ee&&ee.__generator||function(e,t){var n,i,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(a){return function(r){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,r])}}},se=ee;Object.defineProperty(te,"__esModule",{value:!0});var re=ne,ce="browser-tabs-lock-key",le={key:function(e){return oe(se,void 0,void 0,function(){return ae(this,function(e){throw new Error("Unsupported")})})},getItem:function(e){return oe(se,void 0,void 0,function(){return ae(this,function(e){throw new Error("Unsupported")})})},clear:function(){return oe(se,void 0,void 0,function(){return ae(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return oe(se,void 0,void 0,function(){return ae(this,function(e){throw new Error("Unsupported")})})},setItem:function(e,t){return oe(se,void 0,void 0,function(){return ae(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 pe(e){return new Promise(function(t){return setTimeout(t,e)})}function ue(e){for(var t="",n=0;n<e;n++)t+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"[Math.floor(61*Math.random())];return t}var de=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+ue(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),oe(this,void 0,void 0,function(){var i,o,a,s,r,c,l;return ae(this,function(p){switch(p.label){case 0:i=Date.now()+ue(4),o=Date.now()+n,a=ce+"-"+t,s=void 0===this.storageHandler?le:this.storageHandler,p.label=1;case 1:return Date.now()<o?[4,pe(30)]:[3,8];case 2:return p.sent(),null!==s.getItemSync(a)?[3,5]:(r=this.id+"-"+t+"-"+i,[4,pe(Math.floor(25*Math.random()))]);case 3:return p.sent(),s.setItemSync(a,JSON.stringify({id:this.id,iat:i,timeoutKey:r,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,pe(30)];case 4:return p.sent(),null!==(c=s.getItemSync(a))&&(l=JSON.parse(c)).id===this.id&&l.iat===i?(this.acquiredIatSet.add(i),this.refreshLockWhileAcquired(a,i),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?le:this.storageHandler),[4,this.waitForSomethingToChange(o)];case 6:p.sent(),p.label=7;case 7:return i=Date.now()+ue(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return oe(this,void 0,void 0,function(){var n=this;return ae(this,function(i){return setTimeout(function(){return oe(n,void 0,void 0,function(){var n,i,o;return ae(this,function(a){switch(a.label){case 0:return[4,re.default().lock(t)];case 1:return a.sent(),this.acquiredIatSet.has(t)?(n=void 0===this.storageHandler?le:this.storageHandler,null===(i=n.getItemSync(e))?(re.default().unlock(t),[2]):((o=JSON.parse(i)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(o)),re.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(re.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return oe(this,void 0,void 0,function(){return ae(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var i=!1,o=Date.now(),a=!1;function s(){if(a||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(r),a=!0),!i){i=!0;var t=50-(Date.now()-o);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 oe(this,void 0,void 0,function(){return ae(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 oe(this,void 0,void 0,function(){var n,i,o,a;return ae(this,function(s){switch(s.label){case 0:return n=void 0===this.storageHandler?le:this.storageHandler,i=ce+"-"+t,null===(o=n.getItemSync(i))?[2]:(a=JSON.parse(o)).id!==this.id?[3,2]:[4,re.default().lock(a.iat)];case 1:s.sent(),this.acquiredIatSet.delete(a.iat),n.removeItemSync(i),re.default().unlock(a.iat),e.notifyWaiters(),s.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,i=t,o=[],a=0;;){var s=i.keySync(a);if(null===s)break;o.push(s),a++}for(var r=!1,c=0;c<o.length;c++){var l=o[c];if(l.includes(ce)){var p=i.getItemSync(l);if(null!==p){var u=JSON.parse(p);(void 0===u.timeRefreshed&&u.timeAcquired<n||void 0!==u.timeRefreshed&&u.timeRefreshed<n)&&(i.removeItemSync(l),r=!0)}}}r&&e.notifyWaiters()},e.waiters=void 0,e}(),he=te.default=de;class me{async runWithLock(e,t,n){const i=new AbortController,o=setTimeout(()=>i.abort(),t);try{return await navigator.locks.request(e,{mode:"exclusive",signal:i.signal},async e=>{if(clearTimeout(o),!e)throw new Error("Lock not available");return await n()})}catch(e){if(clearTimeout(o),i.signal.aborted&&"AbortError"===(null==e?void 0:e.name))throw new R;throw e}}}class fe{constructor(){this.activeLocks=new Set,this.lock=new he,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 R;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 ve=null;function ge(){return ve||(ve=function(){return"undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.locks)||void 0===e?void 0:e.request)?new me:new fe;var e}()),ve}const ye={},be=new TextEncoder,we=new TextDecoder;function xe(e){return"string"==typeof e?be.encode(e):we.decode(e)}function _e(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new Ee(`${e.name} modulusLength must be at least 2048 bits`)}let ke;if(Uint8Array.prototype.toBase64)ke=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;ke=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 Se(e){return ke(e)}class Te 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 Ee 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 Pe(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){if("SHA-256"===e.algorithm.hash.name)return"PS256";throw new Te("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(e){if("SHA-256"===e.algorithm.hash.name)return"RS256";throw new Te("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(e){if("P-256"===e.algorithm.namedCurve)return"ES256";throw new Te("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new Te("unsupported CryptoKey algorithm name")}}function Ae(e){return e instanceof CryptoKey}function je(e){return Ae(e)&&"public"===e.type}async function Ce(e){const{kty:t,e:n,n:i,x:o,y:a,crv:s}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:s,e:n,n:i,x:o,y:a}}const Ie="dpop-nonce",Oe=["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"],Ue=(e,t)=>new Promise(function(n,i){const o=new MessageChannel;o.port1.onmessage=function(e){e.data.error?i(new Error(e.data.error)):n(e.data),o.port1.close()},t.postMessage(e,[o.port2])}),Re=(e,t,n)=>{const i=new AbortController;let o;return t.signal=i.signal,Promise.race([fetch(e,t),new Promise((e,t)=>{o=setTimeout(()=>{i.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})},Le=async function(e,t,n,i,o,a){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:k;return o?(async(e,t,n,i,o,a,s,r,c,l)=>Ue({type:"refresh",auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:i,useFormData:s,useMrrt:r,skipTokenStorage:c,preserveRefreshToken:l},a))(e,t,n,i,s,o,a,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 Re(e,t,n);return{ok:i.ok,json:await i.json(),headers:(o=i.headers,[...o].reduce((e,t)=>{let n=b(t,2),i=n[0],o=n[1];return e[i]=o,e},{}))};var o})(e,i,s)};async function Ne(e,t,n,o,a,s,r,c,l,p,u,d){if(l){const t=await l.generateProof({url:e,method:a.method||"GET",nonce:await l.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:t})}let h,m=null;for(let i=0;i<3;i++)try{h=await Le(e,n,o,a,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(l&&(_=w[Ie],_&&await l.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,o);if("use_dpop_nonce"===v){if(!l||!_||p)throw new $(_);return Ne(e,t,n,o,a,s,r,c,l,!0,u,d)}throw new C(v||"request_error",i,y)}return y}async function ze(e,t,n){var o=e.baseUrl,a=e.timeout,s=e.audience,r=e.scope,c=e.auth0Client,l=e.useFormData,p=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&&p,g=m||f||v,y=Object.assign(Object.assign(Object.assign({},h),g&&s&&{audience:s}),g&&r&&{scope:r}),b=f||!l,w=b?JSON.stringify(y):G(y),x=(_=h.grant_type,Oe.includes(_));var _;return await Ne("".concat(o,"/oauth/token"),a,s||j,r,{method:"POST",body:w,headers:{"Content-Type":b?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(B(c||P)))}},t,l,p,x?u:void 0,void 0,n,d)}const Me=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},qe=(e,t,n)=>{let i;return n&&(i=e[n]),i||(i=e[j]),Me(i,t)},De="@@auth0spajs@@",We="@@user@@";class $e{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:De,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],o=t[2],a=t[3];return new $e({clientId:i,scope:a,audience:o},n)}static fromCacheEntry(e){const t=e.scope,n=e.audience,i=e.client_id;return new $e({scope:t,audience:n,clientId:i})}}class Je{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(De))}}class Fe{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 He{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||A}async setIdToken(e,t,n){var i;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(i=this.keyManifest)||void 0===i?void 0:i.add(o))}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 o;let a=await this.cache.get(e.toKey()),s=e;if(!a){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(a=await this.cache.get(o),s=$e.fromKey(o)),!a&&n&&"cache-only"!==i)return this.getEntryWithRefreshToken(e,t)}if(!a)return;const r=await this.nowProvider(),c=Math.floor(r/1e3);return a.expiresAt-t<c?a.body.refresh_token?this.modifiedCachedEntry(a,s):(await this.cache.remove(s.toKey()),void await(null===(o=this.keyManifest)||void 0===o?void 0:o.remove(s.toKey()))):a.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 $e({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 $e({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 $e({clientId:e},De,We).toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const i=$e.fromKey(t),o=new Set(i.scope&&i.scope.split(" ")),a=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],s=i.scope&&a.reduce((e,t)=>e&&o.has(t),!0);return i.prefix===De&&i.clientId===e.clientId&&i.audience===e.audience&&s})[0]}async getEntryWithRefreshToken(e,t){var n;for(const i of t){const t=$e.fromKey(i);if(t.prefix===De&&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 o=new Set;for(const a of i){const i=$e.fromKey(a);if(i.prefix===De&&i.clientId===t&&i.audience===e){const e=await this.cache.get(a);(null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.refresh_token)&&o.add(e.body.refresh_token)}}return Array.from(o)}async updateEntry(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=await this.getCacheKeys();if(o)for(const a of o){if($e.fromKey(a).clientId!==n)continue;const o=await this.cache.get(a);if(!(null==o?void 0:o.body))continue;const s=o.body.refresh_token;s&&(i||s===e)&&(o.body.refresh_token=t,await this.cache.set(a,o))}}}class Ke{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 Ve=e=>"number"==typeof e,Be=["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 Ge=ee&&ee.__assign||function(){return Ge=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ge.apply(this,arguments)};function Ze(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function Xe(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 Ze("Expires",e.expires?e.expires.toUTCString():"")+Ze("Domain",e.domain)+Ze("Path",e.path)+Ze("Secure",e.secure)+Ze("SameSite",e.sameSite)}(n)}(e,t,Ge({path:"/"},n))}var Ye=Xe,Qe=function(e,t){Xe(e,"",Ge(Ge({},t),{expires:-1}))};const et={get(e){const t=function(e){return function(e){for(var t={},n=e?e.split("; "):[],i=/(%[\dA-F]{2})+/gi,o=0;o<n.length;o++){var a=n[o].split("="),s=a.slice(1).join("=");'"'===s.charAt(0)&&(s=s.slice(1,-1));try{t[a[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),Ye(e,JSON.stringify(t),i)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Qe(e,n)}},tt="_legacy_",nt={get:e=>et.get(e)||et.get("".concat(tt).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),Ye("".concat(tt).concat(e),JSON.stringify(t),i),et.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Qe(e,n),et.remove(e,t),et.remove("".concat(tt).concat(e),t)}},it={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 ot;!function(e){e.Code="code",e.ConnectCode="connect_code"}(ot||(ot={}));class at{}var st,rt=function(e){return st=st||function(){var e=function(e){var t=atob(e);return t}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxhLGk9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihpLnB1c2goby52YWx1ZSksaS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoYT1yLnJldHVybigpLE9iamVjdChhKSE9PWEpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGl9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQsbyl7c3VwZXIodCksdGhpcy5lcnJvcj1lLHRoaXMuZXJyb3JfZGVzY3JpcHRpb249dCx0aGlzLmRhdGE9byxPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxyLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKGUpe2xldCB0PWUuZXJyb3Isbz1lLmVycm9yX2Rlc2NyaXB0aW9uO3JldHVybiBuZXcgcih0LG8pfX1jbGFzcyBvIGV4dGVuZHMgcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKCJtaXNzaW5nX3JlZnJlc2hfdG9rZW4iLCJNaXNzaW5nIFJlZnJlc2ggVG9rZW4gKGF1ZGllbmNlOiAnIi5jb25jYXQobihlLFsiZGVmYXVsdCJdKSwiJywgc2NvcGU6ICciKS5jb25jYXQobih0KSwiJykiKSksdGhpcy5hdWRpZW5jZT1lLHRoaXMuc2NvcGU9dCxPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxvLnByb3RvdHlwZSl9fWZ1bmN0aW9uIG4oZSl7cmV0dXJuIGUmJiEoYXJndW1lbnRzLmxlbmd0aD4xJiZ2b2lkIDAhPT1hcmd1bWVudHNbMV0/YXJndW1lbnRzWzFdOltdKS5pbmNsdWRlcyhlKT9lOiIifSJmdW5jdGlvbiI9PXR5cGVvZiBTdXBwcmVzc2VkRXJyb3ImJlN1cHByZXNzZWRFcnJvcjtjb25zdCBzPWU9Pnt2YXIgdD1lLmNsaWVudElkLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIG8gaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxvKSYmdC5pbmRleE9mKG8pPDAmJihyW29dPWVbb10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbj0wO2ZvcihvPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bjxvLmxlbmd0aDtuKyspdC5pbmRleE9mKG9bbl0pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLG9bbl0pJiYocltvW25dXT1lW29bbl1dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIodD0+dm9pZCAwIT09ZVt0XSkucmVkdWNlKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkse30pKShPYmplY3QuYXNzaWduKHtjbGllbnRfaWQ6dH0scikpKS50b1N0cmluZygpfTtsZXQgYT17fSxpPW51bGw7Y29uc3QgYz0oZSx0KT0+IiIuY29uY2F0KGUsInwiKS5jb25jYXQodCksbD0oZSx0KT0+dC5zdGFydHNXaXRoKCIiLmNvbmNhdChlLCJ8IikpLHU9KGUsdCk9PmFbYyhlLHQpXSxmPWU9PntPYmplY3QuZW50cmllcyhhKS5mb3JFYWNoKHI9PntsZXQgbz10KHIsMiksbj1vWzBdO29bMV09PT1lJiZkZWxldGUgYVtuXX0pfSxoPWU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKChlLHQpPT57clt0XT1lfSkscn0sZD1hc3luYyBlPT57bGV0IHIsbixpPWUuZGF0YSxmPWkudGltZW91dCxkPWkuYXV0aCxwPWkuZmV0Y2hVcmwseT1pLmZldGNoT3B0aW9ucyxnPWkudXNlRm9ybURhdGEsYj1pLnVzZU1ycnQsTz1pLnNraXBUb2tlblN0b3JhZ2Usaz1pLnByZXNlcnZlUmVmcmVzaFRva2VuLG09dChlLnBvcnRzLDEpWzBdLGo9e307Y29uc3Qgdj1kfHx7fSxfPXYuYXVkaWVuY2Usdz12LnNjb3BlO3RyeXtjb25zdCBlPWc/aCh5LmJvZHkpOkpTT04ucGFyc2UoeS5ib2R5KTtpZihlLnJlZnJlc2hfdG9rZW58fCJyZWZyZXNoX3Rva2VuIiE9PWUuZ3JhbnRfdHlwZSllLm1mYV90b2tlbiYmKG49dShfLHcpLCFuJiZiJiYobj1hLmxhdGVzdF9yZWZyZXNoX3Rva2VuKSk7ZWxzZXtpZihuPXUoXyx3KSwhbiYmYil7Y29uc3QgZT1hLmxhdGVzdF9yZWZyZXNoX3Rva2VuLHQ9KChlLHQpPT4hIU9iamVjdC5rZXlzKGEpLmZpbmQocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBvPWwodCxyKSxuPXIuc3BsaXQoInwiKVsxXS5zcGxpdCgiICIpLHM9ZS5zcGxpdCgiICIpLmV2ZXJ5KGU9Pm4uaW5jbHVkZXMoZSkpO3JldHVybiBvJiZzfX0pKSh3LF8pO2UmJiF0JiYobj1lKX1pZighbil0aHJvdyBuZXcgbyhfLHcpO3kuYm9keT1nP3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSl9bGV0IGksZDsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYoaT1uZXcgQWJvcnRDb250cm9sbGVyLHkuc2lnbmFsPWkuc2lnbmFsKTt0cnl7ZD1hd2FpdCBQcm9taXNlLnJhY2UoWyhQPWYsbmV3IFByb21pc2UoZT0+c2V0VGltZW91dChlLFApKSksZmV0Y2gocCxPYmplY3QuYXNzaWduKHt9LHkpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIG0ucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFkKXJldHVybiBpJiZpLmFib3J0KCksdm9pZCBtLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2lmKFU9ZC5oZWFkZXJzLGo9Wy4uLlVdLnJlZHVjZSgoZSxyKT0+e2xldCBvPXQociwyKSxuPW9bMF0scz1vWzFdO3JldHVybiBlW25dPXMsZX0se30pLHI9YXdhaXQgZC5qc29uKCksTylyZXR1cm4gZGVsZXRlIHIucmVmcmVzaF90b2tlbix2b2lkIG0ucG9zdE1lc3NhZ2Uoe29rOmQub2ssanNvbjpyLGhlYWRlcnM6an0pO3IucmVmcmVzaF90b2tlbj8oYiYmKGEubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLFM9bixNPXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhhKS5mb3JFYWNoKGU9PntsZXQgcj10KGUsMiksbz1yWzBdO3JbMV09PT1TJiYoYVtvXT1NKX0pKSwoKGUsdCxyKT0+e2FbYyh0LHIpXT1lfSkoci5yZWZyZXNoX3Rva2VuLF8sdyksZGVsZXRlIHIucmVmcmVzaF90b2tlbik6a3x8KChlLHQpPT57ZGVsZXRlIGFbYyhlLHQpXX0pKF8sdyksbS5wb3N0TWVzc2FnZSh7b2s6ZC5vayxqc29uOnIsaGVhZGVyczpqfSl9Y2F0Y2goZSl7bS5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9LGhlYWRlcnM6an0pfXZhciBTLE0sVSxQfSxwPWFzeW5jIGU9PntsZXQgcj1lLmRhdGEsbz1yLnRpbWVvdXQsbj1yLmF1dGgsaT1yLmZldGNoVXJsLGM9ci5mZXRjaE9wdGlvbnMsdT1yLnVzZUZvcm1EYXRhLGQ9dChlLnBvcnRzLDEpWzBdO2NvbnN0IHA9KG58fHt9KS5hdWRpZW5jZTt0cnl7Y29uc3QgZT0oZT0+e2NvbnN0IHI9bmV3IFNldDtyZXR1cm4gT2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChvPT57bGV0IG49dChvLDIpLHM9blswXSxhPW5bMV07bChlLHMpJiZyLmFkZChhKX0pLEFycmF5LmZyb20ocil9KShwKTtpZigwPT09ZS5sZW5ndGgpcmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7b2s6ITB9KTtjb25zdCByPXU/aChjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtmb3IoY29uc3QgdCBvZiBlKXtjb25zdCBlPXU/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3Rva2VuOnR9KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpO2xldCBuLGEsbCxoOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihuPW5ldyBBYm9ydENvbnRyb2xsZXIsYT1uLnNpZ25hbCk7dHJ5e2g9YXdhaXQgUHJvbWlzZS5yYWNlKFtuZXcgUHJvbWlzZShlPT57bD1zZXRUaW1lb3V0KGUsbyl9KSxmZXRjaChpLE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxjKSx7Ym9keTplLHNpZ25hbDphfSkpXSkuZmluYWxseSgoKT0+Y2xlYXJUaW1lb3V0KGwpKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBkLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighaClyZXR1cm4gbiYmbi5hYm9ydCgpLHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZighaC5vayl7bGV0IGU7dHJ5e2NvbnN0IHQ9SlNPTi5wYXJzZShhd2FpdCBoLnRleHQoKSk7ZT10LmVycm9yX2Rlc2NyaXB0aW9ufWNhdGNoKGUpe31yZXR1cm4gdm9pZCBkLnBvc3RNZXNzYWdlKHtlcnJvcjplfHwiSFRUUCBlcnJvciAiLmNvbmNhdChoLnN0YXR1cyl9KX1mKHQpfWQucG9zdE1lc3NhZ2Uoe29rOiEwfSl9Y2F0Y2goZSl7ZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfHwiVW5rbm93biBlcnJvciBkdXJpbmcgdG9rZW4gcmV2b2NhdGlvbiJ9KX19LHk9KGUsdCk9PntpZighaSlyZXR1cm4hMTt0cnl7Y29uc3Qgcj1uZXcgVVJMKGkpLm9yaWdpbixvPW5ldyBVUkwoZS5mZXRjaFVybCk7cmV0dXJuIG8ub3JpZ2luPT09ciYmby5wYXRobmFtZT09PXR9Y2F0Y2goZSl7cmV0dXJuITF9fTthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixlPT57Y29uc3Qgcj1lLmRhdGEsbz10KGUucG9ydHMsMSlbMF07aWYoISgidHlwZSJpbiByKXx8ImluaXQiIT09ci50eXBlKXJldHVybiJ0eXBlImluIHImJiJjbGVhciI9PT1yLnR5cGU/KGE9e30sdm9pZChudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMH0pKSk6InR5cGUiaW4gciYmInJldm9rZSI9PT1yLnR5cGU/eShyLCIvb2F1dGgvcmV2b2tlIik/dm9pZCBwKGUpOnZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ImludmFsaWRfZmV0Y2hfdXJsIixlcnJvcl9kZXNjcmlwdGlvbjoiVW5hdXRob3JpemVkIGZldGNoIFVSTCJ9LGhlYWRlcnM6e319KSk6dm9pZCgiZmV0Y2hVcmwiaW4gciYmeShyLCIvb2F1dGgvdG9rZW4iKT9kKGUpOm51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpO2lmKG51bGw9PT1pKXRyeXtuZXcgVVJMKHIuYWxsb3dlZEJhc2VVcmwpLGk9ci5hbGxvd2VkQmFzZVVybH1jYXRjaChlKXtyZXR1cm59fSl9KCk7Cgo="),t=e.indexOf("\n",10)+1,n=e.substring(t)+"",i=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(i)}(),new Worker(st,e)};class ct{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(De,"::").concat(e)}}const lt="auth0.is.authenticated",pt={memory:()=>(new Fe).enclosedCache,localstorage:()=>new Je},ut=e=>pt[e],dt=e=>{const t=e.openUrl,n=e.onRedirect,o=i(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:!1===t||t?t:n})},ht={NONCE:"nonce",KEYPAIR:"keypair"};class mt{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(ht).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(ht.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(ht.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(ht.NONCE,this.buildKey(e))}findKeyPair(){return this.find(ht.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(ht.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(ht.KEYPAIR,this.clientId)}}class ft{constructor(e){this.storage=new mt(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,o=e.nonce,a=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,o,a){const s=null==e?void 0:e.privateKey,r=null==e?void 0:e.publicKey;if(!Ae(c=s)||"private"!==c.type)throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!je(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!==o&&"string"!=typeof o)throw new TypeError('"accessToken" must be a string or undefined');if(void 0!==a&&("object"!=typeof a||null===a||Array.isArray(a)))throw new TypeError('"additional" must be an object');const l=Object.assign(Object.create(null),a,{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:i,htu:t,ath:o?Se(await crypto.subtle.digest("SHA-256",xe(o))):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=`${Se(xe(JSON.stringify(e)))}.${Se(xe(JSON.stringify(t)))}`;return`${i}.${Se(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return _e(e.algorithm),{name:e.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return _e(e.algorithm),{name:e.algorithm.name};case"Ed25519":return{name:e.algorithm.name}}throw new Te}(n),n,xe(i)))}`}({alg:Pe(s),typ:"dpop+jwt",jwk:await Ce(r)},l,s)}(t,s,i,o,a)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!je(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 Ce(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 Te("unsupported JWK kty")}return Se(await crypto.subtle.digest({name:"SHA-256"},xe(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var vt;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(vt||(vt={}));class gt{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]:vt.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,o;"string"==typeof n?(i=this.config.dpopNonceId?vt.DPoP:vt.Bearer,o=n):(i=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,i),i===vt.DPoP&&await this.setDpopProofHeader(e,o)}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,Ie);if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new $(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,i){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,i);const a=await this.config.fetch(o);return this.handleResponse(a,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 yt{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),o=null!==(t=n.headers.get("location"))&&void 0!==t?t:"",a=decodeURIComponent(o.split("/").pop()||"");return Object.assign(Object.assign({},i),{id:a,location:o})}async enrollmentVerify(e){const t=e,n=t.location;t.type;const o=i(t,["location","type"]),a=await this.myAccountFetcher.fetchWithAuth("".concat(n,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)},{scope:["create:me:authentication_methods"]});return this._handleResponse(a)}async getUserProfile(e){var t;const n=new URLSearchParams;(null===(t=null==e?void 0:e.fields)||void 0===t?void 0:t.length)&&n.set("fields",e.fields.join(",")),!1===(null==e?void 0:e.includeFields)&&n.set("include_fields","false");const i=n.toString()?"?".concat(n):"",o=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/profile").concat(i),{method:"GET"},{scope:["read:me:profile"]});return this._handleResponse(o)}async updateUserProfile(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/profile"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["update:me:profile"]});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new bt({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new bt(t)}}class bt extends Error{constructor(e){let t=e.type,n=e.status,i=e.title,o=e.detail,a=e.validation_errors;super(o),this.name="MyAccountApiError",this.type=t,this.status=n,this.title=i,this.detail=o,this.validation_errors=a,Object.setPrototypeOf(this,bt.prototype)}}const wt={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}};var xt,_t;let kt;if("undefined"==typeof navigator||null===(xt=navigator.userAgent)||void 0===xt||null===(_t=xt.startsWith)||void 0===_t||!_t.call(xt,"Mozilla/5.0 ")){const e="v3.8.6";kt="".concat("oauth4webapi","/").concat(e)}function St(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 Tt="ERR_INVALID_ARG_VALUE",Et="ERR_INVALID_ARG_TYPE";function Pt(e,t,n){const i=new TypeError(e,{cause:n});return Object.assign(i,{code:t}),i}const At=Symbol(),jt=Symbol(),Ct=Symbol(),It=Symbol(),Ot=Symbol(),Ut=Symbol(),Rt=new TextEncoder,Lt=new TextDecoder;function Nt(e){return"string"==typeof e?Rt.encode(e):Lt.decode(e)}let zt,Mt;if(Uint8Array.prototype.toBase64)zt=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;zt=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 qt(e){return"string"==typeof e?Mt(e):zt(e)}Mt=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw Pt("The input to be decoded is not correctly encoded.",Tt,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 Pt("The input to be decoded is not correctly encoded.",Tt,e)}};class Dt extends Error{constructor(e,t){var n;super(e,t),f(this,"code",void 0),this.name=this.constructor.name,this.code=Jn,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}class Wt 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 $t(e,t,n){return new Wt(e,{code:t,cause:n})}function Jt(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ft(e){St(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(null!=e?e:{});if(kt&&!t.has("user-agent")&&t.set("user-agent",kt),t.has("authorization"))throw Pt('"options.headers" must not include the "authorization" header name',Tt);return t}function Ht(e,t){if(void 0!==t){if("function"==typeof t&&(t=t(e.href)),!(t instanceof AbortSignal))throw Pt('"options.signal" must return or be an instance of AbortSignal',Et);return t}}function Kt(e){return e.includes("//")?e.replace("//","/"):e}function Vt(e,t,n,i,o){try{if("number"!=typeof e||!Number.isFinite(e))throw Pt("".concat(n," must be a number"),Et,o);if(e>0)return;if(t){if(0!==e)throw Pt("".concat(n," must be a non-negative number"),Tt,o);return}throw Pt("".concat(n," must be a positive number"),Tt,o)}catch(e){if(i)throw $t(e.message,i,o);throw e}}function Bt(e,t,n,i){try{if("string"!=typeof e)throw Pt("".concat(t," must be a string"),Et,i);if(0===e.length)throw Pt("".concat(t," must not be empty"),Tt,i)}catch(e){if(n)throw $t(e.message,n,i);throw e}}function Gt(e){!function(e,t){if(_n(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),o=1;o<n;o++)i[o-1]=arguments[o];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 $t(t,Bn,e)}(e,t)}(e,"application/json")}function Zt(){return qt(crypto.getRandomValues(new Uint8Array(32)))}function Xt(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 Dt("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 Dt("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 Dt("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 Dt("unsupported CryptoKey algorithm name",{cause:e})}}function Yt(e){const t=null==e?void 0:e[jt];return"number"==typeof t&&Number.isFinite(t)?t:0}function Qt(e){const t=null==e?void 0:e[Ct];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function en(){return Math.floor(Date.now()/1e3)}function tn(e){if("object"!=typeof e||null===e)throw Pt('"as" must be an object',Et);Bt(e.issuer,'"as.issuer"')}function nn(e){if("object"!=typeof e||null===e)throw Pt('"client" must be an object',Et);Bt(e.client_id,'"client.client_id"')}function on(e){return Bt(e,'"clientSecret"'),(t,n,i,o)=>{i.set("client_id",n.client_id),i.set("client_secret",e)}}const an=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function sn(e,t){if(t&&"https:"!==e.protocol)throw $t("only requests to HTTPS are allowed",Zn,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw $t("only HTTP and HTTPS requests are allowed",Xn,e)}function rn(e,t,n,i){let o;if("string"!=typeof e||!(o=an(e)))throw $t("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?ti:ni,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return sn(o,i),o}function cn(e,t,n,i){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?rn(e.mtls_endpoint_aliases[t],t,n,i):rn(e[t],t,n,i)}class ln 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=$n,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 pn 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=Fn,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 un 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=Wn,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 dn="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",hn="("+dn+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',mn="("+dn+")\\s*=\\s*("+dn+")",fn=new RegExp("^[,\\s]*("+dn+")"),vn=new RegExp("^[,\\s]*"+hn+"[,\\s]*(.*)"),gn=new RegExp("^[,\\s]*"+mn+"[,\\s]*(.*)"),yn=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function bn(e,t,n){if(e.status!==t){let t;var i;if(Cn(e),t=await async function(e){if(e.status>399&&e.status<500){oi(e),Gt(e);try{const t=await e.clone().json();if(Jt(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 ln("server responded with an error in the response body",{cause:t,response:e});throw $t('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),Gn,e)}}function wn(e){if(!Ln.has(e))throw Pt('"options.DPoP" is not a valid DPoPHandle',Tt)}const xn=Symbol();function _n(e){var t;return null===(t=e.headers.get("content-type"))||void 0===t?void 0:t.split(";")[0]}async function kn(e,t,n,i,o){if(tn(e),nn(t),!St(i,Response))throw Pt('"response" must be an instance of Response',Et);if(Cn(i),200!==i.status)throw $t('"response" is not a conform UserInfo Endpoint response (unexpected HTTP status code)',Gn,i);let a;if(oi(i),"application/jwt"===_n(i)){const n=await ri(await i.text(),ci.bind(void 0,t.userinfo_signed_response_alg,e.userinfo_signing_alg_values_supported,void 0),Yt(t),Qt(t),null==o?void 0:o[Ut]).then(In.bind(void 0,t.client_id)).then(Un.bind(void 0,e)),s=n.claims,r=n.jwt;Pn.set(i,r),a=s}else{if(t.userinfo_signed_response_alg)throw $t("JWT UserInfo Response expected",Hn,i);a=await di(i)}if(Bt(a.sub,'"response" body "sub" property',Vn,{body:a}),n===xn);else if(Bt(n,'"expectedSubject"'),a.sub!==n)throw $t('unexpected "response" body "sub" property value',ei,{expected:n,body:a,attribute:"sub"});return a}async function Sn(e,t,n,i,o,a,s){return await n(e,t,o,a),a.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==s?void 0:s[It])||fetch)(i.href,{body:o,headers:Object.fromEntries(a.entries()),method:"POST",redirect:"manual",signal:Ht(i,null==s?void 0:s.signal)})}async function Tn(e,t,n,i,o,a){var s;const r=cn(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==a?void 0:a[At]));o.set("grant_type",i);const c=Ft(null==a?void 0:a.headers);c.set("accept","application/json"),void 0!==(null==a?void 0:a.DPoP)&&(wn(a.DPoP),await a.DPoP.addProof(r,c,"POST"));const l=await Sn(e,t,n,r,o,c,a);return null==a||null===(s=a.DPoP)||void 0===s||s.cacheNonce(l,r),l}const En=new WeakMap,Pn=new WeakMap;function An(e){if(!e.id_token)return;const t=En.get(e);if(!t)throw Pt('"ref" was already garbage collected or did not resolve from the proper sources',Tt);return t}async function jn(e,t,n,i,o,a){if(tn(e),nn(t),!St(n,Response))throw Pt('"response" must be an instance of Response',Et);await bn(n,200,"Token Endpoint"),oi(n);const s=await di(n);if(Bt(s.access_token,'"response" body "access_token" property',Vn,{body:s}),Bt(s.token_type,'"response" body "token_type" property',Vn,{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;Vt(e,!0,'"response" body "expires_in" property',Vn,{body:s}),s.expires_in=e}if(void 0!==s.refresh_token&&Bt(s.refresh_token,'"response" body "refresh_token" property',Vn,{body:s}),void 0!==s.scope&&"string"!=typeof s.scope)throw $t('"response" body "scope" property must be a string',Vn,{body:s});if(void 0!==s.id_token){Bt(s.id_token,'"response" body "id_token" property',Vn,{body:s});const a=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&a.push("auth_time"),void 0!==t.default_max_age&&(Vt(t.default_max_age,!0,'"client.default_max_age"'),a.push("auth_time")),null!=i&&i.length&&a.push(...i);const r=await ri(s.id_token,ci.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Yt(t),Qt(t),o).then(Mn.bind(void 0,a)).then(Rn.bind(void 0,e)).then(On.bind(void 0,t.client_id)),c=r.claims,l=r.jwt;if(Array.isArray(c.aud)&&1!==c.aud.length){if(void 0===c.azp)throw $t('ID Token "aud" (audience) claim includes additional untrusted audiences',Qn,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw $t('unexpected ID Token "azp" (authorized party) claim value',Qn,{expected:t.client_id,claims:c,claim:"azp"})}void 0!==c.auth_time&&Vt(c.auth_time,!0,'ID Token "auth_time" (authentication time)',Vn,{claims:c}),Pn.set(n,l),En.set(s,c)}if(void 0!==(null==a?void 0:a[s.token_type]))a[s.token_type](n,s);else if("dpop"!==s.token_type&&"bearer"!==s.token_type)throw new Dt("unsupported `token_type` value",{cause:{body:s}});return s}function Cn(e){let t;if(t=function(e){if(!St(e,Response))throw Pt('"response" must be an instance of Response',Et);const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let i=t;for(;i;){var o;let t=i.match(fn);const c=null===(o=t)||void 0===o?void 0:o[1].toLowerCase();if(!c)return;const l=i.substring(t[0].length);if(l&&!l.match(/^[\s,]/))return;const p=l.match(/^\s+(.*)$/),u=!!p;i=p?p[1]:void 0;const d={};let h;if(u)for(;i;){let n,o;if(t=i.match(vn)){var a=b(t,4);if(n=a[1],o=a[2],i=a[3],o.includes("\\"))try{o=JSON.parse('"'.concat(o,'"'))}catch(e){}d[n.toLowerCase()]=o}else{if(!(t=i.match(gn))){if(t=i.match(yn)){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],o=r[2],i=r[3],d[n.toLowerCase()]=o}}else i=l||void 0;const m={scheme:c,parameters:d};h&&(m.token68=h),n.push(m)}return n.length?n:void 0}(e))throw new un("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}function In(e,t){return void 0!==t.claims.aud?On(e,t):t}function On(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw $t('unexpected JWT "aud" (audience) claim value',Qn,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw $t('unexpected JWT "aud" (audience) claim value',Qn,{expected:e,claims:t.claims,claim:"aud"});return t}function Un(e,t){return void 0!==t.claims.iss?Rn(e,t):t}function Rn(e,t){var n,i;const o=null!==(n=null===(i=e[mi])||void 0===i?void 0:i.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw $t('unexpected JWT "iss" (issuer) claim value',Qn,{expected:o,claims:t.claims,claim:"iss"});return t}const Ln=new WeakSet,Nn=Symbol(),zn={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 Mn(e,t){for(const n of e)if(void 0===t.claims[n])throw $t('JWT "'.concat(n,'" (').concat(zn[n],") claim missing"),Vn,{claims:t.claims});return t}const qn=Symbol(),Dn=Symbol(),Wn="OAUTH_WWW_AUTHENTICATE_CHALLENGE",$n="OAUTH_RESPONSE_BODY_ERROR",Jn="OAUTH_UNSUPPORTED_OPERATION",Fn="OAUTH_AUTHORIZATION_RESPONSE_ERROR",Hn="OAUTH_JWT_USERINFO_EXPECTED",Kn="OAUTH_PARSE_ERROR",Vn="OAUTH_INVALID_RESPONSE",Bn="OAUTH_RESPONSE_IS_NOT_JSON",Gn="OAUTH_RESPONSE_IS_NOT_CONFORM",Zn="OAUTH_HTTP_REQUEST_FORBIDDEN",Xn="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Yn="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Qn="OAUTH_JWT_CLAIM_COMPARISON_FAILED",ei="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",ti="OAUTH_MISSING_SERVER_METADATA",ni="OAUTH_INVALID_SERVER_METADATA";async function ii(e){if(!St(e,Response))throw Pt('"response" must be an instance of Response',Et);await bn(e,200,"Revocation Endpoint")}function oi(e){if(e.bodyUsed)throw Pt('"response" body has been used already',Tt)}function ai(e){const t=e.algorithm;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new Dt("unsupported ".concat(t.name," modulusLength"),{cause:e})}function si(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 Dt("unsupported ECDSA namedCurve",{cause:e})}}async function ri(e,t,n,i,o){let a,s,r=e.split("."),c=r[0],l=r[1],p=r.length;if(5===p){if(void 0===o)throw new Dt("JWE decryption is not configured",{cause:e});var u=(e=await o(e)).split(".");c=u[0],l=u[1],p=u.length}if(3!==p)throw $t("Invalid JWT",Vn,e);try{a=JSON.parse(Nt(qt(c)))}catch(e){throw $t("failed to parse JWT Header body as base64url encoded JSON",Kn,e)}if(!Jt(a))throw $t("JWT Header must be a top level object",Vn,e);if(t(a),void 0!==a.crit)throw new Dt('no JWT "crit" header parameter extensions are supported',{cause:{header:a}});try{s=JSON.parse(Nt(qt(l)))}catch(e){throw $t("failed to parse JWT Payload body as base64url encoded JSON",Kn,e)}if(!Jt(s))throw $t("JWT Payload must be a top level object",Vn,e);const d=en()+n;if(void 0!==s.exp){if("number"!=typeof s.exp)throw $t('unexpected JWT "exp" (expiration time) claim type',Vn,{claims:s});if(s.exp<=d-i)throw $t('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Yn,{claims:s,now:d,tolerance:i,claim:"exp"})}if(void 0!==s.iat&&"number"!=typeof s.iat)throw $t('unexpected JWT "iat" (issued at) claim type',Vn,{claims:s});if(void 0!==s.iss&&"string"!=typeof s.iss)throw $t('unexpected JWT "iss" (issuer) claim type',Vn,{claims:s});if(void 0!==s.nbf){if("number"!=typeof s.nbf)throw $t('unexpected JWT "nbf" (not before) claim type',Vn,{claims:s});if(s.nbf>d+i)throw $t('unexpected JWT "nbf" (not before) claim value',Yn,{claims:s,now:d,tolerance:i,claim:"nbf"})}if(void 0!==s.aud&&"string"!=typeof s.aud&&!Array.isArray(s.aud))throw $t('unexpected JWT "aud" (audience) claim type',Vn,{claims:s});return{header:a,claims:s,jwt:e}}function ci(e,t,n,i){if(void 0===e)if(Array.isArray(t)){if(!t.includes(i.alg))throw $t('unexpected JWT "alg" header parameter',Vn,{header:i,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw $t('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 $t('unexpected JWT "alg" header parameter',Vn,{header:i,expected:n,reason:"default value"})}else if("string"==typeof e?i.alg!==e:!e.includes(i.alg))throw $t('unexpected JWT "alg" header parameter',Vn,{header:i,expected:e,reason:"client configuration"})}function li(e,t){const n=e.getAll(t),i=n[0];if(n.length>1)throw $t('"'.concat(t,'" parameter must be provided only once'),Vn);return i}const pi=Symbol(),ui=Symbol();async function di(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gt;try{t=await e.json()}catch(t){throw n(e),$t('failed to parse "response" body as JSON',Kn,t)}if(!Jt(t))throw $t('"response" body must be a top level object',Vn,{body:t});return t}const hi=Symbol(),mi=Symbol(),fi=new TextEncoder,vi=new TextDecoder,gi=new TextDecoder("utf-8",{fatal:!0});function yi(){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),o=new Uint8Array(i);let a=0;for(const e of t)o.set(e,a),a+=e.length;return o}const bi=/[^\x00-\x7f]/;function wi(e){if("string"==typeof e&&e.length>=128){if(bi.test(e))throw new TypeError("non-ASCII string encountered in encode()");return fi.encode(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}function xi(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw new TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}const n=atob(e),i=new Uint8Array(n.length);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return i}class _i 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(_i,"code","ERR_JOSE_GENERIC");class ki extends _i{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(ki,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Si extends _i{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(Si,"code","ERR_JWT_EXPIRED");class Ti extends _i{constructor(){super(...arguments),f(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}f(Ti,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Ei extends _i{constructor(){super(...arguments),f(this,"code","ERR_JOSE_NOT_SUPPORTED")}}f(Ei,"code","ERR_JOSE_NOT_SUPPORTED"),f(class extends _i{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 _i{constructor(){super(...arguments),f(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Pi extends _i{constructor(){super(...arguments),f(this,"code","ERR_JWS_INVALID")}}f(Pi,"code","ERR_JWS_INVALID");class Ai extends _i{constructor(){super(...arguments),f(this,"code","ERR_JWT_INVALID")}}f(Ai,"code","ERR_JWT_INVALID"),f(class extends _i{constructor(){super(...arguments),f(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class ji extends _i{constructor(){super(...arguments),f(this,"code","ERR_JWKS_INVALID")}}f(ji,"code","ERR_JWKS_INVALID");class Ci extends _i{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(Ci,"code","ERR_JWKS_NO_MATCHING_KEY");class Ii extends _i{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(Ii,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Oi extends _i{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(Oi,"code","ERR_JWKS_TIMEOUT");class Ui extends _i{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")}}function Ri(e){try{return xi("string"==typeof e?e:vi.decode(e),!0)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:e})}}function Li(e){return function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Uint8Array.prototype.toBase64)return e.toBase64({alphabet:t?"base64url":"base64",omitPadding:t});const n=[];for(let t=0;t<e.length;t+=32768)n.push(String.fromCharCode.apply(null,e.subarray(t,t+32768)));const i=btoa(n.join(""));return t?i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):i}("string"==typeof e?fi.encode(e):e,!0)}function Ni(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 zi(e){return Ni(e)&&Array.isArray(e.keys)&&Array.from(e.keys).every(Ni)}function Mi(){const e=new Set;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(const t of n)if(t)for(const n of Object.keys(t)){if(e.has(n))return!1;e.add(n)}return!0}function qi(e,t,n){try{return Ri(e)}catch(e){throw new n("Failed to base64url decode the ".concat(t),{cause:e})}}f(Ui,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Di={__proto__:null,b64:!0};function Wi(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'));return void 0===t?void 0:new Set(t)}function $i(e,t,n,i,o){if(void 0!==o.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 a=void 0===n?t:g(g({__proto__:null},n),t);for(const t of i.crit){if(!(t in a))throw new Ei('Extension Header Parameter "'.concat(t,'" is not recognized'));if(!Object.hasOwn(o,t)||void 0===o[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(a[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 Ji(e,t){if(t.includes("b64")){const t=e.b64;if("boolean"!=typeof t)throw new Pi('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return t}return!0}function Fi(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(!Ni(i))throw new e("JOSE Header is not a JSON object");return[i,n]}async function Hi(e,t,n){var i;const o=e.alg,a=e.secret,s="decrypt"===n||"sign"===n;if(a&&t instanceof Uint8Array)return t;let r,c;if(Ni(t)){if(r=function(e){const t=Qi(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),"string"!=typeof r.kty)throw Zi(o,t,a);if(!(a?"oct"===r.kty&&"string"==typeof r.k:"oct"!==r.kty&&(s?"AKP"===r.kty&&"string"==typeof r.priv||"string"==typeof r.d:void 0===r.d&&void 0===r.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(s?"private":"public"," JWK"));if(((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 o;const i="encrypt"===n||"decrypt"===n?null===(o=e.ops)||void 0===o?void 0:o["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,r,n),"oct"===r.kty)return Ri(r.k);if(!Object.isFrozen(t)){const e=t.key_ops;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}}else{if(!Gi(t))throw Zi(o,t,a);const e=a?"secret":s?"private":"public";if(t.type!==e&&(a||["secret","public","private"].includes(t.type)))throw new TypeError("".concat((e=>e[Symbol.toStringTag])(t),' instances must be of type "').concat(e,'" for the ').concat(o," algorithm"));if(Bi(t))return t;if(c=t,"secret"===c.type)return c.export()}Ki||(Ki=new WeakMap);const l=t;let p=Ki.get(l);if(null!==(i=p)&&void 0!==i&&i[o])return p[o];if(p||Ki.set(l,p={}),c&&"function"==typeof c.toCryptoKey){var u,d,h;const t="public"===c.type,n=Vi[null===(u=c.asymmetricKeyDetails)||void 0===u?void 0:u.namedCurve],i=null!==(d=null===(h=e.resolve)||void 0===h?void 0:h.call(e,{crv:n,asymmetricKeyType:c.asymmetricKeyType}))&&void 0!==d?d:e.subtle;return p[o]=c.toCryptoKey(i,t,e.usages[t?0:1])}return null!=r||(r=c.export({format:"jwk"})),r.alg=o,p[o]=await eo(e,r)}let Ki;const Vi={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"},Bi=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},Gi=e=>Bi(e)||(e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]))(e);function Zi(e,t,n){const i=["CryptoKey","KeyObject","JSON Web Key"];return n&&i.push("Uint8Array"),new TypeError(function(e,t){for(var n,i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];if(o.length>2){const t=o.pop();e+="one of type ".concat(o.join(", "),", or ").concat(t,".")}else 2===o.length?e+="one of type ".concat(o[0]," or ").concat(o[1],"."):e+="of type ".concat(o[0],".");return null==t?e+=" Received ".concat(t):"function"==typeof t&&t.name?e+=" Received function ".concat(t.name):"object"==typeof t&&null!=t&&(null===(n=t.constructor)||void 0===n?void 0:n.name)&&(e+=" Received an instance of ".concat(t.constructor.name)),e}("Key for the ".concat(e," algorithm must be "),t,...i))}const Xi=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))};function Yi(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"))}function Qi(e){return g({__proto__:null},e)}async function eo(e,t,n){var i,o,a,s;if(!e.kty.includes(t.kty))throw new Ei('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');const r=null!==(i=null===(o=e.resolve)||void 0===o?void 0:o.call(e,{kty:t.kty,crv:t.crv}))&&void 0!==i?i:e.subtle,c=!(!t.d&&!t.priv),l=g(g({},t),{},{ext:null!=n?n:t.ext});return"AKP"!==l.kty&&delete l.alg,delete l.use,crypto.subtle.importKey("jwk",l,r,null!==(a=l.ext)&&void 0!==a?a:!c,null!==(s=t.key_ops)&&void 0!==s?s:e.usages[c?1:0])}async function to(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e instanceof Uint8Array&&(e=await crypto.subtle.importKey("raw",e,t,i,[n])),function(e,t,n){var i;const o=e.algorithm;if(o.name!==t.name)throw Xi(t.name);if(t.hash&&(null===(i=o.hash)||void 0===i?void 0:i.name)!==t.hash)throw Xi(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw Xi(t.namedCurve,"algorithm.namedCurve");if(void 0!==t.length&&o.length!==t.length)throw Xi(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)}(e,t,n),e}function no(e){const t={__proto__:null};for(const n in e)t[n]=g(g({},e[n]),{},{alg:n});return t}const io=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],oo=[[],["deriveBits"]],ao=[[],[]];function so(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:"SHA-".concat(e)},usages:io,ops:["wrapKey","unwrapKey"]}}function ro(e){return{kty:["EC","OKP"],mode:e,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 Ei('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:n}},usages:oo,ops:[void 0,"deriveBits"]}}function co(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:ao,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function lo(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:ao,ops:["deriveBits","deriveBits"]}}const po=no({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:ao,ops:["encrypt","decrypt"]},"RSA-OAEP":so(1),"RSA-OAEP-256":so(256),"RSA-OAEP-384":so(384),"RSA-OAEP-512":so(512),"ECDH-ES":ro("direct-key-agreement"),"ECDH-ES+A128KW":ro("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":ro("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":ro("key-agreement-with-key-wrapping"),A128KW:co(128),A192KW:co(192),A256KW:co(256),A128GCMKW:co(128,!0),A192GCMKW:co(192,!0),A256GCMKW:co(256,!0),"PBES2-HS256+A128KW":lo(),"PBES2-HS384+A192KW":lo(),"PBES2-HS512+A256KW":lo()}),uo=["encrypt","decrypt"];function ho(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:ao,ops:uo,cekBits:e,ivBits:t?128:96,cbc:t}}var mo,fo;let vo,go;if(no({A128GCM:ho(128),A192GCM:ho(192),A256GCM:ho(256),"A128CBC-HS256":ho(256,!0),"A192CBC-HS384":ho(384,!0),"A256CBC-HS512":ho(512,!0)}),"undefined"==typeof navigator||null===(mo=navigator.userAgent)||void 0===mo||null===(fo=mo.startsWith)||void 0===fo||!fo.call(mo,"Mozilla/5.0 ")){const e="v6.8.4";go="".concat("openid-client","/").concat(e),vo={"user-agent":go}}const yo=e=>bo.get(e);let bo,wo;function xo(e){return void 0!==e?on(e):(wo||(wo=new WeakMap),(e,t,n,i)=>{let o;return(o=wo.get(t))||(function(e,t){if("string"!=typeof e)throw Eo("".concat(t," must be a string"),To);if(0===e.length)throw Eo("".concat(t," must not be empty"),So)}(t.client_secret,'"metadata.client_secret"'),o=on(t.client_secret),wo.set(t,o)),o(e,t,n,i)})}const _o=xn,ko=It,So="ERR_INVALID_ARG_VALUE",To="ERR_INVALID_ARG_TYPE";function Eo(e,t,n){const i=new TypeError(e,{cause:n});return Object.assign(i,{code:t}),i}class Po 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 Ao(e,t,n){return new Po(e,{cause:t,code:n})}function jo(e){if(e instanceof TypeError||e instanceof Po||e instanceof ln||e instanceof pn||e instanceof un)throw e;if(e instanceof Wt)switch(e.code){case Zn:throw Ao("only requests to HTTPS are allowed",e,e.code);case Xn:throw Ao("only requests to HTTP or HTTPS are allowed",e,e.code);case Gn:throw Ao("unexpected HTTP response status code",e.cause,e.code);case Bn:throw Ao("unexpected response content-type",e.cause,e.code);case Kn:throw Ao("parsing error occured",e,e.code);case Vn:throw Ao("invalid response encountered",e,e.code);case Qn:throw Ao("unexpected JWT claim value encountered",e,e.code);case ei:throw Ao("unexpected JSON attribute value encountered",e,e.code);case Yn:throw Ao("JWT timestamp claim value failed validation",e,e.code);default:throw Ao(e.message,e,e.code)}if(e instanceof Dt)throw Ao("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Ao("runtime operation error",e,Jn);case"NotSupportedError":throw Ao("runtime unsupported operation",e,Jn);case"TimeoutError":throw Ao("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Ao("operation aborted",e,"OAUTH_ABORT")}throw new Po("something went wrong",{cause:e})}new TextDecoder;const Co=Symbol();class Io{constructor(e,t,n,i){var o,a,s,r,c;if("string"!=typeof t||!t.length)throw Eo('"clientId" must be a non-empty string',To);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null===(o=n)||void 0===o?void 0:o.client_id)&&t!==n.client_id)throw Eo('"clientId" and "metadata.client_id" must be the same',So);const l=g(g({},structuredClone(n)),{},{client_id:t});let p;l[jt]=null!==(a=null===(s=n)||void 0===s?void 0:s[jt])&&void 0!==a?a:0,l[Ct]=null!==(r=null===(c=n)||void 0===c?void 0:c[Ct])&&void 0!==r?r:30,p=i||("string"==typeof l.client_secret&&l.client_secret.length?xo(l.client_secret):(e,t,n,i)=>{n.set("client_id",t.client_id)});let u=Object.freeze(l);const d=structuredClone(e);Co in e&&(d[mi]=t=>{let n=t.claims.tid;return e.issuer.replace("{tenantid}",n)});let h=Object.freeze(d);bo||(bo=new WeakMap),bo.set(this,{__proto__:null,as:h,c:u,auth:p,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(yo(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(yo(this).c)}get timeout(){return yo(this).timeout}set timeout(e){yo(this).timeout=e}get[ko](){return yo(this).fetch}set[ko](e){yo(this).fetch=e}}function Oo(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 An(this)}catch(e){return}}}}}(e))}async function Uo(e,t,n){var i;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=null===(i=e.headers.get("retry-after"))||void 0===i?void 0:i.trim();if(void 0===a)return;let s;if(/^\d+$/.test(a))s=parseInt(a,10);else{const e=new Date(a);if(Number.isFinite(e.getTime())){const t=new Date,n=e.getTime()-t.getTime();n>0&&(s=Math.ceil(n/1e3))}}if(o&&!Number.isFinite(s))throw new Wt("invalid Retry-After header value",{cause:e});s>t&&await Ro(s-t,n)}function Ro(e,t){return new Promise((n,i)=>{const o=e=>{try{t.throwIfAborted()}catch(e){return void i(e)}if(e<=0)return void n();const a=Math.min(e,5);setTimeout(()=>o(e-a),1e3*a)};o(e)})}async function Lo(e,t){Jo(e);const n=yo(e),i=n.as,o=n.c,a=n.auth,s=n.fetch,r=n.tlsOnly,c=n.timeout;return async function(e,t,n,i,o){tn(e),nn(t);const a=cn(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[At])),s=new URLSearchParams(i);s.set("client_id",t.client_id);const r=Ft(null==o?void 0:o.headers);return r.set("accept","application/json"),Sn(e,t,n,a,s,r,o)}(i,o,a,t,{[It]:s,[At]:!r,headers:new Headers(vo),signal:Fo(c)}).then(e=>async function(e,t,n){if(tn(e),nn(t),!St(n,Response))throw Pt('"response" must be an instance of Response',Et);await bn(n,200,"Backchannel Authentication Endpoint"),oi(n);const i=await di(n);Bt(i.auth_req_id,'"response" body "auth_req_id" property',Vn,{body:i});let o="number"!=typeof i.expires_in?parseFloat(i.expires_in):i.expires_in;return Vt(o,!0,'"response" body "expires_in" property',Vn,{body:i}),i.expires_in=o,void 0!==i.interval&&Vt(i.interval,!1,'"response" body "interval" property',Vn,{body:i}),i}(i,o,e)).catch(jo)}async function No(e,t,n,i){var o,a;Jo(e),n=new URLSearchParams(n);let s=null!==(o=t.interval)&&void 0!==o?o:5;const r=null!==(a=null==i?void 0:i.signal)&&void 0!==a?a:AbortSignal.timeout(1e3*t.expires_in);try{await Ro(s,r)}catch(e){jo(e)}const c=yo(e),l=c.as,p=c.c,u=c.auth,d=c.fetch,h=c.tlsOnly,m=c.nonRepudiation,f=c.timeout,v=c.decrypt,y=(o,a)=>No(e,g(g({},t),{},{interval:o}),n,g(g({},i),{},{signal:r,flag:a})),b=function(e,t){const n=Fo(t);if(!n)return{signal:e,cleanup(){}};const i=new AbortController,o=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",o,{once:!0}),n.addEventListener("abort",o,{once:!0})),{signal:i.signal,cleanup(){e.removeEventListener("abort",o),n.removeEventListener("abort",o)}}}(r,f),w=await async function(e,t,n,i,o){tn(e),nn(t),Bt(i,'"authReqId"');const a=new URLSearchParams(null==o?void 0:o.additionalParameters);return a.set("auth_req_id",i),Tn(e,t,n,"urn:openid:params:grant-type:ciba",a,o)}(l,p,u,t.auth_req_id,{[It]:d,[At]:!h,additionalParameters:n,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:b.signal}).catch(jo).finally(b.cleanup);var x;if(503===w.status&&w.headers.has("retry-after"))return await Uo(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 jn(e,t,n,void 0,null==i?void 0:i[Ut],null==i?void 0:i.recognizedTokenTypes)}(l,p,w,{[Ut]:v});let k;try{k=await _}catch(e){if(Ko(e,i))return y(s,Vo);if(e instanceof ln)switch(e.error){case"slow_down":s+=5;case"authorization_pending":return await Uo(e.response,s,r),y(s)}jo(e)}return k.id_token&&await(null==m?void 0:m(w)),Oo(k),k}function zo(e){yo(e).tlsOnly=!1}async function Mo(e,t,n,i,o){if(Jo(e),!((null==o?void 0:o.flag)===Vo||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw Eo('"currentUrl" must be an instance of URL, or Request',To);let a,s;const r=yo(e),c=r.as,l=r.c,p=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==o?void 0:o.flag)===Vo)a=o.authResponse,s=o.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 Pt("form_post responses are expected to use the POST method",Tt,{cause:e});if("application/x-www-form-urlencoded"!==_n(e))throw Pt("form_post responses are expected to use the application/x-www-form-urlencoded content-type",Tt,{cause:e});return async function(e){if(e.bodyUsed)throw Pt("form_post Request instances must contain a readable body",Tt,{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 Eo("unexpected Request HTTP method",So)}}switch(s=function(e){return(e=new URL(e)).search="",e.hash="",e.href}(t),!0){case!!h:a=await h(t,null==n?void 0:n.expectedState);break;case!!m:a=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{a=function(e,t,n,i){if(tn(e),nn(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Pt('"parameters" must be an instance of URLSearchParams, or URL',Et);if(li(n,"response"))throw $t('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Vn,{parameters:n});const o=li(n,"iss"),a=li(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw $t('response parameter "iss" (issuer) missing',Vn,{parameters:n});if(o&&o!==e.issuer)throw $t('unexpected "iss" (issuer) response parameter value',Vn,{expected:e.issuer,parameters:n});switch(i){case void 0:case ui:if(void 0!==a)throw $t('unexpected "state" response parameter encountered',Vn,{expected:void 0,parameters:n});break;case pi:break;default:if(Bt(i,'"expectedState" argument'),a!==i)throw $t(void 0===a?'response parameter "state" missing':'unexpected "state" response parameter value',Vn,{expected:i,parameters:n})}if(li(n,"error"))throw new pn("authorization response from the server is an error",{cause:n});const s=li(n,"id_token"),r=li(n,"token");if(void 0!==s||void 0!==r)throw new Dt("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),Ln.add(c),c;var c}(c,l,t.searchParams,null==n?void 0:n.expectedState)}catch(e){jo(e)}}}const _=await async function(e,t,n,i,o,a,s){if(tn(e),nn(t),!Ln.has(i))throw Pt('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',Tt);Bt(o,'"redirectUri"');const r=li(i,"code");if(!r)throw $t('no authorization code in "callbackParameters"',Vn);const c=new URLSearchParams(null==s?void 0:s.additionalParameters);return c.set("redirect_uri",o),c.set("code",r),a!==Nn&&(Bt(a,'"codeVerifier"'),c.set("code_verifier",a)),Tn(e,t,n,"authorization_code",c,s)}(c,l,p,a,s,(null==n?void 0:n.pkceCodeVerifier)||Nn,{additionalParameters:i,[It]:u,[At]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(vo),signal:Fo(v)}).catch(jo);"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,o,a,s){const r=[];switch(i){case void 0:i=qn;break;case qn:break;default:Bt(i,'"expectedNonce" argument'),r.push("nonce")}switch(null!=o||(o=t.default_max_age),o){case void 0:o=Dn;break;case Dn:break;default:Vt(o,!0,'"maxAge" argument'),r.push("auth_time")}const c=await jn(e,t,n,r,a,s);Bt(c.id_token,'"response" body "id_token" property',Vn,{body:c});const l=An(c);if(o!==Dn){const e=en()+Yt(t),n=Qt(t);if(l.auth_time+o<e-n)throw $t("too much time has elapsed since the last End-User authentication",Yn,{claims:l,now:e,tolerance:n,claim:"auth_time"})}if(i===qn){if(void 0!==l.nonce)throw $t('unexpected ID Token "nonce" claim value',Qn,{expected:void 0,claims:l,claim:"nonce"})}else if(l.nonce!==i)throw $t('unexpected ID Token "nonce" claim value',Qn,{expected:i,claims:l,claim:"nonce"});return c}(e,t,n,i.expectedNonce,i.maxAge,i[Ut],i.recognizedTokenTypes):async function(e,t,n,i,o){const a=await jn(e,t,n,void 0,i,o),s=An(a);if(s){if(void 0!==t.default_max_age){Vt(t.default_max_age,!0,'"client.default_max_age"');const e=en()+Yt(t),n=Qt(t);if(s.auth_time+t.default_max_age<e-n)throw $t("too much time has elapsed since the last End-User authentication",Yn,{claims:s,now:e,tolerance:n,claim:"auth_time"})}if(void 0!==s.nonce)throw $t('unexpected ID Token "nonce" claim value',Qn,{expected:void 0,claims:s,claim:"nonce"})}return a}(e,t,n,null==i?void 0:i[Ut],null==i?void 0:i.recognizedTokenTypes)}(c,l,_,{expectedNonce:null==n?void 0:n.expectedNonce,maxAge:null==n?void 0:n.maxAge,requireIdToken:null==n?void 0:n.idTokenExpected,[Ut]:y});let S;try{S=await k}catch(t){if(Ko(t,o))return Mo(e,void 0,n,i,g(g({},o),{},{flag:Vo,authResponse:a,redirectUri:s}));jo(t)}return S.id_token&&await(null==f?void 0:f(_)),Oo(S),S}async function qo(e,t,n,i){Jo(e),n=new URLSearchParams(n);const o=yo(e),a=o.as,s=o.c,r=o.auth,c=o.fetch,l=o.tlsOnly,p=o.nonRepudiation,u=o.timeout,d=o.decrypt,h=await async function(e,t,n,i,o){tn(e),nn(t),Bt(i,'"refreshToken"');const a=new URLSearchParams(null==o?void 0:o.additionalParameters);return a.set("refresh_token",i),Tn(e,t,n,"refresh_token",a,o)}(a,s,r,t,{[It]:c,[At]:!l,additionalParameters:n,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:Fo(u)}).catch(jo),m=async function(e,t,n,i){return jn(e,t,n,void 0,null==i?void 0:i[Ut],null==i?void 0:i.recognizedTokenTypes)}(a,s,h,{[Ut]:d});let f;try{f=await m}catch(o){if(Ko(o,i))return qo(e,t,n,g(g({},i),{},{flag:Vo}));jo(o)}return f.id_token&&await(null==p?void 0:p(h)),Oo(f),f}async function Do(e,t,n){Jo(e),t=new URLSearchParams(t);const i=yo(e),o=i.as,a=i.c,s=i.auth,r=i.fetch,c=i.tlsOnly,l=i.timeout,p=await async function(e,t,n,i,o){return tn(e),nn(t),Tn(e,t,n,"client_credentials",new URLSearchParams(i),o)}(o,a,s,t,{[It]:r,[At]:!c,DPoP:null==n?void 0:n.DPoP,headers:new Headers(vo),signal:Fo(l)}).catch(jo),u=async function(e,t,n){return jn(e,t,n,void 0,void 0,void 0)}(o,a,p);let d;try{d=await u}catch(i){if(Ko(i,n))return Do(e,t,g(g({},n),{},{flag:Vo}));jo(i)}return Oo(d),d}function Wo(e,t){Jo(e);const n=yo(e),i=n.as,o=n.c,a=n.tlsOnly,s=n.hybrid,r=n.jarm,c=n.implicit,l=cn(i,"authorization_endpoint",!1,a);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.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 Eo("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",So);r&&t.set("response_mode","jwt")}for(const e of t.entries()){var p=b(e,2);const t=p[0],n=p[1];l.searchParams.append(t,n)}return l}async function $o(e,t,n){Jo(e);const i=Wo(e,t),o=yo(e),a=o.as,s=o.c,r=o.auth,c=o.fetch,l=o.tlsOnly,p=o.timeout,u=await async function(e,t,n,i,o){var a;tn(e),nn(t);const s=cn(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[At])),r=new URLSearchParams(i);r.set("client_id",t.client_id);const c=Ft(null==o?void 0:o.headers);c.set("accept","application/json"),void 0!==(null==o?void 0:o.DPoP)&&(wn(o.DPoP),await o.DPoP.addProof(s,c,"POST"));const l=await Sn(e,t,n,s,r,c,o);return null==o||null===(a=o.DPoP)||void 0===a||a.cacheNonce(l,s),l}(a,s,r,i.searchParams,{[It]:c,[At]:!l,DPoP:null==n?void 0:n.DPoP,headers:new Headers(vo),signal:Fo(p)}).catch(jo),d=async function(e,t,n){if(tn(e),nn(t),!St(n,Response))throw Pt('"response" must be an instance of Response',Et);await bn(n,201,"Pushed Authorization Request Endpoint"),oi(n);const i=await di(n);Bt(i.request_uri,'"response" body "request_uri" property',Vn,{body:i});let o="number"!=typeof i.expires_in?parseFloat(i.expires_in):i.expires_in;return Vt(o,!0,'"response" body "expires_in" property',Vn,{body:i}),i.expires_in=o,i}(a,s,u);let h;try{h=await d}catch(i){if(Ko(i,n))return $o(e,t,g(g({},n),{},{flag:Vo}));jo(i)}return Wo(e,{request_uri:h.request_uri})}function Jo(e){if(!(e instanceof Io))throw Eo('"config" must be an instance of Configuration',To);if(Object.getPrototypeOf(e)!==Io.prototype)throw Eo("subclassing Configuration is not allowed",So)}function Fo(e){return e?AbortSignal.timeout(1e3*e):void 0}async function Ho(e,t,n,i){Jo(e);const o=yo(e),a=o.as,s=o.c,r=o.fetch,c=o.tlsOnly,l=o.nonRepudiation,p=o.timeout,u=o.decrypt,d=await async function(e,t,n,i){tn(e),nn(t);const o=cn(e,"userinfo_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[At])),a=Ft(null==i?void 0:i.headers);return t.userinfo_signed_response_alg?a.set("accept","application/jwt"):(a.set("accept","application/json"),a.append("accept","application/jwt")),async function(e,t,n,i,o,a){var s;if(Bt(e,'"accessToken"'),!(n instanceof URL))throw Pt('"url" must be an instance of URL',Et);sn(n,!0!==(null==a?void 0:a[At])),i=Ft(i),null!=a&&a.DPoP&&(wn(a.DPoP),await a.DPoP.addProof(n,i,"GET".toUpperCase(),e)),i.set("authorization","".concat(i.has("dpop")?"DPoP":"Bearer"," ").concat(e));const r=await((null==a?void 0:a[It])||fetch)(n.href,{duplex:St(null,ReadableStream)?"half":void 0,body:null,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:Ht(n,null==a?void 0:a.signal)});return null==a||null===(s=a.DPoP)||void 0===s||s.cacheNonce(r,n),r}(n,0,o,a,0,g(g({},i),{},{[jt]:Yt(t)}))}(a,s,t,{[It]:r,[At]:!c,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:Fo(p)}).catch(jo);let h,m=kn(a,s,n,d,{[Ut]:u});try{h=await m}catch(o){if(Ko(o,i))return Ho(e,t,n,g(g({},i),{},{flag:Vo}));jo(o)}return"application/jwt"===_n(d)&&await(null==l?void 0:l(d)),h}function Ko(e,t){return!(null==t||!t.DPoP||t.flag===Vo)&&function(e){if(e instanceof un){const t=e.cause,n=t[0];return 1===t.length&&"dpop"===n.scheme&&"use_dpop_nonce"===n.parameters.error}return e instanceof ln&&"use_dpop_nonce"===e.error}(e)}Object.freeze(Io.prototype);const Vo=Symbol();async function Bo(e,t,n,i){Jo(e);const o=yo(e),a=o.as,s=o.c,r=o.auth,c=o.fetch,l=o.tlsOnly,p=o.timeout,u=o.decrypt,d=o.nonRepudiation,h=await async function(e,t,n,i,o,a){return tn(e),nn(t),Bt(i,'"grantType"'),Tn(e,t,n,i,new URLSearchParams(o),a)}(a,s,r,t,new URLSearchParams(n),{[It]:c,[At]:!l,DPoP:null==i?void 0:i.DPoP,headers:new Headers(vo),signal:Fo(p)}).catch(jo);let m;"urn:ietf:params:oauth:grant-type:token-exchange"===t&&(m={n_a:()=>{}});const f=async function(e,t,n,i){return jn(e,t,n,void 0,null==i?void 0:i[Ut],null==i?void 0:i.recognizedTokenTypes)}(a,s,h,{[Ut]:u,recognizedTokenTypes:m});let v;try{v=await f}catch(o){if(Ko(o,i))return Bo(e,t,n,g(g({},i),{},{flag:Vo}));jo(o)}return v.id_token&&await(null==d?void 0:d(h)),Oo(v),v}const Go=[["verify"],["sign"]];function Zo(e){const t={name:"HMAC",hash:"SHA-".concat(e)};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:Go}}function Xo(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:Go,minRsaBits:2048}}function Yo(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:"SHA-".concat(t)},usages:Go}}function Qo(){const e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:Go}}function ea(e){const t={name:"ML-DSA-".concat(e)};return{kty:["AKP"],subtle:t,signing:t,usages:Go}}const ta=no({HS256:Zo(256),HS384:Zo(384),HS512:Zo(512),RS256:Xo(256),RS384:Xo(384),RS512:Xo(512),PS256:Xo(256,32),PS384:Xo(384,48),PS512:Xo(512,64),ES256:Yo("P-256",256),ES384:Yo("P-384",384),ES512:Yo("P-521",512),EdDSA:Qo(),Ed25519:Qo(),"ML-DSA-44":ea(44),"ML-DSA-65":ea(65),"ML-DSA-87":ea(87)});function na(e){const t="string"==typeof e?ta[e]:void 0;if(!t)throw new Ei("alg ".concat(e," is not supported either by JOSE or your javascript runtime"));return t}function ia(e){try{return wi(e)}catch(e){throw new Pi("JWS Compact Serialization payload must use only ASCII characters",{cause:e})}}const oa=e=>Math.floor(e.getTime()/1e3),aa={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},sa=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,ra="check_failed";function ca(){throw new TypeError("Invalid time period format")}function la(e){"string"!=typeof e&&ca();const t=sa.exec(e);(!t||t[4]&&t[1])&&ca();const n=parseFloat(t[2]),i=Math.round(n*aa[t[3][0].toLowerCase()]);return Number.isFinite(i)||ca(),"-"===t[1]||"ago"===t[4]?-i:i}function pa(e,t){if(!Number.isFinite(t))throw new TypeError("Invalid ".concat(e," input"));return t}function ua(e,t){if("string"!=typeof t)throw new TypeError('"'.concat(e,'" claim must be a string'))}function da(e,t){return"number"==typeof e?pa(t,e):e instanceof Date?pa(t,oa(e)):oa(new Date)+la(e)}const ha=e=>{const t=e.toLowerCase();return e.includes("/")?t:"application/".concat(t)};function ma(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 ki('"'.concat(t,'" claim must be a number'),e,t,"invalid");return i}}function fa(e,t){throw new ki('unexpected "'.concat(t,'" claim value'),e,t,ra)}let va;function ga(e){return va.get(e)}async function ya(e,t,n){const i=await async function(e,t,n){if(e instanceof Uint8Array&&(e=vi.decode(e)),"string"!=typeof e)throw new Pi("Compact JWS must be a string or Uint8Array");const i=e.split("."),o=i[0],a=i[1],s=i[2];if(3!==i.length)throw new Pi("Invalid Compact JWS");return async function(e,t,n,i,o){var a;const s=e.protected,r=e.header,c=e.payload,l=null!=o?o:function(e){return void 0===e?{}:function(e,t,n){let i;try{i=JSON.parse(gi.decode(Ri(e)))}catch(e){throw new t(n,{cause:e})}if(!Ni(i))throw new t(n);return i}(e,Pi,"JWS Protected Header is invalid")}(s);if(!Mi(l,r))throw new Pi("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const p=g(g({},l),r),u=Ji(l,$i(Pi,Di,t[1],l,p)),d=p.alg;if("string"!=typeof d||!d)throw new Pi('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t[0]&&!t[0].has(d))throw new Ti('"alg" (Algorithm) Header Parameter value not allowed');if(u){if("string"!=typeof c)throw new Pi("JWS Payload must be a string")}else if("string"!=typeof c&&!(c instanceof Uint8Array))throw new Pi("JWS Payload must be a string or an Uint8Array instance");const h=u||"string"!=typeof c?c:i(c);let m=!1;"function"==typeof n&&(n=await n(l,e),m=!0);const f=na(d),v=yi(void 0!==s?wi(s):new Uint8Array,wi("."),"string"==typeof h?null!==(a=t[2])&&void 0!==a?a:t[2]=function(e,t,n){try{return wi(e)}catch(e){throw new n("The ".concat("payload"," is not a valid base64url string"),{cause:e})}}(h,0,Pi):h),y=qi(e.signature,"signature",Pi),b=await Hi(f,n,"verify"),w=await to(b,f.subtle,"verify");f.minRsaBits&&Yi(f.alg,w);let x=!1;try{x=await crypto.subtle.verify(f.signing,w,y,v)}catch(e){throw new Ui(void 0,{cause:e})}if(!x)throw new Ui;const _={payload:"string"==typeof h?qi(h,"payload",Pi):h};return void 0!==s&&(_.protectedHeader=l),void 0!==r&&(_.unprotectedHeader=r),m?[g(g({},_),{},{key:b}),u]:[_,u]}({payload:a,protected:o,signature:s},t,n,ia)}(e,function(e){return[e&&Wi("algorithms",e.algorithms),null==e?void 0:e.crit]}(n),t),o=b(i,2),a=o[0];if(!o[1])throw new Ai("JWTs MUST NOT use unencoded payload");const s=function(e,t){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{n=JSON.parse(gi.decode(t))}catch(e){throw new Ai("JWT Claims Set must be a top-level JSON object",{cause:e})}if(!Ni(n))throw new Ai("JWT Claims Set must be a top-level JSON object");const o=i.typ;if(void 0!==o&&("string"!=typeof e.typ||ha(e.typ)!==ha(o)))throw new ki('unexpected "typ" JWT header value',n,"typ",ra);const a=i.requiredClaims,s=void 0===a?[]:a,r=i.issuer,c=i.subject,l=i.audience,p=i.maxTokenAge,u=[...s];void 0!==p&&u.push("iat"),void 0!==l&&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 ki('missing required "'.concat(e,'" claim'),n,e,"missing");var d,h;void 0!==r&&!(Array.isArray(r)?r:[r]).includes(n.iss)&&fa(n,"iss"),void 0!==c&&n.sub!==c&&fa(n,"sub"),void 0!==l&&(h="string"==typeof l?[l]:l,!("string"==typeof(d=n.aud)?h.includes(d):Array.isArray(d)&&h.some(e=>d.includes(e))))&&fa(n,"aud");const m=i.clockTolerance;let f=0;if("string"==typeof m)f=la(m);else if(void 0!==m){if("number"!=typeof m)throw new TypeError("Invalid clockTolerance option type");f=m}pa("clockTolerance option",f);const v=i.currentDate,g=pa("currentDate option",oa(void 0===v?new Date:v)),y=ma(n,"iat",void 0!==p),b=ma(n,"nbf");if(void 0!==b&&b>g+f)throw new ki('"nbf" claim timestamp check failed',n,"nbf",ra);const w=ma(n,"exp");if(void 0!==w&&w<=g-f)throw new Si('"exp" claim timestamp check failed',n,"exp",ra);if(void 0!==p){const e=g-y;if(e-f>pa("maxTokenAge option","number"==typeof p?p:la(p)))throw new Si('"iat" claim timestamp check failed (too far in the past)',n,"iat",ra);if(e<-f)throw new ki('"iat" claim timestamp check failed (it should be in the past)',n,"iat",ra)}return n}(a.protectedHeader,a.payload,n);return g(g({},a),{},{payload:s})}const ba=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ni(e))throw new TypeError("JWT Claims Set MUST be an object");(va||(va=new WeakMap)).set(this,structuredClone(e))}setIssuer(e){return ua("iss",e),ga(this).iss=e,this}setSubject(e){return ua("sub",e),ga(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),ga(this).aud=e,this}setJti(e){return ua("jti",e),ga(this).jti=e,this}setNotBefore(e){return ga(this).nbf=da(e,"setNotBefore"),this}setExpirationTime(e){return ga(this).exp=da(e,"setExpirationTime"),this}setIssuedAt(e){return ga(this).iat=void 0===e?oa(new Date):"string"==typeof e?pa("setIssuedAt",oa(new Date)+la(e)):da(e,"setIssuedAt"),this}};var wa=new WeakMap;class xa extends ba{constructor(){super(...arguments),d(this,wa,void 0)}setProtectedHeader(e){return function(e){if(void 0!==e)throw new TypeError("".concat("setProtectedHeader"," can only be called once"))}(u(wa,this)),h(wa,this,e),this}async sign(e,t){return async function(e,t,n,i){const o=b(await async function(e,t,n){let i=b(e,4),o=i[0],a=i[1],s=i[2],r=i[3],c="";if(void 0!==a){const e=Fi(Pi,a);a=e[0],c=Li(e[1])}if(void 0!==s&&(s=Fi(Pi,s)[0]),!a&&!s)throw new Pi("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Mi(a,s))throw new Pi("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const l=g(g({},a),s);!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')}(Pi,a);const p=Ji(a,$i(Pi,Di,r,a,l));p||null==n||n();const u=l.alg;if("string"!=typeof u||!u)throw new Pi('JWS "alg" (Algorithm) Header Parameter missing or invalid');const d=na(u);let h,m="",f=o;if(p){var v,y;const t=e[4];t?(m=null!==(v=t[0])&&void 0!==v?v:t[0]=Li(o),f=null!==(y=t[1])&&void 0!==y?y:t[1]=wi(m)):(m=Li(o),h=fi.encode("".concat(c,".").concat(m)))}null!=h||(h=yi(wi(c),wi("."),f));const w=await to(await Hi(d,t,"sign"),d.subtle,"sign");d.minRsaBits&&Yi(d.alg,w);const x={signature:Li(new Uint8Array(await crypto.subtle.sign(d.signing,w,h))),payload:m};return a&&(x.protected=c),s&&(x.header=s),[x,p]}([e,t,void 0,n],i,()=>{throw new Ai("JWTs MUST NOT use unencoded payload")}),1)[0];return"".concat(o.protected,".").concat(o.payload,".").concat(o.signature)}(function(e){const t=ga(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 fi.encode(JSON.stringify(t))}(this),u(wa,this),null==t?void 0:t.crit,e)}}const _a='"alg" (Algorithm)';function ka(){throw new Ei("Invalid or unsupported ".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:'JWK "alg" (Algorithm) Parameter'," value"))}const Sa=(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},Ta=e=>{const t=e.data[e.pos++];if(void 0===t)throw new Error("Unexpected end of ASN.1 input");return t},Ea=e=>{const t=Ta(e);if(128&t){const n=127&t;let i=0;for(let t=0;t<n;t++)i=i<<8|Ta(e);return i}return t},Pa=(e,t,n)=>{if(Ta(e)!==t)throw new Error(n)},Aa=(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},ja=e=>{const t=(e=>{Pa(e,6,"Expected algorithm OID");const t=Ea(e);return Aa(e,t)})(e);if(Sa(t,[43,101,110]))return"X25519";if(!Sa(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Pa(e,6,"Expected curve OID");const n=Ea(e),i=Aa(e,n);if(Sa(i,[42,134,72,206,61,3,1,7]))return"P-256";if(Sa(i,[43,129,4,0,34]))return"P-384";if(Sa(i,[43,129,4,0,35]))return"P-521";throw new Error("Unsupported named curve")};async function Ca(e,t,n){const i=e.get(t)||e.set(t,{}).get(t),o=n.alg;if(void 0===i[o]){const e=eo(n,t,!0).then(e=>{if("public"!==e.type)throw new ji("JSON Web Key Set members must be public keys");return i[o]=e,e}).catch(t=>{throw i[o]===e&&delete i[o],t});i[o]=e}return i[o]}function Ia(e){let t;try{t=structuredClone(e)}catch(e){throw new ji("JSON Web Key Set malformed",{cause:e})}if(!zi(t))throw new ji("JSON Web Key Set malformed");const n=t.keys.map(e=>{const t=Qi(e);return Array.isArray(t.key_ops)&&(t.key_ops=[...t.key_ops]),t}),i=new WeakMap;return Object.defineProperty(async(e,o)=>{const a=g(g({},e),null==o?void 0:o.header),s=a.alg,r=a.kid,c="string"==typeof s?ta[s]:void 0;if(!c||c.secret)throw new Ei('Unsupported "alg" value for a JSON Web Key Set');const p=t.keys.filter((e,t)=>function(e,t,n,i){const o=e.kty,a=e.key_ops,s=e.ext,r=e.kid,c=e.alg,l=e.use,p=e.crv;return(void 0===s||"boolean"==typeof s)&&(void 0===a||Array.isArray(a)&&a.every((e,t)=>"string"==typeof e&&a.indexOf(e)===t)&&a.includes("verify"))&&t.kty.includes(o)&&(void 0===i||"string"==typeof i&&i===r)&&(void 0===c?"AKP"!==o:n===c)&&(void 0===l||"sig"===l)&&(!t.crv||p===t.crv)}(n[t],c,s,r)),u=p[0],d=p.length;if(!d)throw new Ci;if(1!==d){const e=new Ii;throw e[Symbol.asyncIterator]=w(function*(){for(const e of p)try{yield yield l(Ca(i,e,c))}catch(e){}}),e}return Ca(i,u,c)},"jwks",{value:()=>structuredClone(t)})}var Oa,Ua;let Ra;(typeof navigator>"u"||null===(Oa=navigator.userAgent)||void 0===Oa||null===(Ua=Oa.startsWith)||void 0===Ua||!Ua.call(Oa,"Mozilla/5.0 "))&&(Ra="jose/v6.2.13");const La=Symbol(),Na=Symbol();function za(e,t){return Number.isFinite(e)&&Date.now()<e+t}function Ma(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 qa(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=>xi(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);return(async(e,t,n,i)=>{const o=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),a=function(e,t){var n,i;return null!==(n="string"==typeof e?null!==(i=ta[e])&&void 0!==i?i:po[e]:void 0)&&void 0!==n?n:ka(t)}(n,_a);a.secret&&ka(_a);const s=!1;let r;if(a.resolve)try{const e={data:t,pos:0};(function(e){Pa(e,48,"Invalid ".concat("PKCS#8"," structure")),Ea(e);{Pa(e,2,"Expected version field");const t=Ea(e);e.pos+=t}Pa(e,48,"Expected algorithm identifier"),Ea(e)})(e),r=a.resolve({crv:ja(e)})}catch(e){throw new Ei("Invalid or unsupported key format",{cause:e})}else r=a.subtle;return crypto.subtle.importKey(e,t,r,null!=o?o:s,a.usages[1])})("pkcs8",i,t,n)})(e,t,n)}const Da=["mfaToken"],Wa=["mfaToken"];var $a,Ja,Fa,Ha,Ka,Va,Ba,Ga,Za,Xa,Ya,Qa,es,ts,ns,is,os,as,ss,rs,cs,ls,ps,us,ds,hs,ms,fs,vs,gs,ys,bs,ws,xs,_s,ks,Ss,Ts,Es,Ps,As,js,Cs,Is,Os,Us,Rs,Ls,Ns,zs,Ms,qs;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 o;if(i.response instanceof Response)try{o=new Headers(i.response.headers),o.delete("set-cookie")}catch(e){o=void 0}const a={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:o};if("mfa_required"===i.error&&i.cause){a.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&&(a.mfa_requirements=e)}return a}var $s=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}},Fs=class extends Js{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Hs=class extends Js{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Ks=class extends Js{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Vs=class extends Js{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},Bs=class extends Js{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Gs=class extends Js{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Zs=class extends Js{constructor(e,t){super("token_revocation_error",e,t),this.name="TokenRevocationError"}},Xs=class extends Js{constructor(e,t){super("user_info_error",e,t),this.name="UserInfoError"}},Ys=class extends Error{constructor(e){super(e),f(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Qs=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"}},er=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"}},tr=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"}},nr=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"}},ir=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"}},or=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"}},sr=class extends Error{constructor(e){super(e||"The scope option must be a non-empty string of space-separated scopes. Omit it to request the default grant."),f(this,"code","invalid_scope_error"),this.name="InvalidScopeError"}};function rr(e){try{const t=new Headers(e);return t.delete("set-cookie"),t}catch(e){return new Headers}}function cr(e,t,n){var i;const o="object"==typeof t&&null!==t?t:void 0,a=null!==(i=null==o?void 0:o.response)&&void 0!==i?i:n,s="number"==typeof(null==o?void 0:o.status)?o.status:null==a?void 0:a.status;"number"==typeof s&&(e.statusCode=s),null!=a&&a.headers&&(e.headers=rr(a.headers))}function lr(e){return Object.entries(e).filter(e=>void 0!==b(e,2)[1]).reduce((e,t)=>g(g({},e),{},{[t[0]]:t[1]}),{})}function pr(e){if(!e.trim())throw new or("organization must not be blank")}function ur(e,t){if(!e)return;const n=t.trim();if(n.startsWith("org_")){const t=e.org_id;if("string"!=typeof t)throw new or("Organization Id (org_id) claim must be a string present in the ID token");if(t!==n)throw new or('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 or("Organization Name (org_name) claim must be a string present in the ID token");if(t.toLowerCase()!==n.toLowerCase())throw new or('Organization Name (org_name) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(t,'"'))}}var dr=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}},hr=class extends dr{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},mr=class extends dr{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},fr=class extends dr{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},vr=class extends dr{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}},gr=class extends dr{constructor(e,t){super("mfa_verify_error",e,t),this.name="MfaVerifyError"}};function yr(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var br=class e{constructor(e,t,n,i,o,a,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=o,this.claims=a,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 wr(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 o=t instanceof Request?new Headers(t.headers):new Headers;return null!=n&&n.headers&&new Headers(n.headers).forEach((e,t)=>{o.set(t,e)}),o.set("Auth0-Client",i),e(t,g(g({},n),{},{headers:o}))}}function xr(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.18.0"}}function _r(e){let t;const n=async(n,i)=>{const o=await e(n,i);return t=o.clone(),o};return n.getCapturedResponse=()=>t,n}function kr(e,t,n){if(!t)return e;const i=t.signal,o=t.headers,a=t.customFetch,s=a?wr(a,n):e;return i||o?async(e,t)=>{const n=o?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)),o)for(const e of Object.entries(o)){var a=b(e,2);const t=a[0],i=a[1],o=t.toLowerCase();"authorization"!==o&&"auth0-client"!==o&&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],o=i.find(e=>e.aborted);if(o)return n.abort(o.reason),{signal:n.signal};const a=[],s=()=>{i.forEach((e,t)=>{const n=a[t];n&&e.removeEventListener("abort",n)})};return i.forEach((e,t)=>{const i=()=>{s(),n.abort(e.reason)};a[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 Sr={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"},Tr=($a=new WeakMap,Ja=new WeakMap,Fa=new WeakMap,Ha=new WeakMap,Ka=new WeakMap,Va=new WeakMap,Ba=new WeakMap,Ga=new WeakSet,class{constructor(e){var t,n;m(this,Ga),d(this,$a,void 0),d(this,Ja,void 0),d(this,Fa,void 0),d(this,Ha,void 0),d(this,Ka,void 0),d(this,Va,void 0),d(this,Ba,void 0),h($a,this,"https://".concat(e.domain)),h(Ja,this,e.clientId),h(Fa,this,e.clientSecret),h(Ha,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(Ka,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:xr()),h(Va,this,e.getConfiguration),h(Ba,this,e.createCaptureConfiguration)}async listAuthenticators(e,t){const n="".concat(u($a,this),"/mfa/authenticators"),i=e.mfaToken,o=await c(Ga,this,Er).call(this,t)(n,{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!o.ok){const e=await o.clone().text(),t=o.status,n=rr(o.headers);let a;try{a=JSON.parse(e)}catch(i){throw new hr("Failed to list authenticators",{error:"unknown_error",error_description:"Failed to list authenticators",statusCode:t,headers:n,body:e})}throw new hr(a.error_description||"Failed to list authenticators",g(g({},a),{},{statusCode:t,headers:n,body:e}))}return(await o.json()).map(yr)}async enrollAuthenticator(e,t){const n="".concat(u($a,this),"/mfa/associate"),i=e.mfaToken,o=y(e,Da),a={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(a.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(a.phone_number=o.phoneNumber),"email"in o&&o.email&&(a.email=o.email);const s=await c(Ga,this,Er).call(this,t)(n,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(a)});if(!s.ok){const e=await s.clone().text(),t=s.status,n=rr(s.headers);let o;try{o=JSON.parse(e)}catch(i){throw new mr("Failed to enroll authenticator",{error:"unknown_error",error_description:"Failed to enroll authenticator",statusCode:t,headers:n,body:e})}throw new mr(o.error_description||"Failed to enroll authenticator",g(g({},o),{},{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,o="".concat(u($a,this),"/mfa/authenticators/").concat(encodeURIComponent(n)),a=await c(Ga,this,Er).call(this,t)(o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!a.ok){const e=await a.clone().text(),t=a.status,n=rr(a.headers);let o;try{o=JSON.parse(e)}catch(i){throw new fr("Failed to delete authenticator",{error:"unknown_error",error_description:"Failed to delete authenticator",statusCode:t,headers:n,body:e})}throw new fr(o.error_description||"Failed to delete authenticator",g(g({},o),{},{statusCode:t,headers:n,body:e}))}}async challengeAuthenticator(e,t){const n="".concat(u($a,this),"/mfa/challenge"),i=e.mfaToken,o=y(e,Wa),a={mfa_token:i,client_id:u(Ja,this),challenge_type:o.challengeType};u(Fa,this)&&(a.client_secret=u(Fa,this)),o.authenticatorId&&(a.authenticator_id=o.authenticatorId);const s=await c(Ga,this,Er).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!s.ok){const e=await s.clone().text(),t=s.status,n=rr(s.headers);let o;try{o=JSON.parse(e)}catch(i){throw new vr("Failed to challenge authenticator",{error:"unknown_error",error_description:"Failed to challenge authenticator",statusCode:t,headers:n,body:e})}throw new vr(o.error_description||"Failed to challenge authenticator",g(g({},o),{},{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(Va,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(Ba,this))throw new Error("MFA verify fullResponse requires a capture-config factory (createCaptureConfiguration was not set)");const r=_r(null!==(i=(await u(Va,this).call(this,t))[ko])&&void 0!==i?i:fetch),c=await u(Ba,this).call(this,r);try{const t=await Bo(c,Sr[e.factorType],n),i=br.fromTokenEndpointResponse(t);t.recovery_code&&(i.recoveryCode=t.recovery_code);const o=r.getCapturedResponse();if(!o)throw new ar;return{data:i,response:o}}catch(e){var o,a,s;if(e instanceof ar)throw e;if(e instanceof gr)throw e;const t=e,n=new gr(t.error_description||t.message||"Failed to verify MFA challenge",{error:null!==(o=t.error)&&void 0!==o?o:"mfa_verify_error",error_description:null!==(a=null!==(s=t.error_description)&&void 0!==s?s:t.message)&&void 0!==a?a:"Failed to verify MFA challenge"});throw cr(n,e,r.getCapturedResponse()),n}}const r=await u(Va,this).call(this,t);try{const t=await Bo(r,Sr[e.factorType],n),i=br.fromTokenEndpointResponse(t);return t.recovery_code&&(i.recoveryCode=t.recovery_code),i}catch(e){var c,l,p;if(e instanceof gr)throw e;const t=e,n=new gr(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!==(l=null!==(p=t.error_description)&&void 0!==p?p:t.message)&&void 0!==l?l:"Failed to verify MFA challenge"});throw cr(n,e),n}}});function Er(e){return kr(u(Ha,this),e,u(Ka,this))}var Pr=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}},Ar=class extends Pr{constructor(e,t){super("passkey_register_error",e,t),this.name="PasskeyRegisterError"}},jr=class extends Pr{constructor(e,t){super("passkey_challenge_error",e,t),this.name="PasskeyChallengeError"}},Cr=class extends Pr{constructor(e,t){super("passkey_get_token_error",e,t),f(this,"isRetryable",void 0),f(this,"verificationRequired",void 0),f(this,"authSession",void 0),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,verification_required:t.verification_required,auth_session:t.auth_session},this.isRetryable="invalid_grant"===(null==t?void 0:t.error)&&null!=(null==t?void 0:t.auth_session),this.verificationRequired=null==t?void 0:t.verification_required,this.authSession=null==t?void 0:t.auth_session}};function Ir(e){return e.useMtls?{}:e.clientSecret?{client_secret:e.clientSecret}:{}}var Or="urn:okta:params:oauth:grant-type:webauthn",Ur=(Za=new WeakMap,Xa=new WeakMap,Ya=new WeakMap,Qa=new WeakMap,es=new WeakMap,ts=new WeakMap,ns=new WeakSet,class{constructor(e){var t,n;m(this,ns),d(this,Za,void 0),d(this,Xa,void 0),d(this,Ya,void 0),d(this,Qa,void 0),d(this,es,void 0),d(this,ts,void 0),h(Za,this,"https://".concat(e.domain)),h(Xa,this,e.clientId),h(Ya,this,{clientSecret:e.clientSecret,useMtls:e.useMtls}),h(Qa,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(es,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:xr()),h(ts,this,e.grantRequest)}async register(e,t){const n="".concat(u(Za,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}),o=g(g({client_id:u(Xa,this)},Ir(u(Ya,this))),{},{user_profile:i});e.realm&&(o.realm=e.realm),e.organization&&(o.organization=e.organization),e.userMetadata&&(o.user_metadata=e.userMetadata),e.deliveryMethod&&(o.delivery_method=e.deliveryMethod);const a=await c(ns,this,Rr).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!a.ok){const e=await c(ns,this,Lr).call(this,a),t=new Ar(e.error_description||"Failed to request signup challenge",e);throw t.statusCode=a.status,t.headers=rr(a.headers),t}return g({authSession:(s=await a.json()).auth_session,authnParamsPublicKey:g({},s.authn_params_public_key)},s.verification_required&&{verificationRequired:s.verification_required});var s}async challenge(e,t){const n="".concat(u(Za,this),"/passkey/challenge"),i=g({client_id:u(Xa,this)},Ir(u(Ya,this)));null!=e&&e.realm&&(i.realm=e.realm),null!=e&&e.organization&&(i.organization=e.organization);const o=await c(ns,this,Rr).call(this,t)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok){const e=await c(ns,this,Lr).call(this,o),t=new jr(e.error_description||"Failed to request login challenge",e);throw t.statusCode=o.status,t.headers=rr(o.headers),t}return{authSession:(a=await o.json()).auth_session,authnParamsPublicKey:g({},a.authn_params_public_key)};var a}async getTokenByPasskey(e,t){void 0!==e.organization&&pr(e.organization);const n=new URLSearchParams({auth_session:e.authSession,authn_response:JSON.stringify(e.credential)});if(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),e.verification){const t=Object.fromEntries(Object.entries(e.verification).filter(e=>b(e,2)[1]));Object.keys(t).length>0&&n.append("verification",JSON.stringify(t))}let i;try{i=await u(ts,this).call(this,Or,n,t,e.fullResponse)}catch(e){if(e instanceof ar)throw e;const t=null==e?void 0:e.cause,n=Ws(e),i=new Cr(n.error_description||"Failed to exchange passkey credential for tokens.",g(g({},n),{},{verification_required:null==t?void 0:t.verification_required,auth_session:null==t?void 0:t.auth_session}));throw cr(i,e),i}if(e.fullResponse){const t=i;return e.organization&&ur(t.data.claims,e.organization),t}const o=i;return e.organization&&ur(o.claims,e.organization),o}});function Rr(e){return kr(u(Qa,this),e,u(es,this))}async function Lr(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:429===e.status?"Too many requests. Please try again later.":"HTTP ".concat(e.status," ").concat(e.statusText),statusCode:e.status,headers:e.headers,body:t}}}var Nr=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}},zr=class extends Nr{constructor(e,t){super("passwordless_start_error",e,t),this.name="PasswordlessStartError"}},Mr=class extends Nr{constructor(e,t){super("passwordless_verify_error",e,t),this.name="PasswordlessVerifyError"}},qr=class extends Nr{constructor(e,t){super("passwordless_db_get_token_error",e,t),this.name="PasswordlessDbGetTokenError"}},Dr=class extends Nr{constructor(e,t,n,i,o){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!=o?o:this.headers}};function Wr(e){return/^\+[1-9]\d{1,14}$/.test(e)}async function $r(e,t,n){if(e.useMtls)return{};if(e.clientAssertionSigningKey){var i;const o=null!==(i=e.clientAssertionSigningAlg)&&void 0!==i?i:"RS256",a=e.clientAssertionSigningKey instanceof CryptoKey?e.clientAssertionSigningKey:await qa(e.clientAssertionSigningKey,o);return{client_assertion:await new xa({}).setProtectedHeader({alg:o}).setIssuer(t).setSubject(t).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(a),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}if(e.clientSecret)return{client_secret:e.clientSecret};throw new ir}var Jr=(is=new WeakMap,os=new WeakMap,as=new WeakMap,ss=new WeakMap,rs=new WeakMap,cs=new WeakMap,ls=new WeakMap,ps=new WeakSet,class{constructor(e){var t,n;m(this,ps),d(this,is,void 0),d(this,os,void 0),d(this,as,void 0),d(this,ss,void 0),d(this,rs,void 0),d(this,cs,void 0),d(this,ls,void 0),h(os,this,e.domain),h(is,this,"https://".concat(e.domain)),h(as,this,e.clientId),h(ss,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(rs,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:xr()),h(cs,this,{clientSecret:e.clientSecret,clientAssertionSigningKey:e.clientAssertionSigningKey,clientAssertionSigningAlg:e.clientAssertionSigningAlg,useMtls:e.useMtls}),h(ls,this,e.grantRequest)}async sendEmail(e,t){const n=await c(ps,this,Hr).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(!Wr(e.phoneNumber))throw new zr("Phone number must be in E.164 format (e.g. +14155550100).");const n=await c(ps,this,Hr).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,Kr).call(this,n,"Failed to request email OTP challenge",t)}async challengeWithPhoneNumber(e,t){if(!Wr(e.phoneNumber))throw new Dr("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,Kr).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(ls,this))throw new qr("Missing grant request delegate.",Ws(new Error("missing grantRequest")));try{return await u(ls,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 qr("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 Fr(e){return kr(u(ss,this),e,u(rs,this))}async function Hr(e,t,n,i){var o;const a=await $r(u(cs,this),u(as,this),u(os,this)),s=g(g({client_id:u(as,this)},e),a);let r;try{r=await c(ps,this,Fr).call(this,i)("".concat(u(is,this),"/passwordless/start"),{method:"POST",headers:g({"Content-Type":"application/json"},n?{"x-request-language":n}:{}),body:JSON.stringify(s)})}catch(e){throw new zr("".concat(t,": a network error occurred."))}if(r.ok)return r;const l=await r.clone().text();let p;if(204!==r.status)try{p=JSON.parse(l)}catch(e){p=void 0}const d=new zr((null===(o=p)||void 0===o?void 0:o.error_description)||t,p);throw d.statusCode=r.status,d.headers=rr(r.headers),d.body=l,d}async function Kr(e,t,n){var i,o;const a=await $r(u(cs,this),u(as,this),u(os,this)),s=g(g({client_id:u(as,this)},e),a);let r;try{r=await c(ps,this,Fr).call(this,n)("".concat(u(is,this),"/otp/challenge"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch(e){throw new Dr("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 Dr("".concat(t,": could not parse the response body."),r.status,void 0,void 0,rr(r.headers))}return{authSession:n.auth_session}}const l=await r.clone().text();let p;try{p=JSON.parse(l)}catch(e){p=void 0}const d=p?g(g({},p),{},{statusCode:r.status,headers:r.headers,body:l}):{error:"",error_description:"",statusCode:r.status,headers:r.headers,body:l};throw new Dr((null===(i=p)||void 0===i?void 0:i.error_description)||t,r.status,d,null===(o=p)||void 0===o?void 0:o.validation_errors,rr(r.headers))}var Vr=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}},Br=class extends Vr{constructor(e,t){super("signup_error",e,t),this.name="SignUpError"}},Gr=class extends Vr{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 Xr(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 Yr=(us=new WeakMap,ds=new WeakMap,hs=new WeakMap,ms=new WeakMap,fs=new WeakSet,class{constructor(e){var t,n;m(this,fs),d(this,us,void 0),d(this,ds,void 0),d(this,hs,void 0),d(this,ms,void 0),h(us,this,"https://".concat(e.domain)),h(ds,this,e.clientId),h(hs,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)}),h(ms,this,null!==(n=e.telemetryConfig)&&void 0!==n?n:xr())}async signUp(e,t){var n;Zr(e,["email","password","connection"],Br);const i=g({client_id:null!==(n=e.clientId)&&void 0!==n?n:u(ds,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)),o=await c(fs,this,Qr).call(this,"/dbconnections/signup",i,Br,"Failed to sign up",t);if(e.fullResponse){const e=o.clone();return{data:Xr(await o.json()),response:e}}return Xr(await o.json())}async changePassword(e,t){var n;if(Zr(e,["connection"],Gr),!e.email&&!e.username)throw new Gr('Either "email" or "username" is required.');const i=g({client_id:null!==(n=e.clientId)&&void 0!==n?n:u(ds,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)),o=await c(fs,this,Qr).call(this,"/dbconnections/change_password",i,Gr,"Failed to request a password change",t);if(e.fullResponse){const e=o.clone();return{data:await o.text(),response:e}}return o.text()}});async function Qr(e,t,n,i,o){const a=kr(u(hs,this),o,u(ms,this));let s;try{s=await a("".concat(u(us,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()),l=new n((null==c?void 0:c.error_description)||i,null!=c?c:{error:"unknown_error",error_description:i});throw l.statusCode=s.status,l.headers=rr(s.headers),l.body=r,l}var ec=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 tc(e,t,n){if(e.useMtls)return{};if(e.clientAssertionSigningKey){var i;const o=null!==(i=e.clientAssertionSigningAlg)&&void 0!==i?i:"RS256",a=e.clientAssertionSigningKey instanceof CryptoKey?e.clientAssertionSigningKey:await qa(e.clientAssertionSigningKey,o);return{client_assertion:await new xa({}).setProtectedHeader({alg:o}).setIssuer(t).setSubject(t).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(a),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}return e.clientSecret?{client_secret:e.clientSecret}:{}}async function nc(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 ic=(vs=new WeakMap,gs=new WeakMap,ys=new WeakMap,bs=new WeakMap,ws=new WeakMap,xs=new WeakMap,_s=new WeakMap,ks=new WeakMap,Ss=new WeakSet,class{constructor(e){var t;m(this,Ss),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),d(this,ks,void 0),h(vs,this,e.domain),h(gs,this,"https://".concat(e.domain)),h(ys,this,e.clientId),h(bs,this,e.clientSecret),h(ws,this,e.clientAssertionSigningKey),h(xs,this,e.clientAssertionSigningAlg),h(_s,this,e.useMtls),h(ks,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async createSession(e){const t={client_id:u(ys,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(Ss,this,ac).call(this,t);if(!n.sessionToken)throw new ec("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(Ss,this,oc).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(gs,this),"/anonymous/logout"),t={client_id:u(ys,this)},n=await u(ks,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 nc(n);throw new ec(e.error,e.error_description||"Failed to end anonymous session",e)}}async mintTransferToken(e){const t="".concat(u(gs,this),"/anonymous/token"),n={client_id:u(ys,this),session_token:e,audience:"urn:auth0:anon_transfer"};try{const e=await tc({clientSecret:u(bs,this),clientAssertionSigningKey:u(ws,this),clientAssertionSigningAlg:u(xs,this),useMtls:u(_s,this)},u(ys,this),u(vs,this));Object.assign(n,e);const i=await u(ks,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},redirect:"error",body:JSON.stringify(n)});if(!i.ok)return null;const o=await i.json();return"string"==typeof o.anon_transfer_token?o.anon_transfer_token:null}catch(e){return null}}});async function oc(e,t){const n={client_id:u(ys,this),session_token:e};null!=t&&t.audience&&(n.audience=t.audience),null!=t&&t.scope&&(n.scope=t.scope);const i=await c(Ss,this,ac).call(this,n);return{sessionToken:e,accessToken:i.accessToken,expiresAt:i.expiresAt,sessionTokenExpiresAt:i.sessionTokenExpiresAt,scope:i.scope}}async function ac(e){const t="".concat(u(gs,this),"/anonymous/token"),n=await tc({clientSecret:u(bs,this),clientAssertionSigningKey:u(ws,this),clientAssertionSigningAlg:u(xs,this),useMtls:u(_s,this)},u(ys,this),u(vs,this));Object.assign(e,n);const i=await u(ks,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 nc(i);throw new ec(e.error,e.error_description||"Anonymous token request failed",e)}let o;try{o=await i.json()}catch(e){throw new ec("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 ec("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 ec("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}}(o)}var sc=(Ts=new WeakMap,Es=new WeakMap,Ps=new WeakMap,class{constructor(e,t){d(this,Ts,new Map),d(this,Es,void 0),d(this,Ps,void 0),h(Ps,this,Math.max(1,Math.floor(e))),h(Es,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(Es,this);for(u(Ts,this).set(e,{value:t,expiresAt:Date.now()+i});u(Ts,this).size>u(Ps,this);){const e=u(Ts,this).keys().next().value;if(void 0===e)break;u(Ts,this).delete(e)}}}),rc=new Map;function cc(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 lc=class{static createDiscoveryCache(e){const t=(n=e.maxEntries,i=e.ttlMs,"".concat(n,":").concat(i));var n,i;let o=(a=t,rc.get(a));var a;return o||(o=new sc(e.maxEntries,e.ttlMs),rc.set(t,o)),o}static createJwksCache(){return{}}},pc="openid profile email offline_access",uc=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 dc(e){if(null==e)throw new Gs("subject_token is required");if("string"!=typeof e)throw new Gs("subject_token must be a string");if(0===e.trim().length)throw new Gs("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Gs("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Gs("subject_token must not include the 'Bearer ' prefix")}function hc(e,t){if(t)for(const i of Object.entries(t)){var n=b(i,2);const t=n[0],o=n[1];if(!uc.has(t))if(Array.isArray(o)){if(o.length>20)throw new Gs("Parameter '".concat(t,"' exceeds maximum array size of ").concat(20));o.forEach(n=>{e.append(t,n)})}else e.append(t,o)}}var mc="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",fc="urn:ietf:params:oauth:grant-type:token-exchange",vc="urn:ietf:params:oauth:token-type:access_token";function gc(e,t){return(n,i)=>{const o=null==i?void 0:i.body;if(t!==Or||!(o instanceof URLSearchParams))return e(n,i);const a={};for(const e of o){var s=b(e,2);const t=s[0],n=s[1];a[t]="authn_response"===t||"verification"===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(a)}))}}var yc=(As=new WeakMap,js=new WeakMap,Cs=new WeakMap,Is=new WeakMap,Os=new WeakMap,Us=new WeakMap,Rs=new WeakMap,Ls=new WeakMap,Ns=new WeakMap,zs=new WeakMap,Ms=new WeakMap,qs=new WeakSet,class{constructor(e){var t;if(m(this,qs),d(this,As,void 0),d(this,js,void 0),d(this,Cs,void 0),d(this,Is,void 0),d(this,Os,void 0),d(this,Us,void 0),d(this,Rs,void 0),d(this,Ls,void 0),d(this,Ns,void 0),d(this,zs,void 0),d(this,Ms,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(Os,this,e),e.useMtls&&!e.customFetch)throw new $s("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");h(Rs,this,xr(e.telemetry)),h(Us,this,wr(null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)},u(Rs,this)));const n=cc(e.discoveryCache);h(Ns,this,lc.createDiscoveryCache(n)),h(zs,this,new Map),h(Ms,this,lc.createJwksCache()),this.mfa=new Tr({domain:u(Os,this).domain,clientId:u(Os,this).clientId,clientSecret:u(Os,this).clientSecret,customFetch:u(Us,this),telemetryConfig:u(Rs,this),getConfiguration:async e=>(await c(qs,this,_c).call(this,e)).configuration,createCaptureConfiguration:async e=>{const t=(await c(qs,this,kc).call(this)).serverMetadata;return c(qs,this,wc).call(this,t,e)}}),this.passkey=new Ur({domain:u(Os,this).domain,clientId:u(Os,this).clientId,clientSecret:u(Os,this).clientSecret,useMtls:u(Os,this).useMtls,customFetch:u(Us,this),telemetryConfig:u(Rs,this),grantRequest:async(e,t,n,i)=>{const o=(await c(qs,this,kc).call(this)).serverMetadata,a=c(qs,this,xc).call(this,n);if(i){const n=_r(a),i=await c(qs,this,wc).call(this,o,n);i[ko]=gc(n,e);const s=await Bo(i,e,t),r=br.fromTokenEndpointResponse(s),l=n.getCapturedResponse();if(!l)throw new ar;return{data:r,response:l}}const s=await c(qs,this,wc).call(this,o);s[ko]=gc(a,e);const r=await Bo(s,e,t);return br.fromTokenEndpointResponse(r)}}),this.passwordless=new Jr({domain:u(Os,this).domain,clientId:u(Os,this).clientId,customFetch:u(Us,this),telemetryConfig:u(Rs,this),clientSecret:u(Os,this).clientSecret,clientAssertionSigningKey:u(Os,this).clientAssertionSigningKey,clientAssertionSigningAlg:u(Os,this).clientAssertionSigningAlg,useMtls:u(Os,this).useMtls,grantRequest:async(e,t,n,i)=>{const o=(await c(qs,this,_c).call(this,n)).configuration;if(i){var a;const n=_r(null!==(a=o[ko])&&void 0!==a?a:u(Us,this)),i=await c(qs,this,wc).call(this,o.serverMetadata(),n),s=await Bo(i,e,t),r=br.fromTokenEndpointResponse(s),l=n.getCapturedResponse();if(!l)throw new ar;return{data:r,response:l}}try{const n=await Bo(o,e,t);return br.fromTokenEndpointResponse(n)}catch(e){const t=e,n={};throw cr(n,e),t._statusCode=n.statusCode,t._headers=n.headers,e}}}),this.database=new Yr({domain:u(Os,this).domain,clientId:u(Os,this).clientId,customFetch:u(Us,this),telemetryConfig:u(Rs,this)}),this.anonymous=new ic({domain:u(Os,this).domain,clientId:u(Os,this).clientId,clientSecret:u(Os,this).clientSecret,clientAssertionSigningKey:u(Os,this).clientAssertionSigningKey,clientAssertionSigningAlg:u(Os,this).clientAssertionSigningAlg,useMtls:u(Os,this).useMtls,customFetch:u(Us,this)})}async getServerMetadata(){return(await c(qs,this,kc).call(this)).serverMetadata}async buildAuthorizationUrl(e){const t=(await c(qs,this,kc).call(this)).serverMetadata;if(null!=e&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new $s("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(qs,this,Cc).call(this,e)}catch(e){throw new er(e)}}async buildLinkUserUrl(e){try{const t=await c(qs,this,Cc).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 tr(e)}}async buildUnlinkUserUrl(e){try{const t=await c(qs,this,Cc).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 nr(e)}}async backchannelAuthentication(e,t){var n;const i=await c(qs,this,_c).call(this,t),o=i.configuration,a=i.serverMetadata,s=lr(g(g({},u(Os,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(g(g({scope:pc},s),{},{client_id:u(Os,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:a.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 l;const e=_r(null!==(l=o[ko])&&void 0!==l?l:u(Us,this)),n=await c(qs,this,wc).call(this,o.serverMetadata(),e);try{const t=await Lo(o,r),i=await No(n,t),a=e.getCapturedResponse();if(!a)throw new ar;return{data:br.fromTokenEndpointResponse(i),response:a}}catch(t){if(t instanceof ar)throw t;const n=new Qs(t);throw cr(n,t,e.getCapturedResponse()),n}}const p=_r(null!==(n=o[ko])&&void 0!==n?n:u(Us,this)),d=await c(qs,this,wc).call(this,o.serverMetadata(),p);try{const e=await Lo(o,r),t=await No(d,e);return br.fromTokenEndpointResponse(t)}catch(e){const t=new Qs(e);throw cr(t,e,p.getCapturedResponse()),t}}async initiateBackchannelAuthentication(e,t){var n;const i=await c(qs,this,_c).call(this,t),o=i.configuration,a=i.serverMetadata,s=lr(g(g({},u(Os,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(g(g({scope:pc},s),{},{client_id:u(Os,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:a.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 l=_r(null!==(n=o[ko])&&void 0!==n?n:u(Us,this)),p=await c(qs,this,wc).call(this,o.serverMetadata(),l);try{const e=await Lo(p,r);return{authReqId:e.auth_req_id,expiresIn:e.expires_in,interval:e.interval}}catch(e){const t=new Qs(e),n=l.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?rr(n.headers):void 0,t}}async backchannelAuthenticationGrant(e,t){var n;let i=e.authReqId;const o=(await c(qs,this,_c).call(this,t)).configuration,a=new URLSearchParams({auth_req_id:i}),s=_r(null!==(n=o[ko])&&void 0!==n?n:u(Us,this)),r=await c(qs,this,wc).call(this,o.serverMetadata(),s);try{const e=await Bo(r,"urn:openid:params:grant-type:ciba",a);return br.fromTokenEndpointResponse(e)}catch(e){const t=new Qs(e),n=s.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?rr(n.headers):void 0,t}}async getTokenForConnection(e,t){var n;if(e.refreshToken&&e.accessToken)throw new Bs("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 Bs("Either a refresh or access token must be specified.");try{return await this.exchangeToken(g({connection:e.connection,subjectToken:i,subjectTokenType:e.accessToken?vc:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint},e.fullResponse?{fullResponse:!0}:{}),t)}catch(e){if(e instanceof Gs){const t=new Bs(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(qs,this,Tc).call(this,e,t,!0):c(qs,this,Pc).call(this,e,t,!0):"connection"in e?c(qs,this,Tc).call(this,e,t):c(qs,this,Pc).call(this,e,t)}async getTokenByCode(e,t,n){var i;const o=(await c(qs,this,_c).call(this,n)).configuration;if(void 0!==t.organization&&pr(t.organization),t.fullResponse){var a;const n=_r(null!==(a=o[ko])&&void 0!==a?a:u(Us,this)),i=await c(qs,this,wc).call(this,o.serverMetadata(),n);let s,r;try{const o=await Mo(i,e,{pkceCodeVerifier:t.codeVerifier});if(s=br.fromTokenEndpointResponse(o),r=n.getCapturedResponse(),!r)throw new ar}catch(e){if(e instanceof ar)throw e;const t=new Fs("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?rr(i.headers):void 0,t}return t.organization&&ur(s.claims,t.organization),{data:s,response:r}}const s=_r(null!==(i=o[ko])&&void 0!==i?i:u(Us,this)),r=await c(qs,this,wc).call(this,o.serverMetadata(),s);let l;try{const n=await Mo(r,e,{pkceCodeVerifier:t.codeVerifier});l=br.fromTokenEndpointResponse(n)}catch(e){const t=new Fs("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?rr(n.headers):void 0,t}return t.organization&&ur(l.claims,t.organization),l}async getTokenByMagicLinkCode(e,t,n){var i;const o=(await c(qs,this,_c).call(this,n)).configuration;if(null!=t&&t.fullResponse){var a;const n=_r(null!==(a=o[ko])&&void 0!==a?a:u(Us,this)),i=await c(qs,this,wc).call(this,o.serverMetadata(),n);try{const o=await Mo(i,e,{expectedState:null==t?void 0:t.expectedState}),a=br.fromTokenEndpointResponse(o),s=n.getCapturedResponse();if(!s)throw new ar;return{data:a,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 Fs(t,e),o=n.getCapturedResponse();throw i.statusCode=null==o?void 0:o.status,i.headers=o?rr(o.headers):void 0,i}}const s=_r(null!==(i=o[ko])&&void 0!==i?i:u(Us,this)),r=await c(qs,this,wc).call(this,o.serverMetadata(),s);try{const n=await Mo(r,e,{expectedState:null==t?void 0:t.expectedState});return br.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 Fs(t,e),i=s.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?rr(i.headers):void 0,n}}async getTokenByRefreshToken(e,t){var n;const i=(await c(qs,this,_c).call(this,t)).configuration,o=new URLSearchParams;if(e.audience&&o.append("audience",e.audience),e.scope&&o.append("scope",e.scope),e.fullResponse){var a;const t=_r(null!==(a=i[ko])&&void 0!==a?a:u(Us,this)),n=await c(qs,this,wc).call(this,i.serverMetadata(),t);try{const i=await qo(n,e.refreshToken,o),a=br.fromTokenEndpointResponse(i),s=t.getCapturedResponse();if(!s)throw new ar;return{data:a,response:s}}catch(e){if(e instanceof ar)throw e;const n=new Ks("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?rr(i.headers):void 0,n}}const s=_r(null!==(n=i[ko])&&void 0!==n?n:u(Us,this)),r=await c(qs,this,wc).call(this,i.serverMetadata(),s);try{const t=await qo(r,e.refreshToken,o);return br.fromTokenEndpointResponse(t)}catch(e){const t=new Ks("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?rr(n.headers):void 0,t}}async revokeToken(e,t){var n;const i=(await c(qs,this,_c).call(this,t)).configuration,o={};e.tokenTypeHint&&(o.token_type_hint=e.tokenTypeHint);const a=_r(null!==(n=i[ko])&&void 0!==n?n:u(Us,this)),s=await c(qs,this,wc).call(this,i.serverMetadata(),a);try{await async function(e,t,n){Jo(e);const i=yo(e),o=i.as,a=i.c,s=i.auth,r=i.fetch,c=i.tlsOnly,l=i.timeout;return async function(e,t,n,i,o){tn(e),nn(t),Bt(i,'"token"');const a=cn(e,"revocation_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[At])),s=new URLSearchParams(null==o?void 0:o.additionalParameters);s.set("token",i);const r=Ft(null==o?void 0:o.headers);return r.delete("accept"),Sn(e,t,n,a,s,r,o)}(o,a,s,t,{[It]:r,[At]:!c,additionalParameters:new URLSearchParams(n),headers:new Headers(vo),signal:Fo(l)}).then(ii).catch(jo)}(s,e.token,o)}catch(e){const t=new Zs("An error occurred while trying to revoke the token.",Ws(e)),n=a.getCapturedResponse();throw t.statusCode=null==n?void 0:n.status,t.headers=n?rr(n.headers):void 0,t}}async getUserInfo(e,t){const n=(await c(qs,this,_c).call(this,t,!0)).configuration;try{var i;return await Ho(n,e.accessToken,null!==(i=e.expectedSubject)&&void 0!==i?i:_o)}catch(e){throw new Xs("There was an error while trying to retrieve the user info.",Ws(e))}}async getTokenByPassword(e,t){var n;const i=(await c(qs,this,_c).call(this,t)).configuration,o=new URLSearchParams({username:e.username,password:e.password});e.audience&&o.append("audience",e.audience),e.scope&&o.append("scope",e.scope),e.realm&&o.append("realm",e.realm);let a=i;if(e.auth0ForwardedFor){const t=await c(qs,this,jc).call(this);a=new Io(i.serverMetadata(),u(Os,this).clientId,{client_secret:u(Os,this).clientSecret,use_mtls_endpoint_aliases:u(Os,this).useMtls},t);const n=i[ko];a[ko]=(t,i)=>n(t,g(g({},i),{},{headers:g(g({},i.headers),{},{"auth0-forwarded-for":e.auth0ForwardedFor})}))}if(e.fullResponse){var s;const e=_r(null!==(s=a[ko])&&void 0!==s?s:u(Us,this)),n=await c(qs,this,wc).call(this,a.serverMetadata(),e);try{const t=await Bo(n,"password",o),i=br.fromTokenEndpointResponse(t),a=e.getCapturedResponse();if(!a)throw new ar;return{data:i,response:a}}catch(t){if(t instanceof ar)throw t;const n=new Vs("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?rr(i.headers):void 0,n}}const r=_r(null!==(n=a[ko])&&void 0!==n?n:u(Us,this)),l=await c(qs,this,wc).call(this,a.serverMetadata(),r);try{const e=await Bo(l,"password",o);return br.fromTokenEndpointResponse(e)}catch(e){const t=new Vs("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?rr(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(qs,this,Ac).call(this,n,t,e.fullResponse)}async getTokenByPasswordlessSms(e,t){if(!Wr(e.phoneNumber))throw new Mr("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(qs,this,Ac).call(this,n,t,e.fullResponse)}async getTokenByClientCredentials(e,t){var n;const i=function(e){if(null==e)return;const t="string"==typeof e?e.split(/\s+/).filter(Boolean):[];if(0===t.length)throw new sr;return t.join(" ")}(e.scope),o=(await c(qs,this,_c).call(this,t)).configuration;if(e.fullResponse){var a;const t=_r(null!==(a=o[ko])&&void 0!==a?a:u(Us,this)),n=await c(qs,this,wc).call(this,o.serverMetadata(),t),s=new URLSearchParams({audience:e.audience});e.organization&&s.append("organization",e.organization),void 0!==i&&s.append("scope",i);try{const e=await Do(n,s),i=br.fromTokenEndpointResponse(e),o=t.getCapturedResponse();if(!o)throw new ar;return{data:i,response:o}}catch(e){if(e instanceof ar)throw e;const n=new Hs("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?rr(i.headers):void 0,n}}const s=_r(null!==(n=o[ko])&&void 0!==n?n:u(Us,this)),r=await c(qs,this,wc).call(this,o.serverMetadata(),s);try{const t=new URLSearchParams({audience:e.audience});e.organization&&t.append("organization",e.organization),void 0!==i&&t.append("scope",i);const n=await Do(r,t);return br.fromTokenEndpointResponse(n)}catch(e){const t=new Hs("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?rr(n.headers):void 0,t}}async buildLogoutUrl(e){const t=await c(qs,this,kc).call(this),n=t.configuration;if(!t.serverMetadata.end_session_endpoint){const t=new URL("https://".concat(u(Os,this).domain,"/v2/logout"));return t.searchParams.set("returnTo",e.returnTo),t.searchParams.set("client_id",u(Os,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){Jo(e);const n=yo(e),i=n.as,o=n.c,a=cn(i,"end_session_endpoint",!1,n.tlsOnly);(t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id);for(const e of t.entries()){var s=b(e,2);const t=s[0],n=s[1];a.searchParams.append(t,n)}return a}(n,i)}async verifyLogoutToken(e){const t=(await c(qs,this,kc).call(this)).serverMetadata,n=cc(u(Os,this).discoveryCache),i=t.jwks_uri;u(Ls,this)||h(Ls,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:{},o=i.timeoutDuration;if("number"==typeof o&&(!Number.isInteger(o)||o<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');const a="number"==typeof o?o:5e3,s=Ma(i.cooldownDuration,3e4,"cooldownDuration"),r=Ma(i.cacheMaxAge,6e5,"cacheMaxAge"),c=new Headers(i.headers);Ra&&!c.has("User-Agent")&&c.set("User-Agent",Ra),c.has("accept")||c.set("accept","application/json, application/jwk-set+json");const l=i[La],p=i[Na];let u,d,h,m=0,f=0;if(p&&"object"==typeof p){const e=p.uat,t=p.jwks;za(e,r)&&zi(t)&&(u=e,h=Ia(t))}const v=async()=>{if(d&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&"Cloudflare-Workers"===navigator.userAgent||typeof EdgeRuntime<"u"&&"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 o=await i(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{throw"TimeoutError"===e.name?new Oi(void 0,{cause:e}):e});if(200!==o.status)throw new _i("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new _i("Failed to parse the JSON Web Key Set HTTP response as JSON",{cause:e})}}(n,c,AbortSignal.timeout(a),l).then(t=>{const n=Ia(t);if(e<=f)return;h=n;const i=Date.now();p&&(p.uat=i,p.jwks=t),u=i,f=e}).finally(()=>{d===t&&(d=void 0)})}await d};return Object.defineProperties(async(e,t)=>{(!h||!za(u,r))&&await v();try{return await h(e,t)}catch(n){if(n instanceof Ci&&!za(u,s))return await v(),h(e,t);throw n}},{coolingDown:{get:()=>za(u,s),enumerable:!0},fresh:{get:()=>za(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,[La]:u(Us,this),[Na]:u(Ms,this)}));const o=(await ya(e.logoutToken,u(Ls,this),{issuer:t.issuer,audience:u(Os,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in o)&&!("sub"in o))throw new Ys('either "sid" or "sub" (or both) claims must be present');if("sid"in o&&"string"!=typeof o.sid)throw new Ys('"sid" claim must be a string');if("sub"in o&&"string"!=typeof o.sub)throw new Ys('"sub" claim must be a string');if("nonce"in o)throw new Ys('"nonce" claim is prohibited');if(!("events"in o))throw new Ys('"events" claim is missing');if("object"!=typeof o.events||null===o.events)throw new Ys('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in o.events))throw new Ys('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if("object"!=typeof o.events["http://schemas.openid.net/event/backchannel-logout"])throw new Ys('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:o.sid,sub:o.sub}}});function bc(){const e=u(Os,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(u(Os,this).useMtls?"1":"0")}async function wc(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=await c(qs,this,jc).call(this,n),o=new Io(e,u(Os,this).clientId,{client_secret:u(Os,this).clientSecret,use_mtls_endpoint_aliases:u(Os,this).useMtls},i);return o[ko]=null!=t?t:u(Us,this),o}function xc(e){return kr(u(Us,this),e,u(Rs,this))}async function _c(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=await c(qs,this,kc).call(this,t),i=n.configuration,o=n.serverMetadata;if(!e)return{configuration:i,serverMetadata:o};const a=c(qs,this,xc).call(this,e);return{configuration:await c(qs,this,wc).call(this,o,a,t),serverMetadata:o}}async function kc(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=u(e?js:As,this);if(t&&u(Cs,this))return{configuration:t,serverMetadata:u(Cs,this)};const n=c(qs,this,bc).call(this);e||await c(qs,this,jc).call(this,!1);const i=u(Ns,this).get(n);if(i)return c(qs,this,Sc).call(this,i.serverMetadata,e);const o=u(zs,this).get(n);if(o){const t=await o;return c(qs,this,Sc).call(this,t.serverMetadata,e)}const a=(async()=>{const e=(await async function(e,t,n,i,o){const a=await async function(e,t){var n,i;if(!(e instanceof URL))throw Eo('"server" must be an instance of URL',To);const o=!e.href.includes("/.well-known/"),a=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:30,s=AbortSignal.timeout(1e3*a),r=await(o?async function(e,t){return async function(e,t,n,i){if(!(e instanceof URL))throw Pt('"'.concat("issuerIdentifier",'" must be an instance of URL'),Et);sn(e,!0!==(null==i?void 0:i[At]));const o=n(new URL(e.href)),a=Ft(null==i?void 0:i.headers);return a.set("accept","application/json"),((null==i?void 0:i[It])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(a.entries()),method:"GET",redirect:"manual",signal:Ht(o,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=Kt("".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=Kt("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw Pt('"options.algorithm" must be "oidc" (default), or "oauth2"',Tt)}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[It]:null==t?void 0:t[ko],[At]:null==t||null===(i=t.execute)||void 0===i?void 0:i.includes(zo),signal:s,headers:new Headers(vo)}):((null==t?void 0:t[ko])||fetch)((sn(e,null==t||null===(c=t.execute)||void 0===c||!c.includes(zo)),e.href),{headers:Object.fromEntries(new Headers(g({accept:"application/json"},vo)).entries()),body:void 0,method:"GET",redirect:"manual",signal:s})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==hi)throw Pt('"expectedIssuerIdentifier" must be an instance of URL',Et);if(!St(t,Response))throw Pt('"response" must be an instance of Response',Et);if(200!==t.status)throw $t('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Gn,t);oi(t);const i=await di(t);if(Bt(i.issuer,'"response" body "issuer" property',Vn,{body:i}),n!==hi&&new URL(i.issuer).href!==n.href)throw $t('"response" body "issuer" property does not match the expected value',ei,{expected:n.href,body:i,attribute:"issuer"});return i}(hi,e)).catch(jo);var c;return o&&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[Co]=!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 Po("discovered metadata issuer does not match the expected issuer",{code:ei,cause:{expected:e.href,body:r,attribute:"issuer"}})})()),r}(e,o),s=new Io(a,t,n,i);let r=yo(s);if(null!=o&&o[ko]&&(r.fetch=o[ko]),null!=o&&o.timeout&&(r.timeout=o.timeout),null!=o&&o.execute)for(const e of o.execute)e(s);return s}(new URL("https://".concat(u(Os,this).domain)),u(Os,this).clientId,{use_mtls_endpoint_aliases:u(Os,this).useMtls},(e,t,n,i)=>{n.set("client_id",t.client_id)},{[ko]:u(Us,this)})).serverMetadata();return u(Ns,this).set(n,{serverMetadata:e}),{serverMetadata:e}})();a.catch(()=>{}),u(zs,this).set(n,a);try{const t=(await a).serverMetadata;return c(qs,this,Sc).call(this,t,e)}finally{u(zs,this).delete(n)}}async function Sc(e,t){const n=await c(qs,this,wc).call(this,e,void 0,t);return h(Cs,this,e),h(t?js:As,this,n),{configuration:n,serverMetadata:e}}async function Tc(e,t,n){var i,o,a;const s=(await c(qs,this,_c).call(this,t)).configuration;if("audience"in e||"resource"in e)throw new Gs("audience and resource parameters are not supported for Token Vault exchanges");dc(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==(i=e.subjectTokenType)&&void 0!==i?i:vc,requested_token_type:null!==(o=e.requestedTokenType)&&void 0!==o?o:"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),hc(r,e.extra),n){var l;const t=_r(null!==(l=s[ko])&&void 0!==l?l:u(Us,this)),i=await c(qs,this,wc).call(this,s.serverMetadata(),t);try{const e=await Bo(i,mc,r),n=br.fromTokenEndpointResponse(e),o=t.getCapturedResponse();if(!o)throw new ar;return{data:n,response:o}}catch(n){if(n instanceof ar)throw n;const i=new Gs("Failed to exchange token for connection '".concat(e.connection,"'."),Ws(n)),o=t.getCapturedResponse();throw i.statusCode=null==o?void 0:o.status,i.headers=o?rr(o.headers):void 0,i}}const p=_r(null!==(a=s[ko])&&void 0!==a?a:u(Us,this)),d=await c(qs,this,wc).call(this,s.serverMetadata(),p);try{const e=await Bo(d,mc,r);return br.fromTokenEndpointResponse(e)}catch(t){const n=new Gs("Failed to exchange token for connection '".concat(e.connection,"'."),Ws(t)),i=p.getCapturedResponse();throw n.statusCode=null==i?void 0:i.status,n.headers=i?rr(i.headers):void 0,n}}function Ec(e,t,n){var i;if(n.organization&&ur(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 Ai("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 Ai("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new Ai("Invalid JWT");if(!n)throw new Ai("JWTs must contain a payload");let o,a;try{o=Ri(n)}catch(e){throw new Ai("Failed to base64url decode the payload",{cause:e})}try{a=JSON.parse(gi.decode(o))}catch(e){throw new Ai("Failed to parse the decoded payload as JSON",{cause:e})}if(!Ni(a))throw new Ai("Invalid JWT Claims Set");return a}(t.access_token).act}catch(e){}return e}async function Pc(e,t,n){var i;const o=(await c(qs,this,_c).call(this,t)).configuration;if(dc(e.subjectToken),void 0!==e.organization&&pr(e.organization),void 0!==e.actorToken&&void 0===e.actorTokenType)throw new Gs("actorTokenType is required when actorToken is provided");const a=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});if(e.audience&&a.append("audience",e.audience),e.scope&&a.append("scope",e.scope),e.requestedTokenType&&a.append("requested_token_type",e.requestedTokenType),e.organization&&a.append("organization",e.organization),e.actorToken&&a.append("actor_token",e.actorToken),e.actorTokenType&&a.append("actor_token_type",e.actorTokenType),hc(a,e.extra),n){var s;const t=_r(null!==(s=o[ko])&&void 0!==s?s:u(Us,this)),i=await c(qs,this,wc).call(this,o.serverMetadata(),t);let r,l,p;try{if(l=await Bo(i,fc,a),r=br.fromTokenEndpointResponse(l),p=t.getCapturedResponse(),!p)throw new ar}catch(n){if(n instanceof ar)throw n;const i=new Gs("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),Ws(n)),o=t.getCapturedResponse();throw i.statusCode=null==o?void 0:o.status,i.headers=o?rr(o.headers):void 0,i}return c(qs,this,Ec).call(this,r,l,e),{data:r,response:p}}const r=_r(null!==(i=o[ko])&&void 0!==i?i:u(Us,this)),l=await c(qs,this,wc).call(this,o.serverMetadata(),r);let p,d;try{d=await Bo(l,fc,a),p=br.fromTokenEndpointResponse(d)}catch(t){const n=new Gs("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?rr(i.headers):void 0,n}return c(qs,this,Ec).call(this,p,d,e),p}async function Ac(e,t,n){var i;const o=(await c(qs,this,_c).call(this,t)).configuration;if(n){var a;const t=_r(null!==(a=o[ko])&&void 0!==a?a:u(Us,this)),n=await c(qs,this,wc).call(this,o.serverMetadata(),t);try{const i=await Bo(n,"http://auth0.com/oauth/grant-type/passwordless/otp",e),o=br.fromTokenEndpointResponse(i),a=t.getCapturedResponse();if(!a)throw new ar;return{data:o,response:a}}catch(e){if(e instanceof ar)throw e;const n=new Mr("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?rr(i.headers):void 0,n}}const s=_r(null!==(i=o[ko])&&void 0!==i?i:u(Us,this)),r=await c(qs,this,wc).call(this,o.serverMetadata(),s);try{const t=await Bo(r,"http://auth0.com/oauth/grant-type/passwordless/otp",e);return br.fromTokenEndpointResponse(t)}catch(e){const t=new Mr("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?rr(n.headers):void 0,t}}async function jc(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=!!u(Os,this).clientSecret||!!u(Os,this).clientAssertionSigningKey||!!u(Os,this).useMtls;return e&&!t?(e,t,n,i)=>{n.set("client_id",t.client_id)}:(u(Is,this)||h(Is,this,(async()=>{if(!u(Os,this).clientSecret&&!u(Os,this).clientAssertionSigningKey&&!u(Os,this).useMtls)throw new ir;if(u(Os,this).useMtls)return(e,t,n,i)=>{n.set("client_id",t.client_id)};let e=u(Os,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await qa(e,u(Os,this).clientAssertionSigningAlg||"RS256")),e?function(e){return function(e,t){const n=(a=e)instanceof CryptoKey?{key:a}:(null==a?void 0:a.key)instanceof CryptoKey?(void 0!==a.kid&&Bt(a.kid,'"kid"'),{key:a.key,kid:a.kid}):{},i=n.key,o=n.kid;var a;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw Pt("".concat(t," must be a CryptoKey"),Et)}(e,t),"private"!==e.type)throw Pt("".concat(t," must be a private CryptoKey"),Tt)}(i,'"clientPrivateKey.key"'),async(e,n,a,s)=>{var r;const c={alg:Xt(i),kid:o},l=function(e,t){const n=en()+Yt(t);return{jti:Zt(),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[Ot])||void 0===r||r.call(t,c,l),a.set("client_id",n.client_id),a.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),a.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw Pt('CryptoKey instances used for signing assertions must include "sign" in their "usages"',Tt);const i="".concat(qt(Nt(JSON.stringify(e))),".").concat(qt(Nt(JSON.stringify(t)))),o=qt(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:si(e)};case"RSA-PSS":switch(ai(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 Dt("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return ai(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new Dt("unsupported CryptoKey algorithm name",{cause:e})}(n),n,Nt(i)));return"".concat(i,".").concat(o)}(c,l,i))}}(e,void 0)}(e):xo(u(Os,this).clientSecret)})().catch(e=>{throw h(Is,this,void 0),e})),u(Is,this))}async function Cc(e){const t=(await c(qs,this,kc).call(this)).configuration,n=Zt(),i=await function(e){return async function(e){return Bt(e,"codeVerifier"),qt(await crypto.subtle.digest("SHA-256",Nt(e)))}(e)}(n),o=lr(g(g({},u(Os,this).authorizationParams),null==e?void 0:e.authorizationParams)),a=new URLSearchParams(g(g({scope:pc},o),{},{client_id:u(Os,this).clientId,code_challenge:i,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await $o(t,a):await Wo(t,a),codeVerifier:n}}var Ic,Oc,Uc,Rc=new sc(1e3,6e4);class Lc extends C{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Lc.prototype)}static fromPayload(e){let t=e.error,n=e.error_description;return new Lc(t,n)}}class Nc extends Lc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Nc.prototype)}}class zc extends Lc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,zc.prototype)}}class Mc extends Lc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Mc.prototype)}}class qc extends Lc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,qc.prototype)}}class Dc extends Lc{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Dc.prototype)}}class Wc{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 $c{constructor(e,t){this.authJsMfaClient=e,this.auth0Client=t,this.contextManager=new Wc}setMFAAuthDetails(e,t,n,i){this.contextManager.set(e,{scope:t,audience:n,mfaRequirements:i})}async getAuthenticators(e){var t,n,i;const o=this.contextManager.get(e);if(!o)throw new Nc("invalid_request","MFA context not found for this MFA token");const a=null===(n=null===(t=o.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 a&&0!==a.length?t.filter(e=>!!e.type&&a.includes(e.type)):t}catch(e){if(e instanceof hr)throw new Nc(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=wt[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 mr)throw new zc(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 vr)throw new Mc(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 Dc("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 qc("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 qc("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const i=t.scope,o=t.audience;try{const t=await this.auth0Client._requestTokenForMfa({grant_type:n,mfaToken:e.mfaToken,scope:i,audience:o,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 qc)throw new qc(e.error,e.error_description);throw e}}}class Jc extends Error{constructor(e,t,n){super(t),this.name="PasskeyError",this.code=e,this.cause=n,Object.setPrototypeOf(this,Jc.prototype)}}class Fc{constructor(e,t){Ic.set(this,void 0),Oc.set(this,void 0),Uc.set(this,null),a(this,Ic,e,"f"),a(this,Oc,t,"f")}async signup(e){if(!window.PublicKeyCredential)throw new Jc("passkey_not_supported","WebAuthn is not supported in this browser.");a(this,Uc,null,"f");const t=e.scope,n=e.audience,s=i(e,["scope","audience"]),r=await o(this,Ic,"f").register(s);if(r.verificationRequired&&r.verificationRequired.length>0)throw a(this,Uc,{authSession:r.authSession,publicKey:Vc(r.authnParamsPublicKey),verificationRequired:r.verificationRequired,realm:s.realm,organization:s.organization,scope:t,audience:n},"f"),new q(r.verificationRequired);const c=Vc(r.authnParamsPublicKey),l=await navigator.credentials.create({publicKey:c});if(!l)throw new Jc("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");const p=Gc(l);return o(this,Oc,"f")._requestTokenForPasskey({authSession:r.authSession,credential:p,realm:s.realm,organization:s.organization,scope:t,audience:n})}async login(e){if(!window.PublicKeyCredential)throw new Jc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e||{},n=t.scope,a=t.audience,s=i(t,["scope","audience"]),r=await o(this,Ic,"f").challenge(Object.keys(s).length>0?s:void 0),c=Bc(r.authnParamsPublicKey),l=await navigator.credentials.get({publicKey:c});if(!l)throw new Jc("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");const p=Zc(l);return o(this,Oc,"f")._requestTokenForPasskey({authSession:r.authSession,credential:p,realm:s.realm,organization:s.organization,scope:n,audience:a})}async getSignupChallenge(e){if(!window.PublicKeyCredential)throw new Jc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await o(this,Ic,"f").register(e);return Object.assign({authSession:t.authSession,publicKey:Vc(t.authnParamsPublicKey)},t.verificationRequired&&{verificationRequired:t.verificationRequired})}async getLoginChallenge(e){if(!window.PublicKeyCredential)throw new Jc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=await o(this,Ic,"f").challenge(e);return{authSession:t.authSession,publicKey:Bc(t.authnParamsPublicKey)}}async getTokenWithPasskey(e){if(!window.PublicKeyCredential)throw new Jc("passkey_not_supported","WebAuthn is not supported in this browser.");const t=e.authSession,n=e.credential,i=e.realm,a=e.organization,s=e.scope,r=e.audience,c=e.verification,l=null!=c?c:{};if(Object.keys(l).some(e=>""===l[e]))throw new Jc("missing_verification_code","OTP codes in verification must not be empty.");const p=n.response;let u;if(p instanceof AuthenticatorAttestationResponse)u=Gc(n);else{if(!(p instanceof AuthenticatorAssertionResponse))throw new Jc("passkey_invalid_credential","The provided credential is not a valid attestation or assertion response.");u=Zc(n)}return o(this,Oc,"f")._requestTokenForPasskey({authSession:t,credential:u,realm:i,organization:a,scope:s,audience:r,verification:c})}async continueSignup(e){if(!o(this,Uc,"f"))throw new Jc("no_pending_signup","No pending signup found. Call signup() first and catch PasskeyVerificationRequiredError.");const t=o(this,Uc,"f").verificationRequired.filter(t=>!(null==e?void 0:e[t]));if(t.length>0)throw new Jc("missing_verification_code","Missing OTP code for: ".concat(t.join(", "),". Pass a code for each identifier in verificationRequired."));const n=o(this,Uc,"f");a(this,Uc,null,"f");const i=n.authSession,s=n.publicKey,r=n.realm,c=n.organization,l=n.scope,p=n.audience;let u=n.credential;if(!u){let t;try{t=await navigator.credentials.create({publicKey:s})}catch(e){throw a(this,Uc,n,"f"),e}if(!t)throw a(this,Uc,n,"f"),new Jc("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");u=Gc(t)}try{return await o(this,Oc,"f")._requestTokenForPasskey({authSession:i,credential:u,realm:r,organization:c,scope:l,audience:p,verification:e})}catch(e){throw e instanceof Cr&&e.isRetryable&&a(this,Uc,Object.assign(Object.assign({},n),{authSession:e.authSession,verificationRequired:e.verificationRequired,credential:u}),"f"),e}}}function Hc(e){const t=new Uint8Array(e),n=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Kc(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),i=atob(n),o=new Uint8Array(i.length);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return o.buffer}function Vc(e){return Object.assign(Object.assign({},e),{challenge:Kc(e.challenge),user:Object.assign(Object.assign({},e.user),{id:Kc(e.user.id)}),pubKeyCredParams:e.pubKeyCredParams,authenticatorSelection:e.authenticatorSelection})}function Bc(e){return Object.assign(Object.assign({},e),{challenge:Kc(e.challenge)})}function Gc(e){var t;const n=e.response;return{id:e.id,rawId:Hc(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:Hc(n.clientDataJSON),attestationObject:Hc(n.attestationObject)},clientExtensionResults:e.getClientExtensionResults()}}function Zc(e){var t;const n=e.response;return{id:e.id,rawId:Hc(e.rawId),type:e.type,authenticatorAttachment:null!==(t=e.authenticatorAttachment)&&void 0!==t?t:void 0,response:{clientDataJSON:Hc(n.clientDataJSON),authenticatorData:Hc(n.authenticatorData),signature:Hc(n.signature),userHandle:n.userHandle?Hc(n.userHandle):void 0},clientExtensionResults:e.getClientExtensionResults()}}function Xc(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 Yc(){let e=null;return{get:()=>e,set:t=>{e=t},remove:()=>{e=null}}}Ic=new WeakMap,Oc=new WeakMap,Uc=new WeakMap;class Qc{constructor(e,t){this.slots=new Map,this.baseKey="".concat("@@auth0spajs@@","::").concat(e,"::anonymous");try{this.useLocalStorage="localStorage"===t&&"undefined"!=typeof window&&!!window.localStorage}catch(e){this.useLocalStorage=!1}this.sessionKey="".concat(this.baseKey,"::").concat("session"),this.sessionStore=this.useLocalStorage?Xc(this.sessionKey):Yc();const n="".concat(this.baseKey,"::").concat("session_expired");this.expiredStore=this.useLocalStorage?Xc(n):Yc()}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?Xc(n):Yc()),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 el{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 Qc(t,n),this.lockManager=null!=i?i:ge()}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 ec("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 o=null===(n=this.cache.getSessionToken())||void 0===n?void 0:n.sessionToken;let a;try{a=await this.authJsClient.getAccessToken(Object.assign(Object.assign({},e),{sessionToken:o}))}catch(e){throw e instanceof ec&&("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:a.accessToken,expiresAt:a.expiresAt},void 0!==a.scope&&{scope:a.scope})),this.cache.getSessionToken()||this.cache.setSessionToken(Object.assign({sessionToken:a.sessionToken},void 0!==a.sessionTokenExpiresAt&&{sessionTokenExpiresAt:a.sessionTokenExpiresAt})),Object.assign({accessToken:a.accessToken,expiresAt:a.expiresAt},void 0!==a.scope&&{scope:a.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 tl{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 Fe).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(!F())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===F().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=ge(),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||S,!ut(t))throw new Error('Invalid cache location "'.concat(t,'"'));n=ut(t)()}var i;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:k,this.cookieStorage=!1===e.legacySameSiteCookie?et:nt,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 o=e.useCookiesForTransactions?this.cookieStorage:it;let a="";var s;this.onlineAccess?a=E:this.options.useRefreshTokens&&(a="offline_access"),this.scope=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];if("object"!=typeof e)return{[j]:Me(t,e,...i)};let a={[j]:Me(t,...i)};return Object.keys(e).forEach(n=>{const o=e[n];a[n]=Me(t,o,...i)}),a}(this.options.authorizationParams.scope,"openid",a),this.transactionManager=new Ke(o,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||A,this.cacheManager=new He(n,n.allKeys?void 0:new ct(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new ft(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 yt(c,r),this.authJsClient=new yc({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new $c(this.authJsClient.mfa,this),this.anonymous=new el(this.authJsClient.anonymous,this.options.clientId,this.options.anonymousSessionsCacheMode,this.lockManager),this.passkey=new Fc(this.authJsClient.passkey,this),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&t===S&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new rt,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||P,n=B(t,!0),i=encodeURIComponent(btoa(JSON.stringify(n)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(i)}_authorizeUrl(e){return this._url("/authorize?".concat(G(e)))}async _verifyIdToken(e,t,n,i){const o=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],o=n[1],a=n[2];if(3!==t.length||!i||!o||!a)throw new Error("ID token could not be decoded");const s=JSON.parse(X(o)),r={__raw:e},c={};return Object.keys(s).forEach(e=>{r[e]=s[e],Be.includes(e)||(c[e]=s[e])}),{encoded:{header:i,payload:o,signature:a},header:JSON.parse(X(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(null!=e.max_age&&!Ve(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||!Ve(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ve(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()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),i>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(i,") is after expiration time (").concat(o,")"));if(null!=t.claims.nbf&&Ve(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&&Ve(t.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),i>o)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(o))}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:Q(null!=i?i:this.options.authorizationParams.max_age),now:o})}_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 o=K(H()),a=K(H()),s=H(),r=await Z(s),c=Y(r),l=await(null===(i=this.dpop)||void 0===i?void 0:i.calculateThumbprint()),p=((e,t,n,i,o,a,s,r,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:qe(t,n.scope,n.audience),response_type:"code",response_mode:r||"query",state:i,nonce:o,redirect_uri:s||e.authorizationParams.redirect_uri,code_challenge:a,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,o,a,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,l),u=this._authorizeUrl(p);return{nonce:a,code_verifier:s,scope:p.scope,audience:p.audience||j,redirect_uri:p.redirect_uri,state:o,url:u,max_age:p.max_age}}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 z;const i=await this._applyAnonTransferToken(this._applySessionTransferToken(e.authorizationParams||{})),o=await this._prepareAuthorizeUrl(i,{response_mode:"web_message"},window.location.origin);t.popup.location.href=o.url;const a=await((e,t)=>new Promise((n,i)=>{let o;const a=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(a),clearTimeout(s),window.removeEventListener("message",o,!1),i(new N(e.popup)))},1e3),s=setTimeout(()=>{clearInterval(a),i(new L(e.popup)),window.removeEventListener("message",o,!1)},1e3*(e.timeoutInSeconds||60));o=function(r){if(r.origin===t&&r.data&&"authorization_response"===r.data.type){if(clearTimeout(s),clearInterval(a),window.removeEventListener("message",o,!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",o)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(o.url).origin);if(o.state!==a.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:o.audience,scope:o.scope,code_verifier:o.code_verifier,grant_type:"authorization_code",code:a.code,redirect_uri:o.redirect_uri},{nonceIn:o.nonce,organization:s,max_age:o.max_age})}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=dt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),n=t.openUrl,o=t.fragment,a=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||{})),l=await this._prepareAuthorizeUrl(c),p=l.url,u=i(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},u),{appState:a,response_type:ot.Code}),r&&{organization:r}));const d=o?"".concat(p,"#").concat(o):p;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===ot.ConnectCode?this._handleConnectAccountRedirectCallback(n,t):this._handleLoginRedirectCallback(n,t)}async _handleLoginRedirectCallback(e,t){const n=e.code,i=e.state,o=e.error,a=e.error_description;if(o)throw new O(o,a||o,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,max_age:t.max_age}),{appState:t.appState,response_type:ot.Code}}async _handleConnectAccountRedirectCallback(e,t){const n=e.connect_code,i=e.state,o=e.error,a=e.error_description;if(o)throw new U(o,a||o,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:ot.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(lt))return void await this._maybeCreateAnonymousSession();this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(lt)}try{await this.getTokenSilently(e)}catch(e){e instanceof C&&"login_required"===e.error&&e.error_description!==T&&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:qe(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)})}),o=await((e,t)=>{let n=ye[t];return n||(n=e().finally(()=>{delete ye[t],n=null}),ye[t]=n),n})(()=>this._getTokenSilently(i),"".concat(this.options.clientId,"::").concat(i.authorizationParams.audience,"::").concat(i.authorizationParams.scope,"::").concat(i.cacheMode));return e.detailedResponse?o:null==o?void 0:o.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||j,clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const o=(a=this.options.clientId,s=n.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(a,".").concat(s));var a,s;try{return await this.lockManager.runWithLock(o,5e3,async()=>{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||j,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,o=e.token_type,a=e.access_token,s=e.oauthTokenScope,r=e.expires_in;return Object.assign(Object.assign({id_token:i,token_type:o,access_token:a},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===T}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});const t=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||j,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 o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:qe(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(o,t),(await this.cacheManager.get(new $e({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||j,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,o=i(t,["federated"]),a=n?"&federated":"";return this._url("/v2/logout?".concat(G(Object.assign({clientId:e.clientId},o))))+a}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||j,n=await this.cacheManager.getRefreshTokensByAudience(t,this.options.clientId);await async function(e,t){let n=e.auth0Client,i=e.useFormData,o=e.refreshTokens,a=e.audience,s=e.client_id,r=e.onRefreshTokenRevoked;const c=e.timeout||k,l="refresh_token",p="".concat(e.baseUrl,"/oauth/revoke"),u={"Content-Type":i?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(B(n||P)))};if(t){const n={client_id:s,token_type_hint:l},o=i?G(n):JSON.stringify(n);try{return await Ue({type:"revoke",timeout:c,fetchUrl:p,fetchOptions:{method:"POST",body:o,headers:u},useFormData:i,auth:{audience:null!=a?a:j}},t)}catch(e){throw new C("revoke_error",e.message)}}for(const t of o){const n={client_id:s,token_type_hint:l,token:t},o=i?G(n):JSON.stringify(n),a=await Re(p,{method:"POST",body:o,headers:u},c);if(!a.ok){let t,n;try{var d=JSON.parse(await a.text());t=d.error,n=d.error_description}catch(e){}throw new C(t||"revoke_error",n||"HTTP error ".concat(a.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=dt(e),o=n.openUrl,a=i(n,["openUrl"]);await this._clearLocalSession(e.clientId);const s=this._buildLogoutUrl(a);o?await o(s):!1!==o&&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),o=i.url,a=i.state,s=i.nonce,r=i.code_verifier,c=i.redirect_uri,l=i.scope,p=i.audience,u=i.max_age;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 d=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let h;try{h=new URL(this.domainUrl).origin}catch(e){h=this.domainUrl}const m=await function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60;return new Promise((i,o)=>{const a=window.document.createElement("iframe");a.setAttribute("width","0"),a.setAttribute("height","0"),a.style.display="none";const s=()=>{window.document.body.contains(a)&&(window.document.body.removeChild(a),window.removeEventListener("message",r,!1))};let r;const c=setTimeout(()=>{o(new R),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?o(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(a),a.setAttribute("src",e)})}(o,h,d);if(a!==m.state)throw new C("state_mismatch","Invalid state");const f=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:r,code:m.code,grant_type:"authorization_code",redirect_uri:c,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:s,organization:t.organization,max_age:u});return Object.assign(Object.assign({},f),{scope:l,oauthTokenScope:f.scope,audience:p})})}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 $e({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||j,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||j,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,o=((e,t,n,i)=>{var o;if(e&&n&&i){if(t.audience!==n)return t.scope;const e=i.split(" "),a=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],s=a.every(t=>e.includes(t));return e.length>=a.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 l=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:o});if(await this._propagateRotatedRefreshToken(null==t?void 0:t.refresh_token,l.refresh_token),this.options.useMrrt&&(a=null==t?void 0:t.audience,s=null==t?void 0:t.scope,r=e.authorizationParams.audience,c=e.authorizationParams.scope,a!==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(" "))||[],o=n?i.filter(e=>e!==E):i,a=(null==t?void 0:t.split(" "))||[];return o.filter(e=>-1==a.indexOf(e)).join(",")})(o,l.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||j,e.authorizationParams.scope),new W(e.authorizationParams.audience||"default",t)}}return Object.assign(Object.assign({},l),{scope:e.authorizationParams.scope,oauthTokenScope:l.scope,audience:e.authorizationParams.audience||j})}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 a,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,o=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===o||n<=o)throw new C("invalid_token","Invalid session_expiry: session ceiling is before or at the token issue time.")}const a=e.id_token,s=e.decodedToken,r=i(e,["id_token","decodedToken"]);this.userCache.set(We,{id_token:a,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(We);try{await(null===(t=this.dpop)||void 0===t?void 0:t.clear())}catch(e){}if(this.worker)try{await Ue({type:"clear"},this.worker)}catch(e){}}async _isSessionCeilingReached(){var e,t;const n=this.userCache.get(We),i=null!=n?n:await this.cacheManager.getIdToken(new $e({clientId:this.options.clientId})),o=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===o)return!1;const a=await this.nowProvider();return Math.floor(a/1e3)>=o-30&&(await this._clearLocalSession(),!0)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||j,t=this.scope[e],n=await this.cacheManager.getIdToken(new $e({clientId:this.options.clientId,audience:e,scope:t})),i=this.userCache.get(We);return n&&n.id_token===(null==i?void 0:i.id_token)?i:(this.userCache.set(We,n),n)}async _getEntryFromCache(e){let t=e.scope,n=e.audience,i=e.clientId,o=e.cacheMode;const a=await this.cacheManager.get(new $e({scope:t,audience:n,clientId:i}),60,this.options.useMrrt,o);if(a&&a.access_token){const e=a.token_type,t=a.access_token,n=a.oauthTokenScope,i=a.expires_in,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.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,o,a,s,r;const c=t||{},l=c.nonceIn,p=c.organization,u=c.scopesToRequest,d=c.max_age;try{const t=await ze(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,l,p,d);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(We))}if("authorization_code"!==e.grant_type){const e=await this._getIdTokenFromCache(),t=null===(a=null===(o=null==e?void 0:e.decodedToken)||void 0===o?void 0:o.claims)||void 0===a?void 0:a.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 $e({scope:u||e.scope,audience:e.audience||j,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||j}),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(p||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:qe(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 ze(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 gt(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,o=e.scopes,a=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=K(H()),l=H(),p=await Z(l),u=Y(p),d=await this.myAccount.connectAccount({connection:i,scopes:o,redirect_uri:r,state:c,code_challenge:u,code_challenge_method:"S256",authorization_params:a}),h=d.connect_uri,m=d.connect_params,f=d.auth_session;this.transactionManager.create({state:c,code_verifier:l,auth_session:f,redirect_uri:r,appState:n,connection:i,response_type:ot.ConnectCode});const v=new URL(h);v.searchParams.set("ticket",m.ticket),t?await t(v.toString()):window.location.assign(v)}async _requestTokenForPasskey(e){var t;const n=e.audience||this.options.authorizationParams.audience,i=e.organization||this.options.authorizationParams.organization,o=!!e.verification&&Object.keys(e.verification).length>0;try{return await this._requestToken(Object.assign(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}),o&&{verification:e.verification}),{scope:qe(this.scope,e.scope,n),audience:n}))}catch(e){if(e instanceof C&&(null===(t=e.data)||void 0===t?void 0:t.auth_session)&&e.data.verification_required)throw new Cr(e.error_description,{error:e.error,error_description:e.error_description,auth_session:e.data.auth_session,verification_required:e.data.verification_required});throw e}}async _requestTokenForMfa(e,t){const n=e.mfaToken,o=i(e,["mfaToken"]),a=await this.cacheManager.get(new $e({scope:o.scope,audience:o.audience||j,clientId:this.options.clientId}),void 0,this.options.useMrrt),s=await this._requestToken(Object.assign(Object.assign({},o),{mfa_token:n}),t);return await this._propagateRotatedRefreshToken(null==a?void 0:a.refresh_token,s.refresh_token),s}}function nl(e,t,n){var i;return async function(e,t,n){const i=t.toLowerCase(),o=e.replace(/^https?:\/\//,""),a="".concat(o,"|").concat(i),s=Rc.get(a);if(void 0!==s)return s;try{var r;const e=new URL("https://".concat(o,"/.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=wr(t,n.telemetry));const s=await t(e.toString());return s.ok?(Rc.set(a,!0),!0):404===s.status?(Rc.set(a,!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:P}))}async function il(e){const t=new tl(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,a=r(e),s=a[0],c=a[1],l=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,c)),p=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)],l[p++]=t>>16&255,l[p++]=t>>8&255,l[p++]=255&t;return 2===c&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[p++]=255&t),1===c&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[p++]=t>>8&255,l[p++]=255&t),l},t.fromByteArray=function(e){for(var t,i=e.length,o=i%3,a=[],s=16383,r=0,c=i-o;r<c;r+=s)a.push(l(e,r,r+s>c?c:r+s));return 1===o?(t=e[i-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[i-2]<<8)+e[i-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=a[s],i[a.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 l(e,t,n){for(var i,o=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(c(i));return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},318(e,t){t.read=function(e,t,n,i,o){var a,s,r=8*o-i-1,c=(1<<r)-1,l=c>>1,p=-7,u=n?o-1:0,d=n?-1:1,h=e[t+u];for(u+=d,a=h&(1<<-p)-1,h>>=-p,p+=r;p>0;a=256*a+e[t+u],u+=d,p-=8);for(s=a&(1<<-p)-1,a>>=-p,p+=i;p>0;s=256*s+e[t+u],u+=d,p-=8);if(0===a)a=1-l;else{if(a===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,i),a-=l}return(h?-1:1)*s*Math.pow(2,a-i)},t.write=function(e,t,n,i,o,a){var s,r,c,l=8*a-o-1,p=(1<<l)-1,u=p>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:a-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=p):(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>=p?(r=0,s=p):s+u>=1?(r=(t*c-1)*Math.pow(2,o),s+=u):(r=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[n+h]=255&r,h+=m,r/=256,o-=8);for(s=s<<o|r,l+=o;l>0;e[n+h]=255&s,h+=m,s/=256,l-=8);e[n+h-m]|=128*f}},526(e,t,n){"use strict";var i=n(991),o=n(318),a="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 l(e,t,n)}function l(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),o=i.write(e,t);return o!==n&&(i=i.slice(0,o)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(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(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(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 o=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||$(e.length)?r(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function p(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 p(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)||W(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 o=!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 q(e).length;default:if(o)return i?-1:M(e).length;t=(""+t).toLowerCase(),o=!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 A(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return T(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,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,o){var a,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 l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var p=-1;for(a=n;a<r;a++)if(l(e,a)===l(t,-1===p?0:a-p)){if(-1===p&&(p=a),a-p+1===c)return p*s}else-1!==p&&(a-=a-p),p=-1}else for(n+c>r&&(n=r-c),a=n;a>=0;a--){for(var u=!0,d=0;d<c;d++)if(l(e,a+d)!==l(t,d)){u=!1;break}if(u)return a}return-1}function w(e,t,n,i){n=Number(n)||0;var o=e.length-n;i?(i=Number(i))>o&&(i=o):i=o;var a=t.length;i>a/2&&(i=a/2);for(var s=0;s<i;++s){var r=parseInt(t.substr(2*s,2),16);if($(r))return s;e[n+s]=r}return s}function x(e,t,n,i){return D(M(t,e.length-n),e,n,i)}function _(e,t,n,i){return D(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 D(q(t),e,n,i)}function S(e,t,n,i){return D(function(e,t){for(var n,i,o,a=[],s=0;s<e.length&&!((t-=2)<0);++s)i=(n=e.charCodeAt(s))>>8,o=n%256,a.push(o),a.push(i);return a}(t,e.length-n),e,n,i)}function T(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=[],o=t;o<n;){var a,s,r,c,l=e[o],p=null,u=l>239?4:l>223?3:l>191?2:1;if(o+u<=n)switch(u){case 1:l<128&&(p=l);break;case 2:128==(192&(a=e[o+1]))&&(c=(31&l)<<6|63&a)>127&&(p=c);break;case 3:a=e[o+1],s=e[o+2],128==(192&a)&&128==(192&s)&&(c=(15&l)<<12|(63&a)<<6|63&s)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:a=e[o+1],s=e[o+2],r=e[o+3],128==(192&a)&&128==(192&s)&&128==(192&r)&&(c=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&r)>65535&&c<1114112&&(p=c)}null===p?(p=65533,u=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),o+=u}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=P));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 l(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 p(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(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),W(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,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==t[o]){n=e[o],i=t[o];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),o=0;for(n=0;n<e.length;++n){var a=e[n];if(W(a,Uint8Array))o+a.length>i.length?c.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else{if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o)}o+=a.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+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,n,i,o){if(W(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===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(n>>>=0)-(t>>>=0),r=Math.min(a,s),l=this.slice(i,o),p=e.slice(t,n),u=0;u<r;++u)if(l[u]!==p[u]){a=l[u],s=p[u];break}return a<s?-1:s<a?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 o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!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 S(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function A(e,t,n){var i="";n=Math.min(e.length,n);for(var o=t;o<n;++o)i+=String.fromCharCode(127&e[o]);return i}function j(e,t,n){var i="";n=Math.min(e.length,n);for(var o=t;o<n;++o)i+=String.fromCharCode(e[o]);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 o="",a=t;a<n;++a)o+=J[e[a]];return o}function I(e,t,n){for(var i=e.slice(t,n),o="",a=0;a<i.length-1;a+=2)o+=String.fromCharCode(i[a]+256*i[a+1]);return o}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 U(e,t,n,i,o,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function R(e,t,n,i,o,a){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,i,a){return t=+t,n>>>=0,a||R(e,0,n,4),o.write(e,t,n,i,23,4),n+4}function N(e,t,n,i,a){return t=+t,n>>>=0,a||R(e,0,n,8),o.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],o=1,a=0;++a<t&&(o*=256);)i+=this[e+a]*o;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],o=1;t>0&&(o*=256);)i+=this[e+--t]*o;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],o=1,a=0;++a<t&&(o*=256);)i+=this[e+a]*o;return i>=(o*=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,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},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),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||U(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||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,n){return e=+e,t>>>=0,n||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,n){return e=+e,t>>>=0,n||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,n){return e=+e,t>>>=0,n||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,n,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var a=0,s=1,r=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===r&&0!==this[t+a-1]&&(r=1),this[t+a]=(e/s|0)-r&255;return t+n},c.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var a=n-1,s=1,r=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===r&&0!==this[t+a+1]&&(r=1),this[t+a]=(e/s|0)-r&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||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,n){return e=+e,t>>>=0,n||U(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||U(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||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,n){return e=+e,t>>>=0,n||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,n){return L(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return N(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 o=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),o},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 o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}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 a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=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(a=0;a<n-t;++a)this[a+t]=s[a%r]}return this};var z=/[^+/0-9A-Za-z-_]/g;function M(e,t){var n;t=t||1/0;for(var i=e.length,o=null,a=[],s=0;s<i;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.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;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function q(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,n,i){for(var o=0;o<i&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}var J=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var i=16*n,o=0;o<16;++o)t[i+o]=e[n]+e[o];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="",o=0,a=-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(a===r-1||1===s);else if(a!==r-1&&2===s){if(i.length<2||2!==o||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="",o=0):o=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),a=r,s=0;continue}}else if(2===i.length||1===i.length){i="",o=0,a=r,s=0;continue}t&&(i.length>0?i+="/..":i="..",o=2)}else i.length>0?i+="/"+e.slice(a+1,r):i=e.slice(a+1,r),o=r-a-1;a=r,s=0}else 46===n&&-1!==s?++s:s=-1}return i}var i={resolve:function(){for(var e,i="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var s;a>=0?s=arguments[a]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(i=s+"/"+i,o=47===s.charCodeAt(0))}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var i=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!i)).length||i||(e="."),e.length>0&&o&&(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 o=arguments[n];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}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 o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var a=e.length,s=a-o,r=1;r<n.length&&47===n.charCodeAt(r);++r);for(var c=n.length-r,l=s<c?s:c,p=-1,u=0;u<=l;++u){if(u===l){if(c>l){if(47===n.charCodeAt(r+u))return n.slice(r+u+1);if(0===u)return n.slice(r+u)}else s>l&&(47===e.charCodeAt(o+u)?p=u:0===u&&(p=0));break}var d=e.charCodeAt(o+u);if(d!==n.charCodeAt(r+u))break;47===d&&(p=u)}var h="";for(u=o+p+1;u<=a;++u)u!==a&&47!==e.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(r+p):(r+=p,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,o=-1,a=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!a){o=s;break}}else a=!1;return-1===o?i?"/":".":i&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var i,o=0,a=-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 l=e.charCodeAt(i);if(47===l){if(!s){o=i+1;break}}else-1===c&&(s=!1,c=i+1),r>=0&&(l===n.charCodeAt(r)?-1===--r&&(a=i):(r=-1,a=c))}return o===a?a=c:-1===a&&(a=e.length),e.slice(o,a)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!s){o=i+1;break}}else-1===a&&(s=!1,a=i+1);return-1===a?"":e.slice(o,a)},extname:function(e){t(e);for(var n=-1,i=0,o=-1,a=!0,s=0,r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47!==c)-1===o&&(a=!1,o=r+1),46===c?-1===n?n=r:1!==s&&(s=1):-1!==n&&(s=-1);else if(!a){i=r+1;break}}return-1===n||-1===o||0===s||1===s&&n===o-1&&n===i+1?"":e.slice(n,o)},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,o=e.charCodeAt(0),a=47===o;a?(n.root="/",i=1):i=0;for(var s=-1,r=0,c=-1,l=!0,p=e.length-1,u=0;p>=i;--p)if(47!==(o=e.charCodeAt(p)))-1===c&&(l=!1,c=p+1),46===o?-1===s?s=p:1!==u&&(u=1):-1!==s&&(u=-1);else if(!l){r=p+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&&a?e.slice(1,c):e.slice(r,c)):(0===r&&a?(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):a&&(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 o=i&&i.stringify||t;if("object"==typeof e&&null!==e){var a=n.length+1;if(1===a)return e;var s=new Array(a);s[0]=o(e);for(var r=1;r<a;r++)s[r]=o(n[r]);return s.join(" ")}if("string"!=typeof e)return e;var c=n.length;if(0===c)return e;for(var l="",p=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(p>=c)break;if(null==n[p])break;u<h&&(l+=e.slice(u,h)),l+=Number(n[p]),u=h+2,h++;break;case 105:if(p>=c)break;if(null==n[p])break;u<h&&(l+=e.slice(u,h)),l+=Math.floor(Number(n[p])),u=h+2,h++;break;case 79:case 111:case 106:if(p>=c)break;if(void 0===n[p])break;u<h&&(l+=e.slice(u,h));var m=typeof n[p];if("string"===m){l+="'"+n[p]+"'",u=h+2,h++;break}if("function"===m){l+=n[p].name||"<anonymous>",u=h+2,h++;break}l+=o(n[p]),u=h+2,h++;break;case 115:if(p>=c)break;u<h&&(l+=e.slice(u,h)),l+=String(n[p]),u=h+2,h++;break;case 37:u<h&&(l+=e.slice(u,h)),l+="%",u=h+2,h++,p--}++p}++h}return-1===u?e:(u<d&&(l+=e.slice(u)),l)}},48(e,t,n){var i,o,a;a=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 o=e[i];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(i>0&&(o=o.replace(/^[\/]+/,"")),o=i<e.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),t.push(o))}var a=t.join("/"),s=(a=a.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=a():void 0===(o="function"==typeof(i=a)?i.call(t,n,t,e):i)||(e.exports=o)},122(){},360(){},826(){},713(e,t,n){"use strict";const i=n(930);e.exports=u;const o=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||{},a={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"),l={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function p(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||o;e.browser.write&&(e.browser.asObject=!0);const i=e.serializers||{},a=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]:o[e]||o[l[e]||"log"]||b}),e[r]=i}(w,g,n),p({},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:a,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=a,w._stdErrSerialize=c,w.child=function(n,o){if(!n)throw new Error("missing bindings for child Pino");o=o||{},a&&n.serializers&&(o.serializers=n.serializers);const s=o.serializers;if(a&&s){var r=Object.assign({},i,s),c=!0===e.browser.serialize?Object.keys(r):a;delete n.serializers,h([n],c,r,this._stdErrSerialize)}function l(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)))}l.prototype=this;const u=new l(this);return p(this,u),u.level=this.level,u},t&&(w._logEvent=m()),w}function d(e,t,n,a){if(Object.defineProperty(e,a,{value:s(e.level,n)>s(a,n)?b:n[r][a],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[a]===b)return;e[a]=function(e,t,n,a){return c=e[r][a],function(){const r=t.timestamp(),l=new Array(arguments.length),p=Object.getPrototypeOf&&Object.getPrototypeOf(this)===o?o:this;for(var u=0;u<l.length;u++)l[u]=arguments[u];if(t.serialize&&!t.asObject&&h(l,this._serialize,this.serializers,this._stdErrSerialize),t.asObject||t.formatters?c.call(p,function(e,t,n,o,a={}){const{level:s=()=>e.levels.values[t],log:r=e=>e}=a;e._serialize&&h(n,e._serialize,e.serializers,e._stdErrSerialize);const c=n.slice();let l=c[0];const p={};o&&(p.time=o),p.level=s(t,e.levels.values[t]);let u=1+(0|e._childLevel);if(u<1&&(u=1),null!==l&&"object"==typeof l){for(;u--&&"object"==typeof c[0];)Object.assign(p,c.shift());l=c.length?i(c.shift(),c):void 0}else"string"==typeof l&&(l=i(c.shift(),c));return void 0!==l&&(p.msg=l),r(p)}(this,a,l,r,t.formatters)):c.apply(p,l),t.transmit){const i=t.transmit.level||e._level,o=n.levels.values[i],c=n.levels.values[a];if(c<o)return;!function(e,t,n){const i=t.send,o=t.ts,a=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=o,e._logEvent.messages=n.filter(function(e){return-1===c.indexOf(e)}),e._logEvent.level.label=a,e._logEvent.level.value=s,i(a,e._logEvent,r),e._logEvent=m(c)}(this,{ts:r,methodLevel:a,methodValue:c,transmitLevel:i,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:s(e._level,n)},l)}};var c}(e,t,n,a);const l=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!==l.length&&(e[a]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(l,e[a]))}function h(e,t,n,i){for(const o in e)if(i&&e[o]instanceof Error)e[o]=u.stdSerializers.err(e[o]);else if("object"==typeof e[o]&&!Array.isArray(e[o]))for(const i in e[o])t&&t.indexOf(i)>-1&&i in n&&(e[o][i]=n[i](e[o][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=a,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,o=n(526).hp,a=Object.create,s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,p=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 o of c(t))p.call(e,o)||o===n||s(e,o,{get:()=>t[o],enumerable:!(i=r(t,o))||i.enumerable});return e},h=(e,t,n)=>(n=null!=e?a(l(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,o,a=f(),s=n(942).extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function l(e){if(!e||"string"!=typeof e)return!1;var t=r.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!c.test(t[1]))&&"UTF-8"}e.charset=l,e.charsets={lookup:l},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,o=["nginx","apache",void 0,"iana"],Object.keys(a).forEach(function(e){var n=a[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 l=o.indexOf(a[i[c]].source),p=o.indexOf(n.source);if("application/octet-stream"!==i[c]&&(l>p||l===p&&"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:()=>ge,AnnotationInclusionMode:()=>ut,AnnotationType:()=>ct,AreaType:()=>mt,ArtifactType:()=>wt,AssetInclusionMode:()=>pt,AssetStatus:()=>rt,AssetUrlType:()=>Et,AutoAnnotateStatus:()=>st,AutoAnnotateTask:()=>dt,COMBINED_UPLOAD_MAX_BYTES:()=>Re,ChangeType:()=>_t,ComputeAccountMismatchError:()=>Q,ComputeApiError:()=>Y,ContourType:()=>$,DEFAULT_PREDICTION_VERSION:()=>R,DataApiType:()=>ot,DataEndpoint:()=>Lt,DepthMap:()=>zt,Endpoint:()=>j,EndpointState:()=>k,EvaluationStatus:()=>Pt,ExportedBy:()=>bt,EyePop:()=>Kt,EyePopDataWebSocketError:()=>Ut,EyepopLineDecoder:()=>ce,ForwardOperatorType:()=>z,InferenceType:()=>D,LoadFromAssetUuidJob:()=>ke,LoadFromGroupJob:()=>_e,LoadFromJob:()=>we,LoadMediaStreamJob:()=>Se,MAX_OPEN_SOURCES:()=>Ue,ModelExportStatus:()=>yt,ModelFormat:()=>St,ModelPrecisionType:()=>Tt,ModelStatus:()=>gt,ModelTask:()=>vt,ModelTrainingStage:()=>xt,ModelType:()=>ft,MotionModel:()=>W,PIPELINE_PATH:()=>Ie,PipelineBackend:()=>Ve,PipelineCommandError:()=>Me,PipelineConfigurationError:()=>Ne,PipelineJob:()=>Ke,PipelineSocketClosedError:()=>ze,PipelineSourceError:()=>qe,PointCloud:()=>Dt,PopComponentType:()=>N,PredictionVersion:()=>U,QUATERNION_TOLERANCE:()=>C,SUBPROTOCOL:()=>Oe,SelectMode:()=>M,Semaphore:()=>E,SessionBackend:()=>je,Stream:()=>se,TaskMode:()=>jt,TaskType:()=>At,TranscodeMode:()=>ht,TransientPopId:()=>Te,UploadGroupJob:()=>xe,UploadJob:()=>be,UserReview:()=>lt,VideoMode:()=>L,VlmAbilityStatus:()=>Ct,WebrtcBase:()=>fe,WebrtcWhep:()=>Vt,WebrtcWhip:()=>ve,WorkerEndpoint:()=>nt,WorkflowPhase:()=>kt,accessTokenCredential:()=>x,apiKeyCredential:()=>w,cloudOfDepth:()=>Ft,cloudOfObject:()=>Jt,cloudsOfPrediction:()=>Ht,decodeDepthMap:()=>Mt,decodePointCloud:()=>$t,default:()=>Yt,encodeMultipartFormData:()=>de,getBaseUrl:()=>at,isSelectOperator:()=>q,popSelects:()=>F,randomMultipartBoundary:()=>pe,readableStreamFromString:()=>le,resolveAuth:()=>b,validateCamera:()=>O,validatePop:()=>J}),e.exports=(i=g,d(s({},"__esModule",{value:!0}),i));var _,k=(e=>(e.Idle="Idle",e.Busy="Busy",e.Authenticating="Authenticating",e.FetchConfig="FetchConfig",e.Error="Error",e.NotAvailable="NotAvailable",e))(k||{});function S(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 Qt{constructor(e){this._logger=e}async fetch(e,t){const n=S(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}}_=async e=>new Qt(e)}else{class en{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=S(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}}_=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 en(i,t.fetch,e)}}var T,E=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()}}},P=n(713),A=n(262);T="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,A.createAuth0Client)(n);await i.isAuthenticated()||await i.loginWithPopup();const o=await i.getTokenSilently();if(!o)return Promise.reject("auth0 login failed");let a;const s=t;return a=void 0!==s.popId?{eyepopUrl:t.eyepopUrl,accessToken:o,validUntil:Date.now()+36e5,popId:s.popId,baseUrl:void 0,pipelineId:void 0,isPipelineMode:s.isPipelineMode,authenticationHeaders:()=>({Authorization:`Bearer ${o}`})}:{eyepopUrl:t.eyepopUrl,accessToken:o,validUntil:Date.now()+36e5},a}:(e,t)=>Promise.reject("auth0 login not supported server-side");var j=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 E(this._options.jobQueueLength??1024),this._state="Idle",this._message=null,this._stateChangeHandler=null,t=e.logger?e.logger:(0,P.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 _(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 E(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 T(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}`},o=`${this.eyepopUrl()}/v1/auth/authenticate`,a=await this._client.fetch(o,{method:"POST",headers:i});if(200!=a.status){const e=await a.text();return Promise.reject(`Unexpected status ${a.status}: ${e}`)}const s=await a.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}},C=.001;function I(e){return void 0===e||Number.isFinite(e)}function O(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(!I(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)<=C))throw new Error("camera.extrinsics.rotation must be a unit quaternion")}}}var U=(e=>(e[e.V1=1]="V1",e[e.V2=2]="V2",e[e.V3=3]="V3",e))(U||{}),R=2,L=(e=>(e.STREAM="stream",e.BUFFER="buffer",e))(L||{}),N=(e=>(e.FORWARD="forward",e.INFERENCE="inference",e.TRACKING="tracking",e.CONTOUR_FINDER="contour_finder",e.COMPONENT_FINDER="component_finder",e))(N||{}),z=(e=>(e.FULL="full",e.CROP="crop",e.CROP_WITH_FULL_FALLBACK="crop_with_full_fallback",e.SELECT_CROP="select_crop",e.SELECT_FULL="select_full",e))(z||{}),M=(e=>(e.MOST_RELEVANT="most_relevant",e))(M||{});function q(e){return"select_crop"===e?.type||"select_full"===e?.type}var D=(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))(D||{}),W=(e=>(e.RANDOM_WALK="random_walk",e.CONSTANT_VELOCITY="constant_velocity",e.CONSTANT_ACCELERATION="constant_acceleration",e))(W||{}),$=(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))($||{});function J(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&&O(e.defaults.camera),H(e.components)}function F(e){const t=e=>(e??[]).some(e=>q(e.forward?.operator)||t(e.forward?.targets));return t(e?.components)}function H(e){for(const t of e??[]){const e=t.forward?.operator;void 0!==e&&K(e),H(t.forward?.targets)}}function K(e){if(!q(e)){if(void 0!==e.select)throw new Error("select is only valid with the select_crop or select_full operator");return}const t=e.select;if(void 0===t)throw new Error(`${e.type} requires a select block`);if(void 0!==t.mode&&"most_relevant"!==t.mode)throw new Error(`select mode ${t.mode} is not supported, the only mode is most_relevant`);if(void 0!==t.relevancyModel&&void 0!==t.relevancyModelUuid)throw new Error("select can only have one of relevancyModelUuid or relevancyModel");if(void 0!==t.minTrackLengthSeconds&&t.minTrackLengthSeconds<0)throw new Error("select minTrackLengthSeconds cannot be negative");if(void 0!==t.intervalSeconds&&t.intervalSeconds<=0)throw new Error("select intervalSeconds must be positive");if(void 0!==e.crop){if("select_crop"!==e.type)throw new Error(`crop options are only valid with select_crop, not ${e.type}`);if(void 0!==e.crop.maxItems)throw new Error("select_crop forwards one detection per selection, maxItems does not apply")}}var V=new Set(["error","failed","stopped","pipeline_error","unknown"]),B=e=>new Promise(t=>setTimeout(t,e));function G(e){if(e.pipeline_uuid)return e.pipeline_uuid;const t=e.pipelines?.[0];return t?.id||t?.pipeline_id||null}function Z(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 X(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 Y=class extends Error{constructor(e,t,n){super(e),this.name="ComputeApiError",this.status=t,this.code=n}},Q=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 ee(e,t){const n=await async function(e){try{const t=te(await e.clone().json());if(!t||"object"!=typeof t)return;const n=t,i=te(n.error),o=i&&"object"==typeof i?i.code:n.code;return"string"==typeof o&&o.length>0?o:void 0}catch(e){return}}(e),i=await async function(e){if((e.headers.get("content-type")||"").includes("application/json"))try{const t=ie(te(await e.clone().json()));if(t)return t}catch(e){}const t=await e.text();return ie(t)||t}(e);return new Y(`Unexpected status ${e.status} ${t}: ${i}`,e.status,n)}function te(e){if("string"==typeof e)try{return te(JSON.parse(e))}catch(t){const n=e.replace(/\\"/g,'"');if(n!=e)try{return te(JSON.parse(n))}catch(e){}return e}return e}async function ne(e){return te(await e.json())}function ie(e){if("string"==typeof(e=te(e)))return e;if(!e||"object"!=typeof e)return null;const t=e,n=te(t.error),i=ie(n)||("string"==typeof n?n:null),o=[t.code,i,t.message,t.details].filter(e=>"string"==typeof e&&e.length>0).join(": ");if(o)return o;if(t.pipeline_error)return ie(t.pipeline_error);if(n&&"object"==typeof n)return ie(n);try{return JSON.stringify(e)}catch(e){return null}}var oe=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=G(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:X(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 o=await this.options.httpClient.fetch(t,{headers:n});if(404==o.status)i=[];else{if(200!=o.status)throw await ee(o,"fetching compute sessions");i=await ne(o)}if(i.length>0){this.options.logger?.debug(`User has ${i.length} sessions, inspecting for usable session`);for(let t of i)if(!(V.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 ${G(t)}`);break}}}if(!e){this.options.requestLogger?.debug("creating a new session at: %s",t);const o=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),a={headers:{...n,...o?{"Content-Type":"application/json"}:{}},method:"POST"};o&&(a.body=o);const s="wait=true",r=await this.options.httpClient.fetch(`${t}?${s}`,a);if(200!=r.status)throw await ee(r,"creating a compute session");if(i=await ne(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 o=await this.options.httpClient.fetch(n,{headers:i});if(404==o.status)throw new Y(`Unexpected status ${o.status} compute sessions ${e} not found`,o.status);if(200!=o.status)throw await ee(o,"fetching compute sessions");if(t=await ne(o),this.options.accountId&&t.account_uuid!==this.options.accountId)throw new Q(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 o=`${e.session_endpoint}/health`,a=await this.options.httpClient.fetch(o,{headers:{Authorization:t,Accept:"application/json"}});if(200==a.status){const t=a.headers.get("content-type")||"",o=await a.text();try{n=Z(o,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 B(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 ${a.status}, wait and poll for update`),await B(250)}}}},ae=n(182),se=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 o=!1;try{for await(const t of async function*(){const t=new ce,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(!o&&t){const e=JSON.parse(t),i=e.event;void 0!==i?await n(i):yield e}o=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{o||t.abort()}}()}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],n=[],i=this.iterator(),o=e=>({next:()=>{if(0===e.length){const e=i.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>o(t),this.controller),new e(()=>o(n),this.controller)]}},re=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 o=n.split(e.NEWLINE_REGEXP);return 1!==o.length||i?(this.buffer.length>0&&(o=[this.buffer.join("")+o[0],...o.slice(1)],this.buffer=[]),i||(this.buffer=[o.pop()||""]),o):(this.buffer.push(o[0]),[])}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==o){if(e instanceof o)return e.toString();if(e instanceof Uint8Array)return o.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}};re.NEWLINE_CHARS=new Set(["\n","\r","\v","\f","","","","
","\u2028","\u2029"]),re.NEWLINE_REGEXP=/\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;var ce=re;function le(e){return new ReadableStream({start(t){t.enqueue(o.from(e)),t.close()}})}function pe(){return`----formdata-boundary-${(0,ae.v4)()}`}function ue(e){return e.replace(/"/g,"%22").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function de(e,t){const n=new TextEncoder;let i=0,o=null;return new ReadableStream({async pull(a){if(o){const{done:e,value:t}=await o.read();if(!e)return void a.enqueue(t);o=null,a.enqueue(n.encode("\r\n")),i++}if(i>=e.length)return a.enqueue(n.encode(`--${t}--\r\n`)),void a.close();const s=e[i];let r=`--${t}\r\nContent-Disposition: form-data; name="${ue(s.name)}"`;void 0!==s.filename&&(r+=`; filename="${ue(s.filename)}"`),r+="\r\n",s.contentType&&(r+=`Content-Type: ${s.contentType}\r\n`),r+="\r\n",a.enqueue(n.encode(r)),"string"==typeof s.content?(a.enqueue(n.encode(s.content)),a.enqueue(n.encode("\r\n")),i++):o=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(o?.cancel(t));const n=o?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 he=n(182),me=h(n(942)),fe=class e{constructor(e,t,n,i,o,a){this._getSession=e,this._client=t,this._requestLogger=a,this._ingressId=n,this._urlPath=`${i}/${this._ingressId}`,this._is_pipeline_direct=o,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=me.default.join("pipelines",e.pipelineId,this._urlPath)}else n=this._urlPath;return t&&(n=me.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),o={...n.authenticationHeaders(),"Content-Type":"application/sdp"},a=await this._client.fetch(i,{headers:o,method:"POST",body:t.sdp});return a.status>=300?Promise.reject(`unknown status code for POST '${i}': ${a.status} (${a.statusText})`):(this._eTag=a.headers.get("ETag")??"",this._location=a.headers.get("Location"),await this.onRemoteAnswer(new RTCSessionDescription({type:"answer",sdp:await a.text()})))}async sendLocalCandidates(t){if(!this._offerData)throw new Error("sendLocalCandidates no offerData");const n=await this._getSession(),i=this.gresUrl(n,this._location),o={...n.authenticationHeaders(),"Content-Type":"application/trickle-ice-sdpfrag","If-Match":this._eTag},a=await this._client.fetch(i,{headers:o,method:"PATCH",body:e.generateSdpFragment(this._offerData,t)});return a.status>=300?Promise.reject(`unknown status code for PATCH '${i}': ${a.status} (${a.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:ve.unquoteCredential(t[3]),credential:ve.unquoteCredential(t[4])}:null}):[]).filter(function(e){return null!=e})}static editAnswer(e,t,n,i,o,a){const s=e.split("m=");for(let e=0;e<s.length;e++){const r=s[e];r&&r.startsWith("video")?s[e]=ve.setVideoBitrate(ve.setCodec(r,t),i):r&&r.startsWith("audio")&&(s[e]=ve.setAudioBitrate(ve.setCodec(r,n),o,a))}return s.join("m=")}static setCodec(e,t){const n=e.split("\r\n"),i=[],o=[];for(const e of n)e.startsWith("a=rtpmap:")?t&&e.toLowerCase().includes(t)&&(o.push(e.slice(9).split(" ")[0]),i.push(e)):i.push(e);const a=[];for(const e of i)e.startsWith("a=fmtp:")?o.includes(e.slice(7).split(" ")[0])&&a.push(e):e.startsWith("a=rtcp-fb:")?o.includes(e.slice(10).split(" ")[0])&&a.push(e):a.push(e);return a.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="",o=e.split("\r\n");for(let e=0;e<o.length;e++){const t=o[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<o.length;e++){const a=o[e];a&&a.startsWith("a=fmtp:"+i+" ")&&(o[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 o.join("\r\n")}static parseOffer(e){let t=[],n="",i="";for(const o of e.split("\r\n"))o.startsWith("m=")?t.push(o.slice(2)):""===n&&o.startsWith("a=ice-ufrag:")?n=o.slice(12):""===i&&o.startsWith("a=ice-pwd:")&&(i=o.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",o=0;for(const t of e.medias){let e=n.get(o);if(void 0!==e){i+="m="+t+"\r\na=mid:"+o+"\r\n";for(const t of e)i+="a="+t.candidate+"\r\n"}o++}return i}static unquoteCredential(e){return e?JSON.parse(`"${e}"`):""}},ve=class extends fe{constructor(e,t,n,i,o){super(t,n,(0,he.v4)().toString(),"liveIngress/whip",i,o),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:fe.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()}},ge=class{constructor(e,t,n,i,o=R){this._responseStream=null,this._controller=new AbortController,this._getSession=t,this._params=e,this._client=n,this._requestLogger=i,this._version=o}[Symbol.asyncIterator](){if(!this._responseStream)throw Error("logical bug");return se.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 o=await this.startJob();if(401==o.status){if(t(o.status),!e--){i(`response ${o.status}: ${o.statusText}`);break}this._requestLogger.info("received 401 response, attempt to reauthorize once")}else{if(404!=o.status){if(o.ok){if(o.body){n(o.body);break}{const e=await o.text();if(e){n(le(e));break}i("response body is empty");break}}i(`upload error ${o.status}: ${await o.text()}`);break}if(t(o.status),!e--){i(`response ${o.status}: ${o.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")}};ge.n=0;var ye,be=class extends ge{get[Symbol.toStringTag](){return"uploadJob"}constructor(e,t,n,i,o,a,s,r,c,l=R){super(o,a,s,r,l),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 o=`${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 a={...t.authenticationHeaders(),Accept:"application/jsonl"};n=this._client.fetch(o,{headers:a,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(o,{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 ${o}`)}).catch(e=>{this._requestLogger.debug(`error ${e} for POST ${o}`)})}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 o=await new Response(await this.uploadBody()).blob();n.append("file",o);const a={...e.authenticationHeaders(),Accept:"application/jsonl"};t=await this._client.fetch(i,{headers:a,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}},we=class extends ge{constructor(e,t,n,i,o,a=R){super(t,n,i,o,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}})}},xe=class extends ge{get[Symbol.toStringTag](){return"uploadGroupJob"}constructor(e,t,n,i,o,a=R){if(super(t,n,i,o,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",filename:"blob",contentType:e.mimeType,content:e.stream});const o=pe(),a={...e.authenticationHeaders(),Accept:"application/jsonl","Content-Type":`multipart/form-data; boundary=${o}`};return await this._client.fetch(n,{headers:a,method:"POST",body:de(i,o),signal:this._controller.signal,duplex:"half",eyepop:{responseStreaming:!0}})}},_e=class extends ge{get[Symbol.toStringTag](){return"loadFromGroupJob"}constructor(e,t,n,i,o,a=R){if(super(t,n,i,o,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}})}},ke=class extends ge{constructor(e,t,n,i,o,a=R){super(t,n,i,o,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}})}},Se=class extends ge{constructor(e,t,n,i,o,a=R){super(t,n,i,o,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 ve(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"},o=`${e.baseUrl.replace(/\/+$/,"")}/pipelines/${e.pipelineId}/source?mode=preempt&processing=sync`;return await this._client.fetch(o,{headers:i,method:"PATCH",body:JSON.stringify(n),signal:this._controller.signal,eyepop:{responseStreaming:!0}})}};if("document"in globalThis&&"implementation"in globalThis.document)ye=async(e,t)=>{throw new DOMException("resolving a path to a file is not supported in browser")};else{let tn=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*nn(e){for await(const t of e)yield t}ye=async(e,t)=>{const i=v(),o=n(122),a=await o.open(e.path,"r"),s=(await a.stat()).size,r=nn(a.createReadStream());return{stream:tn(r),mimeType:e.mimeType?e.mimeType:i.lookup(e.path)||"image/*",size:s}}}var Te=(e=>(e.Transient="transient",e))(Te||{}),Ee=class e{constructor(e){this.ctx=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}async disconnect(e){await this.deleteOwnPipeline(),await e()}async deleteOwnPipeline(){const e=this.ctx.client();if("transient"==this.ctx.options.popId&&this._pipelineId&&e){const t=`${this._baseUrl}/pipelines/${this._pipelineId}`,n={Authorization:await this.authorizationHeader()};let i=await e.fetch(t,{method:"DELETE",headers:n});if(204!=i?.status){const e=await(i?.text());this.ctx.logger.info(`stopping pipeline failed, status ${i?.status}: ${e}`)}}}onStatus(e){404==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.ctx.options.eyepopUrl,accessToken:this._sessionAccessToken,validUntil:this._sessionAccessTokenValidUntil||Number.MAX_VALUE}:await this.ctx.credentialSession(),{eyepopUrl:e.eyepopUrl,accessToken:e.accessToken,validUntil:e.validUntil,popId:this.ctx.options.popId,accountId:this._accountId??this.ctx.options.accountId,baseUrl:this._baseUrl,pipelineId:this._pipelineId||void 0,isPipelineMode:!1,authenticationHeaders:()=>this._authenticationHeaders(e)})}popName(){return this._popName}pop(){return this._pipeline?this._pipeline.pop||null:this.ctx.options.pop||null}predictionVersion(){return F(this.pop())?3:R}async changePop(e){if("transient"==this.ctx.options.popId)return void await this.changeTransientPop(e);const t=this.ctx.client();if(!this._baseUrl||!t)return Promise.reject("endpoint not connected, use connect()");let n=await this.ctx.fetchWithRetry(async()=>{const n=await this.session();let i={"Content-Type":"application/json",...this._authenticationHeaders(n)};const o=`${n.baseUrl}/pipelines/${n.pipelineId}/pop`;return await t.fetch(o,{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.ctx.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.ctx.options)?.isLocal?{}:{Authorization:`Bearer ${e.accessToken}`}}async submit(e){switch(e.kind){case"source":return await this.process(e.source,e.params);case"uploadGroup":return await this.uploadGroup(e.paths,e.params);case"uploadStreamGroup":return await this.uploadStreamGroup(e.streams,e.mimeTypes,e.params);case"loadFromGroup":return await this.loadFromGroup(e.urls,e.params)}}async process(e,t){return void 0!==e.file?this.uploadFile(e,t):void 0!==e.stream?this.uploadStream(e,t):void 0!==e.path?this.uploadPath(e,t):void 0!==e.url?this.loadFrom(e,t):void 0!==e.assetUuid?this.loadFromAssetUuid(e,t):void 0!==e.mediaStream?this.loadMediaStream(e,t):Promise.reject("unknown source type")}start(e){return e.start(()=>{this.ctx.jobDone()},e=>{404==e?this.onStatus(e):401==e&&this.ctx.forgetCredential()})}async uploadGroup(e,t){const n=this.ctx.client(),i=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!n)throw new Error("endpoint not connected, use connect()");await i.acquire();try{this.ctx.updateState();const i=await Promise.all(e.map(async e=>{const t=await this.resolvePath({path:e});return{stream:t.stream,mimeType:t.mimeType}}));return this.start(new xe(i,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}catch(e){throw i.release(),e}}async uploadStreamGroup(e,t,n){const i=this.ctx.client(),o=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!i)throw new Error("endpoint not connected, use connect()");await o.acquire();try{this.ctx.updateState();const o=e.map((e,n)=>({stream:e,mimeType:t?.[n]??null}));return this.start(new xe(o,n,async()=>this.session(),i,this.ctx.requestLogger,this.predictionVersion()))}catch(e){throw o.release(),e}}async loadFromGroup(e,t){const n=this.ctx.client(),i=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!n)throw new Error("endpoint not connected, use connect()");await i.acquire();try{return this.ctx.updateState(),this.start(new _e(e,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}catch(e){throw i.release(),e}}async resolvePath(e){return this.ctx.options.platformSupport?.resolvePath?await this.ctx.options.platformSupport.resolvePath(e,this.ctx.logger):await ye(e,this.ctx.logger)}async startConnected(e,t=!1){await this.ensureTransientPipelineStarted();const n=this.ctx.client(),i=this.ctx.limit();if(!this._baseUrl||!this._pipelineId||!n){if(t)return Promise.reject("endpoint not connected, use connect()");throw new Error("endpoint not connected, use connect()")}await i.acquire();try{return this.ctx.updateState(),this.start(await e(n))}catch(e){throw i.release(),e}}async uploadFile(e,t){return await this.startConnected(async n=>new be(e.file,e.file.type,e.file.size,e.videoMode,t,async()=>this.session(),n,this.ctx.requestLogger,void 0,this.predictionVersion()),!0)}async uploadStream(e,t){return await this.startConnected(async n=>new be(e.stream,e.mimeType,e.size,e.videoMode,t,async()=>this.session(),n,this.ctx.requestLogger,void 0,this.predictionVersion()),!0)}async uploadPath(e,t){return await this.startConnected(async n=>{const i=await this.resolvePath(e);let o=!0;return new be(i.stream,i.mimeType,i.size,e.videoMode,t,async()=>this.session(),n,this.ctx.requestLogger,async()=>o?(o=!1,i.stream):(await this.resolvePath(e)).stream,this.predictionVersion())})}async loadFrom(e,t){return e.url.startsWith("file://")?await this.uploadPath({path:e.url.substring(7)},t):await this.startConnected(async n=>new we(e.url,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}async loadFromAssetUuid(e,t){return await this.startConnected(async n=>new ke(e.assetUuid,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}async loadMediaStream(e,t){return await this.startConnected(async n=>new Se(e.mediaStream,t,async()=>this.session(),n,this.ctx.requestLogger,this.predictionVersion()))}async reconnect(){"transient"==this.ctx.options.popId?(await this.getComputeSession(),this.ctx.options.pop&&this.setTransientPipelinePop()):this.ctx.options.sessionUuid?await this.getComputeSession():await this.startWebApiSessionWithPopId(),this.ctx.updateState()}async startWebApiSessionWithPopId(){const e=this.ctx.client();if(!e)throw new Error("endpoint not initialized");const t=`${this.ctx.eyepopWebApiUrl()}/pops/${this.ctx.options.popId}/config?auto_start=false`,n={Authorization:await this.authorizationHeader()};this.ctx.updateState("FetchConfig");let i=await e.fetch(t,{headers:n});if(401==i.status){this.ctx.requestLogger.debug("GET %s: 401, about to retry with fresh access token",t),this.ctx.forgetCredential();const n={Authorization:await this.authorizationHeader()};this.ctx.updateState("FetchConfig"),i=await e.fetch(t,{headers:n})}if(200!=i.status){const e=await i.text();throw 429==i.status?this.ctx.updateState("NotAvailable",e):this.ctx.updateState("Error",e),new Error(`Unexpected status ${i.status}: ${e}`)}let o=await i.json();if(!o.base_url&&this.ctx.options.autoStart){const t=`${this.ctx.eyepopWebApiUrl()}/pops/${this.ctx.options.popId}/config?auto_start=true`;this.ctx.requestLogger.debug("pop was not running, trying to autostart with: %s",t);const n={Authorization:await this.authorizationHeader()};if(i=await e.fetch(t,{headers:n}),200!=i.status){this.ctx.updateState("Error");const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}o=await i.json()}const a=new URL(o.base_url,this.ctx.eyepopUrl());if(this._baseUrl=a.toString(),this._baseUrl){if(this._baseUrl=this._baseUrl.replace(/\/+$/,""),this._pipelineId=o.pipeline_id,this._popName=o.name,!this._pipelineId||!this._baseUrl)throw new Error("Pop not started");const t=`${this._baseUrl}/pipelines/${this._pipelineId}`,n={Authorization:await this.authorizationHeader()};let i=await e.fetch(t,{method:"GET",headers:n});if(i.status>200){const e=await i.text();throw new Error(`Unexpected status ${i.status}: ${e}`)}if(this._pipeline=await i.json(),this.ctx.options.stopJobs){const t={sourceType:"NONE"},n={Authorization:await this.authorizationHeader(),"Content-Type":"application/json"},i=`${this._baseUrl}/pipelines/${this._pipeline.id}/source?mode=preempt&processing=sync`;let o=await e.fetch(i,{method:"PATCH",headers:n,body:JSON.stringify(t)});if(o.status>=300){const e=await o.text();throw new Error(`Unexpected status ${o.status}: ${e}`)}}}}sessionReadyTimeoutMs(){const t=this.ctx.options.sessionReadyTimeoutSeconds;return"number"==typeof t&&Number.isFinite(t)&&t>0?1e3*t:e.WAIT_FOR_IS_READY}async getComputeSession(){const e=this.ctx.client();if(!e)throw new Error("endpoint not initialized");let t;try{t=await new oe({computeUrl:this.ctx.eyepopUrl(),httpClient:e,authorizationHeader:()=>this.computeAuthorizationHeader(),sessionUuid:this.ctx.options.sessionUuid,sessionName:this.ctx.options.sessionName,accountId:this.ctx.options.accountId,pipelineImage:this.ctx.options.pipelineImage,pipelineVersion:this.ctx.options.pipelineVersion,pop:this.ctx.options.pop,readyTimeoutMs:this.sessionReadyTimeoutMs(),logger:this.ctx.logger,requestLogger:this.ctx.requestLogger}).resolve()}catch(e){throw this.ctx.updateState("Error"),e}this._sessionAccessToken=t.accessToken,this._sessionAccessTokenValidUntil=t.accessTokenValidUntil,this._baseUrl=t.session.session_endpoint,this._accountId=t.session.account_uuid||void 0,this._pipeline=null,this._pipelineId=t.pipelineId,this.ctx.options.pop&&this.setTransientPipelinePop()}async startTransientPipeline(){const e=this.ctx.client(),t=this._baseUrl;if(null==e||null==t)throw new Error("endpoint not initialized");let n;if(this.ctx.options.pop)n=this.ctx.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"},o=`${t.replace(/\/+$/,"")}/pipelines`,a=await this.ctx.fetchWithRetry(async()=>{let t={Accept:"application/json","Content-Type":"application/json",Authorization:await this.authorizationHeader()};return e.fetch(o,{method:"POST",body:JSON.stringify(i),headers:t})});if(200!=a.status){const e=await a.text();throw new Error(`Unexpected status ${a.status} starting transient pipeline: ${e.slice(0,300)}`)}return(await a.json()).id}async ensureTransientPipelineStarted(){if("transient"==this.ctx.options.popId&&!this._pipelineId&&this.ctx.options.pop&&(this._baseUrl||await this.reconnect(),!this._pipelineId))if(this.ctx.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.ctx.client())throw new Error("endpoint not initialized");const t=this.ctx.options.pop,n=this._baseUrl,i=this._sessionAccessToken,o=this._sessionAccessTokenValidUntil;this._pipelineId&&(await this.deleteTransientPipeline(this._pipelineId),this._pipelineId=null),this._pipeline=null;try{this.ctx.options.pop=e,await this.getComputeSession()}catch(e){throw this.ctx.options.pop=t,this._pipeline=null,this._pipelineId=null,this._baseUrl=t?null:n,this._sessionAccessToken=i,this._sessionAccessTokenValidUntil=o,e}if(!this._pipelineId)throw new Error("Compute session did not provide a pipeline for the requested pop");this.setTransientPipelinePop()}async deleteTransientPipeline(e){const t=this.ctx.client();if(!t||!this._baseUrl)return;const n=`${this._baseUrl}/pipelines/${e}`,i={Authorization:await this.authorizationHeader()};let o=await t.fetch(n,{method:"DELETE",headers:i});if(o.status>=300){const e=await o.text();this.ctx.logger.info(`stopping pipeline failed, status ${o.status}: ${e}`)}}async authorizationHeader(){return this._sessionAccessToken?`Bearer ${this._sessionAccessToken}`:this.ctx.credentialHeader()}async computeAuthorizationHeader(){const e=b(this.ctx.options);if(void 0!==e?.isLocal)return"Implicit";const t=w(e)??x(e);return void 0!==t?`Bearer ${t}`:this.ctx.credentialHeader()}setTransientPipelinePop(){const e=this.ctx.options.pop;e&&this._pipelineId&&(this._pipeline={id:this._pipelineId,state:"idle",startTime:(new Date).toString(),pop:e})}};Ee.WAIT_FOR_IS_READY=6e4;var Pe,Ae,je=Ee,Ce=class extends Error{constructor(e,t,n){super(e),this.name="UpgradeError",this.status=t,this.retryAfter=n}};"document"in globalThis&&"implementation"in globalThis.document?(Pe=(e,t)=>new WebSocket(e,t),Ae=(e,t,n)=>{const i=new WebSocket(e,void 0===n?[t]:[t,`eyepop.bearer.${n}`]);return i.binaryType="arraybuffer",new Promise((t,n)=>{i.onopen=()=>t(i),i.onerror=()=>n(new Ce(`could not open ${e}`))})}):(Pe=(e,t)=>new(n(826).WebSocket)(e,t),Ae=(e,t,i)=>{const o=void 0===i?{}:{Authorization:`Bearer ${i}`},a=new(n(826).WebSocket)(e,[t],{headers:o,maxPayload:0});return a.binaryType="arraybuffer",new Promise((t,n)=>{a.once("open",()=>t(a)),a.once("unexpected-response",(e,t)=>{const i=Number.parseFloat(t.headers?.["retry-after"]);n(new Ce(`the pipeline API answered the upgrade ${t.statusCode}`,t.statusCode,Number.isFinite(i)?i:void 0)),t.resume(),a.terminate()}),a.once("error",t=>n(new Ce(`could not open ${e}: ${t.message}`)))})});var Ie="/api/v1/pipeline",Oe="eyepop.v1",Ue=256,Re=8388608,Le=new Set(["1008 credential_expired","1011 overloaded","1001 shutting_down"]),Ne=class extends Error{constructor(e,t,n=[]){super(t),this.name="PipelineConfigurationError",this.problem=e,this.options=n}},ze=class extends Error{constructor(e,t){super(`the pipeline API closed the socket: ${e??""} ${t}`.trim()),this.name="PipelineSocketClosedError",this.code=e,this.reason=t}},Me=class extends Error{constructor(e,t=""){super(`the pipeline API refused the command: ${e} ${t}`.trim()),this.name="PipelineCommandError",this.error=e,this.detail=t}},qe=class extends Error{constructor(e,t,n=""){super(`Error in source ${e}: ${t} ${n}`.trim()),this.name="PipelineSourceError",this.sourceId=e,this.reason=t,this.detail=n}},De=Symbol("cancelled"),We=class{constructor(){this._items=[],this._waiter=null}push(e){const t=this._waiter;t?(this._waiter=null,t(e)):this._items.push(e)}next(){const e=this._items.shift();return void 0!==e?Promise.resolve(e):new Promise(e=>this._waiter=e)}},$e=class extends Error{},Je=class{constructor(){this._credit=0,this._ended=!1,this._waiter=null}grant(e){this._credit+=e,this.wake()}end(){this._ended=!0,this.wake()}async take(e){for(;this._credit<=0&&!this._ended;)await new Promise(e=>this._waiter=e);if(this._ended)throw new $e;const t=Math.min(e,this._credit);return this._credit-=t,t}wake(){const e=this._waiter;this._waiter=null,e?.()}},Fe=class{constructor(e){this.id=e,this.inbox=new We,this.uploads=new Map}close(e){this.uploads.forEach(e=>e.end()),this.inbox.push(e)}},He=class{constructor(e){this.ws=e,this.sources=new Map,this.commands=new Map,this._closed=!1,this.closed=new Promise(e=>this._markClosed=e)}get open(){return!this._closed&&1===this.ws.readyState}markClosed(){this._closed=!0,this._markClosed()}sendJson(e){this.ws.send(JSON.stringify(e))}sendBytes(e){this.ws.send(e)}},Ke=class{constructor(e,t,n,i,o=void 0){this.source=e,this.media=t,this.live=n,this.params=i,this.mediaStream=o,this._results=new We,this._consumed=!1,this._cancelled=!1,this.openSource=null,this.stopOnPipeline=null}get cancelled(){return this._cancelled}command(e){const t={type:"setSource",id:e,...this.source};return void 0!==this.params.componentParams&&(t.params=this.params.componentParams),void 0!==this.params.roi&&(t.roi=this.params.roi),void 0!==this.params.camera&&(t.camera=this.params.camera),void 0!==this.params.fps&&(t.fps=this.params.fps),t}predicted(e){this._cancelled||this._results.push(e)}finish(e=null){null!==e&&this._results.push(e),this._results.push(null)}cancel(){this._cancelled||(this._cancelled=!0,this._results.push(null),this.openSource?.inbox.push(De),this.stopOnPipeline?.())}async*[Symbol.asyncIterator](){if(this._consumed)throw new Error("Cannot iterate over a consumed stream");for(this._consumed=!0;;){const e=await this._results.next();if(null===e)return;if(e instanceof Error)throw e;yield e}}},Ve=class{constructor(e){this.ctx=e,this._pipelineApiUrl=null,this._socket=null,this._connecting=null,this._sendChain=Promise.resolve(),this._disconnecting=!1,this._nextId=0,this._warned=new Set,this._heartbeat=null,this._reconnects=0,this._currentPop=e.options.pop??null}async reconnect(){this._disconnecting=!1,await this.inOrder(()=>this.ensureSocket()),this.ctx.updateState()}async disconnect(e){await e(),this._disconnecting=!0,null!==this._heartbeat&&(clearInterval(this._heartbeat),this._heartbeat=null);const t=this._socket;this._socket=null,null!==t&&(t.ws.close(1e3),await t.closed)}onStatus(e){}popName(){return null}async authorizationHeader(){return this.ctx.credentialHeader()}inOrder(e){const t=this._sendChain.then(e);return this._sendChain=t.catch(()=>{}),t}async ensureSocket(){return null!==this._socket&&this._socket.open?this._socket:(null===this._connecting&&(this._connecting=this.openSocket().finally(()=>this._connecting=null)),await this._connecting)}async openSocket(){if(null===this.ctx.client())throw new ze(void 0,"the endpoint is not connected");const e=await this.upgrade(await this.socketUrl()),t=new He(e);if(e.onmessage=e=>{if("string"==typeof e.data)try{this.dispatch(t,JSON.parse(e.data))}catch(e){this.ctx.logger.warn("unreadable message from the pipeline API: %s",e)}},e.onerror=()=>{},e.onclose=e=>this.closed(t,e.code,e.reason),this._socket=t,this.startHeartbeat(e),null!==this._currentPop)try{await this.setPopOn(t,this._currentPop)}catch(t){throw this._socket=null,e.close(1e3),t}return t}startHeartbeat(e){null!==this._heartbeat&&clearInterval(this._heartbeat);const t=e.ping;"function"==typeof t&&(this._heartbeat=setInterval(()=>{1===e.readyState&&t.call(e)},2e4),this._heartbeat.unref?.())}async socketUrl(){if(null===this._pipelineApiUrl){const e=this.ctx.options.isLocalMode?this.ctx.eyepopUrl():new URL(await this.configuredPipelineApiUrl(),this.ctx.eyepopUrl()+"/").toString();this._pipelineApiUrl=function(e){const t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new Ne("insecure_url",`the pipeline API url ${e} must be an http or https url`);if("http:"===t.protocol&&("localhost"!==(n=t.hostname)&&"[::1]"!==n&&"::1"!==n&&!/^127\.\d+\.\d+\.\d+$/.test(n)))throw new Ne("insecure_url",`the pipeline API url ${e} must use https unless its host is a loopback address`);var n;return e.replace(/\/+$/,"")}(e)}return"ws"+this._pipelineApiUrl.slice(4)+Ie}async configuredPipelineApiUrl(){const e=this.ctx.client();if(null===e)throw new Error("endpoint not connected");let t=`${this.ctx.eyepopUrl()}/v1/configs`;const n=this.ctx.options.accountId;n&&(t+=`?account_uuid=${encodeURIComponent(n)}`);const i=await this.ctx.fetchWithRetry(async()=>e.fetch(t,{headers:{Authorization:await this.ctx.credentialHeader()}}));if(!i.ok)throw new Error(`Unexpected status ${i.status} for GET ${t}: ${await i.text()}`);const o=await i.json(),a=o?.pipeline_api_url;if(!a)throw new Ne("no_pipeline_api_url",`${t} has no pipeline_api_url: this compute API serves no pipeline API`);return a}async token(){if(void 0===b(this.ctx.options)?.isLocal)return(await this.ctx.credentialHeader()).replace(/^Bearer /,"")}async upgrade(e){const t=Date.now()+3e4;let n=!1;for(;;)try{return this.ctx.requestLogger.debug("before upgrade %s",e),await Ae(e,Oe,await this.token())}catch(e){if(!(e instanceof Ce))throw e;if(401===e.status&&!n){this.ctx.requestLogger.debug("the pipeline API answered 401, authenticating again"),n=!0,this.ctx.forgetCredential();continue}const i=503===e.status&&void 0!==e.retryAfter?1e3*Math.max(e.retryAfter,1):void 0;if(void 0===i||Date.now()+i>t)throw e;this.ctx.requestLogger.info("the pipeline API answered 503, retrying in %d ms",i),await new Promise(e=>setTimeout(e,i))}}closed(e,t,n){e.markClosed(),this._socket===e&&(this._socket=null);const i=new ze(t,n);if(e.sources.forEach(e=>e.close(i)),e.commands.forEach(e=>e.reject(i)),e.commands.clear(),!this._disconnecting&&(this.ctx.requestLogger.debug("the pipeline API closed the socket: %s %s",t,n),Le.has(`${t} ${n}`))){"credential_expired"===n&&this.ctx.forgetCredential();const e=0===this._reconnects?0:Math.min(1e3*2**(this._reconnects-1),3e4);this._reconnects+=1,new Promise(t=>setTimeout(t,e)).then(()=>this._disconnecting?void 0:this.inOrder(()=>this.ensureSocket())).catch(e=>{this.ctx.requestLogger.info("could not reopen the pipeline API socket: %s",e)})}}dispatch(e,t){const n=t.type,i=t.id,o="string"==typeof i?e.sources.get(i):void 0;if("send"===n||"credit"===n){const e=o?.uploads.get(t.member??null);return void e?.grant(Number("send"===n?t.credit:t.bytes))}const a="string"==typeof i?e.commands.get(i):void 0;if(void 0!==a)return e.commands.delete(i),void("error"===n?a.reject(new Me(t.error??"",t.message??"")):a.resolve(t));void 0!==o?("start"===n&&(this._reconnects=0),"end"===n&&o.uploads.forEach(e=>e.end()),o.inbox.push(t)):"error"===n&&(void 0===i?this.ctx.logger.warn("the pipeline API refused a message: %s %s",t.error,t.message):this.ctx.requestLogger.debug("the pipeline API refused a command for %s: %s %s",i,t.error,t.message))}newId(e){return this._nextId+=1,`${e}-${this._nextId}`}command(e,t){const n=this.newId(t.type);return new Promise((i,o)=>{e.commands.set(n,{resolve:i,reject:o}),e.sendJson({...t,id:n})})}pop(){return this._currentPop}async changePop(e){null!==this.ctx.client()?await this.inOrder(async()=>{if(null!==this._socket&&this._socket.open)return await this.setPopOn(this._socket,e),void(this._currentPop=e);const t=this._currentPop;this._currentPop=e;try{await this.ensureSocket()}catch(e){throw this._currentPop=t,e}}):this._currentPop=e}async setPopOn(e,t){await this.command(e,{type:"setPop",pop:t})}async submit(e){if(null===this.ctx.client())throw new Error("endpoint not connected, use connect()");const t="source"===e.kind?e.source:void 0;this.notSent({motionDetect:e.params.motionDetect,videoMode:t?.videoMode,rtspForceNonCompliantUrl:e.params.rtspForceNonCompliantUrl});const n=await this.jobOf(e),i=this.ctx.limit();return await i.acquire(),this.ctx.updateState(),this.run(n).then(()=>n.finish(),e=>n.finish(e instanceof Error?e:new Error(String(e)))).finally(()=>this.ctx.jobDone()),n}notSent(e){for(const[t,n]of Object.entries(e)){if(void 0===n||this._warned.has(t))continue;this._warned.add(t);const e="rtspForceNonCompliantUrl"===t?"":" (AWSU-317)";this.ctx.logger.warn(`${t} is not sent to the pipeline API and has no effect in pipeline mode${e}`)}}async jobOf(e){switch(e.kind){case"source":return await this.sourceJob(e.source,e.params);case"uploadGroup":{const t=await Promise.all(e.paths.map(e=>this.pathMedia({path:e})));return new Ke(Xe(t),t,!1,e.params)}case"uploadStreamGroup":{const t=e.streams.map((t,n)=>Ze(t,e.mimeTypes?.[n]??"application/octet-stream",void 0));return new Ke(Xe(t),t,!1,e.params)}case"loadFromGroup":return new Ke({group:e.urls.map(e=>({url:e}))},[],!1,e.params)}}async sourceJob(e,t){if(void 0!==e.file){const n=e.file,i=Ze(n,n.type||"application/octet-stream",n.size);return new Ke({upload:{contentType:i.contentType}},[i],!1,t)}if(void 0!==e.stream){const n=e,i=Ze(n.stream,n.mimeType,n.size??Ge(n.stream));return new Ke({upload:{contentType:i.contentType}},[i],!1,t)}if(void 0!==e.path){const n=await this.pathMedia(e);return new Ke({upload:{contentType:n.contentType}},[n],!1,t)}if(void 0!==e.url){const n=e.url;return n.startsWith("file://")?await this.sourceJob({path:n.substring(7)},t):new Ke({url:n},[],/^(rtsp|rtmp):\/\//.test(n),t)}if(void 0!==e.assetUuid)return new Ke({assetUuid:e.assetUuid},[],!1,t);if(void 0!==e.mediaStream){const n=this.newId("whip");return new Ke({whip:{ingressId:n}},[],!0,t,e.mediaStream)}throw new Error("unknown source type")}async pathMedia(e){const t=this.ctx.options,n=async()=>t.platformSupport?.resolvePath?await t.platformSupport.resolvePath(e,this.ctx.logger):await ye(e,this.ctx.logger),i=await n();let o=!0;return{contentType:i.mimeType,size:i.size,open:async()=>o?(o=!1,i.stream):(await n()).stream}}async run(e){let t=!1;for(;;){const n=await this.inOrder(()=>this.setSource(e));if(null===n)return;const{socket:i,source:o}=n,a=o.uploads.size>0?this.upload(i,o,e):Promise.resolve();let s,r=null;try{s=await this.follow(e,o,()=>{if(void 0!==e.mediaStream){const t=t=>{e.stopOnPipeline?.(),o.inbox.push(t instanceof Error?t:new Error(String(t)))};r=new Be(e.mediaStream,e.source.whip.ingressId,e=>this.command(i,e),t,this.ctx.requestLogger),r.start().catch(t)}})}finally{e.openSource=null,e.stopOnPipeline=null,i.sources.delete(o.id),o.uploads.forEach(e=>e.end()),await a,await(r?.close())}if(!s)return;if(t||!e.live)throw new Me("overloaded","the pipeline API has no capacity for another live source");t=!0,await i.closed}}async setSource(e){if(e.cancelled)return null;const t=await async function(e){if(0===e.media.length||e.live||e.media.some(e=>void 0===e.size))return null;if(e.media.reduce((e,t)=>e+(t.size??0),0)>Re)return null;const t=[];for(const n of e.media)t.push(await Qe(await n.open()));return t}(e),n=await this.ensureSocket(),i=new Fe(this.newId("source"));null===t&&Ye(e).forEach(e=>i.uploads.set(e,new Je)),n.sources.set(i.id,i),e.openSource=i,e.stopOnPipeline=()=>{n.open&&n.sendJson({type:"stopSource",id:i.id})};const o=e.command(i.id);return null===t?n.sendJson(o):n.sendBytes(function(e,t){if(void 0!==e.group){let n=0;e={...e,group:e.group.map(e=>void 0!==e.upload?{upload:{...e.upload,bytes:t[n++].length}}:e)}}const n=(new TextEncoder).encode(JSON.stringify(e)),i=new Uint8Array(5);return i[0]=2,new DataView(i.buffer).setUint32(1,n.length,!1),et([i,n,...t])}(o,t)),{socket:n,source:i}}async follow(e,t,n){for(;;){if(e.cancelled)return!1;const i=await t.inbox.next();if(i===De)return!1;if(i instanceof Error)throw i;switch(i.type){case"result":n();break;case"prediction":e.predicted(i.prediction);break;case"end":if("eos"===i.reason)return!1;throw new qe(t.id,i.reason??"",i.message??"");case"error":if("overloaded"===i.error)return!0;throw new Me(i.error??"",i.message??"");case"dropped":this.ctx.requestLogger.debug("the pipeline API dropped %s predictions of a live source",i.count)}}}async upload(e,t,n){const i=Ye(n);try{for(let o=0;o<i.length;o++){const a=i[o],s=t.uploads.get(a);for await(let t of tt(await n.media[o].open()))for(;t.length>0;){const n=await s.take(Math.min(t.length,65536)),i=new Uint8Array(n+1);i[0]=1,i.set(t.subarray(0,n),1),e.sendBytes(i),t=t.subarray(n)}e.sendJson(null===a?{type:"uploaded",id:t.id}:{type:"uploaded",id:t.id,member:a})}}catch(n){n instanceof $e||e.open&&t.inbox.push(n instanceof Error?n:new Error(String(n)))}}async session(){const e=await this.token(),t=void 0===e?Number.MAX_VALUE:Math.min((await this.ctx.credentialSession()).validUntil,Number.MAX_VALUE);return{eyepopUrl:this.ctx.eyepopUrl(),accessToken:e??"",validUntil:t,popId:"transient",accountId:this.ctx.options.accountId,baseUrl:this._pipelineApiUrl??void 0,pipelineId:void 0,isPipelineMode:!0,authenticationHeaders:()=>void 0===e?{}:{Authorization:`Bearer ${e}`}}}},Be=class{constructor(e,t,n,i,o){this._stream=e,this._ingressId=t,this._command=n,this._fail=i,this._logger=o,this._pc=null,this._answered=!1,this._queued=[],this._offerData=null}async start(){const e=(await this._command({type:"whipIceServers",ingressId:this._ingressId})).iceServers??[];this._logger.debug("whip %s: ice servers %j",this._ingressId,e.map(e=>e.split(";")[0]));const t=new RTCPeerConnection({iceServers:fe.linkToIceServers(e.join(", ")||null)});this._pc=t,t.oniceconnectionstatechange=()=>{this._logger.debug("whip %s: ice connection %s",this._ingressId,t.iceConnectionState),"failed"===t.iceConnectionState&&this._pc===t&&this._fail(new Error(`the WebRTC connection of whip ingress ${this._ingressId} failed: no candidate pair connected, so the pipeline API is likely reachable through no STUN or TURN server (ice servers: ${e.length})`))},t.onicecandidate=e=>{null!==e.candidate&&this.candidate(e.candidate).catch(e=>this._logger.debug("whipIce failed: %s",e))},this._stream.getTracks().forEach(e=>t.addTrack(e,this._stream));const n=await t.createOffer();if(!n.sdp)throw new Error("the local offer has no sdp");this._offerData=fe.parseOffer(n.sdp),await t.setLocalDescription(n);const i=await this._command({type:"whipOffer",ingressId:this._ingressId,sdp:n.sdp});await t.setRemoteDescription({type:"answer",sdp:i.sdp}),this._answered=!0;const o=this._queued;this._queued=[],o.length>0&&await this.sendCandidates(o)}async candidate(e){this._answered?await this.sendCandidates([e]):this._queued.push(e)}async sendCandidates(e){null!==this._offerData&&await this._command({type:"whipIce",ingressId:this._ingressId,fragment:fe.generateSdpFragment(this._offerData,e)})}async close(){this._stream.getTracks().forEach(e=>e.stop());const e=this._pc;this._pc=null,e?.close()}};function Ge(e){return"undefined"!=typeof Blob&&e instanceof Blob?e.size:ArrayBuffer.isView(e)||e instanceof ArrayBuffer?e.byteLength:void 0}function Ze(e,t,n){return{open:async()=>e,contentType:t,size:n??Ge(e)}}function Xe(e){return{group:e.map(e=>({upload:{contentType:e.contentType}}))}}function Ye(e){return void 0!==e.source.upload?[null]:(e.source.group??[]).flatMap((e,t)=>void 0!==e.upload?[t]:[])}async function Qe(e){const t=[];for await(const n of tt(e))t.push(n);return et(t)}function et(e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let n=0;for(const i of e)t.set(i,n),n+=i.length;return t}async function*tt(e){if("undefined"!=typeof Blob&&e instanceof Blob)yield*tt(e.stream());else if(e instanceof ArrayBuffer)yield new Uint8Array(e);else if(ArrayBuffer.isView(e))yield new Uint8Array(e.buffer,e.byteOffset,e.byteLength);else{const t=e.getReader();try{for(;;){const{value:e,done:n}=await t.read();if(n)return;void 0!==e&&e.length>0&&(yield e)}}finally{t.releaseLock()}}}var nt=class extends j{constructor(e){if(e.isPipelineMode&&(e={...e,jobQueueLength:e.jobQueueLength||Ue}).jobQueueLength>Ue)throw new Ne("job_queue_length",`jobQueueLength ${e.jobQueueLength} exceeds ${Ue}, the open sources a pipeline API socket takes`);super(e);const t={options:e,logger:this._logger,requestLogger:this._requestLogger,client:()=>this._client,limit:()=>this._limit,jobDone:()=>{this._limit.release(),this.updateState()},updateState:(e,t)=>this.updateState(e,t),eyepopUrl:()=>this.eyepopUrl(),eyepopWebApiUrl:()=>this.eyepopWebApiUrl(),credentialHeader:()=>super.authorizationHeader(),forgetCredential:()=>this.statusHandler401(401),fetchWithRetry:(e,t)=>this.fetchWithRetry(e,t),credentialSession:()=>super.session()};this._backend=e.isPipelineMode?new Ve(t):new je(t),this.setStatusRetryHandlers(new Map([[404,e=>this._backend.onStatus(e)]]))}options(){return this._options}backend(){return this._backend}async disconnect(e=!0){await this._backend.disconnect(()=>super.disconnect(e))}async session(){return await this._backend.session()}popName(){return this._backend.popName()}pop(){return this._backend.pop()}async changePop(e){J(e),await this._backend.changePop(e)}popId(){return this.options().popId||null}async process(e,t){if(void 0!==e.source){const t=e;return this.validateProcessParams(t),await this.submit({kind:"source",source:t.source,params:t})}return await this.submit({kind:"source",source:e,params:{componentParams:t}})}validateProcessParams(e){void 0!==e.camera&&O(e.camera)}async uploadGroup(e,t={}){if(0===e.length)throw new Error("upload group requires at least one path");return this.validateProcessParams(t),await this.submit({kind:"uploadGroup",paths:e,params:t})}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");return this.validateProcessParams(n),await this.submit({kind:"uploadStreamGroup",streams:e,mimeTypes:t,params:n})}async loadFromGroup(e,t={}){if(0===e.length)throw new Error("load from group requires at least one url");return this.validateProcessParams(t),await this.submit({kind:"loadFromGroup",urls:e,params:t})}async submit(e){return await this._backend.submit(e)}async reconnect(){return await this._backend.reconnect(),this}async authorizationHeader(){return await this._backend.authorizationHeader()}},it=h(n(48)),ot=(e=>(e.dataset="dataset",e.vlm="vlm",e))(ot||{});function at(e,t){switch(t){case"dataset":return e.datasetApiUrl??"";case"vlm":return e.vlmApiUrl??"";default:throw new Error(`unsupported type ${t}`)}}var st=(e=>(e.error="error",e.requested="requested",e.in_progress="in_progress",e.completed="completed",e))(st||{}),rt=(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))(rt||{}),ct=(e=>(e.ground_truth="ground_truth",e.prediction="prediction",e.auto="auto",e))(ct||{}),lt=(e=>(e.approved="approved",e.rejected="rejected",e.unknown="unknown",e))(lt||{}),pt=(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))(pt||{}),ut=(e=>(e.all="all",e.user_reviewed="user_reviewed",e.user_approved="user_approved",e.ground_truth="ground_truth",e))(ut||{}),dt=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e))(dt||{}),ht=(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))(ht||{}),mt=(e=>(e.RECTANGLE="rectangle",e.CONTOUR="contour",e))(mt||{}),ft=(e=>(e.epdet_b1="epdet_b1",e.imported="imported",e.vlm_ability="vlm_ability",e))(ft||{}),vt=(e=>(e.object_detection="object_detection",e.image_classification="image_classification",e.keypoint_detection="keypoint_detection",e))(vt||{}),gt=(e=>(e.error="error",e.draft="draft",e.requested="requested",e.in_progress="in_progress",e.available="available",e.published="published",e))(gt||{}),yt=(e=>(e.in_progress="in_progress",e.finished="finished",e.error="error",e))(yt||{}),bt=(e=>(e.eyepop="eyepop",e.qc_ai_hub="qc_ai_hub",e))(bt||{}),wt=(e=>(e.eyepop_bundle="eyepop_bundle",e.weights_file="weights_file",e))(wt||{}),xt=(e=>(e.waiting="waiting",e.scheduling="scheduling",e.preparing="preparing",e.training="training",e.exporting="exporting",e))(xt||{}),_t=(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))(_t||{}),kt=(e=>(e.unknown="Unknown",e.pending="Pending",e.running="Running",e.succeeded="Succeeded",e.failed="Failed",e.error="Error",e))(kt||{}),St=(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))(St||{}),Tt=(e=>(e.float32="float32",e.float16="float16",e.int32="int32",e.int8="int8",e.uint8="uint8",e))(Tt||{}),Et=(e=>(e.gcs="gcs",e.s3="s3",e.https_signed="https_signed",e))(Et||{}),Pt=(e=>(e.success="success",e.failed="failed",e))(Pt||{}),At=(e=>(e.classification="classification",e))(At||{}),jt=(e=>(e.image="image",e.video="video",e))(jt||{}),Ct=(e=>(e.in_progress="in_progress",e.draft="draft",e.published="published",e))(Ct||{}),It=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 o=i.predictions,a=i.run_info;if(o){this._runInfo=a,t(o);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")}},Ot=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")}},Ut=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 Rt(e,t){if(null!==t)return t}var Lt=class extends j{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 o=await i.json();const a=new URL(o.dataset_api_url,this.eyepopUrl());this.datasetApiUrl=a.toString();const s=new URL(o.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,it.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,it.default)(e,"events");return this._requestLogger.debug("about to connect ws to: %s",t),new Promise((e,n)=>{let i=!1;const o=()=>{i=!0,e()},a=e=>{i=!0,n(e)},s=Pe(t);if(!s)return o();this._ws=s,s.onopen=()=>{this.authorizationHeader().then(e=>{if(this._ws!==s)return this.close_ws(s,"unsubscribe"),void o();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,o()}).catch(e=>{this.close_ws(s,"authorization failed",1011),a(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:o}=e;this._requestLogger.debug("ws closed: %d %s",n,o),i||a(new Ut(t,new Error(`closed before the connection was established: ${n} ${o}`))),this._ws===s&&(this._ws=null,this.schedule_ws_reconnect())},s.onerror=e=>{const n=new Ut(t,e);return this._logger.error({err:n},"dataset event WebSocket connection failed"),a(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 o=this._client;if(!o)return Promise.reject("endpoint not connected");let a=await this.fetchWithRetry(async()=>{const a=await this.session(),s=at(a,i),r={...n?{}:{Authorization:`Bearer ${a.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 o.fetch((0,it.default)(s??"",e),c)});if(204===a.status)return null;const s=a.headers.get("Content-Type");if(this._requestLogger.debug("Response - "+a.status+" "+a.statusText),!a.ok)throw s&&(s.toLowerCase().startsWith("application/json")||s.toLowerCase().startsWith("text/"))?new Error(`Request failed with ${a.status} ${a.statusText}: ${await a.text()}`):new Error(`Request failed with ${a.status} ${a.statusText}`);return s&&s.toLowerCase().startsWith("application/json")?await a.json():await a.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 o=n?`&dataset_version=${n}`:"",a=void 0!==i?`&modifiable_version_only=${i}`:"";return this.request(`/datasets/${e}?include_stats=${t}${o}${a}`,{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}`:"",o=n?`&max_assets=${n}`:"";return this.request(`/datasets/${e}/auto_annotate?${i}${o}`,{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,o){const a=o?`dataset_version=${o}&`:"";return this.request(`/datasets/${t}/auto_annotates?auto_annotate=${n}&source=${encodeURIComponent(i)}&${a}`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}async listDatasetAutoAnnotates(e,t,n,i){const o=i?`dataset_version=${i}&`:"",a=t?`auto_annotate=${t}&`:"",s=n?`source=${n}&`:"";return this.request(`/datasets/${e}/auto_annotates?${o}&${a}&${s}`,{method:"GET"})}async uploadAsset(e,t,n,i=void 0){const o=t?`&dataset_version=${t}`:"";let a;return a=i?`/assets?dataset_uuid=${e}${o}&external_id=${i}`:`/assets?dataset_uuid=${e}${o}`,this.request(a,{method:"POST",body:n,headers:{"Content-Type":n.type||"application/octet-stream"}})}async importAsset(e,t,n,i=void 0){const o=t?`&dataset_version=${t}`:"";let a;return a=i?`/assets/imports?dataset_uuid=${e}${o}&external_id=${i}`:`/assets/imports?dataset_uuid=${e}${o}`,this.request(a,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async listAssets(e,t,n=!1,i,o,a,s,r,c){const l=new URLSearchParams;l.set("dataset_uuid",e),null!=t&&l.set("dataset_version",String(t)),n&&l.set("include_annotations","true"),null!=o&&l.set("inclusion_mode",o),null!=a&&l.set("annotation_inclusion_mode",a);for(const e of s??[])l.append("include_partition",e);for(const e of r??[])l.append("include_auto_annotate",e);for(const e of c??[])l.append("include_source",e);return null!=i&&l.set("top_k",String(i)),this.request(`/assets?${l.toString()}`,{method:"GET"})}async getAsset(e,t,n,i=!1,o){const a=n?`&dataset_version=${n}`:"",s=i?"&include_annotations=true":"",r=t?`&dataset_uuid=${t}`:"",c=o?`&top_k=${o}`:"";return this.request(`/assets/${e}?${r}${a}${s}${c}`,{method:"GET"})}async deleteAsset(e,t,n){const i=n?`&dataset_version=${n}`:"",o=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}?${o}${i}`,{method:"DELETE"})}async resurrectAsset(e,t,n,i){const o=i?`&into_dataset_version=${i}`:"";return this.request(`/assets/${e}/resurrect?dataset_uuid=${t}&from_dataset_version=${n}${o}`,{method:"POST"})}async updateAssetGroundTruth(e,t,n,i){const o=n?`&dataset_version=${n}`:"",a=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${a}${o}`,{method:"PATCH",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async deleteAssetGroundTruth(e,t,n){const i=n?`&dataset_version=${n}`:"",o=t?`&dataset_uuid=${t}`:"";return this.request(`/assets/${e}/ground_truth?${o}${i}`,{method:"DELETE"})}async updateAutoAnnotationStatus(e,t,n,i){if(!["approved","rejected","unknown"].includes(n))throw new Error("Invalid status");const o=i?`?approved_threshold=${i}`:"";return this.request(`/assets/${e}/auto_annotations/${t}/user_review/${n}${o}`,{method:"PATCH"})}async addAssetAnnotation(e,t,n,i,o,a,s,r){const c=t?`dataset_uuid=${t}&`:"",l=n?`&dataset_version=${n}&`:"",p=o?`&auto_annotate=${o}&`:"",u=a?`&source=${encodeURIComponent(a)}&`:"",d=s?`&user_review=${s}&`:"",h=void 0!==r?`&approved_threshold=${r}&`:"";return this.request(`/assets/${e}/annotations?${c}${l}${p}${u}${d}${h}`,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})}async updateAssetAnnotationApproval(e,t,n,i,o,a,s){const r=t?`dataset_uuid=${t}&`:"",c=n?`&dataset_version=${n}&`:"",l=i?`&auto_annotate=${i}&`:"",p=o?`&source=${encodeURIComponent(o)}&`:"",u=a?`&user_review=${a}&`:"",d=s?`&approved_threshold=${s}&`:"";return this.request(`/assets/${e}/annotations?${r}${c}${l}${p}${u}${d}`,{method:"PATCH"})}async downloadAsset(e,t,n,i="original",o,a,s){const r=n?`&dataset_version=${n}`:"",c=t?`&dataset_uuid=${t}`:"",l=o?`&start_timestamp=${o}`:"",p=a?`&end_timestamp=${a}`:"",u=s?`&url_type=${s}`:"";return this.request(`/assets/${e}/download?transcode_mode=${i}${c}${r}${l}${p}${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,o){const a=i?`&dataset_version=${i}`:"",s=n?`&dataset_uuid=${n}`:"";return this.request(`/assets/${e}/rois?${s}${a}`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})}async deleteAssetRoi(e,t,n,i){const o=i?`&dataset_version=${i}`:"",a=n?`&dataset_uuid=${n}`:"";return this.request(`/assets/${e}/rois/${encodeURIComponent(t)}?${a}${o}`,{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 o=i?`artifact_type=${i}&`:"",a=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}&${o}${a}${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 o=[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}${o?`&${o}`:""}`,{method:"GET"})}async inferAsset(e,t,n,i,o,a,s){const r=`ai.eyepop://data/assets/${e}?${o?`transcode_mode=${o}&`:""}${n?`dataset_uuid=${n}&`:""}${i?`dataset_version=${i}&`:""}${a?`start_timestamp=${a}&`:""}${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 It(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 Ot(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,Rt),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,Rt),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,Rt),headers:{"Content-Type":"application/json"}}):void 0!==n?this.request(`/vlm_abilities/${e}/refine_task`,{method:"POST",body:JSON.stringify(n,Rt),headers:{"Content-Type":"application/json"}}):Promise.reject("refine vlm ability requires auto_prompt or auto_config parameter")}async cloneVlmAbility(e,t,n,i){const o=new URLSearchParams;return t?o.set("account_uuid",t):this._accountId&&o.set("account_uuid",this._accountId),n&&o.set("name",n),i&&o.set("default_alias_name",i),this.request(`/vlm_abilities/${e}/clone?${o.toString()}`,{method:"POST"})}async publishVlmAbility(e,t,n){const i=t?`alias_name=${encodeURIComponent(t)}&`:"",o=n?`tag_name=${encodeURIComponent(n)}&`:"";return this.request(`/vlm_abilities/${e}/publish?${i}${o}`,{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],zt=class{constructor(e,t,n){this.width=e,this.height=t,this.values=n}at(e,t,n,i){let o=e,a=t;n&&i&&(o=e*this.width/n,a=t*this.height/i);const s=Math.min(Math.max(Math.floor(o),0),this.width-1),r=Math.min(Math.max(Math.floor(a),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 Mt(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!==o){const t=o.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 zt(e.width,e.height,i)}var qt=1===new Uint8Array(new Uint16Array([1]).buffer)[0],Dt=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],o=this.points[n+1],a=this.points[n+2];if(!(Number.isNaN(i)||Number.isNaN(o)||Number.isNaN(a)))return{x:i,y:o,z:a}}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],o=this.points[t+2];Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(o)||e.push({x:n,y:i,z:o})}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 o=this.points[i],a=this.points[i+1],s=this.points[i+2];Number.isNaN(o)||Number.isNaN(a)||Number.isNaN(s)||(e=!0,t.x=Math.min(t.x,o),t.y=Math.min(t.y,a),t.z=Math.min(t.z,s),n.x=Math.max(n.x,o),n.y=Math.max(n.y,a),n.z=Math.max(n.z,s))}return e?{min:t,max:n}:void 0}};function Wt(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 a=function(e){if(void 0!==o){const t=o.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(a.byteLength!==4*s)throw new Error(`'world' holds ${a.byteLength} bytes, expected ${4*s} for ${e}x${t} xyz float32`);let r;if(qt){const e=new Uint8Array(a);r=new Float32Array(e.buffer,0,s)}else{const e=new DataView(a.buffer,a.byteOffset,a.byteLength);r=new Float32Array(s);for(let t=0;t<s;t++)r[t]=e.getFloat32(4*t,!0)}return new Dt(e,t,r,i)}function $t(e,t){if(void 0!==e&&void 0!==e.world)return Wt(e.width,e.height,e.world,t)}function Jt(e){if(void 0!==e&&void 0!==e.mask)return $t(e.mask,{x:e.x,y:e.y,width:e.width,height:e.height})}function Ft(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 Wt(e.width,e.height,e.world,i)}function Ht(e){const t=[];if(void 0===e)return t;const n=e=>{for(const i of e??[]){const e=Jt(i);void 0!==e&&t.push(e),n(i.objects)}};n(e.objects);const i=Ft(e.depth,e.source_width,e.source_height);return void 0!==i&&t.push(i),t}var Kt,Vt=class extends fe{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:fe.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())})}},Bt=e=>{if("undefined"!=typeof process)return process.env?.[e]??void 0},Gt=!1,Zt=()=>{const e=Bt("EYEPOP_ACCOUNT_UUID");if(void 0!==e)return e;const t=Bt("EYEPOP_ACCOUNT_ID");return void 0===t||Gt||(Gt=!0,console.warn("EYEPOP_ACCOUNT_ID is deprecated, use EYEPOP_ACCOUNT_UUID instead")),t},Xt=e=>{if(void 0===e)return!1;const t=e.toLowerCase();return"true"==t||"yes"==t};(e=>{const t=Bt("EYEPOP_API_KEY"),n=t?{apiKey:t}:void 0;function i(e={}){const t={...e};if(void 0!==t.pop&&J(t.pop),void 0===t.isLocalMode&&(t.isLocalMode=Xt(Bt("EYEPOP_LOCAL_MODE"))),void 0===t.isPipelineMode){const e=b(t)?.session;t.isPipelineMode=e?.isPipelineMode??Xt(Bt("EYEPOP_PIPELINE_MODE"))}if(t.isPipelineMode)return function(e){const t=e.popId??Bt("EYEPOP_POP_ID"),n={popId:"transient"===t?void 0:t,sessionUuid:e.sessionUuid??Bt("EYEPOP_SESSION_UUID"),sessionName:e.sessionName,pipelineImage:e.pipelineImage,pipelineVersion:e.pipelineVersion},i=Object.entries(n).filter(([,e])=>e).map(([e])=>e);if(i.length>0)throw new Ne("session_options",`pipeline mode runs no worker session; it takes no ${i.join(", ")}`,i);if(e.isLocalMode&&!e.eyepopUrl&&(e.eyepopUrl=Bt("EYEPOP_URL")||"http://127.0.0.1:9002"),e.jobQueueLength||(e.jobQueueLength=Ue),o(e),void 0===b(e)){if(!e.isLocalMode)throw new Error("apiKey/accessToken/session/oAuth2 option or EYEPOP_API_KEY environment variable is required");e.auth={isLocal:!0}}return void 0===e.accountId&&(e.accountId=b(e)?.session?.accountId??Zt()),new nt(e)}(t);if(t.isLocalMode&&(t.eyepopUrl="http://127.0.0.1:8080"),o(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=Bt("EYEPOP_SESSION_UUID")),void 0===t.sessionName&&(t.sessionName=Bt("EYEPOP_SESSION_NAME")),void 0===t.accountId&&(t.accountId=Zt()),void 0===t.pipelineImage&&(t.pipelineImage=Bt("EYEPOP_PIPELINE_IMAGE")),void 0===t.pipelineVersion&&(t.pipelineVersion=Bt("EYEPOP_PIPELINE_VERSION")),void 0===t.popId&&void 0===t.sessionUuid&&(t.popId=Bt("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 nt(t)}function o(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=Bt("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={}){o(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=Zt()),void 0!==t.session&&void 0!==t.session&&t.session.accountId&&(e.accountId=t.session.accountId),new Lt(e)}})(Kt||(Kt={}));var Yt=Kt},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 o=n(465);Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return o.default}});var a=n(178);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.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 l=n(591);Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return l.default}});var p=n(286);Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return p.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 o(e,t,n,o,a,s){return i((r=i(i(t,e),i(o,s)))<<(c=a)|r>>>32-c,n);var r,c}function a(e,t,n,i,a,s,r){return o(t&n|~t&i,e,t,a,s,r)}function s(e,t,n,i,a,s,r){return o(t&i|n&~i,e,t,a,s,r)}function r(e,t,n,i,a,s,r){return o(t^n^i,e,t,a,s,r)}function c(e,t,n,i,a,s,r){return o(n^(t|~i),e,t,a,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 o=new Uint32Array(n(t)).fill(0);o.set(e),o[t>>5]|=128<<t%32,o[o.length-1]=t,e=o;let l=1732584193,p=-271733879,u=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const n=l,o=p,h=u,m=d;l=a(l,p,u,d,e[t],7,-680876936),d=a(d,l,p,u,e[t+1],12,-389564586),u=a(u,d,l,p,e[t+2],17,606105819),p=a(p,u,d,l,e[t+3],22,-1044525330),l=a(l,p,u,d,e[t+4],7,-176418897),d=a(d,l,p,u,e[t+5],12,1200080426),u=a(u,d,l,p,e[t+6],17,-1473231341),p=a(p,u,d,l,e[t+7],22,-45705983),l=a(l,p,u,d,e[t+8],7,1770035416),d=a(d,l,p,u,e[t+9],12,-1958414417),u=a(u,d,l,p,e[t+10],17,-42063),p=a(p,u,d,l,e[t+11],22,-1990404162),l=a(l,p,u,d,e[t+12],7,1804603682),d=a(d,l,p,u,e[t+13],12,-40341101),u=a(u,d,l,p,e[t+14],17,-1502002290),p=a(p,u,d,l,e[t+15],22,1236535329),l=s(l,p,u,d,e[t+1],5,-165796510),d=s(d,l,p,u,e[t+6],9,-1069501632),u=s(u,d,l,p,e[t+11],14,643717713),p=s(p,u,d,l,e[t],20,-373897302),l=s(l,p,u,d,e[t+5],5,-701558691),d=s(d,l,p,u,e[t+10],9,38016083),u=s(u,d,l,p,e[t+15],14,-660478335),p=s(p,u,d,l,e[t+4],20,-405537848),l=s(l,p,u,d,e[t+9],5,568446438),d=s(d,l,p,u,e[t+14],9,-1019803690),u=s(u,d,l,p,e[t+3],14,-187363961),p=s(p,u,d,l,e[t+8],20,1163531501),l=s(l,p,u,d,e[t+13],5,-1444681467),d=s(d,l,p,u,e[t+2],9,-51403784),u=s(u,d,l,p,e[t+7],14,1735328473),p=s(p,u,d,l,e[t+12],20,-1926607734),l=r(l,p,u,d,e[t+5],4,-378558),d=r(d,l,p,u,e[t+8],11,-2022574463),u=r(u,d,l,p,e[t+11],16,1839030562),p=r(p,u,d,l,e[t+14],23,-35309556),l=r(l,p,u,d,e[t+1],4,-1530992060),d=r(d,l,p,u,e[t+4],11,1272893353),u=r(u,d,l,p,e[t+7],16,-155497632),p=r(p,u,d,l,e[t+10],23,-1094730640),l=r(l,p,u,d,e[t+13],4,681279174),d=r(d,l,p,u,e[t],11,-358537222),u=r(u,d,l,p,e[t+3],16,-722521979),p=r(p,u,d,l,e[t+6],23,76029189),l=r(l,p,u,d,e[t+9],4,-640364487),d=r(d,l,p,u,e[t+12],11,-421815835),u=r(u,d,l,p,e[t+15],16,530742520),p=r(p,u,d,l,e[t+2],23,-995338651),l=c(l,p,u,d,e[t],6,-198630844),d=c(d,l,p,u,e[t+7],10,1126891415),u=c(u,d,l,p,e[t+14],15,-1416354905),p=c(p,u,d,l,e[t+5],21,-57434055),l=c(l,p,u,d,e[t+12],6,1700485571),d=c(d,l,p,u,e[t+3],10,-1894986606),u=c(u,d,l,p,e[t+10],15,-1051523),p=c(p,u,d,l,e[t+1],21,-2054922799),l=c(l,p,u,d,e[t+8],6,1873313359),d=c(d,l,p,u,e[t+15],10,-30611744),u=c(u,d,l,p,e[t+6],15,-1560198380),p=c(p,u,d,l,e[t+13],21,1309151649),l=c(l,p,u,d,e[t+4],6,-145523070),d=c(d,l,p,u,e[t+11],10,-1120210379),u=c(u,d,l,p,e[t+2],15,718787259),p=c(p,u,d,l,e[t+9],21,-343485551),l=i(l,n),p=i(p,o),u=i(u,h),d=i(d,m)}return Uint32Array.of(l,p,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],o=[1732584193,4023233417,2562383102,271733878,3285377520],a=new Uint8Array(e.length+1);a.set(e),a[e.length]=128;const s=(e=a).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 a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=c[e][t];for(let e=16;e<80;++e)a[e]=i(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let s=o[0],r=o[1],l=o[2],p=o[3],u=o[4];for(let e=0;e<80;++e){const o=Math.floor(e/20),c=i(s,5)+n(o,r,l,p)+u+t[o]+a[e]>>>0;u=p,p=l,l=i(r,30)>>>0,r=s,s=c}o[0]=o[0]+s>>>0,o[1]=o[1]+r>>>0,o[2]=o[2]+l>>>0,o[3]=o[3]+p>>>0,o[4]=o[4]+u>>>0}return Uint8Array.of(o[0]>>24,o[0]>>16,o[0]>>8,o[0],o[1]>>24,o[1]>>16,o[1]>>8,o[1],o[2]>>24,o[2]>>16,o[2]>>8,o[2],o[3]>>24,o[3]>>16,o[3]>>8,o[3],o[4]>>24,o[4]>>16,o[4]>>8,o[4])}},11(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unsafeStringify=void 0;const i=n(746),o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function a(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}t.unsafeStringify=a,t.default=function(e,t=0){const n=a(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),o=n(11),a={};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,o,a,s=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(a){if(s<0||s+16>a.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`)}else a=new Uint8Array(16),s=0;t??=Date.now(),n??=0,i??=16383&(e[8]<<8|e[9]),o??=e.slice(10,16);const r=(1e4*(268435455&(t+=122192928e5))+n)%4294967296;a[s++]=r>>>24&255,a[s++]=r>>>16&255,a[s++]=r>>>8&255,a[s++]=255&r;const c=t/4294967296*1e4&268435455;a[s++]=c>>>8&255,a[s++]=255&c,a[s++]=c>>>24&15|16,a[s++]=c>>>16&255,a[s++]=i>>>8|128,a[s++]=255&i;for(let e=0;e<6;++e)a[s++]=o[e];return a}t.updateV1State=s,t.default=function(e,t,n){let c;const l=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(),o=(0,i.default)();s(a,e,o),c=r(o,a.msecs,a.nsecs,l?void 0:a.clockseq,l?void 0:a.node,t,n)}return t??(0,o.unsafeStringify)(c)}},568(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(178),o=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,o.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),o=n(988);var a=n(988);function s(e,t,n,a){return(0,o.default)(48,i.default,e,t,n,a)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return a.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return a.URL}}),s.DNS=o.DNS,s.URL=o.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),o=n(11);function a(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=a,t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t.default=function(e,t,n,s,r,c){const l="string"==typeof n?a(n):n,p="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+l.length);if(u.set(p),u.set(l,p.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,o.unsafeStringify)(u)}},286(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(779),o=n(291),a=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,o.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,a.unsafeStringify)(s)}},557(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const i=n(829),o=n(988);var a=n(988);function s(e,t,n,a){return(0,o.default)(80,i.default,e,t,n,a)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return a.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return a.URL}}),s.DNS=o.DNS,s.URL=o.URL,t.default=s},356(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(11),o=n(425),a=n(568);t.default=function(e,t,n){e??={},n??=0;let s=(0,o.default)({...e,_v6:!0},new Uint8Array(16));if(s=(0,a.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),o=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,o.unsafeStringify)(t):t}},299(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV7State=void 0;const i=n(291),o=n(11),a={};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,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(i){if(o<0||o+16>i.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else i=new Uint8Array(16),o=0;return t??=Date.now(),n??=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9],i[o++]=t/1099511627776&255,i[o++]=t/4294967296&255,i[o++]=t/16777216&255,i[o++]=t/65536&255,i[o++]=t/256&255,i[o++]=255&t,i[o++]=112|n>>>28&15,i[o++]=n>>>20&255,i[o++]=128|n>>>14&63,i[o++]=n>>>6&255,i[o++]=n<<2&255|3&e[10],i[o++]=e[11],i[o++]=e[12],i[o++]=e[13],i[o++]=e[14],i[o++]=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(),o=(0,i.default)();s(a,e,o),c=r(o,a.msecs,a.seq,t,n)}return t??(0,o.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 o=t[i];if(void 0!==o)return o.exports;const a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,n),a.exports}return n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var o=t[i++],a=t[i++],s=0===a?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:a};n.o(e,o)||Object.defineProperty(e,o,s)}else for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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);
|