(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[88709],{52696:(e,t)=>{"use strict";Object.prototype.toString},71407:e=>{"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o={};function a(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function s(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function c(e){var t,r;if(!e)return;let[[n,i],...o]=s(e),{domain:a,expires:c,httponly:d,maxage:p,path:h,samesite:f,secure:y,partitioned:m,priority:w}=Object.fromEntries(o.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));return function(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}({name:n,value:decodeURIComponent(i),domain:a,...c&&{expires:new Date(c)},...d&&{httpOnly:!0},..."string"==typeof p&&{maxAge:Number(p)},path:h,...f&&{sameSite:l.includes(t=(t=f).toLowerCase())?t:void 0},...y&&{secure:!0},...w&&{priority:u.includes(r=(r=w).toLowerCase())?r:void 0},...m&&{partitioned:!0}})}((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(o,{RequestCookies:()=>d,ResponseCookies:()=>p,parseCookie:()=>s,parseSetCookie:()=>c,stringifyCookie:()=>a}),e.exports=((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of n(o))i.call(e,c)||c===a||t(e,c,{get:()=>o[c],enumerable:!(s=r(o,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),o);var l=["strict","lax","none"],u=["low","medium","high"],d=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of s(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>a(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>a(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},p=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,n,i,o,a=[],s=0;function c(){for(;s=e.length)&&a.push(e.substring(t,e.length))}return a}(i)){let t=c(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=a(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(a).join("; ")}}},96103:(e,t,r)=>{var n;(()=>{var i={226:function(i,o){!function(a,s){"use strict";var c="function",l="undefined",u="object",d="string",p="major",h="model",f="name",y="type",m="vendor",w="version",_="architecture",b="console",g="mobile",v="tablet",E="smarttv",A="wearable",S="embedded",x="Amazon",k="Apple",R="ASUS",P="BlackBerry",C="Browser",T="Chrome",O="Firefox",I="Google",H="Huawei",U="Microsoft",W="Motorola",N="Opera",j="Samsung",L="Sharp",M="Sony",D="Xiaomi",K="Zebra",J="Facebook",$="Chromium OS",B="Mac OS",F=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},G=function(e){for(var t={},r=0;r0?2===o.length?typeof o[1]==c?this[o[0]]=o[1].call(this,l):this[o[0]]=o[1]:3===o.length?typeof o[1]!==c||o[1].exec&&o[1].test?this[o[0]]=l?l.replace(o[1],o[2]):void 0:this[o[0]]=l?o[1].call(this,l,o[2]):void 0:4===o.length&&(this[o[0]]=l?o[3].call(this,l.replace(o[1],o[2])):void 0):this[o]=l||s;d+=2}},Y=function(e,t){for(var r in t)if(typeof t[r]===u&&t[r].length>0){for(var n=0;n2&&(e[h]="iPad",e[y]=v),e},this.getEngine=function(){var e={};return e[f]=s,e[w]=s,X.call(e,n,o.engine),e},this.getOS=function(){var e={};return e[f]=s,e[w]=s,X.call(e,n,o.os),b&&!e[f]&&i&&"Unknown"!=i.platform&&(e[f]=i.platform.replace(/chrome os/i,$).replace(/macos/i,B)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===d&&e.length>350?V(e,350):e,this},this.setUA(n),this};ee.VERSION="1.0.35",ee.BROWSER=G([f,w,p]),ee.CPU=G([_]),ee.DEVICE=G([h,m,y,b,g,E,v,A,S]),ee.ENGINE=ee.OS=G([f,w]),typeof o!==l?(i.exports&&(o=i.exports=ee),o.UAParser=ee):r.amdO?void 0!==(n=(function(){return ee}).call(t,r,t,e))&&(e.exports=n):typeof a!==l&&(a.UAParser=ee);var et=typeof a!==l&&(a.jQuery||a.Zepto);if(et&&!et.ua){var er=new ee;et.ua=er.getResult(),et.ua.get=function(){return er.getUA()},et.ua.set=function(e){er.setUA(e);var t=er.getResult();for(var r in t)et.ua[r]=t[r]}}}("object"==typeof window?window:this)}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},n=!0;try{i[e].call(r.exports,r,r.exports,a),n=!1}finally{n&&delete o[e]}return r.exports}a.ab="//";var s=a(226);e.exports=s})()},95525:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_SUFFIX:function(){return d},APP_DIR_ALIAS:function(){return I},CACHE_ONE_YEAR:function(){return S},DOT_NEXT_ALIAS:function(){return T},ESLINT_DEFAULT_DIRS:function(){return Y},GSP_NO_RETURNED_VALUE:function(){return F},GSSP_COMPONENT_MEMBER_ERROR:function(){return z},GSSP_NO_RETURNED_VALUE:function(){return G},INFINITE_CACHE:function(){return x},INSTRUMENTATION_HOOK_FILENAME:function(){return P},MATCHED_PATH_HEADER:function(){return i},MIDDLEWARE_FILENAME:function(){return k},MIDDLEWARE_LOCATION_REGEXP:function(){return R},NEXT_BODY_SUFFIX:function(){return f},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return A},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return w},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return _},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return m},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return E},NEXT_CACHE_TAGS_HEADER:function(){return y},NEXT_CACHE_TAG_MAX_ITEMS:function(){return g},NEXT_CACHE_TAG_MAX_LENGTH:function(){return v},NEXT_DATA_SUFFIX:function(){return p},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return n},NEXT_META_SUFFIX:function(){return h},NEXT_QUERY_PARAM_PREFIX:function(){return r},NEXT_RESUME_HEADER:function(){return b},NON_STANDARD_NODE_ENV:function(){return V},PAGES_DIR_ALIAS:function(){return C},PRERENDER_REVALIDATE_HEADER:function(){return o},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return M},ROOT_DIR_ALIAS:function(){return O},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return L},RSC_ACTION_ENCRYPTION_ALIAS:function(){return j},RSC_ACTION_PROXY_ALIAS:function(){return W},RSC_ACTION_VALIDATE_ALIAS:function(){return U},RSC_CACHE_WRAPPER_ALIAS:function(){return N},RSC_MOD_REF_PROXY_ALIAS:function(){return H},RSC_PREFETCH_SUFFIX:function(){return s},RSC_SEGMENTS_DIR_SUFFIX:function(){return c},RSC_SEGMENT_SUFFIX:function(){return l},RSC_SUFFIX:function(){return u},SERVER_PROPS_EXPORT_ERROR:function(){return B},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return K},SERVER_PROPS_SSG_CONFLICT:function(){return J},SERVER_RUNTIME:function(){return Z},SSG_FALLBACK_EXPORT_ERROR:function(){return X},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return D},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return $},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return q},WEBPACK_LAYERS:function(){return ee},WEBPACK_RESOURCE_QUERIES:function(){return et}});let r="nxtP",n="nxtI",i="x-matched-path",o="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",s=".prefetch.rsc",c=".segments",l=".segment.rsc",u=".rsc",d=".action",p=".json",h=".meta",f=".body",y="x-next-cache-tags",m="x-next-cache-soft-tags",w="x-next-revalidated-tags",_="x-next-revalidate-tag-token",b="next-resume",g=128,v=256,E=1024,A="_N_T_",S=31536e3,x=0xfffffffe,k="middleware",R=`(?:src/)?${k}`,P="instrumentation",C="private-next-pages",T="private-dot-next",O="private-next-root-dir",I="private-next-app-dir",H="private-next-rsc-mod-ref-proxy",U="private-next-rsc-action-validate",W="private-next-rsc-server-reference",N="private-next-rsc-cache-wrapper",j="private-next-rsc-action-encryption",L="private-next-rsc-action-client-wrapper",M="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",D="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",K="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",J="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",$="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",B="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",F="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",G="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",q="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",z="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",V='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',X="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",Y=["app","pages","components","lib","src"],Z={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},Q={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser"},ee={...Q,GROUP:{builtinReact:[Q.reactServerComponents,Q.actionBrowser],serverOnly:[Q.reactServerComponents,Q.actionBrowser,Q.instrument,Q.middleware],neutralTarget:[Q.api],clientOnly:[Q.serverSideRendering,Q.appPagesBrowser],bundled:[Q.reactServerComponents,Q.actionBrowser,Q.serverSideRendering,Q.appPagesBrowser,Q.shared,Q.instrument],appPages:[Q.reactServerComponents,Q.serverSideRendering,Q.appPagesBrowser,Q.actionBrowser]}},et={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},92083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"after",{enumerable:!0,get:function(){return i}});let n=r(50196);function i(e){let t=n.workAsyncStorage.getStore();if(!t)throw Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context");let{afterContext:r}=t;return r.after(e)}},94161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(r(92083),t)},6:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"connection",{enumerable:!0,get:function(){return l}});let n=r(50196),i=r(89305),o=r(68041),a=r(73189),s=r(68956),c=r(93151);function l(){let e=n.workAsyncStorage.getStore(),t=i.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,c.isRequestAPICallableInsideAfter)())throw Error(`Route ${e.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`);if(e.forceStatic)return Promise.resolve(void 0);if(t){if("cache"===t.type)throw Error(`Route ${e.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`);if("unstable-cache"===t.type)throw Error(`Route ${e.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`)}if(e.dynamicShouldError)throw new a.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(t){if("prerender"===t.type)return(0,s.makeHangingPromise)(t.renderSignal,"`connection()`");"prerender-ppr"===t.type?(0,o.postponeWithTracking)(e.route,"connection",t.dynamicTracking):"prerender-legacy"===t.type&&(0,o.throwToInterruptStaticGeneration)("connection",e,t)}(0,o.trackDynamicDataInDynamicRender)(e,t)}return Promise.resolve(void 0)}},589:(e,t,r)=>{"use strict";r(64145),r(36296),r(50196),r(89305),r(68041),r(73189),r(68956);let n=r(5792),i=(r(2777),r(93151),new WeakMap);(0,n.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Error(`${r}used ${t}. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)});function o(){return this.getAll().map(e=>[e.name,e]).values()}function a(e){for(let e of this.getAll())this.delete(e.name);return e}},90155:(e,t,r)=>{"use strict";let n=r(89305),i=r(50196),o=r(68041),a=r(5792),s=r(73189),c=r(1419);new WeakMap;class l{constructor(e){this._provider=e}get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){u("draftMode().enable()"),null!==this._provider&&this._provider.enable()}disable(){u("draftMode().disable()"),null!==this._provider&&this._provider.disable()}}function u(e){let t=i.workAsyncStorage.getStore(),r=n.workUnitAsyncStorage.getStore();if(t){if(r){if("cache"===r.type)throw Error(`Route ${t.route} used "${e}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`);if("unstable-cache"===r.type)throw Error(`Route ${t.route} used "${e}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);if("after"===r.phase)throw Error(`Route ${t.route} used "${e}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`)}if(t.dynamicShouldError)throw new s.StaticGenBailoutError(`Route ${t.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(r){if("prerender"===r.type){let n=Error(`Route ${t.route} used ${e} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`);(0,o.abortAndThrowOnSynchronousRequestDataAccess)(t.route,e,n,r)}else if("prerender-ppr"===r.type)(0,o.postponeWithTracking)(t.route,e,r.dynamicTracking);else if("prerender-legacy"===r.type){r.revalidate=0;let n=new c.DynamicServerError(`Route ${t.route} couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}}}}(0,a.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Error(`${r}used ${t}. \`draftMode()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},54836:(e,t,r)=>{"use strict";r(59228),r(50196),r(89305),r(68041),r(73189),r(68956);let n=r(5792),i=(r(2777),r(93151),new WeakMap);(0,n.createDedupedByCallsiteServerErrorLoggerDev)(function(e,t){let r=e?`Route "${e}" `:"This route ";return Error(`${r}used ${t}. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`)})},40071:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PageSignatureError:function(){return r},RemovedPageError:function(){return n},RemovedUAError:function(){return i}});class r extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form: export function middleware(request, event) { return NextResponse.redirect('/new-location') } Read more: https://nextjs.org/docs/messages/middleware-new-signature `)}}class n extends Error{constructor(){super(`The request.page has been deprecated in favour of \`URLPattern\`. Read more: https://nextjs.org/docs/messages/middleware-request-page `)}}class i extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function. Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent `)}}},27437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ImageResponse:function(){return n.ImageResponse},NextRequest:function(){return i.NextRequest},NextResponse:function(){return o.NextResponse},URLPattern:function(){return s.URLPattern},after:function(){return c.after},connection:function(){return l.connection},userAgent:function(){return a.userAgent},userAgentFromString:function(){return a.userAgentFromString}});let n=r(53182),i=r(16614),o=r(62538),a=r(17046),s=r(83413),c=r(94161),l=r(6)},85242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NextURL",{enumerable:!0,get:function(){return u}});let n=r(79688),i=r(80107),o=r(88892),a=r(33986),s=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function c(e,t){return new URL(String(e).replace(s,"localhost"),t&&String(t).replace(s,"localhost"))}let l=Symbol("NextURLInternal");class u{constructor(e,t,r){let n,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,i=r||{}):i=r||t||{},this[l]={url:c(e,n??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,r,i,s;let c=(0,a.getNextPathnameInfo)(this[l].url.pathname,{nextConfig:this[l].options.nextConfig,parseData:!0,i18nProvider:this[l].options.i18nProvider}),u=(0,o.getHostname)(this[l].url,this[l].options.headers);this[l].domainLocale=this[l].options.i18nProvider?this[l].options.i18nProvider.detectDomainLocale(u):(0,n.detectDomainLocale)(null==(t=this[l].options.nextConfig)?void 0:null==(e=t.i18n)?void 0:e.domains,u);let d=(null==(r=this[l].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[l].options.nextConfig)?void 0:null==(i=s.i18n)?void 0:i.defaultLocale);this[l].url.pathname=c.pathname,this[l].defaultLocale=d,this[l].basePath=c.basePath??"",this[l].buildId=c.buildId,this[l].locale=c.locale??d,this[l].trailingSlash=c.trailingSlash}formatPathname(){return(0,i.formatNextPathnameInfo)({basePath:this[l].basePath,buildId:this[l].buildId,defaultLocale:this[l].options.forceLocale?void 0:this[l].defaultLocale,locale:this[l].locale,pathname:this[l].url.pathname,trailingSlash:this[l].trailingSlash})}formatSearch(){return this[l].url.search}get buildId(){return this[l].buildId}set buildId(e){this[l].buildId=e}get locale(){return this[l].locale??""}set locale(e){var t,r;if(!this[l].locale||!(null==(r=this[l].options.nextConfig)?void 0:null==(t=r.i18n)?void 0:t.locales.includes(e)))throw TypeError(`The NextURL configuration includes no locale "${e}"`);this[l].locale=e}get defaultLocale(){return this[l].defaultLocale}get domainLocale(){return this[l].domainLocale}get searchParams(){return this[l].url.searchParams}get host(){return this[l].url.host}set host(e){this[l].url.host=e}get hostname(){return this[l].url.hostname}set hostname(e){this[l].url.hostname=e}get port(){return this[l].url.port}set port(e){this[l].url.port=e}get protocol(){return this[l].url.protocol}set protocol(e){this[l].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[l].url=c(e),this.analyze()}get origin(){return this[l].url.origin}get pathname(){return this[l].url.pathname}set pathname(e){this[l].url.pathname=e}get hash(){return this[l].url.hash}set hash(e){this[l].url.hash=e}get search(){return this[l].url.search}set search(e){this[l].url.search=e}get password(){return this[l].url.password}set password(e){this[l].url.password=e}get username(){return this[l].url.username}set username(e){this[l].url.username=e}get basePath(){return this[l].basePath}set basePath(e){this[l].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new u(String(this),this[l].options)}}},59228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HeadersAdapter:function(){return o},ReadonlyHeadersError:function(){return i}});let n=r(6239);class i extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new i}}class o extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,i){if("symbol"==typeof r)return n.ReflectAdapter.get(t,r,i);let o=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===o);if(void 0!==a)return n.ReflectAdapter.get(t,a,i)},set(t,r,i,o){if("symbol"==typeof r)return n.ReflectAdapter.set(t,r,i,o);let a=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===a);return n.ReflectAdapter.set(t,s??r,i,o)},has(t,r){if("symbol"==typeof r)return n.ReflectAdapter.has(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0!==o&&n.ReflectAdapter.has(t,o)},deleteProperty(t,r){if("symbol"==typeof r)return n.ReflectAdapter.deleteProperty(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===o||n.ReflectAdapter.deleteProperty(t,o)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return i.callable;default:return n.ReflectAdapter.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},64145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{MutableRequestCookiesAdapter:function(){return p},ReadonlyRequestCookiesError:function(){return s},RequestCookiesAdapter:function(){return c},appendMutableCookies:function(){return d},areCookiesMutableInCurrentPhase:function(){return f},getModifiedCookieValues:function(){return u},responseCookiesToRequestCookies:function(){return m},wrapWithMutableAccessCheck:function(){return h}});let n=r(36296),i=r(6239),o=r(50196),a=r(89305);class s extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new s}}class c{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return s.callable;default:return i.ReflectAdapter.get(e,t,r)}}})}}let l=Symbol.for("next.mutated.cookies");function u(e){let t=e[l];return t&&Array.isArray(t)&&0!==t.length?t:[]}function d(e,t){let r=u(t);if(0===r.length)return!1;let i=new n.ResponseCookies(e),o=i.getAll();for(let e of r)i.set(e);for(let e of o)i.set(e);return!0}class p{static wrap(e,t){let r=new n.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let a=[],s=new Set,c=()=>{let e=o.workAsyncStorage.getStore();if(e&&(e.pathWasRevalidated=!0),a=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of a){let r=new n.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}},u=new Proxy(r,{get(e,t,r){switch(t){case l:return a;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.delete(...t),u}finally{c()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t),u}finally{c()}};default:return i.ReflectAdapter.get(e,t,r)}}});return u}}function h(e){let t=new Proxy(e,{get(e,r,n){switch(r){case"delete":return function(...r){return y("cookies().delete"),e.delete(...r),t};case"set":return function(...r){return y("cookies().set"),e.set(...r),t};default:return i.ReflectAdapter.get(e,r,n)}}});return t}function f(e){return"action"===e.phase}function y(e){if(!f((0,a.getExpectedRequestStore)(e)))throw new s}function m(e){let t=new n.RequestCookies(new Headers);for(let r of e.getAll())t.set(r);return t}},36296:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=r(71407)},53182:(e,t)=>{"use strict";function r(){throw Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead')}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageResponse",{enumerable:!0,get:function(){return r}})},16614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERNALS:function(){return s},NextRequest:function(){return c}});let n=r(85242),i=r(6156),o=r(40071),a=r(36296),s=Symbol("internal request");class c extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(0,i.validateURL)(r),e instanceof Request?super(e,t):super(r,t);let o=new n.NextURL(r,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[s]={cookies:new a.RequestCookies(this.headers),nextUrl:o,url:o.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[s].cookies}get nextUrl(){return this[s].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[s].url}}},62538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NextResponse",{enumerable:!0,get:function(){return d}});let n=r(36296),i=r(85242),o=r(6156),a=r(6239),s=r(36296),c=Symbol("internal response"),l=new Set([301,302,303,307,308]);function u(e,t){var r;if(null==e?void 0:null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Error("request.headers must be an instance of Headers");let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class d extends Response{constructor(e,t={}){super(e,t);let r=this.headers,l=new Proxy(new s.ResponseCookies(r),{get(e,i,o){switch(i){case"delete":case"set":return(...o)=>{let a=Reflect.apply(e[i],e,o),c=new Headers(r);return a instanceof s.ResponseCookies&&r.set("x-middleware-set-cookie",a.getAll().map(e=>(0,n.stringifyCookie)(e)).join(",")),u(t,c),a};default:return a.ReflectAdapter.get(e,i,o)}}});this[c]={cookies:l,url:t.url?new i.NextURL(t.url,{headers:(0,o.toNodeOutgoingHttpHeaders)(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[c].cookies}static json(e,t){let r=Response.json(e,t);return new d(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!l.has(r))throw RangeError('Failed to execute "redirect" on "response": Invalid status code');let n="object"==typeof t?t:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",(0,o.validateURL)(e)),new d(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,o.validateURL)(e)),u(t,r),new d(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),u(e,t),new d(null,{...e,headers:t})}}},83413:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"URLPattern",{enumerable:!0,get:function(){return r}});let r="undefined"==typeof URLPattern?void 0:URLPattern},17046:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isBot:function(){return i},userAgent:function(){return a},userAgentFromString:function(){return o}});let n=function(e){return e&&e.__esModule?e:{default:e}}(r(96103));function i(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function o(e){return{...(0,n.default)(e),isBot:void 0!==e&&i(e)}}function a({headers:e}){return o(e.get("user-agent")||void 0)}},6156:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fromNodeOutgoingHttpHeaders:function(){return i},normalizeNextQueryParam:function(){return c},splitCookiesString:function(){return o},toNodeOutgoingHttpHeaders:function(){return a},validateURL:function(){return s}});let n=r(95525);function i(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}function o(e){var t,r,n,i,o,a=[],s=0;function c(){for(;s=e.length)&&a.push(e.substring(t,e.length))}return a}function a(e){let t={},r=[];if(e)for(let[n,i]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...o(i)),t[n]=1===r.length?r[0]:r):t[n]=i;return t}function s(e){try{return String(new URL(String(e)))}catch(t){throw Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t})}}function c(e,t){for(let r of[n.NEXT_QUERY_PARAM_PREFIX,n.NEXT_INTERCEPTION_MARKER_PREFIX])e!==r&&e.startsWith(r)&&t(e.substring(r.length))}},88892:(e,t)=>{"use strict";function r(e,t){let r;if((null==t?void 0:t.host)&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getHostname",{enumerable:!0,get:function(){return r}})},79688:(e,t)=>{"use strict";function r(e,t,r){if(e)for(let o of(r&&(r=r.toLowerCase()),e)){var n,i;if(t===(null==(n=o.domain)?void 0:n.split(":",1)[0].toLowerCase())||r===o.defaultLocale.toLowerCase()||(null==(i=o.locales)?void 0:i.some(e=>e.toLowerCase()===r)))return o}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return r}})},72805:(e,t)=>{"use strict";function r(e,t){let r;let n=e.split("/");return(t||[]).some(t=>!!n[1]&&n[1].toLowerCase()===t.toLowerCase()&&(r=t,n.splice(1,1),e=n.join("/")||"/",!0)),{pathname:e,detectedLocale:r}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}})},9754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return o}});let n=r(74302),i=r(5991);function o(e,t,r,o){if(!t||t===r)return e;let a=e.toLowerCase();return!o&&((0,i.pathHasPrefix)(a,"/api")||(0,i.pathHasPrefix)(a,"/"+t.toLowerCase()))?e:(0,n.addPathPrefix)(e,"/"+t)}},31047:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return i}});let n=r(85063);function i(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:o}=(0,n.parsePath)(e);return""+r+t+i+o}},80107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});let n=r(12837),i=r(74302),o=r(31047),a=r(9754);function s(e){let t=(0,a.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,o.addPathSuffix)((0,i.addPathPrefix)(t,"/_next/data/"+e.buildId),"/"===e.pathname?"index.json":".json")),t=(0,i.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,o.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},33986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return a}});let n=r(72805),i=r(85857),o=r(5991);function a(e,t){var r,a;let{basePath:s,i18n:c,trailingSlash:l}=null!=(r=t.nextConfig)?r:{},u={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):l};s&&(0,o.pathHasPrefix)(u.pathname,s)&&(u.pathname=(0,i.removePathPrefix)(u.pathname,s),u.basePath=s);let d=u.pathname;if(u.pathname.startsWith("/_next/data/")&&u.pathname.endsWith(".json")){let e=u.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),r=e[0];u.buildId=r,d="index"!==e[1]?"/"+e.slice(1).join("/"):"/",!0===t.parseData&&(u.pathname=d)}if(c){let e=t.i18nProvider?t.i18nProvider.analyze(u.pathname):(0,n.normalizeLocalePath)(u.pathname,c.locales);u.locale=e.detectedLocale,u.pathname=null!=(a=e.pathname)?a:u.pathname,!e.detectedLocale&&u.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(d):(0,n.normalizeLocalePath)(d,c.locales)).detectedLocale&&(u.locale=e.detectedLocale)}return u}},85857:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return i}});let n=r(5991);function i(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:"/"+r}},8820:(e,t,r)=>{"use strict";r.d(t,{k9:()=>h,lR:()=>n,xz:()=>d});class n extends Error{constructor(e,t){e instanceof Error?super(void 0,{cause:{err:e,...e.cause,...t}}):"string"==typeof e?(t instanceof Error&&(t={err:t,...t.cause}),super(e,t)):super(void 0,e),this.name=this.constructor.name,this.type=this.constructor.type??"AuthError",this.kind=this.constructor.kind??"error",Error.captureStackTrace?.(this,this.constructor);let r=`https://errors.authjs.dev#${this.type.toLowerCase()}`;this.message+=`${this.message?". ":""}Read more at ${r}`}}class i extends n{}i.kind="signIn";class o extends n{}o.type="AdapterError";class a extends n{}a.type="AccessDenied";class s extends n{}s.type="CallbackRouteError";class c extends n{}c.type="ErrorPageLoop";class l extends n{}l.type="EventError";class u extends n{}u.type="InvalidCallbackUrl";class d extends i{constructor(){super(...arguments),this.code="credentials"}}d.type="CredentialsSignin";class p extends n{}p.type="InvalidEndpoints";class h extends n{}h.type="InvalidCheck";class f extends n{}f.type="JWTSessionError";class y extends n{}y.type="MissingAdapter";class m extends n{}m.type="MissingAdapterMethods";class w extends n{}w.type="MissingAuthorize";class _ extends n{}_.type="MissingSecret";class b extends i{}b.type="OAuthAccountNotLinked";class g extends i{}g.type="OAuthCallbackError";class v extends n{}v.type="OAuthProfileParseError";class E extends n{}E.type="SessionTokenError";class A extends i{}A.type="OAuthSignInError";class S extends i{}S.type="EmailSignInError";class x extends n{}x.type="SignOutError";class k extends n{}k.type="UnknownAction";class R extends n{}R.type="UnsupportedStrategy";class P extends n{}P.type="InvalidProvider";class C extends n{}C.type="UntrustedHost";class T extends n{}T.type="Verification";class O extends i{}O.type="MissingCSRF";class I extends n{}I.type="DuplicateConditionalUI";class H extends n{}H.type="MissingWebAuthnAutocomplete";class U extends n{}U.type="WebAuthnVerificationError";class W extends i{}W.type="AccountNotLinked";class N extends n{}N.type="ExperimentalFeatureNotEnabled"},88709:(e,t,r)=>{"use strict";let n,i,o,a,s;r.d(t,{xz:()=>c.xz}),new WeakMap,new WeakMap,new WeakMap,new WeakSet;var c=r(8820);let l=()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw Error("unable to locate global object")},u=async(e,t,r,n,i)=>{let{crypto:{subtle:o}}=l();return new Uint8Array(await o.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:r,info:n},await o.importKey("raw",t,"HKDF",!1,["deriveBits"]),i<<3))};function d(e,t){if("string"==typeof e)return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}async function p(e,t,r,n,i){return u(function(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw TypeError('unsupported "digest" value')}}(e),function(e){let t=d(e,"ikm");if(!t.byteLength)throw TypeError('"ikm" must be at least one byte in length');return t}(t),d(r,"salt"),function(e){let t=d(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}(n),function(e,t){if("number"!=typeof e||!Number.isInteger(e)||e<1)throw TypeError('"keylen" must be a positive integer');if(e>255*(parseInt(t.substr(3),10)>>3||20))throw TypeError('"keylen" too large');return e}(i,e))}let h=crypto,f=e=>e instanceof CryptoKey,y=async(e,t)=>{let r=`SHA-${e.slice(-3)}`;return new Uint8Array(await h.subtle.digest(r,t))},m=new TextEncoder,w=new TextDecoder;function _(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}function b(e,t,r){if(t<0||t>=0x100000000)throw RangeError(`value must be >= 0 and <= ${0x100000000-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function g(e){let t=Math.floor(e/0x100000000),r=new Uint8Array(8);return b(r,t,0),b(r,e%0x100000000,4),r}function v(e){let t=new Uint8Array(4);return b(t,e),t}function E(e){return _(v(e.length),e)}async function A(e,t,r){let n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}let S=e=>{let t=e;"string"==typeof t&&(t=m.encode(t));let r=[];for(let e=0;eS(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),k=e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=w.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return k(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}};class P extends Error{constructor(e,t){super(e,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}P.code="ERR_JOSE_GENERIC";class C extends P{constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=n,this.payload=t}}C.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class T extends P{constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=n,this.payload=t}}T.code="ERR_JWT_EXPIRED";class O extends P{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}O.code="ERR_JOSE_ALG_NOT_ALLOWED";class I extends P{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}I.code="ERR_JOSE_NOT_SUPPORTED";class H extends P{constructor(e="decryption operation failed",t){super(e,t),this.code="ERR_JWE_DECRYPTION_FAILED"}}H.code="ERR_JWE_DECRYPTION_FAILED";class U extends P{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}U.code="ERR_JWE_INVALID";class W extends P{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}W.code="ERR_JWS_INVALID";class N extends P{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}N.code="ERR_JWT_INVALID";class j extends P{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}j.code="ERR_JWK_INVALID";class L extends P{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}L.code="ERR_JWKS_INVALID";class M extends P{constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_NO_MATCHING_KEY"}}M.code="ERR_JWKS_NO_MATCHING_KEY";class D extends P{constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator,D.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class K extends P{constructor(e="request timed out",t){super(e,t),this.code="ERR_JWKS_TIMEOUT"}}K.code="ERR_JWKS_TIMEOUT";class J extends P{constructor(e="signature verification failed",t){super(e,t),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}function $(e){if(!("object"==typeof e&&null!==e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}J.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";let B=(e,t)=>{if("string"!=typeof e||!e)throw new j(`${t} missing or invalid`)};async function F(e,t){let r;if(!$(e))throw TypeError("JWK must be an object");if(t??(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(e.kty){case"EC":B(e.crv,'"crv" (Curve) Parameter'),B(e.x,'"x" (X Coordinate) Parameter'),B(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":B(e.crv,'"crv" (Subtype of Key Pair) Parameter'),B(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":B(e.e,'"e" (Exponent) Parameter'),B(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":B(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new I('"kty" (Key Type) Parameter missing or unsupported')}let n=m.encode(JSON.stringify(r));return x(await y(t,n))}let G=Symbol(),q=h.getRandomValues.bind(h);function z(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new I(`Unsupported JWE Algorithm: ${e}`)}}let V=e=>q(new Uint8Array(z(e)>>3)),X=(e,t)=>{if(t.length<<3!==z(e))throw new U("Invalid Initialization Vector length")},Y=(e,t)=>{let r=e.byteLength<<3;if(r!==t)throw new U(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function Z(e,t="algorithm.name"){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Q(e,t){return e.name===t}function ee(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Q(e.algorithm,"AES-GCM"))throw Z("AES-GCM");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Z(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Q(e.algorithm,"AES-KW"))throw Z("AES-KW");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Z(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Z("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Q(e.algorithm,"PBKDF2"))throw Z("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Q(e.algorithm,"RSA-OAEP"))throw Z("RSA-OAEP");let r=parseInt(t.slice(9),10)||1;if(parseInt(e.algorithm.hash.name.slice(4),10)!==r)throw Z(`SHA-${r}`,"algorithm.hash");break}default:throw TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){let r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}(e,r)}function et(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let er=(e,...t)=>et("Key must be ",e,...t);function en(e,t,...r){return et(`Key for the ${e} algorithm must be `,t,...r)}let ei=e=>!!f(e)||e?.[Symbol.toStringTag]==="KeyObject",eo=["CryptoKey"];async function ea(e,t,r,n,i){if(!(r instanceof Uint8Array))throw TypeError(er(r,"Uint8Array"));let o=parseInt(e.slice(1,4),10),a=await h.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await h.subtle.importKey("raw",r.subarray(0,o>>3),{hash:`SHA-${o<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await h.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),l=_(i,n,c,g(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await h.subtle.sign("HMAC",s,l)).slice(0,o>>3)),iv:n}}async function es(e,t,r,n,i){let o;r instanceof Uint8Array?o=await h.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(ee(r,e,"encrypt"),o=r);let a=new Uint8Array(await h.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s,iv:n}}let ec=async(e,t,r,n,i)=>{if(!f(r)&&!(r instanceof Uint8Array))throw TypeError(er(r,...eo,"Uint8Array"));switch(n?X(e,n):n=V(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&Y(r,parseInt(e.slice(-3),10)),ea(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&Y(r,parseInt(e.slice(1,4),10)),es(e,t,r,n,i);default:throw new I("Unsupported JWE Content Encryption Algorithm")}},el=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function eu(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function ed(e,t,r){if(f(e))return ee(e,t,r),e;if(e instanceof Uint8Array)return h.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw TypeError(er(e,...eo,"Uint8Array"))}let ep=async(e,t,r)=>{let n=await ed(t,e,"wrapKey");eu(n,e);let i=await h.subtle.importKey("raw",r,...el);return new Uint8Array(await h.subtle.wrapKey("raw",i,n,"AES-KW"))},eh=async(e,t,r)=>{let n=await ed(t,e,"unwrapKey");eu(n,e);let i=await h.subtle.unwrapKey("raw",r,n,"AES-KW",...el);return new Uint8Array(await h.subtle.exportKey("raw",i))};async function ef(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){let a;if(!f(e))throw TypeError(er(e,...eo));if(ee(e,"ECDH"),!f(t))throw TypeError(er(t,...eo));ee(t,"ECDH","deriveBits");let s=_(E(m.encode(r)),E(i),E(o),v(n));return a="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,A(new Uint8Array(await h.subtle.deriveBits({name:e.algorithm.name,public:e},t,a)),n,s)}async function ey(e){if(!f(e))throw TypeError(er(e,...eo));return h.subtle.generateKey(e.algorithm,!0,["deriveBits"])}function em(e){if(!f(e))throw TypeError(er(e,...eo));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function ew(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new U("PBES2 Salt Input must be 8 or more octets")}(e);let i=_(m.encode(t),new Uint8Array([0]),e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s=await function(e,t){if(e instanceof Uint8Array)return h.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(f(e))return ee(e,t,"deriveBits","deriveKey"),e;throw TypeError(er(e,...eo,"Uint8Array"))}(n,t);if(s.usages.includes("deriveBits"))return new Uint8Array(await h.subtle.deriveBits(a,s,o));if(s.usages.includes("deriveKey"))return h.subtle.deriveKey(a,s,{length:o,name:"AES-KW"},!1,["wrapKey","unwrapKey"]);throw TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}let e_=async(e,t,r,n=2048,i=q(new Uint8Array(16)))=>{let o=await ew(i,e,n,t);return{encryptedKey:await ep(e.slice(-6),o,r),p2c:n,p2s:x(i)}},eb=async(e,t,r,n,i)=>{let o=await ew(i,e,n,t);return eh(e.slice(-6),o,r)};function eg(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new I(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}let ev=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},eE=async(e,t,r)=>{if(!f(t))throw TypeError(er(t,...eo));if(ee(t,e,"encrypt","wrapKey"),ev(e,t),t.usages.includes("encrypt"))return new Uint8Array(await h.subtle.encrypt(eg(e),t,r));if(t.usages.includes("wrapKey")){let n=await h.subtle.importKey("raw",r,...el);return new Uint8Array(await h.subtle.wrapKey("raw",n,t,eg(e)))}throw TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')},eA=async(e,t,r)=>{if(!f(t))throw TypeError(er(t,...eo));if(ee(t,e,"decrypt","unwrapKey"),ev(e,t),t.usages.includes("decrypt"))return new Uint8Array(await h.subtle.decrypt(eg(e),t,r));if(t.usages.includes("unwrapKey")){let n=await h.subtle.unwrapKey("raw",r,t,eg(e),...el);return new Uint8Array(await h.subtle.exportKey("raw",n))}throw TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function eS(e){return $(e)&&"string"==typeof e.kty}let ex=async e=>{if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new I('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new I('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new I('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new I('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),n=[t,e.ext??!1,e.key_ops??r],i={...e};return delete i.alg,delete i.use,h.subtle.importKey("jwk",i,...n)},ek=e=>R(e),eR=e=>e?.[Symbol.toStringTag]==="KeyObject",eP=async(e,t,r,n,i=!1)=>{let o=e.get(t);if(o?.[n])return o[n];let a=await ex({...r,alg:n});return i&&Object.freeze(t),o?o[n]=a:e.set(t,{[n]:a}),a},eC={normalizePublicKey:(e,t)=>{if(eR(e)){let r=e.export({format:"jwk"});return(delete r.d,delete r.dp,delete r.dq,delete r.p,delete r.q,delete r.qi,r.k)?ek(r.k):(i||(i=new WeakMap),eP(i,e,r,t))}return eS(e)?e.k?R(e.k):(i||(i=new WeakMap),eP(i,e,e,t,!0)):e},normalizePrivateKey:(e,t)=>{if(eR(e)){let r=e.export({format:"jwk"});return r.k?ek(r.k):(n||(n=new WeakMap),eP(n,e,r,t))}return eS(e)?e.k?R(e.k):(n||(n=new WeakMap),eP(n,e,e,t,!0)):e}};function eT(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new I(`Unsupported JWE Algorithm: ${e}`)}}let eO=e=>q(new Uint8Array(eT(e)>>3)),eI=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:x(e)};if(!f(e))throw TypeError(er(e,...eo,"Uint8Array"));if(!e.extractable)throw TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:n,use:i,...o}=await h.subtle.exportKey("jwk",e);return o};async function eH(e){return eI(e)}let eU=e=>e?.[Symbol.toStringTag],eW=(e,t,r)=>{if(void 0!==t.use&&"sig"!==t.use)throw TypeError("Invalid key for this operation, when present its use must be sig");if(void 0!==t.key_ops&&t.key_ops.includes?.(r)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${r}`);if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},eN=(e,t,r,n)=>{if(!(t instanceof Uint8Array)){if(n&&eS(t)){if(function(e){return eS(e)&&"oct"===e.kty&&"string"==typeof e.k}(t)&&eW(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!ei(t))throw TypeError(en(e,t,...eo,"Uint8Array",n?"JSON Web Key":null));if("secret"!==t.type)throw TypeError(`${eU(t)} instances for symmetric algorithms must be of type "secret"`)}},ej=(e,t,r,n)=>{if(n&&eS(t))switch(r){case"sign":if(function(e){return"oct"!==e.kty&&"string"==typeof e.d}(t)&&eW(e,t,r))return;throw TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(function(e){return"oct"!==e.kty&&void 0===e.d}(t)&&eW(e,t,r))return;throw TypeError("JSON Web Key for this operation be a public JWK")}if(!ei(t))throw TypeError(en(e,t,...eo,n?"JSON Web Key":null));if("secret"===t.type)throw TypeError(`${eU(t)} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw TypeError(`${eU(t)} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw TypeError(`${eU(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw TypeError(`${eU(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw TypeError(`${eU(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function eL(e,t,r,n){t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?eN(t,r,n,e):ej(t,r,n,e)}let eM=eL.bind(void 0,!1);eL.bind(void 0,!0);let eD=(e,t)=>{if(!(e instanceof Uint8Array))throw TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw TypeError("Second argument must be a buffer");if(e.length!==t.length)throw TypeError("Input buffers must have the same length");let r=e.length,n=0,i=-1;for(;++i>3),"AES-CBC",!1,["decrypt"]),u=await h.subtle.importKey("raw",t.subarray(0,c>>3),{hash:`SHA-${c<<1}`,name:"HMAC"},!1,["sign"]),d=_(o,n,r,g(o.length<<3)),p=new Uint8Array((await h.subtle.sign("HMAC",u,d)).slice(0,c>>3));try{a=eD(i,p)}catch{}if(!a)throw new H;try{s=new Uint8Array(await h.subtle.decrypt({iv:n,name:"AES-CBC"},l,r))}catch{}if(!s)throw new H;return s}async function eJ(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await h.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(ee(t,e,"decrypt"),a=t);try{return new Uint8Array(await h.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,_(r,i)))}catch{throw new H}}let e$=async(e,t,r,n,i,o)=>{if(!f(t)&&!(t instanceof Uint8Array))throw TypeError(er(t,...eo,"Uint8Array"));if(!n)throw new U("JWE Initialization Vector missing");if(!i)throw new U("JWE Authentication Tag missing");switch(X(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&Y(t,parseInt(e.slice(-3),10)),eK(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&Y(t,parseInt(e.slice(1,4),10)),eJ(e,t,r,n,i,o);default:throw new I("Unsupported JWE Content Encryption Algorithm")}};async function eB(e,t,r,n){let i=e.slice(0,7),o=await ec(i,r,t,n,new Uint8Array(0));return{encryptedKey:o.ciphertext,iv:x(o.iv),tag:x(o.tag)}}async function eF(e,t,r,n,i){return e$(e.slice(0,7),t,r,n,i,new Uint8Array(0))}async function eG(e,t,r,n,i={}){let o,a,s;switch(eM(e,r,"encrypt"),r=await eC.normalizePublicKey?.(r,e)||r,e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!em(r))throw new I("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:c,apv:l}=i,{epk:u}=i;u||(u=(await ey(r)).privateKey);let{x:d,y:p,crv:h,kty:f}=await eH(u),y=await ef(r,u,"ECDH-ES"===e?t:e,"ECDH-ES"===e?eT(t):parseInt(e.slice(-5,-2),10),c,l);if(a={epk:{x:d,crv:h,kty:f}},"EC"===f&&(a.epk.y=p),c&&(a.apu=x(c)),l&&(a.apv=x(l)),"ECDH-ES"===e){s=y;break}s=n||eO(t);let m=e.slice(-6);o=await ep(m,y,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||eO(t),o=await eE(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||eO(t);let{p2c:c,p2s:l}=i;({encryptedKey:o,...a}=await e_(e,r,s,c,l));break}case"A128KW":case"A192KW":case"A256KW":s=n||eO(t),o=await ep(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||eO(t);let{iv:c}=i;({encryptedKey:o,...a}=await eB(e,r,s,c));break}default:throw new I('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}let eq=(...e)=>{let t;let r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0},ez=function(e,t,r,n,i){let o;if(void 0!==i.crit&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let a of(o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,n.crit)){if(!o.has(a))throw new I(`Extension Header Parameter "${a}" is not recognized`);if(void 0===i[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(o.get(a)&&void 0===n[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(n.crit)};class eV{constructor(e){if(!(e instanceof Uint8Array))throw TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){let r,n,i,o,a;if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new U("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!eq(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new U("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let s={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(ez(U,new Map,t?.crit,this._protectedHeader,s),void 0!==s.zip)throw new I('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:c,enc:l}=s;if("string"!=typeof c||!c)throw new U('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof l||!l)throw new U('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(this._cek&&("dir"===c||"ECDH-ES"===c))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${c}`);{let i;({cek:n,encryptedKey:r,parameters:i}=await eG(c,l,e,this._cek,this._keyManagementParameters)),i&&(t&&G in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...i}:this.setUnprotectedHeader(i):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...i}:this.setProtectedHeader(i))}o=this._protectedHeader?m.encode(x(JSON.stringify(this._protectedHeader))):m.encode(""),this._aad?(a=x(this._aad),i=_(o,m.encode("."),m.encode(a))):i=o;let{ciphertext:u,tag:d,iv:p}=await ec(l,this._plaintext,n,this._iv,i),h={ciphertext:x(u)};return p&&(h.iv=x(p)),d&&(h.tag=x(d)),r&&(h.encrypted_key=x(r)),a&&(h.aad=a),this._protectedHeader&&(h.protected=w.decode(o)),this._sharedUnprotectedHeader&&(h.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(h.header=this._unprotectedHeader),h}}class eX{constructor(e){this._flattened=new eV(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){let r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}let eY=e=>Math.floor(e.getTime()/1e3),eZ=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,eQ=e=>{let t;let r=eZ.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let n=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*n);break;case"day":case"days":case"d":t=Math.round(86400*n);break;case"week":case"weeks":case"w":t=Math.round(604800*n);break;default:t=Math.round(0x1e187e0*n)}return"-"===r[1]||"ago"===r[4]?-t:t};function e0(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class e1{constructor(e={}){if(!$(e))throw TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return"number"==typeof e?this._payload={...this._payload,nbf:e0("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:e0("setNotBefore",eY(e))}:this._payload={...this._payload,nbf:eY(new Date)+eQ(e)},this}setExpirationTime(e){return"number"==typeof e?this._payload={...this._payload,exp:e0("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:e0("setExpirationTime",eY(e))}:this._payload={...this._payload,exp:eY(new Date)+eQ(e)},this}setIssuedAt(e){return void 0===e?this._payload={...this._payload,iat:eY(new Date)}:e instanceof Date?this._payload={...this._payload,iat:e0("setIssuedAt",eY(e))}:"string"==typeof e?this._payload={...this._payload,iat:e0("setIssuedAt",eY(new Date)+eQ(e))}:this._payload={...this._payload,iat:e0("setIssuedAt",e)},this}}async function e2(e,t){if(!$(e))throw TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return R(e.k);case"RSA":if(void 0!==e.oth)throw new I('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return ex({...e,alg:t});default:throw new I('Unsupported "kty" (Key Type) Parameter value')}}async function e8(e,t,r,n,i){switch(eM(e,t,"decrypt"),t=await eC.normalizePrivateKey?.(t,e)||t,e){case"dir":if(void 0!==r)throw new U("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new U("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let i,o;if(!$(n.epk))throw new U('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!em(t))throw new I("ECDH with the provided key is not allowed or not supported by your javascript runtime");let a=await e2(n.epk,e);if(void 0!==n.apu){if("string"!=typeof n.apu)throw new U('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{i=R(n.apu)}catch{throw new U("Failed to base64url decode the apu")}}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new U('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{o=R(n.apv)}catch{throw new U("Failed to base64url decode the apv")}}let s=await ef(a,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?eT(n.enc):parseInt(e.slice(-5,-2),10),i,o);if("ECDH-ES"===e)return s;if(void 0===r)throw new U("JWE Encrypted Key missing");return eh(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new U("JWE Encrypted Key missing");return eA(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{let o;if(void 0===r)throw new U("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new U('JOSE Header "p2c" (PBES2 Count) missing or invalid');let a=i?.maxPBES2Count||1e4;if(n.p2c>a)throw new U('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new U('JOSE Header "p2s" (PBES2 Salt) missing or invalid');try{o=R(n.p2s)}catch{throw new U("Failed to base64url decode the p2s")}return eb(e,t,r,n.p2c,o)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new U("JWE Encrypted Key missing");return eh(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{let i,o;if(void 0===r)throw new U("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new U('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new U('JOSE Header "tag" (Authentication Tag) missing or invalid');try{i=R(n.iv)}catch{throw new U("Failed to base64url decode the iv")}try{o=R(n.tag)}catch{throw new U("Failed to base64url decode the tag")}return eF(e,t,r,i,o)}default:throw new I('Invalid or unsupported "alg" (JWE Algorithm) header value')}}let e5=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function e6(e,t,r){let n,i,o,a,s,c,l;if(!$(e))throw new U("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new U("JOSE Header missing");if(void 0!==e.iv&&"string"!=typeof e.iv)throw new U("JWE Initialization Vector incorrect type");if("string"!=typeof e.ciphertext)throw new U("JWE Ciphertext missing or incorrect type");if(void 0!==e.tag&&"string"!=typeof e.tag)throw new U("JWE Authentication Tag incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new U("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new U("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new U("JWE AAD incorrect type");if(void 0!==e.header&&!$(e.header))throw new U("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!$(e.unprotected))throw new U("JWE Per-Recipient Unprotected Header incorrect type");if(e.protected)try{let t=R(e.protected);n=JSON.parse(w.decode(t))}catch{throw new U("JWE Protected Header is invalid")}if(!eq(n,e.header,e.unprotected))throw new U("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let u={...n,...e.header,...e.unprotected};if(ez(U,new Map,r?.crit,n,u),void 0!==u.zip)throw new I('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:d,enc:p}=u;if("string"!=typeof d||!d)throw new U("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof p||!p)throw new U("missing JWE Encryption Algorithm (enc) in JWE Header");let h=r&&e5("keyManagementAlgorithms",r.keyManagementAlgorithms),f=r&&e5("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(h&&!h.has(d)||!h&&d.startsWith("PBES2"))throw new O('"alg" (Algorithm) Header Parameter value not allowed');if(f&&!f.has(p))throw new O('"enc" (Encryption Algorithm) Header Parameter value not allowed');if(void 0!==e.encrypted_key)try{i=R(e.encrypted_key)}catch{throw new U("Failed to base64url decode the encrypted_key")}let y=!1;"function"==typeof t&&(t=await t(n,e),y=!0);try{o=await e8(d,t,i,u,r)}catch(e){if(e instanceof TypeError||e instanceof U||e instanceof I)throw e;o=eO(p)}if(void 0!==e.iv)try{a=R(e.iv)}catch{throw new U("Failed to base64url decode the iv")}if(void 0!==e.tag)try{s=R(e.tag)}catch{throw new U("Failed to base64url decode the tag")}let b=m.encode(e.protected??"");c=void 0!==e.aad?_(b,m.encode("."),m.encode(e.aad)):b;try{l=R(e.ciphertext)}catch{throw new U("Failed to base64url decode the ciphertext")}let g={plaintext:await e$(p,o,l,a,s,c)};if(void 0!==e.protected&&(g.protectedHeader=n),void 0!==e.aad)try{g.additionalAuthenticatedData=R(e.aad)}catch{throw new U("Failed to base64url decode the aad")}return(void 0!==e.unprotected&&(g.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(g.unprotectedHeader=e.header),y)?{...g,key:t}:g}async function e3(e,t,r){if(e instanceof Uint8Array&&(e=w.decode(e)),"string"!=typeof e)throw new U("Compact JWE must be a string or Uint8Array");let{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new U("Invalid Compact JWE");let l=await e6({ciphertext:a,iv:o||void 0,protected:n,tag:s||void 0,encrypted_key:i||void 0},t,r),u={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof t?{...u,key:l.key}:u}let e4=e=>e.toLowerCase().replace(/^application\//,""),e9=(e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e))),e7=(e,t,r={})=>{let n,i;try{n=JSON.parse(w.decode(t))}catch{}if(!$(n))throw new N("JWT Claims Set must be a top-level JSON object");let{typ:o}=r;if(o&&("string"!=typeof e.typ||e4(e.typ)!==e4(o)))throw new C('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:s,subject:c,audience:l,maxTokenAge:u}=r,d=[...a];for(let e of(void 0!==u&&d.push("iat"),void 0!==l&&d.push("aud"),void 0!==c&&d.push("sub"),void 0!==s&&d.push("iss"),new Set(d.reverse())))if(!(e in n))throw new C(`missing required "${e}" claim`,n,e,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(n.iss))throw new C('unexpected "iss" claim value',n,"iss","check_failed");if(c&&n.sub!==c)throw new C('unexpected "sub" claim value',n,"sub","check_failed");if(l&&!e9(n.aud,"string"==typeof l?[l]:l))throw new C('unexpected "aud" claim value',n,"aud","check_failed");switch(typeof r.clockTolerance){case"string":i=eQ(r.clockTolerance);break;case"number":i=r.clockTolerance;break;case"undefined":i=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:p}=r,h=eY(p||new Date);if((void 0!==n.iat||u)&&"number"!=typeof n.iat)throw new C('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new C('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>h+i)throw new C('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new C('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=h-i)throw new T('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){let e=h-n.iat;if(e-i>("number"==typeof u?u:eQ(u)))throw new T('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-i)throw new C('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n};async function te(e,t,r){let n=await e3(e,t,r),i=e7(n.protectedHeader,n.plaintext,r),{protectedHeader:o}=n;if(void 0!==o.iss&&o.iss!==i.iss)throw new C('replicated "iss" claim header parameter mismatch',i,"iss","mismatch");if(void 0!==o.sub&&o.sub!==i.sub)throw new C('replicated "sub" claim header parameter mismatch',i,"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(i.aud))throw new C('replicated "aud" claim header parameter mismatch',i,"aud","mismatch");let a={payload:i,protectedHeader:o};return"function"==typeof t?{...a,key:n.key}:a}r(52696);async function tt(e){let{token:t,secret:r,salt:n}=e,i=Array.isArray(r)?r:[r];if(!t)return null;let{payload:o}=await te(t,async({kid:e,enc:t})=>{for(let r of i){let i=await tr(t,r,n);if(void 0===e||e===await F({kty:"oct",k:x(i)},`sha${i.byteLength<<3}`))return i}throw Error("no matching decryption secret")},{clockTolerance:15,keyManagementAlgorithms:["dir"],contentEncryptionAlgorithms:["A256CBC-HS512","A256GCM"]});return o}async function tr(e,t,r){let n;switch(e){case"A256CBC-HS512":n=64;break;case"A256GCM":n=32;break;default:throw Error("Unsupported JWT Content Encryption Algorithm")}return await p("sha256",t,r,`Auth.js Generated Encryption Key (${r})`,n)}Symbol("skip-csrf-check"),Symbol("return-type-raw"),Symbol("custom-fetch"),Symbol("conform-internal");var tn,ti,to,ta,ts,tc={},tl=[],tu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function td(e,t){for(var r in t)e[r]=t[r];return e}function tp(e){var t=e.parentNode;t&&t.removeChild(e)}function th(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++to:i};return null==i&&null!=ti.vnode&&ti.vnode(o),o}function tf(e){return e.children}function ty(e,t){this.props=e,this.context=t}function tm(e,t){if(null==t)return e.__?tm(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t0?th(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=r,h.__b=r.__b+1,null===(p=w[u])||p&&h.key==p.key&&h.type===p.type)w[u]=void 0;else for(d=0;d<_;d++){if((p=w[d])&&h.key==p.key&&h.type===p.type){w[d]=void 0;break}p=null}tx(e,h,p=p||tc,i,o,a,s,c,l),f=h.__e,(d=h.ref)&&p.ref!=d&&(m||(m=[]),p.ref&&m.push(p.ref,null,h),m.push(d,h.__c||f,h)),null!=f?(null==y&&(y=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=c=function e(t,r,n){for(var i,o=t.__k,a=0;o&&a2&&(a.children=arguments.length>3?tn.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return th(e,a,n,i,null)}(tf,null,[r]),i||tc,tc,void 0!==t.ownerSVGElement,!n&&tC?[tC]:i?null:t.firstChild?tn.call(t.childNodes):null,o,!n&&tC?tC:i?i.__e:t.firstChild,n),tk(o,r)}tn=tl.slice,ti={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},to=0,ty.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=td({},this.state),"function"==typeof e&&(e=e(td({},r),this.props)),e&&td(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),tw(this))},ty.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tw(this))},ty.prototype.render=tf,ta=[],t_.__r=0;var tT=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,tO=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,tI=/[\s\n\\/='"\0<>]/,tH=/^xlink:?./,tU=/["&<]/;function tW(e){if(!1===tU.test(e+=""))return e;for(var t=0,r=0,n="",i="";r(t||40)||!r&&-1!==String(e).indexOf("\n")||-1!==String(e).indexOf("<")},tL={},tM=/([A-Z])/g;function tD(e){var t="";for(var r in e){var n=e[r];null!=n&&""!==n&&(t&&(t+=" "),t+="-"==r[0]?r:tL[r]||(tL[r]=r.replace(tM,"-$1").toLowerCase()),t="number"==typeof n&&!1===tT.test(r)?t+": "+n+"px;":t+": "+n+";")}return t||void 0}function tK(e,t){return Array.isArray(t)?t.reduce(tK,e):null!=t&&!1!==t&&e.push(t),e}function tJ(){this.__d=!0}function t$(e,t){return{__v:e,context:t,props:e.props,setState:tJ,forceUpdate:tJ,__d:!0,__h:[]}}function tB(e,t){var r=e.contextType,n=r&&t[r.__c];return null!=r?n?n.props.value:r.__:t}var tF=[],tG={shallow:!0};tz.render=tz;var tq=[];function tz(e,t,r){t=t||{};var n,i=ti.__s;return ti.__s=!0,n=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?function e(t,r,n,i,o,a){if(null==t||"boolean"==typeof t)return"";if("object"!=typeof t)return tW(t);var s=n.pretty,c=s&&"string"==typeof s?s:" ";if(Array.isArray(t)){for(var l="",u=0;u0&&(l+="\n"),l+=e(t[u],r,n,i,o,a);return l}var d,p=t.type,h=t.props,f=!1;if("function"==typeof p){if(f=!0,!n.shallow||!i&&!1!==n.renderRootComponent){if(p===tf){var y=[];return tK(y,t.props.children),e(y,r,n,!1!==n.shallowHighOrder,o,a)}var m,w=t.__c=t$(t,r);ti.__b&&ti.__b(t);var _=ti.__r;if(p.prototype&&"function"==typeof p.prototype.render){var b=tB(p,r);(w=t.__c=new p(h,b)).__v=t,w._dirty=w.__d=!0,w.props=h,null==w.state&&(w.state={}),null==w._nextState&&null==w.__s&&(w._nextState=w.__s=w.state),w.context=b,p.getDerivedStateFromProps?w.state=Object.assign({},w.state,p.getDerivedStateFromProps(w.props,w.state)):w.componentWillMount&&(w.componentWillMount(),w.state=w._nextState!==w.state?w._nextState:w.__s!==w.state?w.__s:w.state),_&&_(t),m=w.render(w.props,w.state,w.context)}else for(var g=tB(p,r),v=0;w.__d&&v++<25;)w.__d=!1,_&&_(t),m=p.call(t.__c,h,g);return w.getChildContext&&(r=Object.assign({},r,w.getChildContext())),ti.diffed&&ti.diffed(t),e(m,r,n,!1!==n.shallowHighOrder,o,a)}p=(d=p).displayName||d!==Function&&d.name||function(e){var t=(Function.prototype.toString.call(e).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!t){for(var r=-1,n=tF.length;n--;)if(tF[n]===e){r=n;break}r<0&&(r=tF.push(e)-1),t="UnnamedComponent"+r}return t}(d)}var E,A,S="<"+p;if(h){var x=Object.keys(h);n&&!0===n.sortAttributes&&x.sort();for(var k=0;k",tI.test(p))throw Error(p+" is not a valid HTML tag name in "+S);var O,I=tO.test(p)||n.voidElements&&n.voidElements.test(p),H=[];if(A)s&&tj(A)&&(A="\n"+c+tN(A,c)),S+=A;else if(null!=E&&tK(O=[],E).length){for(var U=s&&~S.indexOf("\n"),W=!1,N=0;N0&&"<"!=L[0];W&&M?H[H.length-1]+=L:H.push(L),W=M}else H.push(L)}}}if(s&&U)for(var D=H.length;D--;)H[D]="\n"+c+tN(H[D],c)}if(H.length||A)S+=H.join("");else if(n&&n.xml)return S.substring(0,S.length-1)+" />";return!I||O||A?(s&&~S.indexOf("\n")&&(S+="\n"),S=S+""):S=S.replace(/>$/," />"),S}(e,t,r):function e(t,r,n,i){if(null==t||!0===t||!1===t||""===t)return"";if("object"!=typeof t)return tW(t);if(tV(t)){for(var o="",a=0;a",tI.test(s))throw Error(s+" is not a valid HTML tag name in "+b);var k="",R=!1;if(_)k+=_,R=!0;else if("string"==typeof w)k+=tW(w),R=!0;else if(tV(w))for(var P=0;P";return b+""}(e,t,!1,void 0),ti.__c&&ti.__c(e,tq),ti.__s=i,tq.length=0,n}var tV=Array.isArray,tX=Object.assign;function tY(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}tz.shallowRender=function(e,t){return tz(e,t,tG)},"undefined"!=typeof navigator&&navigator.userAgent?.startsWith?.("Mozilla/5.0 ")||(o="oauth4webapi/v3.1.4");let tZ="ERR_INVALID_ARG_VALUE",tQ="ERR_INVALID_ARG_TYPE";function t0(e,t,r){let n=TypeError(e,{cause:r});return Object.assign(n,{code:t}),n}let t1=Symbol(),t2=Symbol(),t8=Symbol(),t5=Symbol(),t6=(Symbol(),Symbol()),t3=Symbol(),t4=new TextEncoder,t9=new TextDecoder;function t7(e){return"string"==typeof e?t4.encode(e):t9.decode(e)}function re(e){return"string"==typeof e?function(e){try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),r=new Uint8Array(t.length);for(let e=0;e0)return;if(t&&0!==e)throw t0(`${r} must be a non-negative number`,tZ,i);throw t0(`${r} must be a positive number`,tZ,i)}catch(e){if(n)throw rn(e.message,n,i);throw e}}function rs(e,t,r,n){try{if("string"!=typeof e)throw t0(`${t} must be a string`,tQ,n);if(0===e.length)throw t0(`${t} must not be empty`,tZ,n)}catch(e){if(r)throw rn(e.message,r,n);throw e}}function rc(e){!function(e,t){if(rv(e)!==t)throw rl(e,t)}(e,"application/json")}function rl(e,...t){let r='"response" content-type must be ';if(t.length>2){let e=t.pop();r+=`${t.join(", ")}, or ${e}`}else 2===t.length?r+=`${t[0]} or ${t[1]}`:r+=t[0];return rn(r,rW,e)}function ru(){return Math.floor(Date.now()/1e3)}function rd(e){if("object"!=typeof e||null===e)throw t0('"as" must be an object',tQ);rs(e.issuer,'"as.issuer"')}async function rp(e){let{kty:t,e:r,n,x:i,y:o,crv:s}=await crypto.subtle.exportKey("jwk",e),c={kty:t,e:r,n,x:i,y:o,crv:s};return a.set(e,c),c}let rh=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function rf(e,t,r,n){let i;if("string"!=typeof e||!(i=rh(e)))throw rn(`authorization server metadata does not contain a valid ${r?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,void 0===e?rJ:r$,{attribute:r?`mtls_endpoint_aliases.${t}`:t});return function(e,t){if(t&&"https:"!==e.protocol)throw rn("only requests to HTTPS are allowed",rj,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw rn("only HTTP and HTTPS requests are allowed",rL,e)}(i,n),i}class ry extends Error{cause;code;error;status;error_description;response;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=rT,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}),Error.captureStackTrace?.(this,this.constructor)}}class rm extends Error{cause;code;response;status;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=rC,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),Error.captureStackTrace?.(this,this.constructor)}}let rw=/((?:,|, )?[0-9a-zA-Z!#$%&'*+-.^_`|~]+=)/,r_=/(?:^|, ?)([0-9a-zA-Z!#$%&'*+\-.^_`|~]+)(?=$|[ ,])/g;function rb(e,t,r,n){(s||=new WeakMap).set(e,{jwks:t,uat:r,get age(){return ru()-this.uat}}),n&&Object.assign(n,{jwks:structuredClone(t),uat:r})}function rg(e,t){s?.delete(e),delete t?.jwks,delete t?.uat}function rv(e){return e.headers.get("content-type")?.split(";")[0]}Symbol();let rE=new WeakMap,rA=new WeakMap;function rS(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw rn('unexpected JWT "aud" (audience) claim value',rD,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw rn('unexpected JWT "aud" (audience) claim value',rD,{expected:e,claims:t.claims,claim:"aud"});return t}function rx(e,t){let r=e[r1]?.(t)??e.issuer;if(t.claims.iss!==r)throw rn('unexpected JWT "iss" (issuer) claim value',rD,{expected:r,claims:t.claims,claim:"iss"});return t}let rk=new WeakSet,rR={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 rP(e,t){for(let r of e)if(void 0===t.claims[r])throw rn(`JWT "${r}" (${rR[r]}) claim missing`,rU,{claims:t.claims});return t}Symbol(),Symbol();let rC="OAUTH_WWW_AUTHENTICATE_CHALLENGE",rT="OAUTH_RESPONSE_BODY_ERROR",rO="OAUTH_UNSUPPORTED_OPERATION",rI="OAUTH_AUTHORIZATION_RESPONSE_ERROR",rH="OAUTH_PARSE_ERROR",rU="OAUTH_INVALID_RESPONSE",rW="OAUTH_RESPONSE_IS_NOT_JSON",rN="OAUTH_RESPONSE_IS_NOT_CONFORM",rj="OAUTH_HTTP_REQUEST_FORBIDDEN",rL="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",rM="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",rD="OAUTH_JWT_CLAIM_COMPARISON_FAILED",rK="OAUTH_KEY_SELECTION_FAILED",rJ="OAUTH_MISSING_SERVER_METADATA",r$="OAUTH_INVALID_SERVER_METADATA";function rB(e){if(e.bodyUsed)throw t0('"response" body has been used already',tZ)}async function rF(e,t){var r,n,i,a;rd(e);let s=(r=e,n="jwks_uri",i=!1,a=t?.[t1]!==!0,i&&r.mtls_endpoint_aliases&&n in r.mtls_endpoint_aliases?rf(r.mtls_endpoint_aliases[n],n,i,a):rf(r[n],n,i,a)),c=function(e){tY(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e);if(o&&!t.has("user-agent")&&t.set("user-agent",o),t.has("authorization"))throw t0('"options.headers" must not include the "authorization" header name',tZ);if(t.has("dpop"))throw t0('"options.headers" must not include the "dpop" header name',tZ);return t}(t?.headers);return c.set("accept","application/json"),c.append("accept","application/jwk-set+json"),(t?.[t5]||fetch)(s.href,{body:void 0,headers:Object.fromEntries(c.entries()),method:"GET",redirect:"manual",signal:t?.signal?ro(t.signal):void 0})}async function rG(e){let t;if(!tY(e,Response))throw t0('"response" must be an instance of Response',tQ);if(200!==e.status)throw rn('"response" is not a conform JSON Web Key Set response (unexpected HTTP status code)',rN,e);rB(e),function(e,...t){if(!t.includes(rv(e)))throw rl(e,...t)}(e,"application/json","application/jwk-set+json");try{t=await e.json()}catch(e){throw rn('failed to parse "response" body as JSON',rH,e)}if(!ri(t))throw rn('"response" body must be a top level object',rU,{body:t});if(!Array.isArray(t.keys))throw rn('"response" body "keys" property must be an array',rU,{body:t});if(!Array.prototype.every.call(t.keys,ri))throw rn('"response" body "keys" property members must be JWK formatted objects',rU,{body:t});return t}async function rq(e){if(e.status>399&&e.status<500){rB(e),rc(e);try{let t=await e.clone().json();if(ri(t)&&"string"==typeof t.error&&t.error.length)return t}catch{}}}function rz(e){let{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new rt(`unsupported ${t.name} modulusLength`,{cause:e})}function rV(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:function(e){let{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new rt("unsupported ECDSA namedCurve",{cause:e})}}(e)};case"RSA-PSS":switch(rz(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 rt("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return rz(e),e.algorithm.name;case"Ed25519":case"EdDSA":return e.algorithm.name}throw new rt("unsupported CryptoKey algorithm name",{cause:e})}async function rX(e,t,r,n,i){let o,a,{0:s,1:c,length:l}=e.split(".");if(5===l){if(void 0!==i)e=await i(e),{0:s,1:c,length:l}=e.split(".");else throw new rt("JWE decryption is not configured",{cause:e})}if(3!==l)throw rn("Invalid JWT",rU,e);try{o=JSON.parse(t7(re(s)))}catch(e){throw rn("failed to parse JWT Header body as base64url encoded JSON",rH,e)}if(!ri(o))throw rn("JWT Header must be a top level object",rU,e);if(t(o),void 0!==o.crit)throw new rt('no JWT "crit" header parameter extensions are supported',{cause:{header:o}});try{a=JSON.parse(t7(re(c)))}catch(e){throw rn("failed to parse JWT Payload body as base64url encoded JSON",rH,e)}if(!ri(a))throw rn("JWT Payload must be a top level object",rU,e);let u=ru()+r;if(void 0!==a.exp){if("number"!=typeof a.exp)throw rn('unexpected JWT "exp" (expiration time) claim type',rU,{claims:a});if(a.exp<=u-n)throw rn('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',rM,{claims:a,now:u,tolerance:n,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw rn('unexpected JWT "iat" (issued at) claim type',rU,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw rn('unexpected JWT "iss" (issuer) claim type',rU,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw rn('unexpected JWT "nbf" (not before) claim type',rU,{claims:a});if(a.nbf>u+n)throw rn('unexpected JWT "nbf" (not before) claim value',rM,{claims:a,now:u,tolerance:n,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw rn('unexpected JWT "aud" (audience) claim type',rU,{claims:a});return{header:o,claims:a,jwt:e}}async function rY(e,t,r){let n;switch(t.alg){case"RS256":case"PS256":case"ES256":n="SHA-256";break;case"RS384":case"PS384":case"ES384":n="SHA-384";break;case"RS512":case"PS512":case"ES512":case"Ed25519":case"EdDSA":n="SHA-512";break;default:throw new rt(`unsupported JWS algorithm for ${r} calculation`,{cause:{alg:t.alg}})}let i=await crypto.subtle.digest(n,t7(e));return re(i.slice(0,i.byteLength/2))}async function rZ(e){if(e.bodyUsed)throw t0("form_post Request instances must contain a readable body",tZ,{cause:e});return e.text()}function rQ(e,t,r,n){if(void 0!==e){if("string"==typeof e?n.alg!==e:!e.includes(n.alg))throw rn('unexpected JWT "alg" header parameter',rU,{header:n,expected:e,reason:"client configuration"});return}if(Array.isArray(t)){if(!t.includes(n.alg))throw rn('unexpected JWT "alg" header parameter',rU,{header:n,expected:t,reason:"authorization server metadata"});return}if(void 0!==r){if("string"==typeof r?n.alg!==r:"function"==typeof r?!r(n.alg):!r.includes(n.alg))throw rn('unexpected JWT "alg" header parameter',rU,{header:n,expected:r,reason:"default value"});return}throw rn('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:r})}async function r0(e,t){let{ext:r,key_ops:n,use:i,...o}=t;return crypto.subtle.importKey("jwk",o,function(e){switch(e){case"PS256":case"PS384":case"PS512":return{name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`};case"RS256":case"RS384":case"RS512":return{name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`};case"ES256":case"ES384":return{name:"ECDSA",namedCurve:`P-${e.slice(-3)}`};case"ES512":return{name:"ECDSA",namedCurve:"P-521"};case"Ed25519":case"EdDSA":return"Ed25519";default:throw new rt("unsupported JWS algorithm",{cause:{alg:e}})}}(e),!0,["verify"])}Symbol(),Symbol();Symbol(),Symbol();let r1=Symbol();async function r2(e,t,r){try{let{logger:n,cookies:i,jwt:o}=r;if(n.debug(`PARSE_${e.toUpperCase()}`,{cookie:t}),!t)throw new c.k9(`${e} cookie was missing`);let a=await tt({...o,token:t,salt:i[e].name});if(a?.value)return a.value;throw Error("Invalid cookie")}catch(t){throw new c.k9(`${e} value could not be parsed`,{cause:t})}}function r8(e,t){return async function(r,n,i){let{provider:o,logger:a}=i;if(!o?.checks?.includes(e))return;let s=r?.[i.cookies[t].name];a.debug(`USE_${t.toUpperCase()}`,{value:s});let c=await r2(t,s,i);return!function(e,t,r){let{logger:n,cookies:i}=t,o=i[e];n.debug(`CLEAR_${e.toUpperCase()}`,{cookie:o}),r.push({name:o.name,value:"",options:{...i[e].options,maxAge:0}})}(t,i,n),c}}r8("pkce","pkceCodeVerifier"),r8("state","state"),r8("nonce","nonce");var r5=r(58907).Buffer;r(27437),r(37811),r(589),r(54836),r(90155);var r6=r(37811);r(40315),r(37811)}}]);