@slashid/jump-page 0.0.7-beta.3 → 0.0.7-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/astro.config.mjs +0 -8
- package/dist/_astro/app.545e4cdc.js +40 -0
- package/dist/_astro/index.0344e4be.css +1 -0
- package/dist/_astro/index.2f22a71e.css +1 -0
- package/dist/index.html +2 -2
- package/package.json +7 -3
- package/tsconfig.json +1 -4
- package/dist/_astro/app.f7d04798.js +0 -39
- package/dist/_astro/index.2dd0ad08.css +0 -1
- package/dist/_astro/index.cc62d81f.css +0 -1
package/astro.config.mjs
CHANGED
|
@@ -13,13 +13,5 @@ export default defineConfig({
|
|
|
13
13
|
integrations: [react()],
|
|
14
14
|
vite: {
|
|
15
15
|
plugins: [vanillaExtractPlugin()],
|
|
16
|
-
resolve: {
|
|
17
|
-
alias: {
|
|
18
|
-
"@slashid/react-primitives": path.resolve(
|
|
19
|
-
__dirname,
|
|
20
|
-
"../../packages/react-primitives/src/main.ts"
|
|
21
|
-
),
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
16
|
},
|
|
25
17
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{r as x,R as Zr}from"./index.03be2d59.js";/* empty css */var Qr={exports:{}},lt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ho=x,Go=Symbol.for("react.element"),Wo=Symbol.for("react.fragment"),Ko=Object.prototype.hasOwnProperty,Yo=Ho.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jo={key:!0,ref:!0,__self:!0,__source:!0};function es(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Ko.call(t,r)&&!jo.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Go,type:e,key:o,ref:i,props:s,_owner:Yo.current}}lt.Fragment=Wo;lt.jsx=es;lt.jsxs=es;Qr.exports=lt;var l=Qr.exports;function N(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var mn={};mn=JSON.parse(`{"name":"@slashid/slashid","private":false,"publishConfig":{"access":"public"},"version":"3.17.4-beta.3","description":"Client SDK for the /id platform","homepage":"https://slashid.dev","author":"SlashID","license":"MIT","main":"./dist/bundle/slashid.js","module":"./dist/esmodule/slashid.esm.js","esmodule":"./dist/esmodule/slashid.esm.js","commonjs":"./dist/commonjs/slashid.cjs.js","bundle":"./dist/bundle/slashid.js","types":"./dist/types/slashid.d.ts","exports":{".":{"require":"./dist/commonjs/slashid.cjs.js","import":"./dist/esmodule/slashid.esm.js","default":"./dist/commonjs/slashid.cjs.js","types":"./dist/types/slashid.d.ts"}},"targets":{"esmodule":{"source":"src/targets/package.ts","context":"browser","isLibrary":true,"outputFormat":"esmodule","engines":{"browsers":["and_chr >= 73","chrome >= 73","and_ff >= 67","android >= 114","edge >= 79","samsung >= 11.2","safari >= 13","ios_saf >= 13.1","opera >= 60","firefox >= 67","unreleased and_chr versions","unreleased chrome versions","unreleased and_ff versions","unreleased android versions","unreleased edge versions","unreleased samsung versions","unreleased safari versions","unreleased ios_saf versions","unreleased opera versions","unreleased firefox versions"]}},"commonjs":{"source":"src/targets/package.ts","context":"node","isLibrary":true,"outputFormat":"commonjs","engines":{"node":">= 12"}},"bundle":{"source":"src/targets/bundle.ts","context":"browser","outputFormat":"global","engines":{"browsers":["> 0.5%","last 2 versions","not dead"]}},"page":{"source":"static/sdk.html","context":"browser","engines":{"browsers":["and_chr >= 73","chrome >= 73","and_ff >= 67","android >= 114","edge >= 79","samsung >= 11.2","safari >= 13","ios_saf >= 13.1","opera >= 60","firefox >= 67","unreleased and_chr versions","unreleased chrome versions","unreleased and_ff versions","unreleased android versions","unreleased edge versions","unreleased samsung versions","unreleased safari versions","unreleased ios_saf versions","unreleased opera versions","unreleased firefox versions"]}},"types":{"source":"src/targets/package.ts"}},"files":["dist/esmodule","dist/commonjs","dist/types"],"keywords":["slashid","SlashID","auth","openid","authentication","jwt","browser"],"scripts":{"clean":"rm -rf dist docs","lint":"eslint ./src --ext .ts","format":"prettier --config .prettierrc.json 'src/**/*.ts' --write","test:ts":"tsc --project tsconfig.json --noEmit","test:unit":"jest","test:unit:watch":"jest --watch","test:unit:ci":"jest --ci","test:integration":"playwright test","build":"rm -rf dist && parcel build && cp compat/esmodule/package.json dist/esmodule","docs":"rm -rf docs && typedoc","dist":"npm run lint && npm run build","all":"npm run dist && npm run docs","serve:all":"parcel serve 'static/*.html' --port 8080","serve:example":"parcel serve static/index.html --port 8080","serve:jump":"parcel serve static/sdk.html --port 8080","serve:docs":"parcel serve docs/index.html --port 8081","push:docs":"aws s3 sync docs s3://slashiddoc/sdk/v$(node tools/version.js --major) && (aws cloudfront create-invalidation --distribution-id ETLBNGAAF97EN --paths \\"/*\\")","changeset":"changeset","prepublishOnly":"npm run all","publish:ci":"npm run build && changeset publish"},"devDependencies":{"@parcel/core":"2.9.3","@parcel/packager-ts":"2.9.3","@parcel/transformer-babel":"2.9.3","@parcel/transformer-js":"2.9.3","@parcel/transformer-json":"2.9.3","@parcel/transformer-react-refresh-wrap":"2.9.3","@parcel/transformer-typescript-types":"2.9.3","@playwright/test":"^1.25.0","@types/jest":"^28.1.7","@types/node":"~15.0.2","@types/qrcode":"^1.5.0","@typescript-eslint/eslint-plugin":"^4.15.1","@typescript-eslint/parser":"^4.15.1","danger":"^11.2.6","eslint":"^7.20.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","isomorphic-fetch":"^3.0.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","jest-fetch-mock":"^3.0.3","parcel":"^2.7.0","prettier":"^2.7.1","ts-jest":"^28.0.8","typedoc":"^0.23.00","typedoc-plugin-mdn-links":"^2.0.0","typedoc-plugin-missing-exports":"^1.0.0","typescript":"~4.7.0"},"dependencies":{"@changesets/cli":"^2.26.2","@types/uuid":"8.3.4","changeset":"^0.2.6","docdash":"^1.2.0","jwt-decode":"^3.1.2","mitt":"^3.0.0","qrcode":"^1.5.1","querystring-es3":"^0.2.1","regenerator-runtime":"^0.13.9","url":"^0.11.0","uuid":"8.3.2"}}`);const[Jo,Xo,Zo]=mn.version.split("."),I={major:Jo,minor:Xo,patch:Zo,raw:mn.version},Qo="https://api.slashid.com".replace(/\/+$/,"");class xe{set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:Qo}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||ts}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(t={}){this.configuration=t}}const $e=new xe;class ae{withMiddleware(...t){const n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(...t){const n=t.map(r=>({pre:r}));return this.withMiddleware(...n)}withPostMiddleware(...t){const n=t.map(r=>({post:r}));return this.withMiddleware(...n)}isJsonMime(t){return t?ae.jsonRegex.test(t):!1}async request(t,n){const{url:r,init:s}=await this.createFetchParams(t,n),o=await this.fetchApi(r,s);if(o&&o.status>=200&&o.status<300)return o;throw new ni(o,"Response returned an error code")}async createFetchParams(t,n){let r=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(r+="?"+this.configuration.queryParamsStringify(t.query));const s=Object.assign({},this.configuration.headers,t.headers);Object.keys(s).forEach(d=>s[d]===void 0?delete s[d]:{});const o=typeof n=="function"?n:async()=>n,i={method:t.method,headers:s,body:t.body,credentials:this.configuration.credentials},a={...i,...await o({init:i,context:t})},c={...a,body:ti(a.body)||a.body instanceof URLSearchParams||ei(a.body)?a.body:JSON.stringify(a.body)};return{url:r,init:c}}clone(){const t=this.constructor,n=new t(this.configuration);return n.middleware=this.middleware.slice(),n}constructor(t=$e){this.configuration=t,this.fetchApi=async(n,r)=>{let s={url:n,init:r};for(const i of this.middleware)i.pre&&(s=await i.pre({fetch:this.fetchApi,...s})||s);let o;try{o=await(this.configuration.fetchApi||fetch)(s.url,s.init)}catch(i){for(const a of this.middleware)a.onError&&(o=await a.onError({fetch:this.fetchApi,url:s.url,init:s.init,error:i,response:o?o.clone():void 0})||o);if(o===void 0)throw i instanceof Error?new ri(i,"The request failed and the interceptors did not return an alternative response"):i}for(const i of this.middleware)i.post&&(o=await i.post({fetch:this.fetchApi,url:s.url,init:s.init,response:o.clone()})||o);return o},this.middleware=t.middleware}}ae.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");function ei(e){return typeof Blob<"u"&&e instanceof Blob}function ti(e){return typeof FormData<"u"&&e instanceof FormData}class ni extends Error{constructor(t,n){super(n),this.response=t,this.name="ResponseError"}}class ri extends Error{constructor(t,n){super(n),this.cause=t,this.name="FetchError"}}class $ extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const zt={csv:",",ssv:" ",tsv:" ",pipes:"|"};function p(e,t){const n=e[t];return n!=null}function ts(e,t=""){return Object.keys(e).map(n=>ns(n,e[n],t)).filter(n=>n.length>0).join("&")}function ns(e,t,n=""){const r=n+(n.length?`[${e}]`:e);if(t instanceof Array){const s=t.map(o=>encodeURIComponent(String(o))).join(`&${encodeURIComponent(r)}=`);return`${encodeURIComponent(r)}=${s}`}if(t instanceof Set){const s=Array.from(t);return ns(e,s,n)}return t instanceof Date?`${encodeURIComponent(r)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?ts(t,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(t))}`}class v{async value(){return this.transformer(await this.raw.json())}constructor(t,n=r=>r){this.raw=t,this.transformer=n}}class ot{async value(){}constructor(t){this.raw=t}}function si(e){return oi(e)}function oi(e,t){return e==null?e:{limit:e.limit,offset:e.offset,total_count:e.total_count}}function F(e){return ii(e)}function ii(e,t){return e==null?e:{pagination:p(e,"pagination")?si(e.pagination):void 0}}function q(e){return ai(e)}function ai(e,t){return e==null?e:{httpcode:p(e,"httpcode")?e.httpcode:void 0,message:p(e,"message")?e.message:void 0}}function Lt(e){return ci(e)}function ci(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0}}const A={Proxy:"proxy",WebauthnCreate:"webauthn_create",WebauthnGet:"webauthn_get",Nonce:"nonce",Otp:"otp",Oidc:"oidc",Saml:"saml",PasswordSet:"password_set",PasswordVerify:"password_verify",PasswordReset:"password_reset"};function Y(e){return di(e)}function di(e,t){return e}function ui(e){if(e!==void 0)return e===null?null:{challenge:e.challenge}}function li(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:ui(e.data)}}function fi(e){if(e!==void 0)return e===null?null:{otp:e.otp}}function hi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:fi(e.data)}}function pi(e){if(e!==void 0)return e===null?null:{password:e.password}}function gi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:pi(e.data)}}function _i(e){if(e!==void 0)return e===null?null:{password:e.password}}function mi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:_i(e.data)}}function bi(e){if(e!==void 0)return e===null?null:{password:e.password}}function wi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:bi(e.data)}}function yi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:e.data}}function xi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:e.data}}function qn(e){if(e!==void 0){if(e===null)return null;switch(e.challenge_type){case"nonce":return li(e);case"otp":return hi(e);case"password_reset":return gi(e);case"password_set":return mi(e);case"password_verify":return wi(e);case"webauthn_create":return yi(e);case"webauthn_get":return xi(e);default:throw new Error(`No variant of Attestation exists with 'challenge_type=${e.challenge_type}'`)}}}const D={Webauthn:"webauthn",EmailLink:"email_link",SmsLink:"sms_link",OtpViaSms:"otp_via_sms",OtpViaEmail:"otp_via_email",Oidc:"oidc",Saml:"saml",Api:"api",DirectId:"direct_id",Password:"password"};function j(e){return $i(e)}function $i(e,t){return e}function rs(e){return e}const _e={EmailAddress:"email_address",PhoneNumber:"phone_number"};function Si(e){return vi(e)}function vi(e,t){return e}function ss(e){return Ei(e)}function Ei(e,t){return e==null?e:{type:Si(e.type),value:e.value}}function ft(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value}}function Ci(e){return ki(e)}function ki(e,t){return e}function Ii(e){return Ri(e)}function Ri(e,t){return e==null?e:{challenge:p(e,"challenge")?e.challenge:void 0}}function Di(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:p(e,"options")?Ii(e.options):void 0}}function Ti(e){return Oi(e)}function Oi(e,t){return e==null?e:{auth_code_url:e.auth_code_url}}function Ai(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:Ti(e.options)}}function zi(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method)}}function Li(e){return Pi(e)}function Pi(e,t){return e}function Ni(e){return Ui(e)}function Ui(e,t){return e}function Mi(e){return Vi(e)}function Vi(e,t){return e==null?e:{name:Ci(e.name),pattern:e.pattern,match_type:Li(e.match_type),pattern_qualifiers:p(e,"pattern_qualifiers")?e.pattern_qualifiers.map(Ni):void 0}}function os(e){return Bi(e)}function Bi(e,t){return e==null?e:{regular_expressions:p(e,"regular_expressions")?e.regular_expressions.map(Mi):void 0}}function Fi(e){return qi(e)}function qi(e,t){return e==null?e:{validation_rules:os(e.validation_rules)}}function Hi(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:Fi(e.options)}}function Gi(e){return Wi(e)}function Wi(e,t){return e==null?e:{validation_rules:os(e.validation_rules)}}function Ki(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:Gi(e.options)}}function Yi(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method)}}function ji(e){return Ji(e)}function Ji(e,t){return e==null?e:{challenge_id:p(e,"challenge_id")?e.challenge_id:void 0}}function Xi(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:p(e,"options")?ji(e.options):void 0}}function Zi(e){return Qi(e)}function Qi(e,t){return e==null?e:{start_authentication_url:e.start_authentication_url}}function ea(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:Zi(e.options)}}function ta(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:p(e,"options")?e.options:void 0}}function na(e,t){return e==null?e:{id:e.id,type:Y(e.type),authentication_method:j(e.authentication_method),options:p(e,"options")?e.options:void 0}}function ra(e){return sa(e)}function sa(e,t){if(e==null)return e;switch(e.type){case"nonce":return{...Di(e,!0),type:"nonce"};case"oidc":return{...Ai(e,!0),type:"oidc"};case"otp":return{...zi(e,!0),type:"otp"};case"password_reset":return{...Hi(e,!0),type:"password_reset"};case"password_set":return{...Ki(e,!0),type:"password_set"};case"password_verify":return{...Yi(e,!0),type:"password_verify"};case"proxy":return{...Xi(e,!0),type:"proxy"};case"saml":return{...ea(e,!0),type:"saml"};case"webauthn_create":return{...ta(e,!0),type:"webauthn_create"};case"webauthn_get":return{...na(e,!0),type:"webauthn_get"};default:throw new Error(`No variant of ChallengeListInner exists with 'type=${e.type}'`)}}function oa(e){return ia(e)}function ia(e,t){return e}const me={AuthenticationSucceededV1:"AuthenticationSucceeded_v1",AuthenticationFailedV1:"AuthenticationFailed_v1",PersonCreatedV1:"PersonCreated_v1",PersonDeletedV1:"PersonDeleted_v1",VirtualPageLoadedV1:"VirtualPageLoaded_v1",SlashIdsdkLoadedV1:"SlashIDSDKLoaded_v1",PersonIdentifiedV1:"PersonIdentified_v1",PersonLoggedOutV1:"PersonLoggedOut_v1",TokenMintedV1:"TokenMinted_v1",GateServerStartedV1:"GateServerStarted_v1",GateRequestHandledV1:"GateRequestHandled_v1"};function aa(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id,authenticated_methods:e.authenticated_methods===void 0?void 0:e.authenticated_methods.map(rs),failed_authn_method:e.failed_authn_method,failure_reason:e.failure_reason,failure_detail:e.failure_detail,handle:ft(e.handle),challenge_id:e.challenge_id}}function ca(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id,success_authn_method:e.success_authn_method,authenticated_methods:e.authenticated_methods.map(rs),handle:ft(e.handle)}}function da(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id}}function ua(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id}}function la(e){if(e!==void 0)return e===null?null:{event_name:e.event_name}}function fa(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id}}function ha(e){if(e!==void 0){if(e===null)return null;switch(e.event_name){case"AuthenticationFailed_v1":return aa(e);case"AuthenticationSucceeded_v1":return ca(e);case"PersonIdentified_v1":return da(e);case"PersonLoggedOut_v1":return ua(e);case"SlashIDSDKLoaded_v1":return la(e);case"VirtualPageLoaded_v1":return fa(e);default:throw new Error(`No variant of EventPostRequestEventData exists with 'event_name=${e.event_name}'`)}}}function Hn(e){if(e!==void 0)return e===null?null:{organization_id:e.organization_id,analytics_correlation_id:e.analytics_correlation_id,window_location:e.window_location,user_agent:e.user_agent,event_data:ha(e.event_data)}}function pa(e){return ga(e)}function ga(e,t){return e==null?e:{params:p(e,"params")?e.params:void 0,type:oa(e.type),label:p(e,"label")?e.label:void 0,id:e.id,last_used:p(e,"last_used")?new Date(e.last_used):void 0}}const ze={Popup:"popup",Redirect:"redirect"};function _a(e){let t=!0;return t=t&&"client_id"in e,t=t&&"provider"in e,t}function ma(e){if(e!==void 0)return e===null?null:{client_id:e.client_id,provider:e.provider,ux_mode:e.ux_mode,redirect_target:e.redirect_target,requires_groups:e.requires_groups,pkce_code_challenge:e.pkce_code_challenge,csrf_token:e.csrf_token}}const Le={Popup:"popup",Redirect:"redirect"};function ba(e){let t=!0;return t=t&&"provider_credentials_id"in e,t}function wa(e){if(e!==void 0)return e===null?null:{provider_credentials_id:e.provider_credentials_id,ux_mode:e.ux_mode,redirect_target:e.redirect_target,pkce_code_challenge:e.pkce_code_challenge,csrf_token:e.csrf_token}}const ya={None:"none",Indirect:"indirect",Direct:"direct"};const Gn={Any:"any",Platform:"platform",CrossPlatform:"cross_platform"};const xa={Discouraged:"discouraged",Preferred:"preferred",Required:"required"};const $a={Discouraged:"discouraged",Preferred:"preferred",Required:"required"};function Sa(e){return!0}function va(e){if(e!==void 0)return e===null?null:{scope:e.scope,available_credential_ids:e.available_credential_ids,attachment:e.attachment,user_verification:e.user_verification,resident_key:e.resident_key,attestation:e.attestation}}function Ea(e){if(e!==void 0)return e===null?null:_a(e)?ma(e):ba(e)?wa(e):Sa(e)?va(e):{}}function Ca(e){if(e!==void 0)return e===null?null:{method:e.method,options:Ea(e.options)}}function ka(e){return Ia(e)}function Ia(e,t){return e}function Ra(e){return e}function Da(e){return Ta(e)}function Ta(e,t){return e==null?e:{consent_level:ka(e.consent_level),created_at:new Date(e.created_at)}}function Wn(e){if(e!==void 0)return e===null?null:{consent_levels:e.consent_levels.map(Ra)}}function is(e){return Oa(e)}function Oa(e,t){return e==null?e:{consents:e.consents.map(Da)}}function Aa(e){return za(e)}function za(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?e.result:void 0}}function La(e){return Pa(e)}function Pa(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?e.result:void 0}}function Kn(e){return Na(e)}function Na(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?e.result:void 0}}function Pt(e){return Ua(e)}function Ua(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?e.result:void 0}}function Ma(e){return Va(e)}function Va(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?is(e.result):void 0}}function Ba(e){return Fa(e)}function Fa(e,t){return e==null?e:{id:e.id,org_name:e.org_name,tenant_name:e.tenant_name}}function qa(e){return Ha(e)}function Ha(e,t){return e==null?e:{id:e.id,org_name:e.org_name,tenant_name:e.tenant_name,managed_organizations:p(e,"managed_organizations")?e.managed_organizations.map(Ba):void 0}}function Ga(e){return Wa(e)}function Wa(e,t){return e==null?e:{active:e.active,person_id:e.person_id,roles:p(e,"roles")?e.roles:void 0,region:e.region,handles:p(e,"handles")?e.handles.map(ss):void 0,groups:p(e,"groups")?e.groups:void 0,attributes:p(e,"attributes")?e.attributes:void 0}}function Ka(e){return Ya(e)}function Ya(e,t){return e==null?e:{person:Ga(e.person),organizations:e.organizations.map(qa),handles:e.handles.map(ss),credentials:e.credentials.map(pa)}}function ja(e){return Ja(e)}function Ja(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:Ka(e.result)}}function Xa(e){if(e!==void 0)return e===null?null:{handle:ft(e.handle),factor:Ca(e.factor)}}function Za(e){return Qa(e)}function Qa(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?e.result:void 0}}function Nt(e){return ec(e)}function ec(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?e.result.map(ra):void 0}}function tc(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,code:e.code,pkce_code_verifier:e.pkce_code_verifier}}function nc(e){return rc(e)}function rc(e,t){return e==null?e:{valid:e.valid,invalidity_reason:p(e,"invalidity_reason")?e.invalidity_reason:void 0,expires_in_seconds:p(e,"expires_in_seconds")?e.expires_in_seconds:void 0,expires_at:p(e,"expires_at")?new Date(e.expires_at):void 0}}function sc(e){return oc(e)}function oc(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:p(e,"result")?nc(e.result):void 0}}function Yn(e){return ic(e)}function ic(e,t){return e==null?e:{meta:p(e,"meta")?F(e.meta):void 0,errors:p(e,"errors")?e.errors.map(q):void 0,result:is(e.result)}}function ac(e){if(e!==void 0)return e===null?null:{method:e.method}}function cc(e){if(e!==void 0)return e===null?null:{handle:ft(e.handle),factor:ac(e.factor)}}function dc(e){if(e!==void 0)return e===null?null:{token:e.token}}class jn extends ae{async deleteAttributesBucketNameRaw(t,n){if(t.bucketName===null||t.bucketName===void 0)throw new $("bucketName","Required parameter requestParameters.bucketName was null or undefined when calling deleteAttributesBucketName.");const r={};t.attributes&&(r.attributes=t.attributes.join(zt.csv));const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/attributes/{bucket_name}".replace("{bucket_name}",encodeURIComponent(String(t.bucketName))),method:"DELETE",headers:s,query:r},n);return new v(o,i=>Lt(i))}async deleteAttributesBucketName(t,n){return await(await this.deleteAttributesBucketNameRaw(t,n)).value()}async getAttributesRaw(t,n){const r={};t.buckets&&(r.buckets=t.buckets.join(zt.csv));const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/attributes",method:"GET",headers:s,query:r},n);return new v(o,i=>Aa(i))}async getAttributes(t={},n){return await(await this.getAttributesRaw(t,n)).value()}async getAttributesBucketNameRaw(t,n){if(t.bucketName===null||t.bucketName===void 0)throw new $("bucketName","Required parameter requestParameters.bucketName was null or undefined when calling getAttributesBucketName.");const r={};t.attributes&&(r.attributes=t.attributes.join(zt.csv));const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/attributes/{bucket_name}".replace("{bucket_name}",encodeURIComponent(String(t.bucketName))),method:"GET",headers:s,query:r},n);return new v(o,i=>La(i))}async getAttributesBucketName(t,n){return await(await this.getAttributesBucketNameRaw(t,n)).value()}async putAttributesRaw(t,n){if(t.body===null||t.body===void 0)throw new $("body","Required parameter requestParameters.body was null or undefined when calling putAttributes.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/attributes",method:"PUT",headers:s,query:r,body:t.body},n);return new v(o,i=>Lt(i))}async putAttributes(t,n){return await(await this.putAttributesRaw(t,n)).value()}async putAttributesBucketNameRaw(t,n){if(t.bucketName===null||t.bucketName===void 0)throw new $("bucketName","Required parameter requestParameters.bucketName was null or undefined when calling putAttributesBucketName.");if(t.body===null||t.body===void 0)throw new $("body","Required parameter requestParameters.body was null or undefined when calling putAttributesBucketName.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/attributes/{bucket_name}".replace("{bucket_name}",encodeURIComponent(String(t.bucketName))),method:"PUT",headers:s,query:r,body:t.body},n);return new v(o,i=>Lt(i))}async putAttributesBucketName(t,n){return await(await this.putAttributesBucketNameRaw(t,n)).value()}}class it extends ae{async getChallengeChallengeIdRaw(t,n){if(t.challengeId===null||t.challengeId===void 0)throw new $("challengeId","Required parameter requestParameters.challengeId was null or undefined when calling getChallengeChallengeId.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/challenge/{challenge_id}".replace("{challenge_id}",encodeURIComponent(String(t.challengeId))),method:"GET",headers:s,query:r},n);return new v(o,i=>Kn(i))}async getChallengeChallengeId(t,n){return await(await this.getChallengeChallengeIdRaw(t,n)).value()}async getChallengeChallengeIdV2Raw(t,n){if(t.challengeId===null||t.challengeId===void 0)throw new $("challengeId","Required parameter requestParameters.challengeId was null or undefined when calling getChallengeChallengeIdV2.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/challenge/{challenge_id}/v2".replace("{challenge_id}",encodeURIComponent(String(t.challengeId))),method:"GET",headers:s,query:r},n);return new v(o,i=>Pt(i))}async getChallengeChallengeIdV2(t,n){return await(await this.getChallengeChallengeIdV2Raw(t,n)).value()}async getChallengePackChallengePackIdRaw(t,n){if(t.challengePackId===null||t.challengePackId===void 0)throw new $("challengePackId","Required parameter requestParameters.challengePackId was null or undefined when calling getChallengePackChallengePackId.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/challenge_pack/{challenge_pack_id}".replace("{challenge_pack_id}",encodeURIComponent(String(t.challengePackId))),method:"GET",headers:s,query:r},n);return new v(o,i=>Nt(i))}async getChallengePackChallengePackId(t,n){return await(await this.getChallengePackChallengePackIdRaw(t,n)).value()}async getMeRaw(t){const n={},r={};if(this.configuration&&this.configuration.accessToken){const o=this.configuration.accessToken,i=await o("Bearer",[]);i&&(r.Authorization=`Bearer ${i}`)}const s=await this.request({path:"/me",method:"GET",headers:r,query:n},t);return new v(s,o=>ja(o))}async getMe(t){return await(await this.getMeRaw(t)).value()}async getTokenRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new $("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling getToken.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/token",method:"GET",headers:s,query:r},n);return new v(o,i=>Pt(i))}async getToken(t,n){return await(await this.getTokenRaw(t,n)).value()}async postAttestationRaw(t,n){if(t.attestation===null||t.attestation===void 0)throw new $("attestation","Required parameter requestParameters.attestation was null or undefined when calling postAttestation.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/attestation",method:"POST",headers:s,query:r,body:qn(t.attestation)},n);return new v(o,i=>Kn(i))}async postAttestation(t,n){return await(await this.postAttestationRaw(t,n)).value()}async postAttestationV2Raw(t,n){if(t.attestation===null||t.attestation===void 0)throw new $("attestation","Required parameter requestParameters.attestation was null or undefined when calling postAttestationV2.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/attestation/v2",method:"POST",headers:s,query:r,body:qn(t.attestation)},n);return new v(o,i=>Pt(i))}async postAttestationV2(t,n){return await(await this.postAttestationV2Raw(t,n)).value()}async postDirectIdRaw(t,n){const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/direct-id",method:"POST",headers:s,query:r},n);return new v(o,i=>Za(i))}async postDirectId(t={},n){return await(await this.postDirectIdRaw(t,n)).value()}async postIdRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new $("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling postId.");if(t.iDRequest===null||t.iDRequest===void 0)throw new $("iDRequest","Required parameter requestParameters.iDRequest was null or undefined when calling postId.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/id",method:"POST",headers:s,query:r,body:Xa(t.iDRequest)},n);return new v(o,i=>Nt(i))}async postId(t,n){return await(await this.postIdRaw(t,n)).value()}async postRecoverRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new $("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling postRecover.");if(t.recoverRequest===null||t.recoverRequest===void 0)throw new $("recoverRequest","Required parameter requestParameters.recoverRequest was null or undefined when calling postRecover.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/recover",method:"POST",headers:s,query:r,body:cc(t.recoverRequest)},n);return new v(o,i=>Nt(i))}async postRecover(t,n){return await(await this.postRecoverRaw(t,n)).value()}async postSsoResolveRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new $("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling postSsoResolve.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/sso/resolve",method:"POST",headers:s,query:r,body:tc(t.postSsoResolveRequest)},n);return new ot(o)}async postSsoResolve(t,n){await this.postSsoResolveRaw(t,n)}}class uc extends ae{async postActionsSdkRaw(t,n){if(t.eventPostRequest===null||t.eventPostRequest===void 0)throw new $("eventPostRequest","Required parameter requestParameters.eventPostRequest was null or undefined when calling postActionsSdk.");const r={},s={};if(s["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/actions/sdk",method:"POST",headers:s,query:r,body:Hn(t.eventPostRequest)},n);return new ot(o)}async postActionsSdk(t,n){await this.postActionsSdkRaw(t,n)}async postEventsRaw(t,n){if(t.eventPostRequest===null||t.eventPostRequest===void 0)throw new $("eventPostRequest","Required parameter requestParameters.eventPostRequest was null or undefined when calling postEvents.");const r={},s={};if(s["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/events",method:"POST",headers:s,query:r,body:Hn(t.eventPostRequest)},n);return new ot(o)}async postEvents(t,n){await this.postEventsRaw(t,n)}}class Jn extends ae{async deleteConsentGdprRaw(t,n){const r={};t.consentLevels&&(r.consent_levels=t.consentLevels),t.deleteAll!==void 0&&(r.deleteAll=t.deleteAll);const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/consent/gdpr",method:"DELETE",headers:s,query:r},n);return new ot(o)}async deleteConsentGdpr(t={},n){await this.deleteConsentGdprRaw(t,n)}async getConsentGdprRaw(t,n){const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/consent/gdpr",method:"GET",headers:s,query:r},n);return new v(o,i=>Ma(i))}async getConsentGdpr(t={},n){return await(await this.getConsentGdprRaw(t,n)).value()}async postConsentGdprRaw(t,n){if(t.gDPRConsentRequest===null||t.gDPRConsentRequest===void 0)throw new $("gDPRConsentRequest","Required parameter requestParameters.gDPRConsentRequest was null or undefined when calling postConsentGdpr.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/consent/gdpr",method:"POST",headers:s,query:r,body:Wn(t.gDPRConsentRequest)},n);return new v(o,i=>Yn(i))}async postConsentGdpr(t,n){return await(await this.postConsentGdprRaw(t,n)).value()}async putConsentGdprRaw(t,n){if(t.gDPRConsentRequest===null||t.gDPRConsentRequest===void 0)throw new $("gDPRConsentRequest","Required parameter requestParameters.gDPRConsentRequest was null or undefined when calling putConsentGdpr.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/consent/gdpr",method:"PUT",headers:s,query:r,body:Wn(t.gDPRConsentRequest)},n);return new v(o,i=>Yn(i))}async putConsentGdpr(t,n){return await(await this.putConsentGdprRaw(t,n)).value()}}class Xn extends ae{async postTokenValidateRaw(t,n){if(t.validateTokenReq===null||t.validateTokenReq===void 0)throw new $("validateTokenReq","Required parameter requestParameters.validateTokenReq was null or undefined when calling postTokenValidate.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(s.Authorization=`Bearer ${a}`)}const o=await this.request({path:"/token/validate",method:"POST",headers:s,query:r,body:dc(t.validateTokenReq)},n);return new v(o,i=>sc(i))}async postTokenValidate(t,n){return await(await this.postTokenValidateRaw(t,n)).value()}}function lc(){const n=window.screenX+(window.innerWidth-400)/2;return`width=400,height=600,top=${window.screenY+(window.innerHeight-600)/2},left=${n},resizable,scrollbars=yes,status=1`}function as(){const e=lc(),t=window.open(window.location.href,"/id:popup",e);if(!t)throw new Error("SlashId: Popup blocked, please consider redirect instead");const n='<div style="position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);">You will be redirected in a moment...</div>';try{var r;t==null||(r=t.document)===null||r===void 0||r.write(n)}catch(o){console.error(o),t.document&&t.document.body&&(t.document.body.innerHTML=n)}finally{t.blur()}return[t,o=>(t&&(t.location=o,t.focus()),t)]}function fc(e,t){return e.origin+e.pathname===t.origin+t.pathname}function cs(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}var Xe,hc=new Uint8Array(16);function pc(){if(!Xe&&(Xe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xe(hc)}var gc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function _c(e){return typeof e=="string"&&gc.test(e)}var mc=_c,k=[];for(var Ut=0;Ut<256;++Ut)k.push((Ut+256).toString(16).substr(1));function bc(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(k[e[t+0]]+k[e[t+1]]+k[e[t+2]]+k[e[t+3]]+"-"+k[e[t+4]]+k[e[t+5]]+"-"+k[e[t+6]]+k[e[t+7]]+"-"+k[e[t+8]]+k[e[t+9]]+"-"+k[e[t+10]]+k[e[t+11]]+k[e[t+12]]+k[e[t+13]]+k[e[t+14]]+k[e[t+15]]).toLowerCase();if(!mc(n))throw TypeError("Stringified UUID is invalid");return n}var wc=bc;function yc(e,t,n){e=e||{};var r=e.random||(e.rng||pc)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=r[s];return t}return wc(r)}var Pe=yc;function be(e){const t=e.replace(/_/g,"/").replace(/-/g,"+"),n=atob(t);return Uint8Array.from(n,r=>r.charCodeAt(0))}function X(e,t=!0){const n=String.fromCharCode(...e),r=btoa(n);return t?r.replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,""):r}const xc="challenges",$c="sidcp",Kt="@SLASHID/CSRF_TOKEN",Yt="@SLASHID/PKCE_CODE_VERIFIER";var P;(function(e){e[e.StorageGetItem=0]="StorageGetItem",e[e.StorageSetItem=1]="StorageSetItem",e[e.Ping=2]="Ping",e[e.ChallengeWebauthnCreate=3]="ChallengeWebauthnCreate",e[e.ChallengeWebauthnGet=4]="ChallengeWebauthnGet",e[e.SSOChallenge=5]="SSOChallenge"})(P||(P={}));class Sc{constructor(){this.id=Ge(),this.type=P.Ping}}class Zn{constructor(t,n){this.id=t,this.error=n}}class vc{constructor(t,n){this.type=P.ChallengeWebauthnCreate,this.id=Ge(),this.slashIDOptions=t,this.challenge=n}}class Qn{constructor(t,n,r){this.id=t,this.attestation=n,this.error=r}}class Ec{constructor(t,n){this.type=P.ChallengeWebauthnGet,this.id=Ge(),this.slashIDOptions=t,this.challenge=n}}class er{constructor(t,n,r){this.id=t,this.attestation=n,this.error=r}}class Cc{constructor(t){this.type=P.StorageGetItem,this.id=Ge(),this.key=t}}class tr{constructor(t,n,r){this.id=t,this.value=n,this.error=r}}class kc{constructor(t,n){this.id=Ge(),this.type=P.StorageSetItem,this.key=t,this.value=n}}class nr{constructor(t,n){this.id=t,this.error=n}}function Ge(){const e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]}function rr(e){const t=new URLSearchParams(e),n=t.get("sso_challenge_id"),r=t.get("sso_code"),s=t.get("csrf_token");return!n||!r||!s?null:{ssoChallengeID:n,ssoCode:r,csrfToken:s}}function Ic(e){return e.type===P.ChallengeWebauthnCreate}function Rc(e){return e.type===P.ChallengeWebauthnGet}function Dc(e){return e&&e.type===P.SSOChallenge}function Tc(e){return e.type===P.Ping}function Oc(e){return typeof e=="object"&&!!e.baseURL&&!!e.sdkURL}const Ac=["http:","https:"];function zc(e){if(!e)throw new TypeError("options cannot be null");if(e.environment){if(typeof e.environment=="string"&&e.environment!=="production"&&e.environment!=="sandbox")throw new TypeError("If 'environment' is set as a string, it must be either 'production' or 'sandbox'");if(typeof e.environment=="object"){if(typeof e.environment.baseURL!="string")throw new TypeError("'environment.baseURL' must be a string");if(typeof e.environment.sdkURL!="string")throw new TypeError("'environment.sdkURL' must be a string")}}if(e.environment&&(e.baseURL||e.sdkURL))throw new TypeError("If 'environment' is set, 'baseURL' and 'sdkURL' cannot be set at the same time. Use a custom environment instead.");if(e.baseURL){if(typeof e.baseURL!="string")throw new TypeError("'baseURL' must be a string");let r;try{r=new URL(e.baseURL)}catch{throw new TypeError("'baseURL' must be a valid URL")}if(Ac.indexOf(r.protocol)===-1)throw new TypeError("'baseURL' must be either an http or https URL")}if(e.sdkURL){if(typeof e.sdkURL!="string")throw new TypeError("'sdkURL' must be a string");try{new URL(e.sdkURL)}catch{throw new TypeError("'sdkURL' must be a valid URL")}}const{analyticsEnabled:t=!0,oid:n}=e;if(t&&!n)throw new Error("Analytics require the 'oid' parameter to be set when instantiating SlashID()")}function Lc(e){return e.environment?Pc(e.environment):{baseURL:e.baseURL||jt.production.baseURL,sdkURL:e.sdkURL||jt.production.sdkURL}}const jt={production:{baseURL:"https://api.slashid.com",sdkURL:"https://cdn.slashid.com/sdk.html"},sandbox:{baseURL:"https://api.sandbox.slashid.com",sdkURL:"https://cdn.sandbox.slashid.com/sdk.html"}};function Pc(e){if(typeof e=="string")return jt[e];if(Oc(e))return{baseURL:e.baseURL,sdkURL:e.sdkURL};throw new TypeError("'environment' must be either a string or an object")}function ds(e){const t=Lc(e);var n;return{oid:e.oid,analyticsEnabled:(n=e.analyticsEnabled)!==null&&n!==void 0?n:!0,...t}}class sr{constructor(t){this.getOTP=t?.getOTP}}async function us(){const e=Pe(),t=Pe()+Pe(),n=new TextEncoder().encode(t),r=await window.crypto.subtle.digest("SHA-256",n),s=X(new Uint8Array(r));return window.localStorage.setItem(Kt,e),window.localStorage.setItem(Yt,t),{csrf_token:e,pkce_code_challenge:s}}async function Nc(e){if(e.method!=="oidc")throw new Error(`Can't create OIDC extras for method: ${e.method}`);let t={};const{client_id:n,provider:r}=e.options;let{ux_mode:s,redirect_target:o}=e.options;if(s||(s=ze.Popup),o||(o=window.location.href),s===ze.Redirect&&!cs(o))throw new Error(`If OIDC ux_mode was set to "redirect" a "redirect_target" is required, got ${o}`);if(s===ze.Popup){const[c,d]=as();t={...t,popup:c,setPopupUrl:d}}const{csrf_token:i,pkce_code_challenge:a}=await us();return{...e,options:{...e.options,client_id:n,provider:r,ux_mode:s,redirect_target:o,csrf_token:i,pkce_code_challenge:a},extras:t}}async function Uc(e){if(e.method!=="saml")throw new Error(`Can't create SAML extras for method: ${e.method}`);let t={},{ux_mode:n,redirect_target:r}=e.options;if(n||(n=Le.Popup),r||(r=window.location.href),n===Le.Redirect&&!cs(r))throw new Error(`If SAML ux_mode was set to "redirect" a "redirect_target" is required, got ${r}`);if(n===Le.Popup){const[i,a]=as();t={...t,popup:i,setPopupUrl:a}}const{csrf_token:s,pkce_code_challenge:o}=await us();return{...e,options:{...e.options,ux_mode:n,redirect_target:r,csrf_token:s,pkce_code_challenge:o},extras:t}}function Jt(e){this.message=e}Jt.prototype=new Error,Jt.prototype.name="InvalidCharacterError";var or=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Jt("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,o=0,i="";r=t.charAt(o++);~r&&(n=s%4?64*n+r:r,s++%4)&&(i+=String.fromCharCode(255&n>>(-2*s&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return i};function Mc(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(or(n).replace(/(.)/g,function(r,s){var o=s.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(t)}catch{return or(t)}}function at(e){this.message=e}function Vc(e,t){if(typeof e!="string")throw new at("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(Mc(e.split(".")[n]))}catch(r){throw new at("Invalid token specified: "+r.message)}}at.prototype=new Error,at.prototype.name="InvalidTokenError";var Mt=Vc;const Bc={end_user_read_write:"end_user_read_write",end_user_read_only:"end_user_read_only",end_user_no_access:"end_user_no_access","person_pool-end_user_read_write":"person_pool-end_user_read_write","person_pool-end_user_read_only":"person_pool-end_user_read_only","person_pool-end_user_no_access":"person_pool-end_user_no_access"};class Fc{async get(t){const n=await this.user.getAttributesClient().getAttributesBucketName({bucketName:this.bucketName,attributes:t,slashIDSdkVersion:I.raw},{cache:"no-cache"}),r=n.errors;if(r)throw r;return n.result}async set(t){const r=(await this.user.getAttributesClient().putAttributesBucketName({bucketName:this.bucketName,body:t,slashIDSdkVersion:I.raw},{cache:"no-cache"})).errors;if(r)throw r}async delete(t){const r=(await this.user.getAttributesClient().deleteAttributesBucketName({bucketName:this.bucketName,slashIDSdkVersion:I.raw,attributes:t},{cache:"no-cache"})).errors;if(r)throw r}constructor({user:t,bucketName:n}){this.user=t,this.bucketName=n}}function qc(e){return e?typeof e.user_token=="string":!1}class ls{get decoded(){if(!this._token)throw new Error("Cannot call methods on unauthenticated user");try{return Mt(this._token)}catch(t){throw new TypeError(t.toString())}}get tokenClaims(){return this.decoded}get decodedTokenContainer(){if(this._tokenContainer)try{return Mt(this._tokenContainer)}catch(t){throw new TypeError(t.toString())}}get tokenContainerClaims(){return this.decodedTokenContainer}updateClient(t){var n;this._token=t;const r=new xe({...$e,...((n=this._clientOptions)===null||n===void 0?void 0:n.baseURL)&&{basePath:this._clientOptions.baseURL},accessToken:t});this._apiClient=new it(r),this._attrsClient=new jn(r),this._tokenClient=new Xn(r),this._personConsentsApi=new Jn(r)}get ID(){return this.decoded.person_id}get token(){var t;return(t=this._token)!==null&&t!==void 0?t:""}get tokenContainer(){return this._tokenContainer||""}get oid(){return this.decoded.oid}get firstLogin(){return this.decoded.first_token}get authentication(){return this.decoded.authenticated_methods||[]}get authentications(){return this.decoded.authentications||[]}async createDirectID(){const{result:t}=await this._apiClient.postDirectId({slashIDSdkVersion:I.raw});return t}async logout(){this.updateClient(void 0),this._tokenContainer=void 0}async validateToken(){var t;const n=await((t=this._tokenClient)===null||t===void 0?void 0:t.postTokenValidate({validateTokenReq:{token:this.token},slashIDSdkVersion:I.raw},{cache:"no-cache"})),r=n.errors;if(r)throw r;return n.result}getGroups(){const t=this.decoded.groups_claim_name||"groups";return this.decoded[t]}getAttributesClient(){return this._attrsClient}getBucket(t=Bc.end_user_read_write){return new Fc({user:this,bucketName:t})}async get(t){return this.getBucket().get(t)}async set(t){return this.getBucket().set(t)}async delete(t){return this.getBucket().delete(t)}async getGDPRConsent(){const t=await this._personConsentsApi.getConsentGdpr({slashIDSdkVersion:I.raw}),n=t.errors;if(n)throw n;return t.result}async setGDPRConsent({consentLevels:t}){const n=await this._personConsentsApi.putConsentGdpr({gDPRConsentRequest:{consent_levels:t},slashIDSdkVersion:I.raw}),r=n.errors;if(r)throw r;return n.result}async addGDPRConsent({consentLevels:t}){const n=await this._personConsentsApi.postConsentGdpr({gDPRConsentRequest:{consent_levels:t},slashIDSdkVersion:I.raw}),r=n.errors;if(r)throw r;return n.result}async removeGDPRConsent({consentLevels:t}){return this._personConsentsApi.deleteConsentGdpr({slashIDSdkVersion:I.raw,consentLevels:t})}async removeGDPRConsentAll(){return this._personConsentsApi.deleteConsentGdpr({slashIDSdkVersion:I.raw,deleteAll:!0})}async getOrganizations(){const t=await this._apiClient.getMe(),n=t.errors;if(n)throw n;return t.result.organizations}async getHandles(){const{errors:t,result:n}=await this._apiClient.getMe();if(t)throw t;return n.handles}async getTokenForOrganization(t){const n=await this._apiClient.getToken({slashIDOrgID:t,slashIDSdkVersion:I.raw}),r=n.errors;if(r)throw r;return n.result}toString(){var t,n;return(n=(t=this._tokenContainer)!==null&&t!==void 0?t:this._token)!==null&&n!==void 0?n:""}toJSON(){var t,n;return`${(n=(t=this._tokenContainer)!==null&&t!==void 0?t:this._token)!==null&&n!==void 0?n:""}`}constructor(t,n){try{t=JSON.parse(t)}catch{}if(typeof t!="string")throw new TypeError("token must be a string");try{const s=Mt(t);qc(s)?(this._token=s.user_token,this._tokenContainer=t):this._token=t}catch(s){throw new TypeError(s.toString())}this._clientOptions=ds(n??{});const r=new xe({...$e,...n?.baseURL&&{basePath:n.baseURL},accessToken:this._token});this._apiClient=new it(r),this._attrsClient=new jn(r),this._tokenClient=new Xn(r),this._personConsentsApi=new Jn(r)}}var T={};N(T,"InvalidAuthenticationMethodError",function(){return de});N(T,"isResponseError",function(){return oe});N(T,"isRateLimitError",function(){return bn});N(T,"isTimeoutError",function(){return fs});N(T,"isBadPasskeyScopeError",function(){return hs});N(T,"isThrownResponse",function(){return Ue});N(T,"isTimeoutInPayload",function(){return ps});N(T,"isRateLimitInPayload",function(){return gs});N(T,"RateLimitError",function(){return Me});N(T,"clientGeneratedErrorSlugs",function(){return _s});N(T,"isClientGeneratedErrorSlug",function(){return Hc});N(T,"ensureError",function(){return Xt});N(T,"createEventFromError",function(){return ms});class de extends Error{constructor(t,n){super(`Authentication method '${t}': ${n}`)}}function oe(e){return e.name==="ResponseError"&&e.response instanceof Response}function bn(e){var t;return((t=e.response)===null||t===void 0?void 0:t.status)===429}async function fs(e){var t,n,r,s;return(((t=e.response)===null||t===void 0?void 0:t.status)===401||((n=e.response)===null||n===void 0?void 0:n.status)===403)&&oe(e)&&((r=(await e.response.clone().json()).errors)===null||r===void 0||(s=r[0])===null||s===void 0?void 0:s.message)==="authentication has expired"}async function hs(e){var t,n,r;const s=/selected scope '(.*?)' is not equal to or a registrable domain suffix of origin '(.*?)'/;return((t=e.response)===null||t===void 0?void 0:t.status)===400&&oe(e)&&s.test((n=(await e.response.clone().json()).errors)===null||n===void 0||(r=n[0])===null||r===void 0?void 0:r.message)}function Ue(e){return typeof e=="object"&&Array.isArray(e.errors)&&e.errors.every(t=>typeof t.httpcode=="number"&&typeof t.message=="string")}function ps(e){return e.errors.some(t=>t.message==="authentication has expired")}function gs(e){return e.errors.some(t=>t.httpcode===429)}class Me extends Error{static async fromResponseError(t){const r=(await t.response.clone().json()).errors.find(s=>s.httpcode===429);return r?new Me(t,r.message):new Me(t)}constructor(t,n){super(n||"Too many requests!"),this.name="RateLimitError",this.response=t.response}}const _s=["incorrect_otp_code_via_email","incorrect_otp_code_via_sms","incorrect_otp_code","invalid_password","incorrect_password","bad_passkey_scope","rate_limit_exceeded","timeout","client_side_error","unspecified"],Hc=e=>_s.includes(e);function Xt(e){if(e instanceof Error)return e;let t="[Unable to stringify the thrown value]";try{t=JSON.stringify(e)}catch{}return new Error(`Non-Error thrown: ${t}`)}async function Gc(e){if(oe(e)||Ue(e)){let t;try{return oe(e)?t=await e.response.clone().json():t=e,JSON.stringify(t)}catch{return Xt(e).message}}return Xt(e).message}async function ms(e,{authenticationFactor:t,handle:n,previousToken:r,challengeId:s}){const o=await(async()=>{if(!oe(e)&&!Ue(e))return null;if(bn(e))return"rate_limit_exceeded";if(await fs(e))return"timeout";if(await hs(e))return"bad_passkey_scope";if(Ue(e)){if(ps(e))return"timeout";if(gs(e))return"rate_limit_exceeded"}return"unspecified"})();return{authenticationFactor:t,handle:n,errorText:o||"client_side_error",previousToken:r,challengeId:s,failureDetail:await Gc(e)}}function Ne(e){return new Promise(t=>setTimeout(t,e))}function Wc(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(s){s(n)}),(r=e.get("*"))&&r.slice().map(function(s){s(t,n)})}}}async function ir(){const e=document.hasFocus();for(;!e&&!document.hasFocus();)await Ne(50);return e}const ar={PopupBlocked:"Popup blocked",BadOAuthURL:"Bad OAuth sign in URL"},cr={PopupBlocked:"Popup blocked",BadAuthURL:"Bad authentication URL"};function Kc(e){return e.errorText==="client_side_error"}const Yc=["otpSmsSent","otpCodeSent","otpIncorrectCodeSubmitted","passwordSetReady","passwordResetReady","passwordVerifyReady","invalidPasswordSubmitted","incorrectPasswordSubmitted","oauthFlowStarted","oauthFlowFailed","userAuthenticatedFromURL","idFlowSucceeded","idFlowStarted","idFlowFailed","webAuthnChallengeProcessed"],jc=["otpCodeSubmitted","passwordSubmitted"],Jc=["clientSideError"];function dr(e){return Yc.includes(e)}function Xc(e){return jc.includes(e)}function Vt(e){return Jc.includes(e)}function Zc(){return Wc()}async function Zt(e){return new Promise(async(n,r)=>{const s=new Sc;let o=!1;const i=a=>{const c=a.data;c.id===s.id&&(window.removeEventListener("message",i),c.error?r(c.error):(o=!0,n(e)))};for(window.addEventListener("message",i);!o;)e.postMessage(s,"*"),await Ne(50)})}class Qc{async getRemoteWindow(){var t;const n=(t=this.remote)===null||t===void 0?void 0:t.contentWindow;if(!n)throw new Error("this context has no remote");return this.remoteReady||(await Zt(n),this.remoteReady=!0),n}async processEvent(t){let n=null;if(window.parent&&t.source===window.parent&&(n=window.parent),!!n)switch(t.data.type){case P.StorageGetItem:{const r=t.data;try{const s=await this.localGetItem(r.key);n.postMessage(new tr(t.data.id,s),"*")}catch(s){n.postMessage(new tr(t.data.id,null,s),"*")}}break;case P.StorageSetItem:{const r=t.data;try{await this.localSetItem(r.key,r.value),n.postMessage(new nr(t.data.id),"*")}catch(s){n.postMessage(new nr(t.data.id,s),"*")}}break}}async localGetItem(t){return window.localStorage.getItem(t)}async remoteGetItem(t){let n=null;return this.remote&&(n=await new Promise((r,s)=>{const o=new Cc(t),i=a=>{const c=a.data;c.id===o.id&&(window.removeEventListener("message",i),c.error?s(c.error):r(c.value))};window.addEventListener("message",i),this.getRemoteWindow().then(a=>{a.postMessage(o,"*")})})),n}async localSetItem(t,n){return window.localStorage.setItem(t,n)}async remoteSetItem(t,n){this.remote&&await new Promise((r,s)=>{const o=new kc(t,n),i=a=>{const c=a.data;c.id===o.id&&(window.removeEventListener("message",i),c.error?s(c.error):r())};window.addEventListener("message",i),this.getRemoteWindow().then(a=>{a.postMessage(o,"*")})})}constructor(t,n){this.remoteReady=!1,this.remote=t,this.remoteOrigin=n,this.remote||window.addEventListener("message",this.processEvent.bind(this))}}class bs{constructor(t){this.store=t}}class H extends bs{stringify(t){return JSON.stringify(t)}parse(t){return t?JSON.parse(t):[]}async getAll(){const t=this.parse(await this.store.localGetItem(H.LOCAL_STORAGE_IDENTIFIERS_KEY)),n=this.parse(await this.store.remoteGetItem(H.LOCAL_STORAGE_IDENTIFIERS_KEY));return H.merge(t,n)}async add(t){const n=await this.getAll(),r=this.stringify(H.merge(n,[t]));await this.store.localSetItem(H.LOCAL_STORAGE_IDENTIFIERS_KEY,r),await this.store.remoteSetItem(H.LOCAL_STORAGE_IDENTIFIERS_KEY,r)}static identifiersEqual(t,n){return t.type===n.type&&t.value===n.value}static merge(t,n){return t.concat(...n).reduce((r,s)=>{for(const o of r)if(H.identifiersEqual(o,s))return r;return r.push(s),r},[])}}H.LOCAL_STORAGE_IDENTIFIERS_KEY="SLASHID_IDENTIFIERS";class ht extends bs{static identifiersEqual(t,n){return t===n}static merge(t,n){return t.concat(...n).reduce((r,s)=>{for(const o of r)if(ht.identifiersEqual(o,s))return r;return r.push(s),r},[])}}class Q extends ht{stringify(t){return JSON.stringify(t)}parse(t){if(!t)return[];let n=null;try{n=JSON.parse(t)}catch{return[t]}return Array.isArray(n)?n.filter(s=>typeof s=="string"):[]}async getAll(){const t=this.parse(await this.store.localGetItem(Q.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY)),n=this.parse(await this.store.remoteGetItem(Q.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY));return Q.merge(t,n)}async add(t){const n=await this.getAll(),r=this.stringify(Q.merge(n,[t]));await this.store.localSetItem(Q.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY,r),await this.store.remoteSetItem(Q.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY,r)}}Q.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY="SLASHID_WEBAUTHN_CREDENTIAL_ID";class Ve extends ht{stringify(t){return JSON.stringify(t)}parse(t){if(!t)return{};let n=null;try{n=JSON.parse(t)}catch{return{}}if(typeof n!="object")return{};const r={};for(const s of Object.keys(n)){if(typeof s!="string"||!Array.isArray(n[s]))continue;const o=n[s].filter(i=>typeof i=="string");r[s]=o}return r}async getAll(){return this.parse(await this.store.localGetItem(Ve.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY_V2))}async get(t){return!this.store.remoteOrigin||this.store.remoteOrigin.endsWith(t)?this.v1Storage.getAll():(await this.getAll())[t]||[]}async add(t,n){if(!this.store.remoteOrigin||this.store.remoteOrigin.endsWith(t)){this.v1Storage.add(n);return}const r=await this.getAll(),s=r[t]||[];for(const i of s)if(i===n){console.warn(`Attempted to add already present credential ID: scope=${t} credId=${n}`);return}s.push(n),r[t]=s;const o=this.stringify(r);await this.store.localSetItem(Ve.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY_V2,o)}constructor(t){super(t),this.v1Storage=new Q(t)}}Ve.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY_V2="SLASHID_WEBAUTHN_CREDENTIAL_ID_V2";class ed extends ls{async mfa(t,n){let r;if(!t)throw new Error("at least one of PersonHandle or Factor is required");t.type&&t.value&&(r=t),t.method&&(n=t);const s=await this._slashid._id(this.decoded.oid,r,n,this._token);this.updateClient(s._token)}constructor(t,n){super(t,n),this._slashid=n instanceof Be?n:new Be(n),this._slashid.updateClient(this._token)}}const ur="@slashid/EVENTS_CORRELATION_ID";class td{subscribeToDomainEvents(){this.sdk.subscribe("idFlowSucceeded",n=>this.trackAuthenticationSuccess(n)),this.sdk.subscribe("idFlowFailed",n=>this.trackAuthenticationFailure(n)),this.sdk.subscribe("invalidPasswordSubmitted",n=>this.trackAuthenticationFailure({...n,errorText:"invalid_password"})),this.sdk.subscribe("incorrectPasswordSubmitted",n=>this.trackAuthenticationFailure({...n,errorText:"incorrect_password"})),this.sdk.subscribe("otpIncorrectCodeSubmitted",n=>{var r;const s=(()=>{var o,i;return((o=n.factor)===null||o===void 0?void 0:o.method)==="otp_via_email"?"incorrect_otp_code_via_email":((i=n.factor)===null||i===void 0?void 0:i.method)==="otp_via_sms"?"incorrect_otp_code_via_sms":"incorrect_otp_code"})();this.trackAuthenticationFailure({errorText:s,authenticationFactor:{method:(r=n.factor)===null||r===void 0?void 0:r.method},challengeId:n.challengeId})}),$s(this.sdk).subscribe("clientSideError",n=>{this.trackAuthenticationFailure({...n,errorText:"client_side_error"})})}getCorrelationID(){let t=sessionStorage.getItem(ur);return t||(t=Pe(),sessionStorage.setItem(ur,t)),t}getFlowID(){return Pe()}createEventMetadata({location:t=window.location.href}={}){var n,r,s;return{organization_id:(s=(r=this.sdk.oid)!==null&&r!==void 0?r:(n=this.user)===null||n===void 0?void 0:n.oid)!==null&&s!==void 0?s:"",analytics_correlation_id:this.getCorrelationID(),window_location:t,user_agent:navigator.userAgent}}sendEvent(t){const n=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(`${this.sdk.baseURL}/actions/sdk`,n)}trackPersonIdentified({user:t}){const n={event_name:me.PersonIdentifiedV1,person_id:t.ID},r={...this.createEventMetadata(),event_data:n};this.sendEvent(r)}trackPersonLoggedOut(t){const n=this.sdk.getUser(t.token),r={event_name:me.PersonLoggedOutV1,person_id:n.ID},s={...this.createEventMetadata(),event_data:r};this.sendEvent(s)}trackAuthenticationSuccess(t){var n;const r=this.sdk.getUser(t.token);this.identify(r);const s={event_name:me.AuthenticationSucceededV1,person_id:r.ID,success_authn_method:(n=t.authenticationFactor)===null||n===void 0?void 0:n.method,authenticated_methods:r.authentication,...t.handle&&{handle:t.handle}},o={...this.createEventMetadata(),event_data:s};this.sendEvent(o)}trackAuthenticationFailure(t){var n,r;const s={event_name:me.AuthenticationFailedV1,failed_authn_method:(n=t.authenticationFactor)===null||n===void 0?void 0:n.method,authenticated_methods:(r=this.user)===null||r===void 0?void 0:r.authentication,failure_reason:t.errorText,...t.handle&&{handle:t.handle},...t.challengeId&&{challenge_id:t.challengeId},...t.failureDetail&&{failure_detail:t.failureDetail}},o={...this.createEventMetadata({}),event_data:s};this.sendEvent(o)}trackSdkLoaded(){const t={...this.createEventMetadata(),event_data:{event_name:me.SlashIdsdkLoadedV1}};this.sendEvent(t)}identify(t){this.user=t,this.trackPersonIdentified({user:t})}logout(){const t=this.user;t&&(this.trackPersonLoggedOut({token:t.token}),this.user=void 0)}trackVirtualPageView(t){const{url:n=window.location.href}=t,r={event_name:me.VirtualPageLoadedV1},s={...this.createEventMetadata({location:n}),event_data:r};this.sendEvent(s)}constructor(t){this.sdk=t.sdk,this.eventsAPI=new uc(new xe({...$e,basePath:this.sdk.baseURL})),this.user=t.user,this.subscribeToDomainEvents(),this.trackSdkLoaded()}}function nd(e){var t;const n=(t=e.pattern_qualifiers)===null||t===void 0?void 0:t.reduce((s,o)=>o==="case_insensitive"?s+"i":s,"");return new RegExp(e.pattern,n)}function lr(e){const t=e.options.validation_rules.regular_expressions;return t?t.map(r=>{const s=nd(r);return{type:"regex",name:r.name,regexp:s,matchType:r.match_type}}):[]}function fr({password:e,rules:t}){const n=[];return t.forEach(r=>{const s=r.regexp.test(e);(s&&r.matchType==="must_not_match"||!s&&r.matchType==="must_match")&&n.push(r)}),n.length===0?{valid:!0,failedRules:[]}:{valid:!1,failedRules:n}}const hr="__SlashID_iframe",ws=Symbol(),ys=Symbol(),xs=Symbol(),$s=e=>({publish:(t,n)=>e[ws](t,n),subscribe:(t,n)=>e[ys](t,n),unsubscribe:(t,n)=>e[xs](t,n)});class Be{getAnalytics(){if(!this.analytics)throw new Error("Analytics has to be enabled and oid has to be set to use this method");return this.analytics}static async canGetPublicKeyCredentialsInIFrame(){const t=window;return!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime)}publish(t,n){if(!Xc(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.emit(t,n)}[ws](t,n){if(!Vt(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.emit(t,n)}subscribe(t,n){if(!dr(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.on(t,n)}[ys](t,n){if(!Vt(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.on(t,n)}unsubscribe(t,n){if(!dr(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.off(t,n)}[xs](t,n){if(!Vt(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.off(t,n)}updateClient(t){this.authnClient=new it(new xe({...$e,basePath:this.baseURL,accessToken:t}))}resetClient(){this.updateClient(void 0)}async getChallengesFromURL(){const t=window.location.search,n=new URLSearchParams(t);let r;const s=n.get($c),o=n.get(xc);if(s&&o)throw new Error("found both 'challenges' and 'sidcp' URL query parameters");if(s){const i=await this.authnClient.getChallengePackChallengePackId({challengePackId:s,slashIDSdkVersion:I.raw},{cache:"no-cache"});if(i.errors)throw i;r=i.result}else if(o){const i=be(o),a=new TextDecoder("utf-8").decode(i);r=JSON.parse(a)}return r}async getUserFromURL(){if(!this.urlChallengesUser){let n;try{n=await this.getChallengesFromURL()}catch(r){throw await this.processError(r,{}),r}if(n){var t;const r=rr(window.location.search);r&&this.resolveSSOChallenge(r);let s;for(const o of n){const i=o;try{s=await this.processChallenge(i,void 0)}catch(a){throw await this.processError(a,{challengeId:i.id,authenticationFactor:{method:i.authentication_method}}),a}this.updateClient(s)}if(this.urlChallengesUser=new ls(s,{baseURL:this.baseURL,sdkURL:this.sdkURL}),!((t=this.urlChallengesUser.authentications)===null||t===void 0)&&t.length){const o=this.urlChallengesUser.authentications[this.urlChallengesUser.authentications.length-1];this.emitter.emit("idFlowSucceeded",{token:s,authenticationFactor:{method:o.method},handle:o.handle})}}}return this.urlChallengesUser&&this.emitter.emit("userAuthenticatedFromURL",{token:this.urlChallengesUser.token}),this.urlChallengesUser}async resolveSSOChallenge({ssoChallengeID:t,ssoCode:n,csrfToken:r}){if(!(!t||!n||!r))try{const s=window.localStorage.getItem(Kt);if(!s)throw new Error("no CSRF token stored");if(r!==s)throw new Error("CSRF token mismatch");const o=window.localStorage.getItem(Yt);if(!o)throw new Error("no PKCE code verifier stored");await this.authnClient.postSsoResolve({slashIDOrgID:this.oid,postSsoResolveRequest:{challenge_id:t,code:n,pkce_code_verifier:o}})}catch(s){this.processError(s,{})}finally{window.localStorage.removeItem(Kt),window.localStorage.removeItem(Yt)}}async processEvent(t){if(Dc(t.data)){if(t.origin!==this.baseURL)return;const r=rr(t.data.urlParams);r&&await this.resolveSSOChallenge(r);return}let n=null;if(window.opener&&t.source===window.opener&&(n=window.opener),window.parent&&t.source===window.parent&&(n=window.parent),!!n){if(Tc(t.data)){const r=t.data;try{n.postMessage(new Zn(r.id),"*")}catch(s){n.postMessage(new Zn(r.id,s.toString()),"*")}}if(Ic(t.data)){const r=t.data;try{const s=await this.processWebAuthnCreateChallenge(r.challenge);n.postMessage(new Qn(r.id,s),"*")}catch(s){n.postMessage(new Qn(r.id,null,s.toString()),"*")}}if(Rc(t.data)){const r=t.data;try{const s=await this.processWebAuthnGetChallenge(r.challenge);n.postMessage(new er(r.id,s),"*")}catch(s){n.postMessage(new er(r.id,null,s.toString()),"*")}}}}async listenForEvents(){window.addEventListener("message",this.processEvent.bind(this))}setupIFrame(){const t=this.getSDKUrl().toString();if(fc(new URL(window.location.href),new URL(this.sdkURL)))return null;let n=document.getElementById(hr);return n&&n.src!==t&&(n.remove(),n=null),n||(n=document.createElement("iframe"),n.id=hr,n.allow="publickey-credentials-get *",n.src=t,n.style.display="none",document.body.appendChild(n)),n}async getAvailableAuthenticationMethods(t){const n=[D.Password];switch(t){case _e.EmailAddress:n.push(D.EmailLink,D.OtpViaEmail);break;case _e.PhoneNumber:n.push(D.SmsLink,D.OtpViaSms);break;default:throw new Error(`unhandled handle type: ${t}`)}return navigator&&window.PublicKeyCredential&&n.unshift(D.Webauthn),n}getUser(t){return new ed(t,this)}async id(t,n,r){return this._id(t,n,r)}async _id(t,n,r,s){this.resetClient(),s&&this.updateClient(s);try{if(r)switch(r.method){case D.Webauthn.toString():{if(!(navigator&&window.PublicKeyCredential))throw new de(D.Webauthn,"The WebAuthn API is not available in the current environment");let d=r.options;d||(d={}),d.scope||(d.scope=window.location.hostname);const f=await this.credentialStorage.get(d.scope);if(f&&(d.available_credential_ids=f),d.attachment||(d.attachment=Gn.Any),d.user_verification||(d.user_verification=$a.Preferred),d.resident_key||(d.resident_key=xa.Preferred),d.attestation||(d.attestation=ya.None),d.attachment===Gn.Platform&&!await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable())throw new de(D.Webauthn,`This device has no authenticator available with attachment '${d.attachment}'`);r.options=d}break;case D.EmailLink.toString():case D.OtpViaEmail.toString():if(n&&n.type!==_e.EmailAddress)throw new de(r.method,`A handle of type '${_e.EmailAddress}' is required, got '${n.type}' instead`);break;case D.SmsLink.toString():case D.OtpViaSms.toString():if(n&&n.type!==_e.PhoneNumber)throw new de(r.method,`A handle of type '${_e.PhoneNumber}' is required, got '${n.type}' instead`);r.options=new sr(r.options);break;case D.Oidc.toString():{if(n)throw new de(r.method,"OIDC should not be used with handles");r=await Nc(r);const d=()=>{var f,u;const h=r;!(h==null||(f=h.extras)===null||f===void 0)&&f.popup&&(h==null||(u=h.extras)===null||u===void 0||u.popup.close()),this.emitter.off("oauthFlowFailed",d)};this.emitter.on("oauthFlowFailed",d)}break;case D.Saml.toString():{if(n)throw new de(r.method,"SAML should not be used with handles");r=await Uc(r);const d=()=>{var f,u;const h=r;!(h==null||(f=h.extras)===null||f===void 0)&&f.popup&&(h==null||(u=h.extras)===null||u===void 0||u.popup.close()),this.emitter.off("popupFailed",d)};this.emitter.on("popupFailed",d)}break;default:break}const o={method:r?.method,options:r?.options};this.emitter.emit("idFlowStarted",{authenticationFactor:r});const i=await this.authnClient.postId({slashIDOrgID:t,slashIDSdkVersion:I.raw,iDRequest:{handle:n,factor:o}},{cache:"no-cache"});if(i.errors)throw i;const a=i.result;if(!a)throw new Error("no challenges in ID response");let c=s;for(const d of a)c=await this.processChallenge(d,r),c&&this.updateClient(c);if(n)try{this.identifiersStorage.add(n)}catch(d){console.warn(d)}return this.emitter.emit("idFlowSucceeded",{token:`${c}`,authenticationFactor:r,handle:n}),this.getUser(c)}catch(o){throw await this.processError(o,{authenticationFactor:r,handle:n,previousToken:s}),oe(o)&&bn(o)?await Me.fromResponseError(o):o}finally{this.resetClient()}}async getAvailableIdentifiers(){try{return this.identifiersStorage.getAll()}catch(t){return console.warn(t),[]}}async recover({handle:t,factor:n}){if(!this.oid)throw new Error("oid is required - please initialize the SDK with an organization ID");try{const{result:r}=await this.authnClient.postRecover({recoverRequest:{handle:t,factor:n},slashIDSdkVersion:I.raw,slashIDOrgID:this.oid});if(!r)throw new Error("no result in recover response");let s;for(const o of r)s=await this.processChallenge(o,n),s&&this.updateClient(s);if(t)try{this.identifiersStorage.add(t)}catch(o){console.warn(o)}return this.getUser(s)}catch(r){throw this.processError(r,{handle:t}),r}}async processChallenge(t,n){let r;switch(t.type){case A.Proxy:return this.processProxyChallenge(t);case A.Nonce:r=await this.processNonceChallenge(t);break;case A.Otp:{const i=new sr(n?.options);r=await this.processOTPChallenge(t,i);break}case A.WebauthnGet:r=await this.processWebAuthnGetChallenge(t);break;case A.WebauthnCreate:r=await this.processWebAuthnCreateChallenge(t);break;case A.Oidc:return this.processOIDCChallenge(t,n);case A.Saml:return this.processSAMLChallenge(t,n);case A.PasswordSet:r=await this.processPasswordSetChallenge(t);break;case A.PasswordVerify:r=await this.processPasswordVerifyChallenge(t);break;case A.PasswordReset:r=await this.processPasswordResetChallenge(t);break;default:throw new Error("unhandled challenge type: "+t.toString())}let s;try{s=await this.authnClient.postAttestationV2({attestation:r,slashIDSdkVersion:I.raw},{cache:"no-cache"})}catch(i){if(oe(i))s=await i.response.json();else throw i}if(Ue(s)&&s.errors.length){if(s.errors[0].httpcode===400&&t.type===A.PasswordSet)return this.emitter.emit("invalidPasswordSubmitted",{failedRules:[],authenticationFactor:n,challengeId:t.id,failureDetail:s.errors[0].message}),this.processChallenge(t,n);if(s.errors[0].httpcode===401&&t.type===A.PasswordVerify)return this.emitter.emit("incorrectPasswordSubmitted",{authenticationFactor:n,challengeId:t.id,failureDetail:s.errors[0].message}),this.processChallenge(t,n);if(s.errors[0].httpcode===401&&t.type===A.Otp)return this.emitter.emit("otpIncorrectCodeSubmitted",{factor:n,challengeId:t.id}),this.processChallenge(t,n);throw s}const o=s.result;if(!o)throw new Error("no user token in attestation response");if(t.type===A.WebauthnCreate){const i=t.options;this.credentialStorage.add(i.rp.id,r.data.rawId)}return o}async processProxyChallenge(t){let n;for(;!n;){await Ne(1e3);const r=await this.authnClient.getChallengeChallengeIdV2({challengeId:t.options.challenge_id,slashIDSdkVersion:I.raw},{cache:"no-cache"});if(r.errors&&(r.errors.length!==1||r.errors[0].httpcode!==202))throw r;n=r.result}return n}async processNonceChallenge(t){var n;return{challenge_id:t.id,challenge_type:t.type,data:{challenge:(n=t.options)===null||n===void 0?void 0:n.challenge}}}async processOTPChallenge(t,n){this.emitter.emit("otpSmsSent"),this.emitter.emit("otpCodeSent");const r=new Promise(i=>{const a=c=>{this.emitter.off("otpCodeSubmitted",a),i(c)};this.emitter.on("otpCodeSubmitted",a)});typeof n.getOTP=="function"&&n.getOTP().then(i=>this.emitter.emit("otpCodeSubmitted",i));const s=await r;if(!s)throw new Error("no OTP code provided");return{challenge_id:t.id,challenge_type:t.type,data:{otp:s}}}async processWebAuthnGetChallenge(t){const n=await ir(),r=t.options;if(this.isLocalScope(r.rpId)){const s={challenge:be(r.challenge),extensions:r.extensions,rpId:r.rpId,timeout:r.timeout,userVerification:r.userVerification},o=r.allowCredentials;if(o){s.allowCredentials=new Array(o.length);for(let u=0;u<o.length;u++){const h=o[u];s.allowCredentials[u]={id:be(h.id),type:h.type,transports:h.transports}}}const i=await navigator.credentials.get({publicKey:s});if(!i)throw new Error("could not create assert credential");const a=i.response,c=X(new Uint8Array(i.rawId)),d={id:i.id,rawId:c,type:i.type,clientExtensionResults:i.getClientExtensionResults(),response:{clientDataJSON:X(new Uint8Array(a.clientDataJSON)),authenticatorData:X(new Uint8Array(a.authenticatorData)),signature:X(new Uint8Array(a.signature)),userHandle:a.userHandle?X(new Uint8Array(a.userHandle)):null}},f={challenge_id:t.id,challenge_type:t.type,data:d};return this.emitter.emit("webAuthnChallengeProcessed",{credentialId:c}),f}else{const s=this.getSDKUrl();let o;if(await Be.canGetPublicKeyCredentialsInIFrame()){if(o=this.iframe.contentWindow,!o)throw new Error("cannot get global id iframe")}else if(n||await Ne(200),o=window.open(s.toString()),!o)throw new Error("cannot open global id window");return new Promise((a,c)=>{const d=new Ec({baseURL:this.baseURL,sdkURL:this.sdkURL},t),f=u=>{const h=u.data;h.id===d.id&&(o.close(),window.removeEventListener("message",f),h.error?c(h.error):a(h.attestation))};window.addEventListener("message",f),Zt(o).then(u=>{u.postMessage(d,s.origin)})})}}async processWebAuthnCreateChallenge(t){const n=await ir(),r=t.options;if(this.isLocalScope(r.rp.id)){const s={challenge:be(r.challenge),rp:r.rp,user:{id:be(r.user.id),name:r.user.name,displayName:r.user.displayName},pubKeyCredParams:r.pubKeyCredParams,authenticatorSelection:r.authenticatorSelection,timeout:r.timeout,extensions:r.extensions,attestation:r.attestation},o=r.excludeCredentials;if(o){s.excludeCredentials=new Array(o.length);for(let u=0;u<o.length;u++){const h=o[u];s.excludeCredentials[u]={id:be(h.id),type:h.type,transports:h.transports}}}const i=await navigator.credentials.create({publicKey:s});if(!i)throw new Error("cannot create credential");const a=i.response,c=X(new Uint8Array(i.rawId)),d={id:i.id,rawId:c,type:i.type,clientExtensionResults:i.getClientExtensionResults(),response:{attestationObject:X(new Uint8Array(a.attestationObject)),clientDataJSON:X(new Uint8Array(a.clientDataJSON))}},f={challenge_id:t.id,challenge_type:t.type,data:d};return this.emitter.emit("webAuthnChallengeProcessed",{credentialId:c}),f}else return n||await Ne(200),new Promise((o,i)=>{const a=this.getSDKUrl(),c=window.open(a.toString());if(!c){i(new Error("cannot open global id window"));return}const d=new vc({baseURL:this.baseURL,sdkURL:this.sdkURL},t),f=u=>{const h=u.data;h.id===d.id&&(c.close(),window.removeEventListener("message",f),h.error?i(h.error):o(h.attestation))};window.addEventListener("message",f),Zt(c).then(u=>{u.postMessage(d,a.origin)})})}async processOIDCChallenge(t,n){if(n.options.ux_mode===ze.Popup){var r;const o=n.extras.setPopupUrl(t.options.auth_code_url);if(!(!(t==null||(r=t.options)===null||r===void 0)&&r.auth_code_url)){var s;throw this.emitter.emit("oauthFlowFailed",{...n.options,reason:ar.BadOAuthURL}),new Error(`Bad OAuth URL - got ${t==null||(s=t.options)===null||s===void 0?void 0:s.auth_code_url}`)}if(!o)throw this.emitter.emit("oauthFlowFailed",{...n.options,reason:ar.PopupBlocked}),new Error("OIDC flow unsuccesful!")}else if(n.options.ux_mode===ze.Redirect)window.location.assign(t.options.auth_code_url);else throw new Error(`Unsupported OAuth ux_mode - got ${n.options.ux_mode}`);return this.emitter.emit("oauthFlowStarted",n.options),""}async processSAMLChallenge(t,n){if(n.options.ux_mode===Le.Popup){var r;const o=n.extras.setPopupUrl(t.options.start_authentication_url);if(!(!(t==null||(r=t.options)===null||r===void 0)&&r.start_authentication_url)){var s;throw this.emitter.emit("popupFailed",{reason:cr.BadAuthURL}),new Error(`Bad authentication URL - got ${t==null||(s=t.options)===null||s===void 0?void 0:s.start_authentication_url}`)}if(!o)throw this.emitter.emit("popupFailed",{reason:cr.PopupBlocked}),new Error("SAML flow unsuccesful!")}else if(n.options.ux_mode===Le.Redirect)window.location.assign(t.options.start_authentication_url);else throw new Error(`Unsupported SAML ux_mode - got ${n.options.ux_mode}`);return""}async processPasswordSetChallenge(t){this.emitter.emit("passwordSetReady");const r=await new Promise(i=>{const a=c=>{this.emitter.off("passwordSubmitted",a),i(c)};this.emitter.on("passwordSubmitted",a)}),s=fr({password:r,rules:lr(t)});return s.valid?{challenge_id:t.id,challenge_type:t.type,data:{password:r}}:(this.emitter.emit("invalidPasswordSubmitted",{failedRules:s.failedRules,challengeId:t.id,failureDetail:`invalid_password: ${s.failedRules.map(i=>i.name).join(",")}`}),await this.processPasswordSetChallenge(t))}processPasswordVerifyChallenge(t){return this.emitter.emit("passwordVerifyReady"),new Promise(r=>{const s=o=>{this.emitter.off("passwordSubmitted",s),r(o)};this.emitter.on("passwordSubmitted",s)}).then(r=>{if(!r)throw new Error("No password provided");return{challenge_id:t.id,challenge_type:t.type,data:{password:r}}})}async processPasswordResetChallenge(t){this.emitter.emit("passwordResetReady");const r=await new Promise(i=>{const a=c=>{this.emitter.off("passwordSubmitted",a),i(c)};this.emitter.on("passwordSubmitted",a)}),s=fr({password:r,rules:lr(t)});return s.valid?{challenge_id:t.id,challenge_type:t.type,data:{password:r}}:(this.emitter.emit("invalidPasswordSubmitted",{failedRules:s.failedRules,challengeId:t.id,failureDetail:`invalid_password: ${s.failedRules.map(i=>i.name).join(",")}`}),await this.processPasswordSetChallenge(t))}getSDKUrl(){const t=new URL(this.sdkURL);return t.searchParams.append("v",I.raw),t}isLocalScope(t){return window.location.hostname.endsWith(t)}async processError(t,{authenticationFactor:n,handle:r,previousToken:s,challengeId:o}){const i=await ms(t,{authenticationFactor:n,handle:r,previousToken:s,challengeId:o});Kc(i)?$s(this).publish("clientSideError",i):this.emitter.emit("idFlowFailed",i)}constructor(t){t&&zc(t);const{baseURL:n,sdkURL:r,oid:s,analyticsEnabled:o=!0}=ds(t??{});this.baseURL=n,this.sdkURL=r,this.oid=s,this.authnClient=new it(new xe({...$e,basePath:this.baseURL})),this.iframe=this.setupIFrame();const i=new Qc(this.iframe,this.getSDKUrl().origin);this.identifiersStorage=new H(i),this.credentialStorage=new Ve(i),this.urlChallengesUser=null,this.emitter=Zc(),this.analytics=o?new td({sdk:this}):void 0,this.listenForEvents()}}({...T});({...T});const Ss=Object.prototype.toString;function wn(e){switch(Ss.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return ue(e,Error)}}function Ce(e,t){return Ss.call(e)===`[object ${t}]`}function yn(e){return Ce(e,"ErrorEvent")}function pr(e){return Ce(e,"DOMError")}function rd(e){return Ce(e,"DOMException")}function te(e){return Ce(e,"String")}function xn(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function $n(e){return e===null||xn(e)||typeof e!="object"&&typeof e!="function"}function Se(e){return Ce(e,"Object")}function pt(e){return typeof Event<"u"&&ue(e,Event)}function sd(e){return typeof Element<"u"&&ue(e,Element)}function od(e){return Ce(e,"RegExp")}function gt(e){return!!(e&&e.then&&typeof e.then=="function")}function id(e){return Se(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ad(e){return typeof e=="number"&&e!==e}function ue(e,t){try{return e instanceof t}catch{return!1}}function vs(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function ye(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function gr(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{vs(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function cd(e,t,n=!1){return te(e)?od(t)?t.test(e):te(t)?n?e===t:e.includes(t):!1:!1}function _t(e,t=[],n=!1){return t.some(r=>cd(e,r,n))}function dd(e,t,n=250,r,s,o,i){if(!o.exception||!o.exception.values||!i||!ue(i.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=ud(Qt(e,t,s,i.originalException,r,o.exception.values,a,0),n))}function Qt(e,t,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(ue(r[s],Error)){_r(i,a);const d=e(t,r[s]),f=c.length;mr(d,s,f,a),c=Qt(e,t,n,r[s],s,[d,...c],d,f)}return Array.isArray(r.errors)&&r.errors.forEach((d,f)=>{if(ue(d,Error)){_r(i,a);const u=e(t,d),h=c.length;mr(u,`errors[${f}]`,h,a),c=Qt(e,t,n,d,s,[u,...c],u,h)}}),c}function _r(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function mr(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function ud(e,t){return e.map(n=>(n.value&&(n.value=ye(n.value,t)),n))}function Ze(e){return e&&e.Math==Math?e:void 0}const b=typeof globalThis=="object"&&Ze(globalThis)||typeof window=="object"&&Ze(window)||typeof self=="object"&&Ze(self)||typeof global=="object"&&Ze(global)||function(){return this}()||{};function Sn(){return b}function Es(e,t,n){const r=n||b,s=r.__SENTRY__=r.__SENTRY__||{};return s[e]||(s[e]=t())}const vn=Sn(),ld=80;function Cs(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let o=0,i=0;const a=" > ",c=a.length;let d;const f=Array.isArray(t)?t:t.keyAttrs,u=!Array.isArray(t)&&t.maxStringLength||ld;for(;n&&o++<r&&(d=fd(n,f),!(d==="html"||o>1&&i+s.length*c+d.length>=u));)s.push(d),i+=d.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function fd(e,t){const n=e,r=[];let s,o,i,a,c;if(!n||!n.tagName)return"";if(vn.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const d=t&&t.length?t.filter(u=>n.getAttribute(u)).map(u=>[u,n.getAttribute(u)]):null;if(d&&d.length)d.forEach(u=>{r.push(`[${u[0]}="${u[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),s=n.className,s&&te(s))for(o=s.split(/\s+/),c=0;c<o.length;c++)r.push(`.${o[c]}`);const f=["aria-label","type","name","title","alt"];for(c=0;c<f.length;c++)i=f[c],a=n.getAttribute(i),a&&r.push(`[${i}="${a}"]`);return r.join("")}function hd(){try{return vn.document.location.href}catch{return""}}function pd(e){if(!vn.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}const We=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,gd="Sentry Logger ",en=["debug","info","warn","error","log","assert","trace"],ct={};function mt(e){if(!("console"in b))return e();const t=b.console,n={},r=Object.keys(ct);r.forEach(s=>{const o=ct[s];n[s]=t[s],t[s]=o});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function _d(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return We?en.forEach(n=>{t[n]=(...r)=>{e&&mt(()=>{b.console[n](`${gd}[${n}]:`,...r)})}}):en.forEach(n=>{t[n]=()=>{}}),t}const g=_d(),md=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function bd(e){return e==="http"||e==="https"}function ke(e,t=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function wd(e){const t=md.exec(e);if(!t){mt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",o,i="",a]=t.slice(1);let c="",d=a;const f=d.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),d=f.pop()),d){const u=d.match(/^\d+/);u&&(d=u[0])}return ks({host:o,pass:s,path:c,projectId:d,port:i,protocol:n,publicKey:r})}function ks(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function yd(e){if(!We)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(g.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?bd(r)?t&&isNaN(parseInt(t,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Is(e){const t=typeof e=="string"?wd(e):ks(e);if(!(!t||!yd(t)))return t}class G extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function R(e,t,n){if(!(t in e))return;const r=e[t],s=n(r);typeof s=="function"&&Rs(s,r),e[t]=s}function Fe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{We&&g.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Rs(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Fe(e,"__sentry_original__",t)}catch{}}function En(e){return e.__sentry_original__}function xd(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Ds(e){if(wn(e))return{message:e.message,name:e.name,stack:e.stack,...wr(e)};if(pt(e)){const t={type:e.type,target:br(e.target),currentTarget:br(e.currentTarget),...wr(e)};return typeof CustomEvent<"u"&&ue(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function br(e){try{return sd(e)?Cs(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function wr(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function $d(e,t=40){const n=Object.keys(Ds(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return ye(n[0],t);for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(!(s.length>t))return r===n.length?s:ye(s,t)}return""}function ee(e){return tn(e,new Map)}function tn(e,t){if(Sd(e)){const n=t.get(e);if(n!==void 0)return n;const r={};t.set(e,r);for(const s of Object.keys(e))typeof e[s]<"u"&&(r[s]=tn(e[s],t));return r}if(Array.isArray(e)){const n=t.get(e);if(n!==void 0)return n;const r=[];return t.set(e,r),e.forEach(s=>{r.push(tn(s,t))}),r}return e}function Sd(e){if(!Se(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}const Ts=50,yr=/\(error: (.*)\)/,xr=/captureMessage|captureException/;function Os(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{const s=[],o=n.split(`
|
|
10
|
+
`);for(let i=r;i<o.length;i++){const a=o[i];if(a.length>1024)continue;const c=yr.test(a)?a.replace(yr,"$1"):a;if(!c.match(/\S*Error: /)){for(const d of t){const f=d(c);if(f){s.push(f);break}}if(s.length>=Ts)break}}return Ed(s)}}function vd(e){return Array.isArray(e)?Os(...e):e}function Ed(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),xr.test(t[t.length-1].function||"")&&(t.pop(),xr.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,Ts).map(n=>({...n,filename:n.filename||t[t.length-1].filename,function:n.function||"?"}))}const Bt="<anonymous>";function ie(e){try{return!e||typeof e!="function"?Bt:e.name||Bt}catch{return Bt}}const st={},$r={};function pe(e,t){st[e]=st[e]||[],st[e].push(t)}function ge(e,t){$r[e]||(t(),$r[e]=!0)}function B(e,t){const n=e&&st[e];if(n)for(const r of n)try{r(t)}catch(s){We&&g.error(`Error while triggering instrumentation handler.
|
|
11
|
+
Type: ${e}
|
|
12
|
+
Name: ${ie(r)}
|
|
13
|
+
Error:`,s)}}function Cd(e){const t="console";pe(t,e),ge(t,kd)}function kd(){"console"in b&&en.forEach(function(e){e in b.console&&R(b.console,e,function(t){return ct[e]=t,function(...n){B("console",{args:n,level:e});const s=ct[e];s&&s.apply(b.console,n)}})})}function V(){const e=b,t=e.crypto||e.msCrypto;let n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function As(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function se(e){const{message:t,event_id:n}=e;if(t)return t;const r=As(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function nn(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function qe(e,t){const n=As(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const o={...s&&s.data,...t.data};n.mechanism.data=o}}function Sr(e){if(e&&e.__sentry_captured__)return!0;try{Fe(e,"__sentry_captured__",!0)}catch{}return!1}function zs(e){return Array.isArray(e)?e:[e]}const we=b,Id=1e3;let vr,rn,sn;function Rd(e){const t="dom";pe(t,e),ge(t,Dd)}function Dd(){if(!we.document)return;const e=B.bind(null,"dom"),t=Er(e,!0);we.document.addEventListener("click",t,!1),we.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const r=we[n]&&we[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(R(r,"addEventListener",function(s){return function(o,i,a){if(o==="click"||o=="keypress")try{const c=this,d=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},f=d[o]=d[o]||{refCount:0};if(!f.handler){const u=Er(e);f.handler=u,s.call(this,o,u,a)}f.refCount++}catch{}return s.call(this,o,i,a)}}),R(r,"removeEventListener",function(s){return function(o,i,a){if(o==="click"||o=="keypress")try{const c=this,d=c.__sentry_instrumentation_handlers__||{},f=d[o];f&&(f.refCount--,f.refCount<=0&&(s.call(this,o,f.handler,a),f.handler=void 0,delete d[o]),Object.keys(d).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return s.call(this,o,i,a)}}))})}function Td(e){if(e.type!==rn)return!1;try{if(!e.target||e.target._sentryId!==sn)return!1}catch{}return!0}function Od(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function Er(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Ad(n);if(Od(n.type,r))return;Fe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Fe(r,"_sentryId",V());const s=n.type==="keypress"?"input":n.type;Td(n)||(e({event:n,name:s,global:t}),rn=n.type,sn=r?r._sentryId:void 0),clearTimeout(vr),vr=we.setTimeout(()=>{sn=void 0,rn=void 0},Id)}}function Ad(e){try{return e.target}catch{return null}}const on=Sn();function Ls(){if(!("fetch"in on))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function an(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function zd(){if(typeof EdgeRuntime=="string")return!0;if(!Ls())return!1;if(an(on.fetch))return!0;let e=!1;const t=on.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=an(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){We&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Ld(e){const t="fetch";pe(t,e),ge(t,Pd)}function Pd(){zd()&&R(b,"fetch",function(e){return function(...t){const{method:n,url:r}=Nd(t),s={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return B("fetch",{...s}),e.apply(b,t).then(o=>{const i={...s,endTimestamp:Date.now(),response:o};return B("fetch",i),o},o=>{const i={...s,endTimestamp:Date.now(),error:o};throw B("fetch",i),o})}})}function cn(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Cr(e){return typeof e=="string"?e:e?cn(e,"url")?e.url:e.toString?e.toString():"":""}function Nd(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Cr(n),method:cn(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Cr(t),method:cn(t,"method")?String(t.method).toUpperCase():"GET"}}let Qe=null;function Ud(e){const t="error";pe(t,e),ge(t,Md)}function Md(){Qe=b.onerror,b.onerror=function(e,t,n,r,s){return B("error",{column:r,error:s,line:n,msg:e,url:t}),Qe&&!Qe.__SENTRY_LOADER__?Qe.apply(this,arguments):!1},b.onerror.__SENTRY_INSTRUMENTED__=!0}let et=null;function Vd(e){const t="unhandledrejection";pe(t,e),ge(t,Bd)}function Bd(){et=b.onunhandledrejection,b.onunhandledrejection=function(e){return B("unhandledrejection",e),et&&!et.__SENTRY_LOADER__?et.apply(this,arguments):!0},b.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const tt=Sn();function Fd(){const e=tt.chrome,t=e&&e.app&&e.app.runtime,n="history"in tt&&!!tt.history.pushState&&!!tt.history.replaceState;return!t&&n}const De=b;let nt;function Ps(e){const t="history";pe(t,e),ge(t,qd)}function qd(){if(!Fd())return;const e=De.onpopstate;De.onpopstate=function(...n){const r=De.location.href,s=nt;if(nt=r,B("history",{from:s,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const o=nt,i=String(s);nt=i,B("history",{from:o,to:i})}return n.apply(this,r)}}R(De.history,"pushState",t),R(De.history,"replaceState",t)}const Hd=b,Oe="__sentry_xhr_v3__";function Gd(e){const t="xhr";pe(t,e),ge(t,Wd)}function Wd(){if(!Hd.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;R(e,"open",function(t){return function(...n){const r=Date.now(),s=te(n[0])?n[0].toUpperCase():void 0,o=Kd(n[1]);if(!s||!o)return t.apply(this,n);this[Oe]={method:s,url:o,request_headers:{}},s==="POST"&&o.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const i=()=>{const a=this[Oe];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}const c={args:[s,o],endTimestamp:Date.now(),startTimestamp:r,xhr:this};B("xhr",c)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?R(this,"onreadystatechange",function(a){return function(...c){return i(),a.apply(this,c)}}):this.addEventListener("readystatechange",i),R(this,"setRequestHeader",function(a){return function(...c){const[d,f]=c,u=this[Oe];return u&&te(d)&&te(f)&&(u.request_headers[d.toLowerCase()]=f),a.apply(this,c)}}),t.apply(this,n)}}),R(e,"send",function(t){return function(...n){const r=this[Oe];if(!r)return t.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const s={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return B("xhr",s),t.apply(this,n)}})}function Kd(e){if(te(e))return e;try{return e.toString()}catch{}}function Yd(){return"npm"}function jd(){const e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(s){if(e)return t.has(s)?!0:(t.add(s),!1);for(let o=0;o<t.length;o++)if(t[o]===s)return!0;return t.push(s),!1}function r(s){if(e)t.delete(s);else for(let o=0;o<t.length;o++)if(t[o]===s){t.splice(o,1);break}}return[n,r]}function re(e,t=100,n=1/0){try{return dn("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ns(e,t=3,n=100*1024){const r=re(e,t);return Qd(r)>n?Ns(e,t-1,n):r}function dn(e,t,n=1/0,r=1/0,s=jd()){const[o,i]=s;if(t==null||["number","boolean","string"].includes(typeof t)&&!ad(t))return t;const a=Jd(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(o(t))return"[Circular ~]";const d=t;if(d&&typeof d.toJSON=="function")try{const _=d.toJSON();return dn("",_,c-1,r,s)}catch{}const f=Array.isArray(t)?[]:{};let u=0;const h=Ds(t);for(const _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(u>=r){f[_]="[MaxProperties ~]";break}const C=h[_];f[_]=dn(_,C,c-1,r,s),u++}return i(t),f}function Jd(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(vs(t))return"[VueViewModel]";if(id(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${ie(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Xd(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Xd(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Zd(e){return~-encodeURI(e).split(/%..|./).length}function Qd(e){return Zd(JSON.stringify(e))}var Z;(function(e){e[e.PENDING=0]="PENDING";const n=1;e[e.RESOLVED=n]="RESOLVED";const r=2;e[e.REJECTED=r]="REJECTED"})(Z||(Z={}));function ve(e){return new L(t=>{t(e)})}function Cn(e){return new L((t,n)=>{n(e)})}class L{constructor(t){L.prototype.__init.call(this),L.prototype.__init2.call(this),L.prototype.__init3.call(this),L.prototype.__init4.call(this),this._state=Z.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}then(t,n){return new L((r,s)=>{this._handlers.push([!1,o=>{if(!t)r(o);else try{r(t(o))}catch(i){s(i)}},o=>{if(!n)s(o);else try{r(n(o))}catch(i){s(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new L((n,r)=>{let s,o;return this.then(i=>{o=!1,s=i,t&&t()},i=>{o=!0,s=i,t&&t()}).then(()=>{if(o){r(s);return}n(s)})})}__init(){this._resolve=t=>{this._setResult(Z.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(Z.REJECTED,t)}}__init3(){this._setResult=(t,n)=>{if(this._state===Z.PENDING){if(gt(n)){n.then(this._resolve,this._reject);return}this._state=t,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Z.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Z.RESOLVED&&n[1](this._value),this._state===Z.REJECTED&&n[2](this._value),n[0]=!0)})}}}function eu(e){const t=[];function n(){return e===void 0||t.length<e}function r(i){return t.splice(t.indexOf(i),1)[0]}function s(i){if(!n())return Cn(new G("Not adding Promise because buffer limit was reached."));const a=i();return t.indexOf(a)===-1&&t.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function o(i){return new L((a,c)=>{let d=t.length;if(!d)return a(!0);const f=setTimeout(()=>{i&&i>0&&a(!1)},i);t.forEach(u=>{ve(u).then(()=>{--d||(clearTimeout(f),a(!0))},c)})})}return{$:t,add:s,drain:o}}function Ft(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const tu=["fatal","error","warning","log","info","debug"];function nu(e){return e==="warn"?"warning":tu.includes(e)?e:"log"}const Us=1e3;function Ke(){return Date.now()/Us}function ru(){const{performance:e}=b;if(!e||!e.now)return Ke;const t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/Us}const Ms=ru();(()=>{const{performance:e}=b;if(!e||!e.now)return;const t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=s<t,i=e.timing&&e.timing.navigationStart,c=typeof i=="number"?Math.abs(i+n-r):t,d=c<t;return o||d?s<=c?e.timeOrigin:i:r})();function Ie(e,t=[]){return[e,t]}function su(e,t){const[n,r]=e;return[n,[...r,t]]}function kr(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function un(e,t){return(t||new TextEncoder).encode(e)}function ou(e,t){const[n,r]=e;let s=JSON.stringify(n);function o(i){typeof s=="string"?s=typeof i=="string"?s+i:[un(s,t),i]:s.push(typeof i=="string"?un(i,t):i)}for(const i of r){const[a,c]=i;if(o(`
|
|
14
|
+
${JSON.stringify(a)}
|
|
15
|
+
`),typeof c=="string"||c instanceof Uint8Array)o(c);else{let d;try{d=JSON.stringify(c)}catch{d=JSON.stringify(re(c))}o(d)}}return typeof s=="string"?s:iu(s)}function iu(e){const t=e.reduce((s,o)=>s+o.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function au(e,t){const n=typeof e.data=="string"?un(e.data,t):e.data;return[ee({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const cu={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",statsd:"unknown"};function Ir(e){return cu[e]}function Vs(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function du(e,t,n,r){const s=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ke(r)},...s&&{trace:ee({...s})}}}function uu(e,t,n){const r=[{type:"client_report"},{timestamp:n||Ke(),discarded_events:e}];return Ie(t?{dsn:t}:{},[r])}const lu=60*1e3;function fu(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?lu:r-t}function hu(e,t){return e[t]||e.all||0}function pu(e,t,n=Date.now()){return hu(e,t)>n}function gu(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},o=n&&n["x-sentry-rate-limits"],i=n&&n["retry-after"];if(o)for(const a of o.trim().split(",")){const[c,d]=a.split(":",2),f=parseInt(c,10),u=(isNaN(f)?60:f)*1e3;if(!d)s.all=r+u;else for(const h of d.split(";"))s[h]=r+u}else i?s.all=r+fu(i,r):t===429&&(s.all=r+60*1e3);return s}const y=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,bt="production";function kn(){return Es("globalEventProcessors",()=>[])}function _u(e){kn().push(e)}function dt(e,t,n,r=0){return new L((s,o)=>{const i=e[r];if(t===null||typeof i!="function")s(t);else{const a=i({...t},n);y&&i.id&&a===null&&g.log(`Event processor "${i.id}" dropped event`),gt(a)?a.then(c=>dt(e,c,n,r+1).then(s)).then(null,o):dt(e,a,n,r+1).then(s).then(null,o)}})}function Bs(e){const t=Ms(),n={sid:V(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>mu(n)};return e&&le(n,e),n}function le(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ms(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:V()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Fs(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),le(e,n)}function mu(e){return ee({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}const bu=1;function wu(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:o,status:i,tags:a,origin:c}=He(e);return ee({data:r,op:s,parent_span_id:o,span_id:t,status:i,tags:a,trace_id:n,origin:c})}function He(e){return yu(e)?e.getSpanJSON():typeof e.toJSON=="function"?e.toJSON():{}}function yu(e){return typeof e.getSpanJSON=="function"}function xu(e){const{traceFlags:t}=e.spanContext();return!!(t&bu)}function $u(e,t,n,r,s,o){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||V(),timestamp:t.timestamp||Ke()},d=n.integrations||e.integrations.map(O=>O.name);Su(c,e),Cu(c,d),t.type===void 0&&vu(c,e.stackParser);const f=Iu(r,n.captureContext);n.mechanism&&qe(c,n.mechanism);const u=s&&s.getEventProcessors?s.getEventProcessors():[],h=Vu().getScopeData();if(o){const O=o.getScopeData();Or(h,O)}if(f){const O=f.getScopeData();Or(h,O)}const _=[...n.attachments||[],...h.attachments];_.length&&(n.attachments=_),js(c,h);const C=[...u,...kn(),...h.eventProcessors];return dt(C,c,n).then(O=>(O&&Eu(O),typeof i=="number"&&i>0?ku(O,i,a):O))}function Su(e,t){const{environment:n,release:r,dist:s,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:bt),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&s!==void 0&&(e.dist=s),e.message&&(e.message=ye(e.message,o));const i=e.exception&&e.exception.values&&e.exception.values[0];i&&i.value&&(i.value=ye(i.value,o));const a=e.request;a&&a.url&&(a.url=ye(a.url,o))}const Rr=new WeakMap;function vu(e,t){const n=b._sentryDebugIds;if(!n)return;let r;const s=Rr.get(t);s?r=s:(r=new Map,Rr.set(t,r));const o=Object.keys(n).reduce((i,a)=>{let c;const d=r.get(a);d?c=d:(c=t(a),r.set(a,c));for(let f=c.length-1;f>=0;f--){const u=c[f];if(u.filename){i[u.filename]=n[a];break}}return i},{});try{e.exception.values.forEach(i=>{i.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=o[a.filename])})})}catch{}}function Eu(e){const t={};try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?t[s.abs_path]=s.debug_id:s.filename&&(t[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:t[r]})})}function Cu(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function ku(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(s=>({...s,...s.data&&{data:re(s.data,t,n)}}))},...e.user&&{user:re(e.user,t,n)},...e.contexts&&{contexts:re(e.contexts,t,n)},...e.extra&&{extra:re(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=re(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(s=>{const o=He(s).data;return o&&(s.data=re(o,t,n)),s})),r}function Iu(e,t){if(!t)return e;const n=e?e.clone():new W;return n.update(t),n}function Ru(e){if(e)return Du(e)?{captureContext:e}:Ou(e)?{captureContext:e}:e}function Du(e){return e instanceof W||typeof e=="function"}const Tu=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function Ou(e){return Object.keys(e).some(t=>Tu.includes(t))}function wt(e,t){return J().captureException(e,Ru(t))}function qs(e,t){return J().captureEvent(e,t)}function fe(e,t){J().addBreadcrumb(e,t)}function Hs(...e){const t=J();if(e.length===2){const[n,r]=e;return n?t.withScope(()=>(t.getStackTop().scope=n,r(n))):t.withScope(r)}return t.withScope(e[0])}function z(){return J().getClient()}function Ye(){return J().getScope()}function Dr(e){const t=z(),n=xt(),r=Ye(),{release:s,environment:o=bt}=t&&t.getOptions()||{},{userAgent:i}=b.navigator||{},a=Bs({release:s,environment:o,user:r.getUser()||n.getUser(),...i&&{userAgent:i},...e}),c=n.getSession();return c&&c.status==="ok"&&le(c,{status:"exited"}),Gs(),n.setSession(a),r.setSession(a),a}function Gs(){const e=xt(),t=Ye(),n=t.getSession()||e.getSession();n&&Fs(n),Ws(),e.setSession(),t.setSession()}function Ws(){const e=xt(),t=Ye(),n=z(),r=t.getSession()||e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function Tr(e=!1){if(e){Gs();return}Ws()}function Ks(e){return e.transaction}function Ys(e,t,n){const r=t.getOptions(),{publicKey:s}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},i=ee({environment:r.environment||bt,release:r.release,user_segment:o,public_key:s,trace_id:e});return t.emit&&t.emit("createDsc",i),i}function Au(e){const t=z();if(!t)return{};const n=Ys(He(e).trace_id||"",t,Ye()),r=Ks(e);if(!r)return n;const s=r&&r._frozenDynamicSamplingContext;if(s)return s;const{sampleRate:o,source:i}=r.metadata;o!=null&&(n.sample_rate=`${o}`);const a=He(r);return i&&i!=="url"&&(n.transaction=a.description),n.sampled=String(xu(r)),t.emit&&t.emit("createDsc",n),n}function js(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:o,propagationContext:i}=t;zu(e,t),r&&Nu(e,r),Uu(e,n),Lu(e,s),Pu(e,o,i)}function Or(e,t){const{extra:n,tags:r,user:s,contexts:o,level:i,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:d,eventProcessors:f,attachments:u,propagationContext:h,transactionName:_,span:C}=t;Te(e,"extra",n),Te(e,"tags",r),Te(e,"user",s),Te(e,"contexts",o),Te(e,"sdkProcessingMetadata",a),i&&(e.level=i),_&&(e.transactionName=_),C&&(e.span=C),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),u.length&&(e.attachments=[...e.attachments,...u]),e.propagationContext={...e.propagationContext,...h}}function Te(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}function zu(e,t){const{extra:n,tags:r,user:s,contexts:o,level:i,transactionName:a}=t,c=ee(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});const d=ee(r);d&&Object.keys(d).length&&(e.tags={...d,...e.tags});const f=ee(s);f&&Object.keys(f).length&&(e.user={...f,...e.user});const u=ee(o);u&&Object.keys(u).length&&(e.contexts={...u,...e.contexts}),i&&(e.level=i),a&&(e.transaction=a)}function Lu(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Pu(e,t,n){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t,propagationContext:n}}function Nu(e,t){e.contexts={trace:wu(t),...e.contexts};const n=Ks(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:Au(t),...e.sdkProcessingMetadata};const r=He(n).description;r&&(e.tags={transaction:r,...e.tags})}}function Uu(e,t){e.fingerprint=e.fingerprint?zs(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}const Mu=100;let qt;class W{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ar()}static clone(t){return t?t.clone():new W}clone(){const t=new W;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},t._user=this._user,t._level=this._level,t._span=this._span,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t}setClient(t){this._client=t}getClient(){return this._client}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&le(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this._span;return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if(typeof t=="function"){const n=t(this);return n instanceof W?n:this}return t instanceof W?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession),t._propagationContext&&(this._propagationContext=t._propagationContext)):Se(t)&&(t=t,this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Ar(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:Mu;if(r<=0)return this;const s={timestamp:Ke(),...t},o=this._breadcrumbs;return o.push(s),this._breadcrumbs=o.length>r?o.slice(-r):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:t,_attachments:n,_contexts:r,_tags:s,_extra:o,_user:i,_level:a,_fingerprint:c,_eventProcessors:d,_propagationContext:f,_sdkProcessingMetadata:u,_transactionName:h,_span:_}=this;return{breadcrumbs:t,attachments:n,contexts:r,tags:s,extra:o,user:i,level:a,fingerprint:c||[],eventProcessors:d,propagationContext:f,sdkProcessingMetadata:u,transactionName:h,span:_}}applyToEvent(t,n={},r=[]){js(t,this.getScopeData());const s=[...r,...kn(),...this._eventProcessors];return dt(s,t,n)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:V();if(!this._client)return g.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=r&&r.event_id?r.event_id:V();if(!this._client)return g.warn("No client configured on scope - will not capture message!"),s;const o=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:o,...r,event_id:s},this),s}captureEvent(t,n){const r=n&&n.event_id?n.event_id:V();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(g.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function Vu(){return qt||(qt=new W),qt}function Ar(){return{traceId:V(),spanId:V().substring(16)}}const ln="7.95.0",Js=parseFloat(ln),Bu=100;class Xs{constructor(t,n,r,s=Js){this._version=s;let o;n?o=n:(o=new W,o.setClient(t));let i;r?i=r:(i=new W,i.setClient(t)),this._stack=[{scope:o}],t&&this.bindClient(t),this._isolationScope=i}isOlderThan(t){return this._version<t}bindClient(t){const n=this.getStackTop();n.client=t,n.scope.setClient(t),t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){const t=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(t){const n=this.pushScope();let r;try{r=t(n)}catch(s){throw this.popScope(),s}return gt(r)?r.then(s=>(this.popScope(),s),s=>{throw this.popScope(),s}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:V(),s=new Error("Sentry syntheticException");return this.getScope().captureException(t,{originalException:t,syntheticException:s,...n,event_id:r}),r}captureMessage(t,n,r){const s=this._lastEventId=r&&r.event_id?r.event_id:V(),o=new Error(t);return this.getScope().captureMessage(t,n,{originalException:t,syntheticException:o,...r,event_id:s}),s}captureEvent(t,n){const r=n&&n.event_id?n.event_id:V();return t.type||(this._lastEventId=r),this.getScope().captureEvent(t,{...n,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(t,n){const{scope:r,client:s}=this.getStackTop();if(!s)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Bu}=s.getOptions&&s.getOptions()||{};if(i<=0)return;const c={timestamp:Ke(),...t},d=o?mt(()=>o(c,n)):c;d!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",d,n),r.addBreadcrumb(d,i))}setUser(t){this.getScope().setUser(t),this.getIsolationScope().setUser(t)}setTags(t){this.getScope().setTags(t),this.getIsolationScope().setTags(t)}setExtras(t){this.getScope().setExtras(t),this.getIsolationScope().setExtras(t)}setTag(t,n){this.getScope().setTag(t,n),this.getIsolationScope().setTag(t,n)}setExtra(t,n){this.getScope().setExtra(t,n),this.getIsolationScope().setExtra(t,n)}setContext(t,n){this.getScope().setContext(t,n),this.getIsolationScope().setContext(t,n)}configureScope(t){const{scope:n,client:r}=this.getStackTop();r&&t(n)}run(t){const n=zr(this);try{t(this)}finally{zr(n)}}getIntegration(t){const n=this.getClient();if(!n)return null;try{return n.getIntegration(t)}catch{return y&&g.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,n){const r=this._callExtensionMethod("startTransaction",t,n);return y&&!r&&(this.getClient()?g.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
16
|
+
Sentry.addTracingExtensions();
|
|
17
|
+
Sentry.init({...});
|
|
18
|
+
`):g.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&Fs(r),this._sendSessionUpdate(),n.setSession()}startSession(t){const{scope:n,client:r}=this.getStackTop(),{release:s,environment:o=bt}=r&&r.getOptions()||{},{userAgent:i}=b.navigator||{},a=Bs({release:s,environment:o,user:n.getUser(),...i&&{userAgent:i},...t}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&le(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){const t=this.getClient(),n=t&&t.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:n}=this.getStackTop(),r=t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_callExtensionMethod(t,...n){const s=yt().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[t]=="function")return s.extensions[t].apply(this,n);y&&g.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function yt(){return b.__SENTRY__=b.__SENTRY__||{extensions:{},hub:void 0},b}function zr(e){const t=yt(),n=fn(t);return Zs(t,e),n}function J(){const e=yt();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return Fu(e)}function xt(){return J().getIsolationScope()}function Fu(e=yt()){return(!qu(e)||fn(e).isOlderThan(Js))&&Zs(e,new Xs),fn(e)}function qu(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function fn(e){return Es("hub",()=>new Xs,e)}function Zs(e,t){if(!e)return!1;const n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}function Hu(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function Gu(e,t,n,r){const s=Vs(n),o={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:ke(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Ie(o,[i])}function Wu(e,t,n,r){const s=Vs(n),o=e.type&&e.type!=="replay_event"?e.type:"event";Hu(e,n&&n.sdk);const i=du(e,s,r,t);return delete e.sdkProcessingMetadata,Ie(i,[[{type:o},e]])}const Ku="7";function Qs(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Yu(e){return`${Qs(e)}${e.projectId}/envelope/`}function ju(e,t){return xd({sentry_key:e.publicKey,sentry_version:Ku,...t&&{sentry_client:`${t.name}/${t.version}`}})}function Ju(e,t={}){const n=typeof t=="string"?t:t.tunnel,r=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return n||`${Yu(e)}?${ju(e,r)}`}function Xu(e,t){const n=Is(e);if(!n)return"";const r=`${Qs(n)}embed/error-page/`;let s=`dsn=${ke(n)}`;for(const o in t)if(o!=="dsn"&&o!=="onClose")if(o==="user"){const i=t.user;if(!i)continue;i.name&&(s+=`&name=${encodeURIComponent(i.name)}`),i.email&&(s+=`&email=${encodeURIComponent(i.email)}`)}else s+=`&${encodeURIComponent(o)}=${encodeURIComponent(t[o])}`;return`${r}?${s}`}const Lr=[];function Zu(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.keys(t).map(n=>t[n])}function Qu(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...t,...n]:typeof n=="function"?r=zs(n(t)):r=t;const s=Zu(r),o=tl(s,i=>i.name==="Debug");if(o!==-1){const[i]=s.splice(o,1);s.push(i)}return s}function el(e,t){const n={};return t.forEach(r=>{r&&eo(e,r,n)}),n}function eo(e,t,n){if(n[t.name]){y&&g.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,Lr.indexOf(t.name)===-1&&(t.setupOnce(_u,J),Lr.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),e.on&&typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,o)=>r(s,o,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((o,i)=>r(o,i,e),{id:t.name});e.addEventProcessor(s)}y&&g.log(`Integration installed: ${t.name}`)}function tl(e,t){for(let n=0;n<e.length;n++)if(t(e[n])===!0)return n;return-1}function ce(e,t){return Object.assign(function(...r){return t(...r)},{id:e})}function nl(e){let t="";for(const n of e){const r=Object.entries(n.tags),s=r.length>0?`|#${r.map(([o,i])=>`${o}:${i}`).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${s}|T${n.timestamp}
|
|
19
|
+
`}return t}function rl(e,t,n,r){const s={sent_at:new Date().toISOString()};n&&n.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(s.dsn=ke(t));const o=sl(e);return Ie(s,[o])}function sl(e){const t=nl(e);return[{type:"statsd",length:t.length},t]}const Pr="Not capturing exception because it's already been captured.";class ol{constructor(t){if(this._options=t,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=Is(t.dsn):y&&g.warn("No DSN provided, client will not send events."),this._dsn){const n=Ju(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,r){if(Sr(t)){y&&g.log(Pr);return}let s=n&&n.event_id;return this._process(this.eventFromException(t,n).then(o=>this._captureEvent(o,n,r)).then(o=>{s=o})),s}captureMessage(t,n,r,s){let o=r&&r.event_id;const i=xn(t)?t:String(t),a=$n(t)?this.eventFromMessage(i,n,r):this.eventFromException(t,r);return this._process(a.then(c=>this._captureEvent(c,r,s)).then(c=>{o=c})),o}captureEvent(t,n,r){if(n&&n.originalException&&Sr(n.originalException)){y&&g.log(Pr);return}let s=n&&n.event_id;return this._process(this._captureEvent(t,n,r).then(o=>{s=o})),s}captureSession(t){typeof t.release!="string"?y&&g.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),le(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const n=this._transport;return n?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(t).then(r=>n.flush(t).then(s=>r&&s))):ve(!0)}close(t){return this.flush(t).then(n=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}setupIntegrations(t){(t&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(t){return this.getIntegrationByName(t)}getIntegrationByName(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch{return y&&g.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){eo(this,t,this._integrations)}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Wu(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=su(r,au(o,this._options.transportOptions&&this._options.transportOptions.textEncoder));const s=this._sendEnvelope(r);s&&s.then(o=>this.emit("afterSendEvent",t,o),null)}sendSession(t){const n=Gu(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(t,n,r){if(this._options.sendClientReports){const s=`${t}:${n}`;y&&g.log(`Adding outcome: "${s}"`),this._outcomes[s]=this._outcomes[s]+1||1}}captureAggregateMetrics(t){y&&g.log(`Flushing aggregated metrics, number of metrics: ${t.length}`);const n=rl(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}on(t,n){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(n)}emit(t,...n){this._hooks[t]&&this._hooks[t].forEach(r=>r(...n))}_setupIntegrations(){this._integrations=el(this,this._options.integrations),this._integrationsInitialized=!0}_updateSessionFromEvent(t,n){let r=!1,s=!1;const o=n.exception&&n.exception.values;if(o){s=!0;for(const c of o){const d=c.mechanism;if(d&&d.handled===!1){r=!0;break}}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(le(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}_isClientDoneProcessing(t){return new L(n=>{let r=0;const s=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),n(!0)):(r+=s,t&&r>=t&&(clearInterval(o),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s=xt()){const o=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",t,n),$u(o,t,n,r,this,s).then(a=>{if(a===null)return a;const{propagationContext:c}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:f,spanId:u,parentSpanId:h,dsc:_}=c;a.contexts={trace:{trace_id:f,span_id:u,parent_span_id:h},...a.contexts};const C=_||Ys(f,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:C,...a.sdkProcessingMetadata}}return a})}_captureEvent(t,n={},r){return this._processEvent(t,n,r).then(s=>s.event_id,s=>{if(y){const o=s;o.logLevel==="log"?g.log(o.message):g.warn(o)}})}_processEvent(t,n,r){const s=this.getOptions(),{sampleRate:o}=s,i=no(t),a=to(t),c=t.type||"error",d=`before send for type \`${c}\``;if(a&&typeof o=="number"&&Math.random()>o)return this.recordDroppedEvent("sample_rate","error",t),Cn(new G(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const f=c==="replay_event"?"replay":c;return this._prepareEvent(t,n,r).then(u=>{if(u===null)throw this.recordDroppedEvent("event_processor",f,t),new G("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return u;const _=al(s,u,n);return il(_,d)}).then(u=>{if(u===null)throw this.recordDroppedEvent("before_send",f,t),new G(`${d} returned \`null\`, will not send event.`,"log");const h=r&&r.getSession();!i&&h&&this._updateSessionFromEvent(h,u);const _=u.transaction_info;if(i&&_&&u.transaction!==t.transaction){const C="custom";u.transaction_info={..._,source:C}}return this.sendEvent(u,n),u}).then(null,u=>{throw u instanceof G?u:(this.captureException(u,{data:{__sentry__:!0},originalException:u}),new G(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
20
|
+
Reason: ${u}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)return this._transport.send(t).then(null,n=>{y&&g.error("Error while sending event:",n)});y&&g.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map(n=>{const[r,s]=n.split(":");return{reason:r,category:s,quantity:t[n]}})}}function il(e,t){const n=`${t} must return \`null\` or a valid event.`;if(gt(e))return e.then(r=>{if(!Se(r)&&r!==null)throw new G(n);return r},r=>{throw new G(`${t} rejected with ${r}`)});if(!Se(e)&&e!==null)throw new G(n);return e}function al(e,t,n){const{beforeSend:r,beforeSendTransaction:s}=e;return to(t)&&r?r(t,n):no(t)&&s?s(t,n):t}function to(e){return e.type===void 0}function no(e){return e.type==="transaction"}function cl(e,t){t.debug===!0&&(y?g.enable():mt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Ye().update(t.initialScope);const r=new e(t);dl(r),ul(r)}function dl(e){const n=J().getStackTop();n.client=e,n.scope.setClient(e)}function ul(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}const ll=30;function ro(e,t,n=eu(e.bufferSize||ll)){let r={};const s=i=>n.drain(i);function o(i){const a=[];if(kr(i,(u,h)=>{const _=Ir(h);if(pu(r,_)){const C=Nr(u,h);e.recordDroppedEvent("ratelimit_backoff",_,C)}else a.push(u)}),a.length===0)return ve();const c=Ie(i[0],a),d=u=>{kr(c,(h,_)=>{const C=Nr(h,_);e.recordDroppedEvent(u,Ir(_),C)})},f=()=>t({body:ou(c,e.textEncoder)}).then(u=>(u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&y&&g.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=gu(r,u),u),u=>{throw d("network_error"),u});return n.add(f).then(u=>u,u=>{if(u instanceof G)return y&&g.error("Skipped sending event because buffer is full."),d("queue_overflow"),ve();throw u})}return o.__sentry__baseTransport__=!0,{send:o,flush:s}}function Nr(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}function so(e,t,n=[t],r="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map(o=>({name:`${r}:@sentry/${o}`,version:ln})),version:ln}),e._metadata=s}const fl=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],hl=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],oo="InboundFilters",pl=(e={})=>({name:oo,setupOnce(){},processEvent(t,n,r){const s=r.getOptions(),o=ml(e,s);return bl(t,o)?null:t}}),gl=pl,_l=ce(oo,gl);function ml(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:fl],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:hl],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function bl(e,t){return t.ignoreInternal&&vl(e)?(y&&g.warn(`Event dropped due to being internal Sentry Error.
|
|
21
|
+
Event: ${se(e)}`),!0):wl(e,t.ignoreErrors)?(y&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
22
|
+
Event: ${se(e)}`),!0):yl(e,t.ignoreTransactions)?(y&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
23
|
+
Event: ${se(e)}`),!0):xl(e,t.denyUrls)?(y&&g.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
24
|
+
Event: ${se(e)}.
|
|
25
|
+
Url: ${ut(e)}`),!0):$l(e,t.allowUrls)?!1:(y&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
26
|
+
Event: ${se(e)}.
|
|
27
|
+
Url: ${ut(e)}`),!0)}function wl(e,t){return e.type||!t||!t.length?!1:Sl(e).some(n=>_t(n,t))}function yl(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;const n=e.transaction;return n?_t(n,t):!1}function xl(e,t){if(!t||!t.length)return!1;const n=ut(e);return n?_t(n,t):!1}function $l(e,t){if(!t||!t.length)return!0;const n=ut(e);return n?_t(n,t):!0}function Sl(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),y&&t.length===0&&g.error(`Could not extract message for event ${se(e)}`),t}function vl(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function El(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function ut(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?El(t):null}catch{return y&&g.error(`Cannot extract url for event ${se(e)}`),null}}let Ur;const io="FunctionToString",Cl=()=>({name:io,setupOnce(){Ur=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=En(this)||this;return Ur.apply(t,e)}}catch{}}}),kl=Cl,Il=ce(io,kl),m=b;let hn=0;function ao(){return hn>0}function Rl(){hn++,setTimeout(()=>{hn--})}function Ee(e,t={},n){if(typeof e!="function")return e;try{const s=e.__sentry_wrapped__;if(s)return s;if(En(e))return e}catch{return e}const r=function(){const s=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const o=s.map(i=>Ee(i,t));return e.apply(this,o)}catch(o){throw Rl(),Hs(i=>{i.addEventProcessor(a=>(t.mechanism&&(nn(a,void 0,void 0),qe(a,t.mechanism)),a.extra={...a.extra,arguments:s},a)),wt(o)}),o}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}Rs(r,e),Fe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}const M=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function co(e,t){const n=In(e,t),r={type:t&&t.name,value:Al(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Dl(e,t,n,r){const s=z(),o=s&&s.getOptions().normalizeDepth,i={exception:{values:[{type:pt(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Pl(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Ns(t,o)}};if(n){const a=In(e,n);a.length&&(i.exception.values[0].stacktrace={frames:a})}return i}function Ht(e,t){return{exception:{values:[co(e,t)]}}}function In(e,t){const n=t.stacktrace||t.stack||"",r=Ol(t);try{return e(n,r)}catch{}return[]}const Tl=/Minified React error #\d+;/i;function Ol(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(Tl.test(e.message))return 1}return 0}function Al(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function zl(e,t,n,r){const s=n&&n.syntheticException||void 0,o=Rn(e,t,s,r);return qe(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),ve(o)}function Ll(e,t,n="info",r,s){const o=r&&r.syntheticException||void 0,i=pn(e,t,o,s);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),ve(i)}function Rn(e,t,n,r,s){let o;if(yn(t)&&t.error)return Ht(e,t.error);if(pr(t)||rd(t)){const i=t;if("stack"in t)o=Ht(e,t);else{const a=i.name||(pr(i)?"DOMError":"DOMException"),c=i.message?`${a}: ${i.message}`:a;o=pn(e,c,n,r),nn(o,c)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return wn(t)?Ht(e,t):Se(t)||pt(t)?(o=Dl(e,t,n,s),qe(o,{synthetic:!0}),o):(o=pn(e,t,n,r),nn(o,`${t}`,void 0),qe(o,{synthetic:!0}),o)}function pn(e,t,n,r){const s={};if(r&&n){const o=In(e,n);o.length&&(s.exception={values:[{value:t,stacktrace:{frames:o}}]})}if(xn(t)){const{__sentry_template_string__:o,__sentry_template_values__:i}=t;return s.logentry={message:o,params:i},s}return s.message=t,s}function Pl(e,{isUnhandledRejection:t}){const n=$d(e),r=t?"promise rejection":"exception";return yn(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:pt(e)?`Event \`${Nl(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Nl(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Ul(e,{metadata:t,tunnel:n,dsn:r}){const s={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:ke(r)}},o=Ml(e);return Ie(s,[o])}function Ml(e){return[{type:"user_report"},e]}class Vl extends ol{constructor(t){const n=m.SENTRY_SDK_SOURCE||Yd();so(t,"browser",["browser"],n),super(t),t.sendClientReports&&m.document&&m.document.addEventListener("visibilitychange",()=>{m.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return zl(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Ll(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){M&&g.warn("SDK not enabled, will not capture user feedback.");return}const n=Ul(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}_flushOutcomes(){const t=this._clearOutcomes();if(t.length===0){M&&g.log("No outcomes to send");return}if(!this._dsn){M&&g.log("No dsn provided, will not send outcomes");return}M&&g.log("Sending outcomes:",t);const n=uu(t,this._options.tunnel&&ke(this._dsn));this._sendEnvelope(n)}}let Ae;function Bl(){if(Ae)return Ae;if(an(m.fetch))return Ae=m.fetch.bind(m);const e=m.document;let t=m.fetch;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(n){M&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return Ae=t.bind(m)}function Fl(){Ae=void 0}function ql(e,t=Bl()){let n=0,r=0;function s(o){const i=o.body.length;n+=i,r++;const a={body:o.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,a).then(c=>(n-=i,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return Fl(),n-=i,r--,Cn(c)}}return ro(e,s)}const Hl=4;function Gl(e){function t(n){return new L((r,s)=>{const o=new XMLHttpRequest;o.onerror=s,o.onreadystatechange=()=>{o.readyState===Hl&&r({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url);for(const i in e.headers)Object.prototype.hasOwnProperty.call(e.headers,i)&&o.setRequestHeader(i,e.headers[i]);o.send(n.body)})}return ro(e,t)}const $t="?",Wl=30,Kl=40,Yl=50;function Dn(e,t,n,r){const s={filename:e,function:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const jl=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jl=/\((\S*)(?::(\d+))(?::(\d+))\)/,Xl=e=>{const t=jl.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){const o=Jl.exec(t[2]);o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3])}const[r,s]=uo(t[1]||$t,t[2]);return Dn(s,r,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},Zl=[Wl,Xl],Ql=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ef=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tf=e=>{const t=Ql.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const o=ef.exec(t[3]);o&&(t[1]=t[1]||"eval",t[3]=o[1],t[4]=o[2],t[5]="")}let r=t[3],s=t[1]||$t;return[s,r]=uo(s,r),Dn(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},nf=[Yl,tf],rf=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,sf=e=>{const t=rf.exec(e);return t?Dn(t[2],t[1]||$t,+t[3],t[4]?+t[4]:void 0):void 0},of=[Kl,sf],af=[Zl,nf,of],cf=Os(...af),uo=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:$t,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},lo="GlobalHandlers",df=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:lo,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(lf(n),Mr("onerror")),t.onunhandledrejection&&(ff(n),Mr("onunhandledrejection"))}}},uf=ce(lo,df);function lf(e){Ud(t=>{const{stackParser:n,attachStacktrace:r}=ho();if(z()!==e||ao())return;const{msg:s,url:o,line:i,column:a,error:c}=t,d=c===void 0&&te(s)?gf(s,o,i,a):fo(Rn(n,c||s,void 0,r,!1),o,i,a);d.level="error",qs(d,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function ff(e){Vd(t=>{const{stackParser:n,attachStacktrace:r}=ho();if(z()!==e||ao())return;const s=hf(t),o=$n(s)?pf(s):Rn(n,s,void 0,r,!0);o.level="error",qs(o,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function hf(e){if($n(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return e}function pf(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function gf(e,t,n,r){const s=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=yn(e)?e.message:e,i="Error";const a=o.match(s);return a&&(i=a[1],o=a[2]),fo({exception:{values:[{type:i,value:o}]}},t,n,r)}function fo(e,t,n,r){const s=e.exception=e.exception||{},o=s.values=s.values||[],i=o[0]=o[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[],d=isNaN(parseInt(r,10))?void 0:r,f=isNaN(parseInt(n,10))?void 0:n,u=te(t)&&t.length>0?t:hd();return c.length===0&&c.push({colno:d,filename:u,function:"?",in_app:!0,lineno:f}),e}function Mr(e){M&&g.log(`Global Handler attached: ${e}`)}function ho(){const e=z();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const _f=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],po="TryCatch",mf=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:po,setupOnce(){t.setTimeout&&R(m,"setTimeout",Vr),t.setInterval&&R(m,"setInterval",Vr),t.requestAnimationFrame&&R(m,"requestAnimationFrame",wf),t.XMLHttpRequest&&"XMLHttpRequest"in m&&R(XMLHttpRequest.prototype,"send",yf);const n=t.eventTarget;n&&(Array.isArray(n)?n:_f).forEach(xf)}}},bf=ce(po,mf);function Vr(e){return function(...t){const n=t[0];return t[0]=Ee(n,{mechanism:{data:{function:ie(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function wf(e){return function(t){return e.apply(this,[Ee(t,{mechanism:{data:{function:"requestAnimationFrame",handler:ie(e)},handled:!1,type:"instrument"}})])}}function yf(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&R(n,s,function(o){const i={mechanism:{data:{function:s,handler:ie(o)},handled:!1,type:"instrument"}},a=En(o);return a&&(i.mechanism.data.handler=ie(a)),Ee(o,i)})}),e.apply(this,t)}}function xf(e){const t=m,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(R(n,"addEventListener",function(r){return function(s,o,i){try{typeof o.handleEvent=="function"&&(o.handleEvent=Ee(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ie(o),target:e},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[s,Ee(o,{mechanism:{data:{function:"addEventListener",handler:ie(o),target:e},handled:!1,type:"instrument"}}),i])}}),R(n,"removeEventListener",function(r){return function(s,o,i){const a=o;try{const c=a&&a.__sentry_wrapped__;c&&r.call(this,s,c,i)}catch{}return r.call(this,s,a,i)}}))}const rt=1024,go="Breadcrumbs",$f=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:go,setupOnce(){},setup(n){t.console&&Cd(Cf(n)),t.dom&&Rd(Ef(n,t.dom)),t.xhr&&Gd(kf(n)),t.fetch&&Ld(If(n)),t.history&&Ps(Rf(n)),t.sentry&&n.on&&n.on("beforeSendEvent",vf(n))}}},Sf=ce(go,$f);function vf(e){return function(n){z()===e&&fe({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:se(n)},{event:n})}}function Ef(e,t){return function(r){if(z()!==e)return;let s,o,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>rt&&(M&&g.warn(`\`dom.maxStringLength\` cannot exceed ${rt}, but a value of ${a} was configured. Sentry will use ${rt} instead.`),a=rt),typeof i=="string"&&(i=[i]);try{const d=r.event,f=Df(d)?d.target:d;s=Cs(f,{keyAttrs:i,maxStringLength:a}),o=pd(f)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};o&&(c.data={"ui.component_name":o}),fe(c,{event:r.event,name:r.name,global:r.global})}}function Cf(e){return function(n){if(z()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:nu(n.level),message:gr(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${gr(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;fe(r,{input:n.args,level:n.level})}}function kf(e){return function(n){if(z()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,o=n.xhr[Oe];if(!r||!s||!o)return;const{method:i,url:a,status_code:c,body:d}=o,f={method:i,url:a,status_code:c},u={xhr:n.xhr,input:d,startTimestamp:r,endTimestamp:s};fe({category:"xhr",data:f,type:"http"},u)}}function If(e){return function(n){if(z()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const o=n.fetchData,i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s};fe({category:"fetch",data:o,level:"error",type:"http"},i)}else{const o=n.response,i={...n.fetchData,status_code:o&&o.status},a={input:n.args,response:o,startTimestamp:r,endTimestamp:s};fe({category:"fetch",data:i,type:"http"},a)}}}function Rf(e){return function(n){if(z()!==e)return;let r=n.from,s=n.to;const o=Ft(m.location.href);let i=r?Ft(r):void 0;const a=Ft(s);(!i||!i.path)&&(i=o),o.protocol===a.protocol&&o.host===a.host&&(s=a.relative),o.protocol===i.protocol&&o.host===i.host&&(r=i.relative),fe({category:"navigation",data:{from:r,to:s}})}}function Df(e){return!!e&&!!e.target}const Tf="cause",Of=5,_o="LinkedErrors",Af=(e={})=>{const t=e.limit||Of,n=e.key||Tf;return{name:_o,setupOnce(){},preprocessEvent(r,s,o){const i=o.getOptions();dd(co,i.stackParser,i.maxValueLength,n,t,r,s)}}},zf=ce(_o,Af),mo="HttpContext",Lf=()=>({name:mo,setupOnce(){},preprocessEvent(e){if(!m.navigator&&!m.location&&!m.document)return;const t=e.request&&e.request.url||m.location&&m.location.href,{referrer:n}=m.document||{},{userAgent:r}=m.navigator||{},s={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:s};e.request=o}}),Pf=ce(mo,Lf),bo="Dedupe",Nf=()=>{let e;return{name:bo,setupOnce(){},processEvent(t){if(t.type)return t;try{if(Mf(t,e))return M&&g.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Uf=ce(bo,Nf);function Mf(e,t){return t?!!(Vf(e,t)||Bf(e,t)):!1}function Vf(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!yo(e,t)||!wo(e,t))}function Bf(e,t){const n=Br(t),r=Br(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!yo(e,t)||!wo(e,t))}function wo(e,t){let n=Fr(e),r=Fr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const o=r[s],i=n[s];if(o.filename!==i.filename||o.lineno!==i.lineno||o.colno!==i.colno||o.function!==i.function)return!1}return!0}function yo(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Br(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Fr(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}const Ff=[new _l,new Il,new bf,new Sf,new uf,new zf,new Uf,new Pf];function qf(e){return[...Ff]}function Hf(e={}){e.defaultIntegrations===void 0&&(e.defaultIntegrations=qf()),e.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(e.release=__SENTRY_RELEASE__),m.SENTRY_RELEASE&&m.SENTRY_RELEASE.id&&(e.release=m.SENTRY_RELEASE.id)),e.autoSessionTracking===void 0&&(e.autoSessionTracking=!0),e.sendClientReports===void 0&&(e.sendClientReports=!0);const t={...e,stackParser:vd(e.stackParser||cf),integrations:Qu(e),transport:e.transport||(Ls()?ql:Gl)};cl(Vl,t),e.autoSessionTracking&&Gf()}const qr=(e={},t=J())=>{if(!m.document){M&&g.error("Global document not defined in showReportDialog call");return}const{client:n,scope:r}=t.getStackTop(),s=e.dsn||n&&n.getDsn();if(!s){M&&g.error("DSN not configured for showReportDialog call");return}r&&(e.user={...r.getUser(),...e.user}),e.eventId||(e.eventId=t.lastEventId());const o=m.document.createElement("script");o.async=!0,o.crossOrigin="anonymous",o.src=Xu(s,e),e.onLoad&&(o.onload=e.onLoad);const{onClose:i}=e;if(i){const c=d=>{if(d.data==="__sentry_reportdialog_closed__")try{i()}finally{m.removeEventListener("message",c)}};m.addEventListener("message",c)}const a=m.document.head||m.document.body;a?a.appendChild(o):M&&g.error("Not injecting report dialog. No injection point found in HTML")};function Gf(){if(typeof m.document>"u"){M&&g.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}Dr({ignoreDuration:!0}),Tr(),Ps(({from:e,to:t})=>{e!==void 0&&e!==t&&(Dr({ignoreDuration:!0}),Tr())})}function Wf(e){const t={...e};so(t,"react"),Hf(t)}var xo={exports:{}},w={};/** @license React v16.13.1
|
|
28
|
+
* react-is.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var E=typeof Symbol=="function"&&Symbol.for,Tn=E?Symbol.for("react.element"):60103,On=E?Symbol.for("react.portal"):60106,St=E?Symbol.for("react.fragment"):60107,vt=E?Symbol.for("react.strict_mode"):60108,Et=E?Symbol.for("react.profiler"):60114,Ct=E?Symbol.for("react.provider"):60109,kt=E?Symbol.for("react.context"):60110,An=E?Symbol.for("react.async_mode"):60111,It=E?Symbol.for("react.concurrent_mode"):60111,Rt=E?Symbol.for("react.forward_ref"):60112,Dt=E?Symbol.for("react.suspense"):60113,Kf=E?Symbol.for("react.suspense_list"):60120,Tt=E?Symbol.for("react.memo"):60115,Ot=E?Symbol.for("react.lazy"):60116,Yf=E?Symbol.for("react.block"):60121,jf=E?Symbol.for("react.fundamental"):60117,Jf=E?Symbol.for("react.responder"):60118,Xf=E?Symbol.for("react.scope"):60119;function U(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Tn:switch(e=e.type,e){case An:case It:case St:case Et:case vt:case Dt:return e;default:switch(e=e&&e.$$typeof,e){case kt:case Rt:case Ot:case Tt:case Ct:return e;default:return t}}case On:return t}}}function $o(e){return U(e)===It}w.AsyncMode=An;w.ConcurrentMode=It;w.ContextConsumer=kt;w.ContextProvider=Ct;w.Element=Tn;w.ForwardRef=Rt;w.Fragment=St;w.Lazy=Ot;w.Memo=Tt;w.Portal=On;w.Profiler=Et;w.StrictMode=vt;w.Suspense=Dt;w.isAsyncMode=function(e){return $o(e)||U(e)===An};w.isConcurrentMode=$o;w.isContextConsumer=function(e){return U(e)===kt};w.isContextProvider=function(e){return U(e)===Ct};w.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tn};w.isForwardRef=function(e){return U(e)===Rt};w.isFragment=function(e){return U(e)===St};w.isLazy=function(e){return U(e)===Ot};w.isMemo=function(e){return U(e)===Tt};w.isPortal=function(e){return U(e)===On};w.isProfiler=function(e){return U(e)===Et};w.isStrictMode=function(e){return U(e)===vt};w.isSuspense=function(e){return U(e)===Dt};w.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===St||e===It||e===Et||e===vt||e===Dt||e===Kf||typeof e=="object"&&e!==null&&(e.$$typeof===Ot||e.$$typeof===Tt||e.$$typeof===Ct||e.$$typeof===kt||e.$$typeof===Rt||e.$$typeof===jf||e.$$typeof===Jf||e.$$typeof===Xf||e.$$typeof===Yf)};w.typeOf=U;xo.exports=w;var Zf=xo.exports,So=Zf,Qf={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},eh={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},vo={};vo[So.ForwardRef]=Qf;vo[So.Memo]=eh;const th=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function nh(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}const Hr={componentStack:null,error:null,eventId:null};function rh(e,t){const n=new WeakMap;function r(s,o){if(!n.has(s)){if(s.cause)return n.set(s,!0),r(s.cause,o);s.cause=o}}r(e,t)}class zn extends x.Component{constructor(t){super(t),zn.prototype.__init.call(this),this.state=Hr,this._openFallbackReportDialog=!0;const n=z();n&&n.on&&t.showDialog&&(this._openFallbackReportDialog=!1,n.on("afterSendEvent",r=>{!r.type&&r.event_id===this._lastEventId&&qr({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,{componentStack:n}){const{beforeCapture:r,onError:s,showDialog:o,dialogOptions:i}=this.props;Hs(a=>{if(nh(x.version)&&wn(t)){const d=new Error(t.message);d.name=`React ErrorBoundary ${t.name}`,d.stack=n,rh(t,d)}r&&r(a,t,n);const c=wt(t,{captureContext:{contexts:{react:{componentStack:n}}},mechanism:{handled:!1}});s&&s(t,n,c),o&&(this._lastEventId=c,this._openFallbackReportDialog&&qr({...i,eventId:c})),this.setState({error:t,componentStack:n,eventId:c})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:s}=this.props;s&&s(t,n,r)}__init(){this.resetErrorBoundary=()=>{const{onReset:t}=this.props,{error:n,componentStack:r,eventId:s}=this.state;t&&t(n,r,s),this.setState(Hr)}}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.error){let s;return typeof t=="function"?s=t({error:r.error,componentStack:r.componentStack,resetError:this.resetErrorBoundary,eventId:r.eventId}):s=t,x.isValidElement(s)?s:(t&&th&&g.warn("fallback did not produce a valid ReactElement"),null)}return typeof n=="function"?n():n}}function Eo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Eo(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function K(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Eo(e))&&(r&&(r+=" "),r+=t);return r}var Gr="sid-theme-root",sh="y2413r2",oh="y2413r0",ih="y2413r1",ah="y2413r3";function Co(){return typeof window<"u"&&globalThis===window}function ko({theme:e,className:t}){return K(Gr,`${Gr}__${e}`,ah,{[oh]:e==="dark",[sh]:e==="auto",[ih]:e==="light"},t)}function ch({theme:e,className:t}){const n=ko({theme:e,className:t});document.body.classList.add(...n.split(" "))}const Io=({children:e})=>l.jsx("div",{className:ko({theme:"light"}),children:e}),dh=({children:e,theme:t="light",className:n})=>{const[r,s]=Zr.useState(!1);return x.useLayoutEffect(()=>{r||s(!0)},[n,r,t]),x.useLayoutEffect(()=>{r&&ch({theme:t,className:n})},[n,r,t]),r?l.jsx(l.Fragment,{children:e}):l.jsx(Io,{children:e})};function uh({children:e,theme:t="light",className:n}){return Co()?l.jsx(dh,{theme:t,className:n,children:e}):l.jsx(Io,{children:e})}var lh={default:"_92y0ua2 _92y0ua1",short:"_92y0ua3 _92y0ua1"};const Ro=({className:e,variant:t="default"})=>l.jsx("div",{className:K(lh[t],e)});var fh={primary:"eccmw2 eccmw0",secondary:"eccmw3 eccmw0",secondaryMd:"eccmw4 eccmw0 eccmw1",neutral:"eccmw5 eccmw0",neutralMd:"eccmw6 eccmw0 eccmw1",ghost:"eccmw7 eccmw0",ghostMd:"eccmw8 eccmw0 eccmw1"},hh="eccmw9",ph="eccmwa",gh={primary:"eccmwb",secondary:"eccmwc",secondaryMd:"eccmwd",neutral:"eccmwe",neutralMd:"eccmwf",ghost:"eccmwg",ghostMd:"eccmwh"};const Do=x.forwardRef(({children:e,onClick:t,className:n,type:r="button",variant:s="primary",testId:o,icon:i,disabled:a,loading:c=!1},d)=>l.jsx("button",{ref:d,"data-testid":o,type:r,disabled:a,className:K("sid-button",`sid-button--${s}`,fh[s],{[hh]:a},n),onClick:t,children:c?l.jsx(Ro,{variant:"short",className:gh[s]}):l.jsxs(l.Fragment,{children:[i?l.jsx("i",{className:ph,children:i}):null,e]})}));Do.displayName="Button";var _h="_1doytsg3",mh="_1doytsg0",bh={text:"_1doytsg5 _1doytsg4",email:"_1doytsg6 _1doytsg4",password:"_1doytsg7 _1doytsg4",tel:"_1doytsg8 _1doytsg4"},wh="_1doytsg9";const yh=({id:e,name:t,label:n,placeholder:r="",value:s,onChange:o,type:i="text",rightSlot:a})=>{const c=x.useCallback(d=>{o(d)},[o]);return l.jsxs("div",{className:bh[i],children:[l.jsx("label",{htmlFor:e,className:wh,children:n}),l.jsx("input",{type:i,id:e,name:t,className:mh,placeholder:r,value:s,onChange:c}),a||null]})},Wr=({name:e,id:t,label:n,placeholder:r="",className:s="",type:o="text",value:i,onChange:a})=>l.jsx("div",{className:K("sid-input",`sid-input--${o}`,_h,s),children:l.jsx(yh,{id:t,name:e,label:n,placeholder:r,className:s,type:o,value:i,onChange:a})}),xh=`
|
|
35
|
+
@media (prefers-color-scheme: dark) {
|
|
36
|
+
.sid-theme-root__auto path { fill: white; }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.sid-theme-root__dark path { fill: white; }
|
|
40
|
+
`;function $h(){return l.jsxs("svg",{width:"5",height:"20",viewBox:"0 0 5 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 0C3.32843 1.19209e-07 4 0.671573 4 1.5L4 11.5C4 12.3284 3.32843 13 2.5 13C1.67157 13 1 12.3284 1 11.5L1 1.5C1 0.671573 1.67157 -1.19209e-07 2.5 0Z",fill:"white"}),l.jsx("path",{d:"M4.5 18C4.5 19.1046 3.60457 20 2.5 20C1.39543 20 0.5 19.1046 0.5 18C0.5 16.8954 1.39543 16 2.5 16C3.60457 16 4.5 16.8954 4.5 18Z",fill:"white"})]})}const To=()=>l.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("style",{children:xh}),l.jsx("path",{d:"M12.686 10L2 30.228H5.198L15.884 10H12.686Z",fill:"#2A6AFF"}),l.jsx("path",{d:"M19.7923 15.694C20.9373 15.694 21.8723 14.732 21.8723 13.588C21.8723 12.444 20.9373 11.482 19.7923 11.482C18.6223 11.482 17.6873 12.444 17.6873 13.588C17.6873 14.732 18.6233 15.694 19.7933 15.694H19.7923ZM18.0773 17.514V30.228H21.4573V17.514H18.0773ZM34.1883 10V18.502C33.172 17.6398 31.8809 17.1695 30.5483 17.176C26.8563 17.176 24.0743 20.14 24.0743 23.884C24.0743 27.628 26.8563 30.592 30.5483 30.592C32.0823 30.592 33.4343 30.02 34.4483 29.032V30.228H37.5683V10H34.1883ZM30.9383 27.42C28.9883 27.42 27.5583 25.912 27.5583 23.884C27.5583 21.856 28.9883 20.348 30.9383 20.348C32.8883 20.348 34.3183 21.856 34.3183 23.884C34.3183 25.912 32.8883 27.42 30.9383 27.42Z",fill:"#142049"})]});var Sh="_1rf2mux3",vh="_1rf2muxg",Eh={blue:"_1rf2muxe _1rf2muxc",red:"_1rf2muxf _1rf2muxc"},Ch="_1rf2muxd",kh={blue:"_1rf2muxa _1rf2mux8",red:"_1rf2muxb _1rf2mux8"},Ih="_1rf2mux9",Rh={blue:"_1rf2mux6 _1rf2mux4",red:"_1rf2mux7 _1rf2mux4"},Dh="_1rf2mux5";const Ln=({children:e,className:t,variant:n="blue",shouldAnimate:r=!0})=>l.jsxs("div",{className:K(Sh,t),children:[l.jsx("div",{className:K(Rh[n],{[Dh]:r})}),l.jsx("div",{className:K(kh[n],{[Ih]:r})}),l.jsx("div",{className:K(Eh[n],{[Ch]:r})}),l.jsx("div",{className:vh,children:e})]});function Th(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Yr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kr(Object(n),!0).forEach(function(r){Th(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Oh=(e,t,n)=>{for(var r of Object.keys(e)){var s;if(e[r]!==((s=t[r])!==null&&s!==void 0?s:n[r]))return!1}return!0},Oo=e=>t=>{var n=e.defaultClassName,r=Yr(Yr({},e.defaultVariants),t);for(var s in r){var o,i=(o=r[s])!==null&&o!==void 0?o:e.defaultVariants[s];if(i!=null){var a=i;typeof a=="boolean"&&(a=a===!0?"true":"false");var c=e.variantClassNames[s][a];c&&(n+=" "+c)}}for(var[d,f]of e.compoundVariants)Oh(d,r,e.defaultVariants)&&(n+=" "+f);return n},Ah=Oo({defaultClassName:"s3l9sv0",variantClassNames:{direction:{vertical:"s3l9sv1",horizontal:"s3l9sv2"},space:{between:"s3l9sv3",evenly:"s3l9sv4"}},defaultVariants:{direction:"vertical"},compoundVariants:[]});function zh(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lh(e){var t=zh(e,"string");return typeof t=="symbol"?t:String(t)}function Ph(e,t,n){return t=Lh(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jr(Object(n),!0).forEach(function(r){Ph(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Nh=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=Object.assign({},...n.map(c=>c.styles)),o=Object.keys(s),i=o.filter(c=>"mappings"in s[c]),a=c=>{var d=[],f={},u=Gt({},c),h=!1;for(var _ of i){var C=c[_];if(C!=null){var Nn=s[_];h=!0;for(var O of Nn.mappings)f[O]=C,u[O]==null&&delete u[O]}}var Un=h?Gt(Gt({},f),u):c,Vo=function(){var ne=Un[Mn],Re=s[Mn];try{if(Re.mappings)return"continue";if(typeof ne=="string"||typeof ne=="number")d.push(Re.values[ne].defaultClass);else if(Array.isArray(ne))for(var Je=0;Je<ne.length;Je++){var Vn=ne[Je];if(Vn!=null){var Fo=Re.responsiveArray[Je];d.push(Re.values[Vn].conditions[Fo])}}else for(var Bn in ne){var Fn=ne[Bn];Fn!=null&&d.push(Re.values[Fn].conditions[Bn])}}catch(qo){throw qo}};for(var Mn in Un)var Bo=Vo();return e(d.join(" "))};return Object.assign(a,{properties:new Set(o)})},Uh=e=>e,Mh=function(){return Nh(Uh)(...arguments)},Ao=Mh({conditions:{defaultCondition:"lightMode",conditionNames:["lightMode","darkMode"],responsiveArray:void 0},styles:{color:{values:{background:{conditions:{lightMode:"_1hbz9ox0",darkMode:"_1hbz9ox1"},defaultClass:"_1hbz9ox0"},mute:{conditions:{lightMode:"_1hbz9ox2",darkMode:"_1hbz9ox3"},defaultClass:"_1hbz9ox2"},panel:{conditions:{lightMode:"_1hbz9ox4",darkMode:"_1hbz9ox5"},defaultClass:"_1hbz9ox4"},foreground:{conditions:{lightMode:"_1hbz9ox6",darkMode:"_1hbz9ox7"},defaultClass:"_1hbz9ox6"},contrast:{conditions:{lightMode:"_1hbz9ox8",darkMode:"_1hbz9ox9"},defaultClass:"_1hbz9ox8"},secondary:{conditions:{lightMode:"_1hbz9oxa",darkMode:"_1hbz9oxb"},defaultClass:"_1hbz9oxa"},tertiary:{conditions:{lightMode:"_1hbz9oxc",darkMode:"_1hbz9oxd"},defaultClass:"_1hbz9oxc"},placeholder:{conditions:{lightMode:"_1hbz9oxe",darkMode:"_1hbz9oxf"},defaultClass:"_1hbz9oxe"},smooth:{conditions:{lightMode:"_1hbz9oxg",darkMode:"_1hbz9oxh"},defaultClass:"_1hbz9oxg"},subtle:{conditions:{lightMode:"_1hbz9oxi",darkMode:"_1hbz9oxj"},defaultClass:"_1hbz9oxi"},soft:{conditions:{lightMode:"_1hbz9oxk",darkMode:"_1hbz9oxl"},defaultClass:"_1hbz9oxk"},offset:{conditions:{lightMode:"_1hbz9oxm",darkMode:"_1hbz9oxn"},defaultClass:"_1hbz9oxm"},primary:{conditions:{lightMode:"_1hbz9oxo",darkMode:"_1hbz9oxp"},defaultClass:"_1hbz9oxo"},primaryHover:{conditions:{lightMode:"_1hbz9oxq",darkMode:"_1hbz9oxr"},defaultClass:"_1hbz9oxq"},transparent:{conditions:{lightMode:"_1hbz9oxs",darkMode:"_1hbz9oxt"},defaultClass:"_1hbz9oxs"},error:{conditions:{lightMode:"_1hbz9oxu",darkMode:"_1hbz9oxv"},defaultClass:"_1hbz9oxu"},auxiliary:{conditions:{lightMode:"_1hbz9oxw",darkMode:"_1hbz9oxx"},defaultClass:"_1hbz9oxw"},success:{conditions:{lightMode:"_1hbz9oxy",darkMode:"_1hbz9oxz"},defaultClass:"_1hbz9oxy"},foregroundSuccess:{conditions:{lightMode:"_1hbz9ox10",darkMode:"_1hbz9ox11"},defaultClass:"_1hbz9ox10"},backgroundSuccess:{conditions:{lightMode:"_1hbz9ox12",darkMode:"_1hbz9ox13"},defaultClass:"_1hbz9ox12"},failure:{conditions:{lightMode:"_1hbz9ox14",darkMode:"_1hbz9ox15"},defaultClass:"_1hbz9ox14"},foregroundFailure:{conditions:{lightMode:"_1hbz9ox16",darkMode:"_1hbz9ox17"},defaultClass:"_1hbz9ox16"},backgroundFailure:{conditions:{lightMode:"_1hbz9ox18",darkMode:"_1hbz9ox19"},defaultClass:"_1hbz9ox18"}}},backgroundColor:{values:{background:{conditions:{lightMode:"_1hbz9ox1a",darkMode:"_1hbz9ox1b"},defaultClass:"_1hbz9ox1a"},mute:{conditions:{lightMode:"_1hbz9ox1c",darkMode:"_1hbz9ox1d"},defaultClass:"_1hbz9ox1c"},panel:{conditions:{lightMode:"_1hbz9ox1e",darkMode:"_1hbz9ox1f"},defaultClass:"_1hbz9ox1e"},foreground:{conditions:{lightMode:"_1hbz9ox1g",darkMode:"_1hbz9ox1h"},defaultClass:"_1hbz9ox1g"},contrast:{conditions:{lightMode:"_1hbz9ox1i",darkMode:"_1hbz9ox1j"},defaultClass:"_1hbz9ox1i"},secondary:{conditions:{lightMode:"_1hbz9ox1k",darkMode:"_1hbz9ox1l"},defaultClass:"_1hbz9ox1k"},tertiary:{conditions:{lightMode:"_1hbz9ox1m",darkMode:"_1hbz9ox1n"},defaultClass:"_1hbz9ox1m"},placeholder:{conditions:{lightMode:"_1hbz9ox1o",darkMode:"_1hbz9ox1p"},defaultClass:"_1hbz9ox1o"},smooth:{conditions:{lightMode:"_1hbz9ox1q",darkMode:"_1hbz9ox1r"},defaultClass:"_1hbz9ox1q"},subtle:{conditions:{lightMode:"_1hbz9ox1s",darkMode:"_1hbz9ox1t"},defaultClass:"_1hbz9ox1s"},soft:{conditions:{lightMode:"_1hbz9ox1u",darkMode:"_1hbz9ox1v"},defaultClass:"_1hbz9ox1u"},offset:{conditions:{lightMode:"_1hbz9ox1w",darkMode:"_1hbz9ox1x"},defaultClass:"_1hbz9ox1w"},primary:{conditions:{lightMode:"_1hbz9ox1y",darkMode:"_1hbz9ox1z"},defaultClass:"_1hbz9ox1y"},primaryHover:{conditions:{lightMode:"_1hbz9ox20",darkMode:"_1hbz9ox21"},defaultClass:"_1hbz9ox20"},transparent:{conditions:{lightMode:"_1hbz9ox22",darkMode:"_1hbz9ox23"},defaultClass:"_1hbz9ox22"},error:{conditions:{lightMode:"_1hbz9ox24",darkMode:"_1hbz9ox25"},defaultClass:"_1hbz9ox24"},auxiliary:{conditions:{lightMode:"_1hbz9ox26",darkMode:"_1hbz9ox27"},defaultClass:"_1hbz9ox26"},success:{conditions:{lightMode:"_1hbz9ox28",darkMode:"_1hbz9ox29"},defaultClass:"_1hbz9ox28"},foregroundSuccess:{conditions:{lightMode:"_1hbz9ox2a",darkMode:"_1hbz9ox2b"},defaultClass:"_1hbz9ox2a"},backgroundSuccess:{conditions:{lightMode:"_1hbz9ox2c",darkMode:"_1hbz9ox2d"},defaultClass:"_1hbz9ox2c"},failure:{conditions:{lightMode:"_1hbz9ox2e",darkMode:"_1hbz9ox2f"},defaultClass:"_1hbz9ox2e"},foregroundFailure:{conditions:{lightMode:"_1hbz9ox2g",darkMode:"_1hbz9ox2h"},defaultClass:"_1hbz9ox2g"},backgroundFailure:{conditions:{lightMode:"_1hbz9ox2i",darkMode:"_1hbz9ox2j"},defaultClass:"_1hbz9ox2i"}}}}},{conditions:void 0,styles:{marginY:{mappings:["marginTop","marginBottom"]},marginX:{mappings:["marginLeft","marginRight"]},gap:{values:{0:{defaultClass:"_1hbz9ox2k"},1:{defaultClass:"_1hbz9ox2l"},2:{defaultClass:"_1hbz9ox2m"},3:{defaultClass:"_1hbz9ox2n"},4:{defaultClass:"_1hbz9ox2o"},5:{defaultClass:"_1hbz9ox2p"},6:{defaultClass:"_1hbz9ox2q"},7:{defaultClass:"_1hbz9ox2r"},8:{defaultClass:"_1hbz9ox2s"},9:{defaultClass:"_1hbz9ox2t"},10:{defaultClass:"_1hbz9ox2u"},11:{defaultClass:"_1hbz9ox2v"},12:{defaultClass:"_1hbz9ox2w"},13:{defaultClass:"_1hbz9ox2x"},14:{defaultClass:"_1hbz9ox2y"},15:{defaultClass:"_1hbz9ox2z"},16:{defaultClass:"_1hbz9ox30"},20:{defaultClass:"_1hbz9ox31"},24:{defaultClass:"_1hbz9ox32"},28:{defaultClass:"_1hbz9ox33"},32:{defaultClass:"_1hbz9ox34"},36:{defaultClass:"_1hbz9ox35"},40:{defaultClass:"_1hbz9ox36"},44:{defaultClass:"_1hbz9ox37"},48:{defaultClass:"_1hbz9ox38"},52:{defaultClass:"_1hbz9ox39"},56:{defaultClass:"_1hbz9ox3a"},60:{defaultClass:"_1hbz9ox3b"},64:{defaultClass:"_1hbz9ox3c"},68:{defaultClass:"_1hbz9ox3d"},72:{defaultClass:"_1hbz9ox3e"},76:{defaultClass:"_1hbz9ox3f"},80:{defaultClass:"_1hbz9ox3g"},96:{defaultClass:"_1hbz9ox3h"},px:{defaultClass:"_1hbz9ox3i"},"0.25":{defaultClass:"_1hbz9ox3j"},"0.5":{defaultClass:"_1hbz9ox3k"},"0.75":{defaultClass:"_1hbz9ox3l"},"1.5":{defaultClass:"_1hbz9ox3m"},"2.5":{defaultClass:"_1hbz9ox3n"},"3.5":{defaultClass:"_1hbz9ox3o"}}},marginTop:{values:{0:{defaultClass:"_1hbz9ox3p"},1:{defaultClass:"_1hbz9ox3q"},2:{defaultClass:"_1hbz9ox3r"},3:{defaultClass:"_1hbz9ox3s"},4:{defaultClass:"_1hbz9ox3t"},5:{defaultClass:"_1hbz9ox3u"},6:{defaultClass:"_1hbz9ox3v"},7:{defaultClass:"_1hbz9ox3w"},8:{defaultClass:"_1hbz9ox3x"},9:{defaultClass:"_1hbz9ox3y"},10:{defaultClass:"_1hbz9ox3z"},11:{defaultClass:"_1hbz9ox40"},12:{defaultClass:"_1hbz9ox41"},13:{defaultClass:"_1hbz9ox42"},14:{defaultClass:"_1hbz9ox43"},15:{defaultClass:"_1hbz9ox44"},16:{defaultClass:"_1hbz9ox45"},20:{defaultClass:"_1hbz9ox46"},24:{defaultClass:"_1hbz9ox47"},28:{defaultClass:"_1hbz9ox48"},32:{defaultClass:"_1hbz9ox49"},36:{defaultClass:"_1hbz9ox4a"},40:{defaultClass:"_1hbz9ox4b"},44:{defaultClass:"_1hbz9ox4c"},48:{defaultClass:"_1hbz9ox4d"},52:{defaultClass:"_1hbz9ox4e"},56:{defaultClass:"_1hbz9ox4f"},60:{defaultClass:"_1hbz9ox4g"},64:{defaultClass:"_1hbz9ox4h"},68:{defaultClass:"_1hbz9ox4i"},72:{defaultClass:"_1hbz9ox4j"},76:{defaultClass:"_1hbz9ox4k"},80:{defaultClass:"_1hbz9ox4l"},96:{defaultClass:"_1hbz9ox4m"},px:{defaultClass:"_1hbz9ox4n"},"0.25":{defaultClass:"_1hbz9ox4o"},"0.5":{defaultClass:"_1hbz9ox4p"},"0.75":{defaultClass:"_1hbz9ox4q"},"1.5":{defaultClass:"_1hbz9ox4r"},"2.5":{defaultClass:"_1hbz9ox4s"},"3.5":{defaultClass:"_1hbz9ox4t"}}},marginBottom:{values:{0:{defaultClass:"_1hbz9ox4u"},1:{defaultClass:"_1hbz9ox4v"},2:{defaultClass:"_1hbz9ox4w"},3:{defaultClass:"_1hbz9ox4x"},4:{defaultClass:"_1hbz9ox4y"},5:{defaultClass:"_1hbz9ox4z"},6:{defaultClass:"_1hbz9ox50"},7:{defaultClass:"_1hbz9ox51"},8:{defaultClass:"_1hbz9ox52"},9:{defaultClass:"_1hbz9ox53"},10:{defaultClass:"_1hbz9ox54"},11:{defaultClass:"_1hbz9ox55"},12:{defaultClass:"_1hbz9ox56"},13:{defaultClass:"_1hbz9ox57"},14:{defaultClass:"_1hbz9ox58"},15:{defaultClass:"_1hbz9ox59"},16:{defaultClass:"_1hbz9ox5a"},20:{defaultClass:"_1hbz9ox5b"},24:{defaultClass:"_1hbz9ox5c"},28:{defaultClass:"_1hbz9ox5d"},32:{defaultClass:"_1hbz9ox5e"},36:{defaultClass:"_1hbz9ox5f"},40:{defaultClass:"_1hbz9ox5g"},44:{defaultClass:"_1hbz9ox5h"},48:{defaultClass:"_1hbz9ox5i"},52:{defaultClass:"_1hbz9ox5j"},56:{defaultClass:"_1hbz9ox5k"},60:{defaultClass:"_1hbz9ox5l"},64:{defaultClass:"_1hbz9ox5m"},68:{defaultClass:"_1hbz9ox5n"},72:{defaultClass:"_1hbz9ox5o"},76:{defaultClass:"_1hbz9ox5p"},80:{defaultClass:"_1hbz9ox5q"},96:{defaultClass:"_1hbz9ox5r"},px:{defaultClass:"_1hbz9ox5s"},"0.25":{defaultClass:"_1hbz9ox5t"},"0.5":{defaultClass:"_1hbz9ox5u"},"0.75":{defaultClass:"_1hbz9ox5v"},"1.5":{defaultClass:"_1hbz9ox5w"},"2.5":{defaultClass:"_1hbz9ox5x"},"3.5":{defaultClass:"_1hbz9ox5y"}}},marginLeft:{values:{0:{defaultClass:"_1hbz9ox5z"},1:{defaultClass:"_1hbz9ox60"},2:{defaultClass:"_1hbz9ox61"},3:{defaultClass:"_1hbz9ox62"},4:{defaultClass:"_1hbz9ox63"},5:{defaultClass:"_1hbz9ox64"},6:{defaultClass:"_1hbz9ox65"},7:{defaultClass:"_1hbz9ox66"},8:{defaultClass:"_1hbz9ox67"},9:{defaultClass:"_1hbz9ox68"},10:{defaultClass:"_1hbz9ox69"},11:{defaultClass:"_1hbz9ox6a"},12:{defaultClass:"_1hbz9ox6b"},13:{defaultClass:"_1hbz9ox6c"},14:{defaultClass:"_1hbz9ox6d"},15:{defaultClass:"_1hbz9ox6e"},16:{defaultClass:"_1hbz9ox6f"},20:{defaultClass:"_1hbz9ox6g"},24:{defaultClass:"_1hbz9ox6h"},28:{defaultClass:"_1hbz9ox6i"},32:{defaultClass:"_1hbz9ox6j"},36:{defaultClass:"_1hbz9ox6k"},40:{defaultClass:"_1hbz9ox6l"},44:{defaultClass:"_1hbz9ox6m"},48:{defaultClass:"_1hbz9ox6n"},52:{defaultClass:"_1hbz9ox6o"},56:{defaultClass:"_1hbz9ox6p"},60:{defaultClass:"_1hbz9ox6q"},64:{defaultClass:"_1hbz9ox6r"},68:{defaultClass:"_1hbz9ox6s"},72:{defaultClass:"_1hbz9ox6t"},76:{defaultClass:"_1hbz9ox6u"},80:{defaultClass:"_1hbz9ox6v"},96:{defaultClass:"_1hbz9ox6w"},px:{defaultClass:"_1hbz9ox6x"},"0.25":{defaultClass:"_1hbz9ox6y"},"0.5":{defaultClass:"_1hbz9ox6z"},"0.75":{defaultClass:"_1hbz9ox70"},"1.5":{defaultClass:"_1hbz9ox71"},"2.5":{defaultClass:"_1hbz9ox72"},"3.5":{defaultClass:"_1hbz9ox73"}}},marginRight:{values:{0:{defaultClass:"_1hbz9ox74"},1:{defaultClass:"_1hbz9ox75"},2:{defaultClass:"_1hbz9ox76"},3:{defaultClass:"_1hbz9ox77"},4:{defaultClass:"_1hbz9ox78"},5:{defaultClass:"_1hbz9ox79"},6:{defaultClass:"_1hbz9ox7a"},7:{defaultClass:"_1hbz9ox7b"},8:{defaultClass:"_1hbz9ox7c"},9:{defaultClass:"_1hbz9ox7d"},10:{defaultClass:"_1hbz9ox7e"},11:{defaultClass:"_1hbz9ox7f"},12:{defaultClass:"_1hbz9ox7g"},13:{defaultClass:"_1hbz9ox7h"},14:{defaultClass:"_1hbz9ox7i"},15:{defaultClass:"_1hbz9ox7j"},16:{defaultClass:"_1hbz9ox7k"},20:{defaultClass:"_1hbz9ox7l"},24:{defaultClass:"_1hbz9ox7m"},28:{defaultClass:"_1hbz9ox7n"},32:{defaultClass:"_1hbz9ox7o"},36:{defaultClass:"_1hbz9ox7p"},40:{defaultClass:"_1hbz9ox7q"},44:{defaultClass:"_1hbz9ox7r"},48:{defaultClass:"_1hbz9ox7s"},52:{defaultClass:"_1hbz9ox7t"},56:{defaultClass:"_1hbz9ox7u"},60:{defaultClass:"_1hbz9ox7v"},64:{defaultClass:"_1hbz9ox7w"},68:{defaultClass:"_1hbz9ox7x"},72:{defaultClass:"_1hbz9ox7y"},76:{defaultClass:"_1hbz9ox7z"},80:{defaultClass:"_1hbz9ox80"},96:{defaultClass:"_1hbz9ox81"},px:{defaultClass:"_1hbz9ox82"},"0.25":{defaultClass:"_1hbz9ox83"},"0.5":{defaultClass:"_1hbz9ox84"},"0.75":{defaultClass:"_1hbz9ox85"},"1.5":{defaultClass:"_1hbz9ox86"},"2.5":{defaultClass:"_1hbz9ox87"},"3.5":{defaultClass:"_1hbz9ox88"}}}}});const At=e=>l.jsx("div",{className:K("sid-stack",Ah(e.variant),Ao({gap:e.space||"2"}),e.className),style:e.style,children:e.children});var Vh=Oo({defaultClassName:"_1wn0ypy0",variantClassNames:{size:{xs:"_1wn0ypy1",sm:"_1wn0ypy2",base:"_1wn0ypy3",xl:"_1wn0ypy4","2xl-title":"_1wn0ypy5"},weight:{medium:"_1wn0ypy6",semibold:"_1wn0ypy7",bold:"_1wn0ypy8"},color:{contrast:"_1wn0ypy9",tertiary:"_1wn0ypya",placeholder:"_1wn0ypyb",white:"_1wn0ypyc",success:"_1wn0ypyd",failure:"_1wn0ypye"}},defaultVariants:{size:"base",weight:"medium"},compoundVariants:[]});const Bh={text:{}},Pn=x.createContext(Bh);Pn.displayName="SlashIDTextContext";const Fh=({text:e,children:t})=>{const n=x.useMemo(()=>({text:e}),[e]);return l.jsx(Pn.Provider,{value:n,children:t})};function qh(){const{text:e}=Zr.useContext(Pn);return e}const Wt={opening:"{{",closing:"}}"};function Hh(e,t){return e.includes(Wt.opening)?Object.keys(t).reduce((r,s)=>r.replace(`${Wt.opening}${s}${Wt.closing}`,t[s]),e):e}const gn=({as:e,t,tokens:n,variant:r,className:s,children:o})=>{const i=qh(),a=e||"p";return l.jsxs(a,{className:K("sid-text",`sid-text--${e}`,Vh(r),s),children:[n?Hh(i[t],n):i[t],o||null]})};var Gh="iokgmp1";function Jr({width:e,height:t,minHeight:n,maxHeight:r,minWidth:s,maxWidth:o}){return l.jsx("div",{className:Gh,style:{width:e,height:t,minHeight:n,maxHeight:r,minWidth:s,maxWidth:o}})}function Wh(){const e=navigator.language.toLowerCase();return e==="ja"||e.startsWith("ja-")?"ja":"en"}const S={"footer.text":"Top-tier security by SlashID","initial.title":"Logging you in...","initial.details":"Please follow the on-screen instructions.","recover.password.title":"Reset password","recover.password.details":"Enter your new password.","recover.password.input.password.label":"Password","recover.password.input.confirmPassword.label":"Confirm password","recover.password.input.placeholder":"Type your new password","recover.password.submit":"Reset password","recover.password.validation.length":"Password is too short","recover.password.validation.password_variants":"Contains word 'password'","recover.password.validation.admin_variants":"Contains word 'admin'","recover.password.validation.user_variants":"Contains word 'user'","recover.password.validation.alphanumeric_sequences_1":"Sequence of alphanumeric characters","recover.password.validation.alphanumeric_sequences_2":"Sequence of alphanumeric characters","recover.password.validation.numeric_sequences_ascending":"Sequence of alphanumeric characters","recover.password.validation.numeric_subsequences_ascending":"Sequence of alphanumeric characters","recover.password.validation.numeric_sequences_descending":"Sequence of alphanumeric characters","recover.password.validation.numeric_subsequences_descending":"Sequence of alphanumeric characters","recover.password.validation.common_password_xkcd":"Common password","success.title":"Thank you, you're signed in!","success.details":"You can now close this page.","error.title":"Something went wrong...","error.detail":"Please log in again."},zo={en:S,ja:{"footer.text":S["footer.text"],"initial.title":"ログイン処理を行っています。","initial.details":"処理完了後、画面は自動で切り替わります。","success.title":"認証が完了しました!","success.details":"このページを閉じて、元のページへ戻ってください。","recover.password.title":S["recover.password.title"],"recover.password.details":S["recover.password.details"],"recover.password.input.password.label":S["recover.password.input.password.label"],"recover.password.input.confirmPassword.label":S["recover.password.input.confirmPassword.label"],"recover.password.input.placeholder":S["recover.password.input.placeholder"],"recover.password.submit":S["recover.password.submit"],"recover.password.validation.length":S["recover.password.validation.length"],"recover.password.validation.password_variants":S["recover.password.validation.password_variants"],"recover.password.validation.admin_variants":S["recover.password.validation.admin_variants"],"recover.password.validation.user_variants":S["recover.password.validation.user_variants"],"recover.password.validation.alphanumeric_sequences_1":S["recover.password.validation.alphanumeric_sequences_1"],"recover.password.validation.alphanumeric_sequences_2":S["recover.password.validation.alphanumeric_sequences_2"],"recover.password.validation.numeric_sequences_ascending":S["recover.password.validation.numeric_sequences_ascending"],"recover.password.validation.numeric_subsequences_ascending":S["recover.password.validation.numeric_subsequences_ascending"],"recover.password.validation.numeric_sequences_descending":S["recover.password.validation.numeric_sequences_descending"],"recover.password.validation.numeric_subsequences_descending":S["recover.password.validation.numeric_subsequences_descending"],"recover.password.validation.common_password_xkcd":S["recover.password.validation.common_password_xkcd"],"error.title":S["error.title"],"error.detail":"再度ログインをしてください。"}},Kh=e=>t=>zo[e][t],Lo={logo:l.jsx(To,{}),language:"en",state:"initial",sdk:void 0},Po=x.createContext(Lo),je=()=>x.useContext(Po),he=e=>l.jsx(gn,{...e});var Yh="_1vg0oop0",jh="_1vg0oop2",Jh="_1vg0oop1",Xh="_1vg0oop3";function Zh(){const{logo:e}=je();return l.jsx("div",{className:Xh,children:e})}function Qh(){return l.jsx(he,{t:"footer.text",variant:{size:"xs",weight:"semibold",color:"placeholder"}})}function No({children:e,header:t=l.jsx(Zh,{}),footer:n=l.jsx(Qh,{})}){return l.jsxs("article",{className:Yh,children:[t&&l.jsx("header",{className:Jh,children:t}),l.jsx("div",{children:e}),n&&l.jsx("footer",{className:jh,children:n})]})}function Uo(){return l.jsx(Ln,{children:l.jsx(Ro,{})})}function ep(){return l.jsxs(l.Fragment,{children:[l.jsxs(At,{space:"2",children:[l.jsx(Jr,{width:"75%",height:24}),l.jsx(Jr,{width:"50%",height:16})]}),l.jsx(Uo,{})]})}function tp({type:e}){return l.jsx(Ln,{variant:e==="warning"?"blue":"red",shouldAnimate:!1,children:l.jsx($h,{})})}function _n({type:e}){return l.jsxs(l.Fragment,{children:[l.jsxs(At,{space:"0.25",children:[l.jsx(he,{as:"h1",variant:{size:"2xl-title",weight:"bold"},t:"error.title"}),l.jsx(he,{as:"h2",t:"error.detail",variant:{color:"contrast",weight:"semibold"}})]}),l.jsx(tp,{type:e})]})}var np="_8vopmj2",rp="_8vopmj0";function sp(){const{language:e}=je();return x.useMemo(()=>Kh(e),[e])}function op(e){return`authenticating.setPassword.validation.${e.failedRules[0].name}`}function ip({message:e}){return l.jsx("span",{className:np,children:e})}function ap(){const e=sp(),{sdk:t}=je(),[n,r]=x.useState(""),[s,o]=x.useState(""),[i,a]=x.useState(null);x.useEffect(()=>{const u=h=>{console.log("onInvalidPassword",h),a(e(op(h)))};return t?.subscribe("invalidPasswordSubmitted",u),()=>{t?.unsubscribe("invalidPasswordSubmitted",u)}},[e,t,a]);const c=u=>{u.preventDefault(),t&&t.publish("passwordSubmitted",n)},d=u=>{r(u.target.value)},f=u=>{o(u.target.value)};return l.jsxs(l.Fragment,{children:[l.jsxs(At,{space:"0.25",children:[l.jsx(gn,{as:"h1",variant:{size:"2xl-title",weight:"bold"},t:"recover.password.title"}),l.jsx(gn,{variant:{color:"contrast",weight:"semibold"},as:"h2",t:"recover.password.details"})]}),l.jsxs("form",{onSubmit:c,children:[l.jsxs("div",{className:rp,children:[l.jsx(Wr,{id:"password-input",label:e("recover.password.input.password.label"),placeholder:e("recover.password.input.placeholder"),name:"password",type:"password",value:n??"",onChange:d}),l.jsx(Wr,{id:"password-input-confirm",label:e("recover.password.input.confirmPassword.label"),placeholder:e("recover.password.input.placeholder"),name:"passwordConfirm",type:"password",value:s??"",onChange:f,className:Ao({marginTop:"4"})}),i&&l.jsx(ip,{message:i})]}),l.jsx(Do,{type:"submit",variant:"primary",testId:"sid-form-initial-submit-button",disabled:!n||n!==s,children:e("recover.password.submit")})]})]})}class cp extends Error{errors;constructor(t){super(t.length>0?t[0].message:"Unknown SlashID error"),this.errors=t}}function dp(e){return!!(typeof e=="object"&&e!==null&&"errors"in e&&Array.isArray(e.errors))}function Mo(e){if(e instanceof Error)return e;if(dp(e))return new cp(e.errors);let t="[Unable to stringify the thrown value]";try{t=JSON.stringify(e)}catch{}return new Error(`This value was thrown as is, not through an Error: ${t}`)}function up({onSuccess:e,onError:t,flowType:n}){const{sdk:r}=je();return x.useEffect(()=>{if(!r)return;async function s(){try{await r?.getUserFromURL(),e()}catch(o){const i=Mo(o);wt(i),t({error:i})}}s()},[n,t,e,r]),n==="password-recovery"?l.jsx(ap,{}):l.jsxs(l.Fragment,{children:[l.jsxs(At,{space:"0.25",children:[l.jsx(he,{as:"h1",variant:{size:"2xl-title",weight:"bold"},t:"initial.title"}),l.jsx(he,{variant:{color:"contrast",weight:"semibold"},as:"h2",t:"initial.details"})]}),l.jsx(Uo,{})]})}const lp=()=>l.jsx(Ln,{children:l.jsx("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.8505 0.705985C20.6342 1.38283 20.7209 2.56684 20.044 3.35055L8.16908 17.1005C7.80192 17.5256 7.2635 17.7637 6.70195 17.7493C6.1404 17.7349 5.61489 17.4695 5.27002 17.0261L0.895049 11.4011C0.259296 10.5837 0.406547 9.4057 1.22394 8.76995C2.04134 8.13419 3.21935 8.28145 3.8551 9.09884L6.82592 12.9185L17.2059 0.89949C17.8828 0.115778 19.0668 0.0291434 19.8505 0.705985Z",fill:"white"})})});function fp(){return l.jsxs("article",{"data-testid":"sid-form-success-state",children:[l.jsx(he,{as:"h1",t:"success.title",variant:{size:"2xl-title",weight:"bold"}}),l.jsx(he,{as:"h2",t:"success.details",variant:{color:"contrast",weight:"semibold"}}),l.jsx(lp,{})]})}function hp(e){return e.some(t=>t.type==="password_reset")}function pp(e){return hp(e)?"password-recovery":"catch-all"}function gp(){const[e,t]=x.useState({state:"initial"}),{sdk:n,state:r}=je();x.useEffect(()=>{if(e.state!=="initial")return;async function i(){if(!n)return;t({state:"parsing-url"});let a=[];try{a=await n.getChallengesFromURL()}catch(d){wt(Mo(d))}if(!a){t({state:"no-challenges",challenges:null});return}const c=pp(a);t({state:"progress",challenges:a,flowType:c})}i()},[r,e.state,n]);const s=()=>{e.state==="progress"&&t({state:"success",challenges:e.challenges,flowType:e.flowType})},o=({error:i})=>{e.state==="progress"&&t({state:"error",challenges:e.challenges,flowType:e.flowType,error:i})};return l.jsxs(No,{children:[(r!=="ready"||e.state==="parsing-url")&&l.jsx(ep,{}),r==="ready"&&l.jsxs(l.Fragment,{children:[e.state==="progress"&&l.jsx(up,{onSuccess:s,onError:o,flowType:e.flowType}),e.state==="no-challenges"&&l.jsx(_n,{type:"warning"}),e.state==="success"&&l.jsx(fp,{}),e.state==="error"&&l.jsx(_n,{type:"error"})]})]})}var _p="d0vxn40";const Xr={sdkURL:{}.PUBLIC_SID_SDK_URL||"https://jump.slashid.local",baseURL:{}.PUBLIC_SID_API_URL||"https://slashid.local"};function yp(){const e=Co(),[t,n]=x.useState("initial"),r=x.useRef(void 0);x.useEffect(()=>{t==="initial"&&(Wf({dsn:"https://6435e8a20ba8b61404fb4621d2aedd4a@o4505317722619904.ingest.sentry.io/4506275681075200"}),r.current=new Be({analyticsEnabled:!1,sdkURL:Xr.sdkURL,baseURL:Xr.baseURL}),n("ready"))},[t]);const s=x.useMemo(()=>!e||t=="initial"?Lo:{logo:l.jsx(To,{}),language:Wh(),state:t,sdk:r.current},[t,e]);return l.jsx(uh,{theme:"light",children:l.jsx(zn,{fallback:l.jsx(No,{children:l.jsx(_n,{type:"error"})}),children:l.jsx(Po.Provider,{value:s,children:l.jsx(Fh,{text:zo[s.language],children:l.jsx("main",{className:_p,children:l.jsx(gp,{})})})})})})}export{yp as App};
|