@modulrfinance/customer-verification-sdk 1.0.0-beta.1
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/README.md +9 -0
- package/cdn/modulr-customer-verification-sdk.js +127 -0
- package/index.d.ts +2 -0
- package/index.mjs +10200 -0
- package/lib/alloy.config.d.ts +3 -0
- package/lib/auth/sdk-auth.d.ts +17 -0
- package/lib/browser-sdk-api.d.ts +4 -0
- package/lib/components/register.d.ts +2 -0
- package/lib/components/spinner/spinner.element.d.ts +13 -0
- package/lib/config/sdk.config.d.ts +12 -0
- package/lib/default-custom-style.d.ts +3 -0
- package/lib/http/auth.interceptor.d.ts +3 -0
- package/lib/http/headers.interceptor.d.ts +3 -0
- package/lib/http/interceptor.d.ts +8 -0
- package/lib/http/response-error.interceptor.d.ts +3 -0
- package/lib/http/sdk-fetch.d.ts +2 -0
- package/lib/sdk.d.ts +6 -0
- package/lib/sdk.handler.d.ts +32 -0
- package/lib/sdk.model.d.ts +102 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
(function(xt){"use strict";function Xo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rr={},Yo=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),sr="%[a-f0-9]{2}",or=new RegExp("("+sr+")|([^%]+?)","gi"),ir=new RegExp("("+sr+")+","gi");function H0(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var n=t.slice(0,e),r=t.slice(e);return Array.prototype.concat.call([],H0(n),H0(r))}function Jo(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(or)||[],n=1;n<e.length;n++)t=H0(e,n).join(""),e=t.match(or)||[];return t}}function Zo(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=ir.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch{var r=Jo(n[0]);r!==n[0]&&(e[n[0]]=r)}n=ir.exec(t)}e["%C2"]="�";for(var s=Object.keys(e),o=0;o<s.length;o++){var i=s[o];t=t.replace(new RegExp(i,"g"),e[i])}return t}var Qo=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return Zo(t)}},ei=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const n=t.indexOf(e);return n===-1?[t]:[t.slice(0,n),t.slice(n+e.length)]},ti=function(t,e){for(var n={},r=Object.keys(t),s=Array.isArray(e),o=0;o<r.length;o++){var i=r[o],c=t[i];(s?e.indexOf(i)!==-1:e(i,c,t))&&(n[i]=c)}return n};(function(t){const e=Yo,n=Qo,r=ei,s=ti,o=f=>f==null;function i(f){switch(f.arrayFormat){case"index":return g=>(C,A)=>{const x=C.length;return A===void 0||f.skipNull&&A===null||f.skipEmptyString&&A===""?C:A===null?[...C,[l(g,f),"[",x,"]"].join("")]:[...C,[l(g,f),"[",l(x,f),"]=",l(A,f)].join("")]};case"bracket":return g=>(C,A)=>A===void 0||f.skipNull&&A===null||f.skipEmptyString&&A===""?C:A===null?[...C,[l(g,f),"[]"].join("")]:[...C,[l(g,f),"[]=",l(A,f)].join("")];case"comma":case"separator":return g=>(C,A)=>A==null||A.length===0?C:C.length===0?[[l(g,f),"=",l(A,f)].join("")]:[[C,l(A,f)].join(f.arrayFormatSeparator)];default:return g=>(C,A)=>A===void 0||f.skipNull&&A===null||f.skipEmptyString&&A===""?C:A===null?[...C,l(g,f)]:[...C,[l(g,f),"=",l(A,f)].join("")]}}function c(f){let g;switch(f.arrayFormat){case"index":return(C,A,x)=>{if(g=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!g){x[C]=A;return}x[C]===void 0&&(x[C]={}),x[C][g[1]]=A};case"bracket":return(C,A,x)=>{if(g=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!g){x[C]=A;return}if(x[C]===void 0){x[C]=[A];return}x[C]=[].concat(x[C],A)};case"comma":case"separator":return(C,A,x)=>{const p=typeof A=="string"&&A.includes(f.arrayFormatSeparator),h=typeof A=="string"&&!p&&d(A,f).includes(f.arrayFormatSeparator);A=h?d(A,f):A;const E=p||h?A.split(f.arrayFormatSeparator).map(P=>d(P,f)):A===null?A:d(A,f);x[C]=E};default:return(C,A,x)=>{if(x[C]===void 0){x[C]=A;return}x[C]=[].concat(x[C],A)}}}function a(f){if(typeof f!="string"||f.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function l(f,g){return g.encode?g.strict?e(f):encodeURIComponent(f):f}function d(f,g){return g.decode?n(f):f}function u(f){return Array.isArray(f)?f.sort():typeof f=="object"?u(Object.keys(f)).sort((g,C)=>Number(g)-Number(C)).map(g=>f[g]):f}function m(f){const g=f.indexOf("#");return g!==-1&&(f=f.slice(0,g)),f}function _(f){let g="";const C=f.indexOf("#");return C!==-1&&(g=f.slice(C)),g}function b(f){f=m(f);const g=f.indexOf("?");return g===-1?"":f.slice(g+1)}function D(f,g){return g.parseNumbers&&!Number.isNaN(Number(f))&&typeof f=="string"&&f.trim()!==""?f=Number(f):g.parseBooleans&&f!==null&&(f.toLowerCase()==="true"||f.toLowerCase()==="false")&&(f=f.toLowerCase()==="true"),f}function S(f,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),a(g.arrayFormatSeparator);const C=c(g),A=Object.create(null);if(typeof f!="string"||(f=f.trim().replace(/^[?#&]/,""),!f))return A;for(const x of f.split("&")){if(x==="")continue;let[p,h]=r(g.decode?x.replace(/\+/g," "):x,"=");h=h===void 0?null:["comma","separator"].includes(g.arrayFormat)?h:d(h,g),C(d(p,g),h,A)}for(const x of Object.keys(A)){const p=A[x];if(typeof p=="object"&&p!==null)for(const h of Object.keys(p))p[h]=D(p[h],g);else A[x]=D(p,g)}return g.sort===!1?A:(g.sort===!0?Object.keys(A).sort():Object.keys(A).sort(g.sort)).reduce((x,p)=>{const h=A[p];return h&&typeof h=="object"&&!Array.isArray(h)?x[p]=u(h):x[p]=h,x},Object.create(null))}t.extract=b,t.parse=S,t.stringify=(f,g)=>{if(!f)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),a(g.arrayFormatSeparator);const C=h=>g.skipNull&&o(f[h])||g.skipEmptyString&&f[h]==="",A=i(g),x={};for(const h of Object.keys(f))C(h)||(x[h]=f[h]);const p=Object.keys(x);return g.sort!==!1&&p.sort(g.sort),p.map(h=>{const E=f[h];return E===void 0?"":E===null?l(h,g):Array.isArray(E)?E.reduce(A(h),[]).join("&"):l(h,g)+"="+l(E,g)}).filter(h=>h.length>0).join("&")},t.parseUrl=(f,g)=>{g=Object.assign({decode:!0},g);const[C,A]=r(f,"#");return Object.assign({url:C.split("?")[0]||"",query:S(b(f),g)},g&&g.parseFragmentIdentifier&&A?{fragmentIdentifier:d(A,g)}:{})},t.stringifyUrl=(f,g)=>{g=Object.assign({encode:!0,strict:!0},g);const C=m(f.url).split("?")[0]||"",A=t.extract(f.url),x=t.parse(A,{sort:!1}),p=Object.assign(x,f.query);let h=t.stringify(p,g);h&&(h=`?${h}`);let E=_(f.url);return f.fragmentIdentifier&&(E=`#${l(f.fragmentIdentifier,g)}`),`${C}${h}${E}`},t.pick=(f,g,C)=>{C=Object.assign({parseFragmentIdentifier:!0},C);const{url:A,query:x,fragmentIdentifier:p}=t.parseUrl(f,C);return t.stringifyUrl({url:A,query:s(x,g),fragmentIdentifier:p},C)},t.exclude=(f,g,C)=>{const A=Array.isArray(g)?x=>!g.includes(x):(x,p)=>!g(x,p);return t.pick(f,A,C)}})(rr);var Tt=Xo(rr);const T=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,R=globalThis,ze=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,We="9.14.0";function s0(){return o0(R),R}function o0(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||We,e[We]=e[We]||{}}function i0(t,e,n=R){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[We]=r[We]||{};return s[t]||(s[t]=e())}const ni="Sentry Logger ",$0=["debug","info","warn","error","log","assert","trace"],c0={};function a0(t){if(!("console"in R))return t();const e=R.console,n={},r=Object.keys(c0);r.forEach(s=>{const o=c0[s];n[s]=e[s],e[s]=o});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function ri(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ze?$0.forEach(n=>{e[n]=(...r)=>{t&&a0(()=>{R.console[n](`${ni}[${n}]:`,...r)})}}):$0.forEach(n=>{e[n]=()=>{}}),e}const w=i0("logger",ri),cr=50,Ge="?",ar=/\(error: (.*)\)/,lr=/captureMessage|captureException/;function si(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const o=[],i=n.split(`
|
|
2
|
+
`);for(let c=r;c<i.length;c++){const a=i[c];if(a.length>1024)continue;const l=ar.test(a)?a.replace(ar,"$1"):a;if(!l.match(/\S*Error: /)){for(const d of e){const u=d(l);if(u){o.push(u);break}}if(o.length>=cr+s)break}}return oi(o.slice(s))}}function oi(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(l0(e).function||"")&&e.pop(),e.reverse(),lr.test(l0(e).function||"")&&(e.pop(),lr.test(l0(e).function||"")&&e.pop()),e.slice(0,cr).map(n=>({...n,filename:n.filename||l0(e).filename,function:n.function||Ge}))}function l0(t){return t[t.length-1]||{}}const j0="<anonymous>";function Ne(t){try{return!t||typeof t!="function"?j0:t.name||j0}catch{return j0}}function dr(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const d0={},ur={};function Ve(t,e){d0[t]=d0[t]||[],d0[t].push(e)}function Ke(t,e){if(!ur[t]){ur[t]=!0;try{e()}catch(n){ze&&w.error(`Error while instrumenting ${t}`,n)}}}function fe(t,e){const n=t&&d0[t];if(n)for(const r of n)try{r(e)}catch(s){ze&&w.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${t}
|
|
4
|
+
Name: ${Ne(r)}
|
|
5
|
+
Error:`,s)}}let z0=null;function ii(t){const e="error";Ve(e,t),Ke(e,ci)}function ci(){z0=R.onerror,R.onerror=function(t,e,n,r,s){return fe("error",{column:r,error:s,line:n,msg:t,url:e}),z0?z0.apply(this,arguments):!1},R.onerror.__SENTRY_INSTRUMENTED__=!0}let W0=null;function ai(t){const e="unhandledrejection";Ve(e,t),Ke(e,li)}function li(){W0=R.onunhandledrejection,R.onunhandledrejection=function(t){return fe("unhandledrejection",t),W0?W0.apply(this,arguments):!0},R.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const xr=Object.prototype.toString;function G0(t){switch(xr.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Pe(t,Error)}}function ft(t,e){return xr.call(t)===`[object ${e}]`}function fr(t){return ft(t,"ErrorEvent")}function pr(t){return ft(t,"DOMError")}function di(t){return ft(t,"DOMException")}function be(t){return ft(t,"String")}function V0(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function K0(t){return t===null||V0(t)||typeof t!="object"&&typeof t!="function"}function Rt(t){return ft(t,"Object")}function u0(t){return typeof Event<"u"&&Pe(t,Event)}function ui(t){return typeof Element<"u"&&Pe(t,Element)}function xi(t){return ft(t,"RegExp")}function x0(t){return!!(t?.then&&typeof t.then=="function")}function fi(t){return Rt(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Pe(t,e){try{return t instanceof e}catch{return!1}}function hr(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function pi(t){return typeof Request<"u"&&Pe(t,Request)}const q0=R,hi=80;function mr(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let o=0,i=0;const c=" > ",a=c.length;let l;const d=Array.isArray(e)?e:e.keyAttrs,u=!Array.isArray(e)&&e.maxStringLength||hi;for(;n&&o++<r&&(l=mi(n,d),!(l==="html"||o>1&&i+s.length*a+l.length>=u));)s.push(l),i+=l.length,n=n.parentNode;return s.reverse().join(c)}catch{return"<unknown>"}}function mi(t,e){const n=t,r=[];if(!n?.tagName)return"";if(q0.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=e?.length?e.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(s?.length)s.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&be(i)){const c=i.split(/\s+/);for(const a of c)r.push(`.${a}`)}}const o=["aria-label","type","name","title","alt"];for(const i of o){const c=n.getAttribute(i);c&&r.push(`[${i}="${c}"]`)}return r.join("")}function Er(){try{return q0.document.location.href}catch{return""}}function Ei(t){if(!q0.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}function f0(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function gr(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];try{hr(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function gi(t,e,n=!1){return be(t)?xi(e)?e.test(t):be(e)?n?t===e:t.includes(e):!1:!1}function p0(t,e=[],n=!1){return e.some(r=>gi(t,r,n))}function oe(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&_r(s,r);try{t[e]=s}catch{ze&&w.log(`Failed to replace method "${e}" in object`,t)}}function qe(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{ze&&w.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function _r(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,qe(t,"__sentry_original__",e)}catch{}}function X0(t){return t.__sentry_original__}function yr(t){if(G0(t))return{message:t.message,name:t.name,stack:t.stack,...Ar(t)};if(u0(t)){const e={type:t.type,target:Cr(t.target),currentTarget:Cr(t.currentTarget),...Ar(t)};return typeof CustomEvent<"u"&&Pe(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Cr(t){try{return ui(t)?mr(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Ar(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function _i(t,e=40){const n=Object.keys(yr(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return f0(r,e);for(let s=n.length;s>0;s--){const o=n.slice(0,s).join(", ");if(!(o.length>e))return s===n.length?o:f0(o,e)}return""}function yi(){const t=R;return t.crypto||t.msCrypto}function le(t=yi()){let e=()=>Math.random()*16;try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"");t?.getRandomValues&&(e=()=>{const n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(e()&15)>>n/4).toString(16))}function br(t){return t.exception?.values?.[0]}function Xe(t){const{message:e,event_id:n}=t;if(e)return e;const r=br(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Y0(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=e||""),o.type||(o.type="Error")}function pt(t,e){const n=br(t);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...e},e&&"data"in e){const o={...s?.data,...e.data};n.mechanism.data=o}}function Dr(t){if(Ci(t))return!0;try{qe(t,"__sentry_captured__",!0)}catch{}return!1}function Ci(t){try{return t.__sentry_captured__}catch{}}const Br=1e3;function Ot(){return Date.now()/Br}function Ai(){const{performance:t}=R;if(!t?.now)return Ot;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/Br}const De=Ai();function bi(t){const e=De(),n={sid:le(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Bi(n)};return t&&ht(n,t),n}function ht(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||De(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:le()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Di(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),ht(t,n)}function Bi(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function Sr(){return le()}function Fr(){return le().substring(16)}function Nt(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Nt(r[s],e[s],n-1));return r}const J0="_sentrySpan";function wr(t,e){e?qe(t,J0,e):delete t[J0]}function vr(t){return t[J0]}const Si=100;class Ee{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Sr(),sampleRand:Math.random()}}clone(){const e=new Ee;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,wr(e,vr(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ht(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,r=n instanceof Ee?n.getScopeData():Rt(n)?e:void 0,{tags:s,extra:o,user:i,contexts:c,level:a,fingerprint:l=[],propagationContext:d}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...o},this._contexts={...this._contexts,...c},i&&Object.keys(i).length&&(this._user=i),a&&(this._level=a),l.length&&(this._fingerprint=l),d&&(this._propagationContext=d),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._session=void 0,wr(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Sr(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:Si;if(r<=0)return this;const s={timestamp:Ot(),...e,message:e.message?f0(e.message,2048):e.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:vr(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Nt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n?.event_id||le();if(!this._client)return w.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureMessage(e,n,r){const s=r?.event_id||le();if(!this._client)return w.warn("No client configured on scope - will not capture message!"),s;const o=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:o,...r,event_id:s},this),s}captureEvent(e,n){const r=n?.event_id||le();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(w.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Fi(){return i0("defaultCurrentScope",()=>new Ee)}function wi(){return i0("defaultIsolationScope",()=>new Ee)}class vi{constructor(e,n){let r;e?r=e:r=new Ee;let s;n?s=n:s=new Ee,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(s){throw this._popScope(),s}return x0(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}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function mt(){const t=s0(),e=o0(t);return e.stack=e.stack||new vi(Fi(),wi())}function Ii(t){return mt().withScope(t)}function ki(t,e){const n=mt();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function Ir(t){return mt().withScope(()=>t(mt().getIsolationScope()))}function Ti(){return{withIsolationScope:Ir,withScope:Ii,withSetScope:ki,withSetIsolationScope:(t,e)=>Ir(e),getCurrentScope:()=>mt().getScope(),getIsolationScope:()=>mt().getIsolationScope()}}function Z0(t){const e=o0(t);return e.acs?e.acs:Ti()}function Et(){const t=s0();return Z0(t).getCurrentScope()}function Pt(){const t=s0();return Z0(t).getIsolationScope()}function Ri(){return i0("globalScope",()=>new Ee)}function Oi(...t){const e=s0(),n=Z0(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function Y(){return Et().getClient()}function Ni(t){const e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=e,o={trace_id:n,span_id:s||Fr()};return r&&(o.parent_span_id=r),o}const Pi="sentry.source",Mi="sentry.sample_rate",Li="sentry.op",Ui="sentry.origin",kr="sentry.profile_id",Tr="sentry.exclusive_time",Hi=0,$i=1,ji="_sentryScope",zi="_sentryIsolationScope";function Rr(t){return{scope:t[ji],isolationScope:t[zi]}}function Wi(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const Gi="sentry-",Vi=/^sentry-/;function Ki(t){const e=qi(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,o])=>{if(s.match(Vi)){const i=s.slice(Gi.length);r[i]=o}return r},{});if(Object.keys(n).length>0)return n}function qi(t){if(!(!t||!be(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=Or(n);return Object.entries(r).forEach(([s,o])=>{e[s]=o}),e},{}):Or(t)}function Or(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}const Nr=1;let Pr=!1;function Xi(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:Q0(t).parent_span_id,o=Rr(t).scope,i=r?o?.getPropagationContext().propagationSpanId||Fr():e;return{parent_span_id:s,span_id:i,trace_id:n}}function Yi(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...s},attributes:o})=>({span_id:e,trace_id:n,sampled:r===Nr,attributes:o,...s}))}function Mr(t){return typeof t=="number"?Lr(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Lr(t.getTime()):De()}function Lr(t){return t>9999999999?t/1e3:t}function Q0(t){if(Zi(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(Ji(t)){const{attributes:r,startTime:s,name:o,endTime:i,parentSpanId:c,status:a,links:l}=t;return{span_id:e,trace_id:n,data:r,description:o,parent_span_id:c,start_timestamp:Mr(s),timestamp:Mr(i)||void 0,status:ec(a),op:r[Li],origin:r[Ui],links:Yi(l)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Ji(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function Zi(t){return typeof t.getSpanJSON=="function"}function Qi(t){const{traceFlags:e}=t.spanContext();return e===Nr}function ec(t){if(!(!t||t.code===Hi))return t.code===$i?"ok":t.message||"unknown_error"}const tc="_sentryRootSpan";function Ur(t){return t[tc]||t}function Hr(){Pr||(a0(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Pr=!0)}function nc(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Y()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}const en="production",rc="_frozenDsc";function $r(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||en,release:n.release,public_key:r,trace_id:t};return e.emit("createDsc",s),s}function sc(t,e){const n=e.getPropagationContext();return n.dsc||$r(n.traceId,t)}function oc(t){const e=Y();if(!e)return{};const n=Ur(t),r=Q0(n),s=r.data,o=n.spanContext().traceState,i=o?.get("sentry.sample_rate")??s[Mi];function c(b){return(typeof i=="number"||typeof i=="string")&&(b.sample_rate=`${i}`),b}const a=n[rc];if(a)return c(a);const l=o?.get("sentry.dsc"),d=l&&Ki(l);if(d)return c(d);const u=$r(t.spanContext().traceId,e),m=s[Pi],_=r.description;return m!=="url"&&_&&(u.transaction=_),nc()&&(u.sampled=String(Qi(n)),u.sample_rand=o?.get("sentry.sample_rand")??Rr(n).scope?.getPropagationContext().sampleRand.toString()),c(u),e.emit("createDsc",u,n),u}const ic=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function cc(t){return t==="http"||t==="https"}function h0(t,e=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:c,publicKey:a}=t;return`${c}://${a}${e&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function ac(t){const e=ic.exec(t);if(!e){a0(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",o="",i="",c=""]=e.slice(1);let a="",l=c;const d=l.split("/");if(d.length>1&&(a=d.slice(0,-1).join("/"),l=d.pop()),l){const u=l.match(/^\d+/);u&&(l=u[0])}return jr({host:o,pass:s,path:a,projectId:l,port:i,protocol:n,publicKey:r})}function jr(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function lc(t){if(!ze)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(w.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?cc(r)?e&&isNaN(parseInt(e,10))?(w.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(w.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(w.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function dc(t){const e=typeof t=="string"?ac(t):jr(t);if(!(!e||!lc(e)))return e}function Be(t,e=100,n=1/0){try{return tn("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function zr(t,e=3,n=100*1024){const r=Be(t,e);return pc(r)>n?zr(t,e-1,n):r}function tn(t,e,n=1/0,r=1/0,s=hc()){const[o,i]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const c=uc(t,e);if(!c.startsWith("[object "))return c;if(e.__sentry_skip_normalization__)return e;const a=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(a===0)return c.replace("object ","");if(o(e))return"[Circular ~]";const l=e;if(l&&typeof l.toJSON=="function")try{const _=l.toJSON();return tn("",_,a-1,r,s)}catch{}const d=Array.isArray(e)?[]:{};let u=0;const m=yr(e);for(const _ in m){if(!Object.prototype.hasOwnProperty.call(m,_))continue;if(u>=r){d[_]="[MaxProperties ~]";break}const b=m[_];d[_]=tn(_,b,a-1,r,s),u++}return i(e),d}function uc(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(hr(e))return"[VueViewModel]";if(fi(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${Ne(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=xc(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function xc(t){const e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function fc(t){return~-encodeURI(t).split(/%..|./).length}function pc(t){return fc(JSON.stringify(t))}function hc(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Mt(t,e=[]){return[t,e]}function mc(t,e){const[n,r]=t;return[n,[...r,e]]}function Wr(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function nn(t){const e=o0(R);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function Ec(t){const[e,n]=t;let r=JSON.stringify(e);function s(o){typeof r=="string"?r=typeof o=="string"?r+o:[nn(r),o]:r.push(typeof o=="string"?nn(o):o)}for(const o of n){const[i,c]=o;if(s(`
|
|
6
|
+
${JSON.stringify(i)}
|
|
7
|
+
`),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(Be(c))}s(a)}}return typeof r=="string"?r:gc(r)}function gc(t){const e=t.reduce((s,o)=>s+o.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function _c(t){const e=typeof t.data=="string"?nn(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const yc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",otel_log:"log_item"};function Gr(t){return yc[t]}function Vr(t){if(!t?.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function Cc(t,e,n,r){const s=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:h0(r)},...s&&{trace:s}}}function Ac(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function bc(t,e,n,r){const s=Vr(n),o={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:h0(e)}},i="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Mt(o,[i])}function Dc(t,e,n,r){const s=Vr(n),o=t.type&&t.type!=="replay_event"?t.type:"event";Ac(t,n?.sdk);const i=Cc(t,s,r,e);return delete t.sdkProcessingMetadata,Mt(i,[[{type:o},t]])}var Se;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(Se||(Se={}));function Ye(t){return new Me(e=>{e(t)})}function m0(t){return new Me((e,n)=>{n(t)})}class Me{constructor(e){this._state=Se.PENDING,this._handlers=[],this._runExecutor(e)}then(e,n){return new Me((r,s)=>{this._handlers.push([!1,o=>{if(!e)r(o);else try{r(e(o))}catch(i){s(i)}},o=>{if(!n)s(o);else try{r(n(o))}catch(i){s(i)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Me((n,r)=>{let s,o;return this.then(i=>{o=!1,s=i,e&&e()},i=>{o=!0,s=i,e&&e()}).then(()=>{if(o){r(s);return}n(s)})})}_executeHandlers(){if(this._state===Se.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Se.RESOLVED&&n[1](this._value),this._state===Se.REJECTED&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(o,i)=>{if(this._state===Se.PENDING){if(x0(i)){i.then(r,s);return}this._state=o,this._value=i,this._executeHandlers()}},r=o=>{n(Se.RESOLVED,o)},s=o=>{n(Se.REJECTED,o)};try{e(r,s)}catch(o){s(o)}}}function rn(t,e,n,r=0){return new Me((s,o)=>{const i=t[r];if(e===null||typeof i!="function")s(e);else{const c=i({...e},n);T&&i.id&&c===null&&w.log(`Event processor "${i.id}" dropped event`),x0(c)?c.then(a=>rn(t,a,n,r+1).then(s)).then(null,o):rn(t,c,n,r+1).then(s).then(null,o)}})}let E0,Kr,g0;function Bc(t){const e=R._sentryDebugIds;if(!e)return{};const n=Object.keys(e);return g0&&n.length===Kr||(Kr=n.length,g0=n.reduce((r,s)=>{E0||(E0={});const o=E0[s];if(o)r[o[0]]=o[1];else{const i=t(s);for(let c=i.length-1;c>=0;c--){const l=i[c]?.filename,d=e[s];if(l&&d){r[l]=d,E0[s]=[l,d];break}}}return r},{})),g0}function Sc(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:o}=e;Fc(t,e),r&&Ic(t,r),kc(t,n),wc(t,s),vc(t,o)}function qr(t,e){const{extra:n,tags:r,user:s,contexts:o,level:i,sdkProcessingMetadata:c,breadcrumbs:a,fingerprint:l,eventProcessors:d,attachments:u,propagationContext:m,transactionName:_,span:b}=e;_0(t,"extra",n),_0(t,"tags",r),_0(t,"user",s),_0(t,"contexts",o),t.sdkProcessingMetadata=Nt(t.sdkProcessingMetadata,c,2),i&&(t.level=i),_&&(t.transactionName=_),b&&(t.span=b),a.length&&(t.breadcrumbs=[...t.breadcrumbs,...a]),l.length&&(t.fingerprint=[...t.fingerprint,...l]),d.length&&(t.eventProcessors=[...t.eventProcessors,...d]),u.length&&(t.attachments=[...t.attachments,...u]),t.propagationContext={...t.propagationContext,...m}}function _0(t,e,n){t[e]=Nt(t[e],n,1)}function Fc(t,e){const{extra:n,tags:r,user:s,contexts:o,level:i,transactionName:c}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(s).length&&(t.user={...s,...t.user}),Object.keys(o).length&&(t.contexts={...o,...t.contexts}),i&&(t.level=i),c&&t.type!=="transaction"&&(t.transaction=c)}function wc(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function vc(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function Ic(t,e){t.contexts={trace:Xi(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:oc(e),...t.sdkProcessingMetadata};const n=Ur(e),r=Q0(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function kc(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function Tc(t,e,n,r,s,o){const{normalizeDepth:i=3,normalizeMaxBreadth:c=1e3}=t,a={...e,event_id:e.event_id||n.event_id||le(),timestamp:e.timestamp||Ot()},l=n.integrations||t.integrations.map(S=>S.name);Rc(a,t),Pc(a,l),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&Oc(a,t.stackParser);const d=Lc(r,n.captureContext);n.mechanism&&pt(a,n.mechanism);const u=s?s.getEventProcessors():[],m=Ri().getScopeData();if(o){const S=o.getScopeData();qr(m,S)}if(d){const S=d.getScopeData();qr(m,S)}const _=[...n.attachments||[],...m.attachments];_.length&&(n.attachments=_),Sc(a,m);const b=[...u,...m.eventProcessors];return rn(b,a,n).then(S=>(S&&Nc(S),typeof i=="number"&&i>0?Mc(S,i,c):S))}function Rc(t,e){const{environment:n,release:r,dist:s,maxValueLength:o=250}=e;t.environment=t.environment||n||en,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const i=t.request;i?.url&&(i.url=f0(i.url,o))}function Oc(t,e){const n=Bc(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(s=>{s.filename&&(s.debug_id=n[s.filename])})})}function Nc(t){const e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(s=>{s.debug_id&&(s.abs_path?e[s.abs_path]=s.debug_id:s.filename&&(e[s.filename]=s.debug_id),delete s.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([r,s])=>{n.push({type:"sourcemap",code_file:r,debug_id:s})})}function Pc(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function Mc(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(s=>({...s,...s.data&&{data:Be(s.data,e,n)}}))},...t.user&&{user:Be(t.user,e,n)},...t.contexts&&{contexts:Be(t.contexts,e,n)},...t.extra&&{extra:Be(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=Be(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(s=>({...s,...s.data&&{data:Be(s.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=Be(t.contexts.flags,3,n)),r}function Lc(t,e){if(!e)return t;const n=t?t.clone():new Ee;return n.update(e),n}function Ux(t){}function Uc(t,e){return Et().captureException(t,void 0)}function Xr(t,e){return Et().captureEvent(t,e)}function Yr(t){const e=Pt(),n=Et(),{userAgent:r}=R.navigator||{},s=bi({user:n.getUser()||e.getUser(),...r&&{userAgent:r},...t}),o=e.getSession();return o?.status==="ok"&&ht(o,{status:"exited"}),Jr(),e.setSession(s),s}function Jr(){const t=Pt(),n=Et().getSession()||t.getSession();n&&Di(n),Zr(),t.setSession()}function Zr(){const t=Pt(),e=Y(),n=t.getSession();n&&e&&e.captureSession(n)}function Qr(t=!1){if(t){Jr();return}Zr()}const Hc="7";function $c(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function jc(t){return`${$c(t)}${t.projectId}/envelope/`}function zc(t,e){const n={sentry_version:Hc};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function Wc(t,e,n){return e||`${jc(t)}?${zc(t,n)}`}const es=[];function Gc(t,e){const n={};return e.forEach(r=>{r&&ns(t,r,n)}),n}function ts(t,e){for(const n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function ns(t,e,n){if(n[e.name]){T&&w.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,es.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),es.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,o)=>r(s,o,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((o,i)=>r(o,i,t),{id:e.name});t.addEventProcessor(s)}T&&w.log(`Integration installed: ${e.name}`)}function Hx(t){return t}function Vc(t,e,n){const r=[{type:"client_report"},{timestamp:Ot(),discarded_events:t}];return Mt(e?{dsn:e}:{},[r])}function rs(t){const e=[];t.message&&e.push(t.message);try{const n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function Kc(t){const{trace_id:e,parent_span_id:n,span_id:r,status:s,origin:o,data:i,op:c}=t.contexts?.trace??{};return{data:i??{},description:t.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:s,timestamp:t.timestamp,trace_id:e??"",origin:o,profile_id:i?.[kr],exclusive_time:i?.[Tr],measurements:t.measurements,is_segment:!0}}function qc(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[kr]:t.profile_id},...t.exclusive_time&&{[Tr]:t.exclusive_time}}}},measurements:t.measurements}}const ss="Not capturing exception because it's already been captured.",os="Discarded session because of missing or non-string release",is=Symbol.for("SentryInternalError"),cs=Symbol.for("SentryDoNotSendEventError");function y0(t){return{message:t,[is]:!0}}function sn(t){return{message:t,[cs]:!0}}function as(t){return!!t&&typeof t=="object"&&is in t}function ls(t){return!!t&&typeof t=="object"&&cs in t}class Xc{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=dc(e.dsn):T&&w.warn("No DSN provided, client will not send events."),this._dsn){const n=Wc(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){const s=le();if(Dr(e))return T&&w.log(ss),s;const o={event_id:s,...n};return this._process(this.eventFromException(e,o).then(i=>this._captureEvent(i,o,r))),o.event_id}captureMessage(e,n,r,s){const o={event_id:le(),...r},i=V0(e)?e:String(e),c=K0(e)?this.eventFromMessage(i,n,o):this.eventFromException(e,o);return this._process(c.then(a=>this._captureEvent(a,o,s))),o.event_id}captureEvent(e,n,r){const s=le();if(n?.originalException&&Dr(n.originalException))return T&&w.log(ss),s;const o={event_id:s,...n},i=e.sdkProcessingMetadata||{},c=i.capturedSpanScope,a=i.capturedSpanIsolationScope;return this._process(this._captureEvent(e,o,c||r,a)),o.event_id}captureSession(e){this.sendSession(e),ht(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(s=>r&&s))):Ye(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const n=this._integrations[e.name];ns(this,e,this._integrations),n||ts(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=Dc(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=mc(r,_c(o));const s=this.sendEnvelope(r);s&&s.then(o=>this.emit("afterSendEvent",e,o),null)}sendSession(e){const{release:n,environment:r=en}=this._options;if("aggregates"in e){const o=e.attrs||{};if(!o.release&&!n){T&&w.warn(os);return}o.release=o.release||n,o.environment=o.environment||r,e.attrs=o}else{if(!e.release&&!n){T&&w.warn(os);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);const s=bc(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){const s=`${e}:${n}`;T&&w.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(e,n){const r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{const s=r.indexOf(n);s>-1&&r.splice(s,1)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(s=>s(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(T&&w.error("Error while sending envelope:",n),n)):(T&&w.error("Transport disabled"),Ye({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=Gc(this,e),ts(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",s=!1;const o=n.exception?.values;if(o){s=!0;for(const a of o)if(a.mechanism?.handled===!1){r=!0;break}}const i=e.status==="ok";(i&&e.errors===0||i&&r)&&(ht(e,{...r&&{status:"crashed"},errors:e.errors||Number(s||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Me(n=>{let r=0;const s=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),n(!0)):(r+=s,e&&r>=e&&(clearInterval(o),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,s){const o=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",e,n),e.type||s.setLastEventId(e.event_id||n.event_id),Tc(o,e,n,r,this,s).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:Ni(r),...c.contexts};const a=sc(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(e,n={},r=Et(),s=Pt()){return T&&on(e)&&w.log(`Captured error event \`${rs(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,s).then(o=>o.event_id,o=>{T&&(ls(o)?w.log(o.message):as(o)?w.warn(o.message):w.warn(o))})}_processEvent(e,n,r,s){const o=this.getOptions(),{sampleRate:i}=o,c=ds(e),a=on(e),l=e.type||"error",d=`before send for type \`${l}\``,u=typeof i>"u"?void 0:Wi(i);if(a&&typeof u=="number"&&Math.random()>u)return this.recordDroppedEvent("sample_rate","error"),m0(sn(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const m=l==="replay_event"?"replay":l;return this._prepareEvent(e,n,r,s).then(_=>{if(_===null)throw this.recordDroppedEvent("event_processor",m),sn("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return _;const D=Jc(this,o,_,n);return Yc(D,d)}).then(_=>{if(_===null){if(this.recordDroppedEvent("before_send",m),c){const f=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",f)}throw sn(`${d} returned \`null\`, will not send event.`)}const b=r.getSession()||s.getSession();if(a&&b&&this._updateSessionFromEvent(b,_),c){const S=_.sdkProcessingMetadata?.spanCountBeforeProcessing||0,f=_.spans?_.spans.length:0,g=S-f;g>0&&this.recordDroppedEvent("before_send","span",g)}const D=_.transaction_info;if(c&&D&&_.transaction!==e.transaction){const S="custom";_.transaction_info={...D,source:S}}return this.sendEvent(_,n),_}).then(null,_=>{throw ls(_)||as(_)?_:(this.captureException(_,{data:{__sentry__:!0},originalException:_}),y0(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
8
|
+
Reason: ${_}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[s,o]=n.split(":");return{reason:s,category:o,quantity:r}})}_flushOutcomes(){T&&w.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){T&&w.log("No outcomes to send");return}if(!this._dsn){T&&w.log("No dsn provided, will not send outcomes");return}T&&w.log("Sending outcomes:",e);const n=Vc(e,this._options.tunnel&&h0(this._dsn));this.sendEnvelope(n)}}function Yc(t,e){const n=`${e} must return \`null\` or a valid event.`;if(x0(t))return t.then(r=>{if(!Rt(r)&&r!==null)throw y0(n);return r},r=>{throw y0(`${e} rejected with ${r}`)});if(!Rt(t)&&t!==null)throw y0(n);return t}function Jc(t,e,n,r){const{beforeSend:s,beforeSendTransaction:o,beforeSendSpan:i}=e;let c=n;if(on(c)&&s)return s(c,r);if(ds(c)){if(i){const a=i(Kc(c));if(a?c=Nt(n,qc(a)):Hr(),c.spans){const l=[];for(const d of c.spans){const u=i(d);u?l.push(u):(Hr(),l.push(d))}c.spans=l}}if(o){if(c.spans){const a=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:a}}return o(c,r)}}return c}function on(t){return t.type===void 0}function ds(t){return t.type==="transaction"}function Zc(t){return[{type:"otel_log"},t]}function Qc(t,e,n,r){const s={};return e?.sdk&&(s.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(s.dsn=h0(r)),Mt(s,t.map(Zc))}const ea=new WeakMap;function cn(t,e){const n=ea.get(t)??[];if(n.length===0)return;const r=t.getOptions(),s=Qc(n,r._metadata,r.tunnel,t.getDsn());n.length=0,t.emit("flushLogs"),t.sendEnvelope(s)}const us=Symbol.for("SentryBufferFullError");function ta(t){const e=[];function n(){return t===void 0||e.length<t}function r(i){return e.splice(e.indexOf(i),1)[0]||Promise.resolve(void 0)}function s(i){if(!n())return m0(us);const c=i();return e.indexOf(c)===-1&&e.push(c),c.then(()=>r(c)).then(null,()=>r(c).then(null,()=>{})),c}function o(i){return new Me((c,a)=>{let l=e.length;if(!l)return c(!0);const d=setTimeout(()=>{i&&i>0&&c(!1)},i);e.forEach(u=>{Ye(u).then(()=>{--l||(clearTimeout(d),c(!0))},a)})})}return{$:e,add:s,drain:o}}const na=60*1e3;function ra(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?na:r-e}function sa(t,e){return t[e]||t.all||0}function oa(t,e,n=Date.now()){return sa(t,e)>n}function ia(t,{statusCode:e,headers:n},r=Date.now()){const s={...t},o=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(o)for(const c of o.trim().split(",")){const[a,l,,,d]=c.split(":",5),u=parseInt(a,10),m=(isNaN(u)?60:u)*1e3;if(!l)s.all=r+m;else for(const _ of l.split(";"))_==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[_]=r+m):s[_]=r+m}else i?s.all=r+ra(i,r):e===429&&(s.all=r+60*1e3);return s}const ca=64;function aa(t,e,n=ta(t.bufferSize||ca)){let r={};const s=i=>n.drain(i);function o(i){const c=[];if(Wr(i,(u,m)=>{const _=Gr(m);oa(r,_)?t.recordDroppedEvent("ratelimit_backoff",_):c.push(u)}),c.length===0)return Ye({});const a=Mt(i[0],c),l=u=>{Wr(a,(m,_)=>{t.recordDroppedEvent(u,Gr(_))})},d=()=>e({body:Ec(a)}).then(u=>(u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&T&&w.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=ia(r,u),u),u=>{throw l("network_error"),T&&w.error("Encountered error running transport request:",u),u});return n.add(d).then(u=>u,u=>{if(u===us)return T&&w.error("Skipped sending event because buffer is full."),l("queue_overflow"),Ye({});throw u})}return{send:o,flush:s}}function la(t){t.user?.ip_address===void 0&&(t.user={...t.user,ip_address:"{{auto}}"})}function da(t){"aggregates"in t?t.attrs?.ip_address===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function ua(t,e,n=[e],r="npm"){const s=t._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${e}`,packages:n.map(o=>({name:`${r}:@sentry/${o}`,version:We})),version:We}),t._metadata=s}const xa=100;function Je(t,e){const n=Y(),r=Pt();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=xa}=n.getOptions();if(o<=0)return;const c={timestamp:Ot(),...t},a=s?a0(()=>s(c,e)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,e),r.addBreadcrumb(a,o))}let xs;const fa="FunctionToString",fs=new WeakMap,pa=(()=>({name:fa,setupOnce(){xs=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=X0(this),n=fs.has(Y())&&e!==void 0?e:this;return xs.apply(n,t)}}catch{}},setup(t){fs.set(t,!0)}})),ha=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],ma="EventFilters",Ea=(t={})=>{let e;return{name:ma,setup(n){const r=n.getOptions();e=ps(t,r)},processEvent(n,r,s){if(!e){const o=s.getOptions();e=ps(t,o)}return _a(n,e)?null:n}}},ga=((t={})=>({...Ea(t),name:"InboundFilters"}));function ps(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:ha],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function _a(t,e){if(t.type){if(t.type==="transaction"&&Ca(t,e.ignoreTransactions))return T&&w.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
9
|
+
Event: ${Xe(t)}`),!0}else{if(ya(t,e.ignoreErrors))return T&&w.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
10
|
+
Event: ${Xe(t)}`),!0;if(Ba(t))return T&&w.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
11
|
+
Event: ${Xe(t)}`),!0;if(Aa(t,e.denyUrls))return T&&w.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
12
|
+
Event: ${Xe(t)}.
|
|
13
|
+
Url: ${C0(t)}`),!0;if(!ba(t,e.allowUrls))return T&&w.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
14
|
+
Event: ${Xe(t)}.
|
|
15
|
+
Url: ${C0(t)}`),!0}return!1}function ya(t,e){return e?.length?rs(t).some(n=>p0(n,e)):!1}function Ca(t,e){if(!e?.length)return!1;const n=t.transaction;return n?p0(n,e):!1}function Aa(t,e){if(!e?.length)return!1;const n=C0(t);return n?p0(n,e):!1}function ba(t,e){if(!e?.length)return!0;const n=C0(t);return n?p0(n,e):!0}function Da(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function C0(t){try{const n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Da(n):null}catch{return T&&w.error(`Cannot extract url for event ${Xe(t)}`),null}}function Ba(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function Sa(t,e,n,r,s,o){if(!s.exception?.values||!o||!Pe(o.originalException,Error))return;const i=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;i&&(s.exception.values=an(t,e,r,o.originalException,n,s.exception.values,i,0))}function an(t,e,n,r,s,o,i,c){if(o.length>=n+1)return o;let a=[...o];if(Pe(r[s],Error)){hs(i,c);const l=t(e,r[s]),d=a.length;ms(l,s,d,c),a=an(t,e,n,r[s],s,[l,...a],l,d)}return Array.isArray(r.errors)&&r.errors.forEach((l,d)=>{if(Pe(l,Error)){hs(i,c);const u=t(e,l),m=a.length;ms(u,`errors[${d}]`,m,c),a=an(t,e,n,l,s,[u,...a],u,m)}}),a}function hs(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function ms(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function Fa(t){const e="console";Ve(e,t),Ke(e,wa)}function wa(){"console"in R&&$0.forEach(function(t){t in R.console&&oe(R.console,t,function(e){return c0[t]=e,function(...n){fe("console",{args:n,level:t}),c0[t]?.apply(R.console,n)}})})}function va(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const Ia="Dedupe",ka=(()=>{let t;return{name:Ia,processEvent(e){if(e.type)return e;try{if(Ta(e,t))return T&&w.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}});function Ta(t,e){return e?!!(Ra(t,e)||Oa(t,e)):!1}function Ra(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!gs(t,e)||!Es(t,e))}function Oa(t,e){const n=_s(e),r=_s(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!gs(t,e)||!Es(t,e))}function Es(t,e){let n=dr(t),r=dr(e);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 gs(t,e){let n=t.fingerprint,r=e.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 _s(t){return t.exception?.values&&t.exception.values[0]}function ln(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function ys(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Lt=R;function Na(){return"history"in Lt&&!!Lt.history}function Pa(){if(!("fetch"in Lt))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function dn(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Ma(){if(typeof EdgeRuntime=="string")return!0;if(!Pa())return!1;if(dn(Lt.fetch))return!0;let t=!1;const e=Lt.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=dn(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){ze&&w.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function La(t,e){const n="fetch";Ve(n,t),Ke(n,()=>Ua(void 0,e))}function Ua(t,e=!1){e&&!Ma()||oe(R,"fetch",function(n){return function(...r){const s=new Error,{method:o,url:i}=Ha(r),c={args:r,fetchData:{method:o,url:i},startTimestamp:De()*1e3,virtualError:s,headers:$a(r)};return fe("fetch",{...c}),n.apply(R,r).then(async a=>(fe("fetch",{...c,endTimestamp:De()*1e3,response:a}),a),a=>{if(fe("fetch",{...c,endTimestamp:De()*1e3,error:a}),G0(a)&&a.stack===void 0&&(a.stack=s.stack,qe(a,"framesToPop",1)),a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const l=new URL(c.fetchData.url);a.message=`${a.message} (${l.host})`}catch{}throw a})}})}function un(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Cs(t){return typeof t=="string"?t:t?un(t,"url")?t.url:t.toString?t.toString():"":""}function Ha(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:Cs(n),method:un(r,"method")?String(r.method).toUpperCase():"GET"}}const e=t[0];return{url:Cs(e),method:un(e,"method")?String(e.method).toUpperCase():"GET"}}function $a(t){const[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(pi(e))return new Headers(e.headers)}catch{}}function ja(){return"npm"}const W=R;let xn=0;function As(){return xn>0}function za(){xn++,setTimeout(()=>{xn--})}function gt(t,e={}){function n(s){return typeof s=="function"}if(!n(t))return t;try{const s=t.__sentry_wrapped__;if(s)return typeof s=="function"?s:t;if(X0(t))return t}catch{return t}const r=function(...s){try{const o=s.map(i=>gt(i,e));return t.apply(this,o)}catch(o){throw za(),Oi(i=>{i.addEventProcessor(c=>(e.mechanism&&(Y0(c,void 0),pt(c,e.mechanism)),c.extra={...c.extra,arguments:s},c)),Uc(o)}),o}};try{for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}catch{}_r(r,t),qe(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function fn(t,e){const n=hn(t,e),r={type:qa(e),value:Xa(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Wa(t,e,n,r){const o=Y()?.getOptions().normalizeDepth,i=el(e),c={__serialized__:zr(e,o)};if(i)return{exception:{values:[fn(t,i)]},extra:c};const a={exception:{values:[{type:u0(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Za(e,{isUnhandledRejection:r})}]},extra:c};if(n){const l=hn(t,n);l.length&&(a.exception.values[0].stacktrace={frames:l})}return a}function pn(t,e){return{exception:{values:[fn(t,e)]}}}function hn(t,e){const n=e.stacktrace||e.stack||"",r=Va(e),s=Ka(e);try{return t(n,r,s)}catch{}return[]}const Ga=/Minified React error #\d+;/i;function Va(t){return t&&Ga.test(t.message)?1:0}function Ka(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function bs(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function qa(t){const e=t?.name;return!e&&bs(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Xa(t){const e=t?.message;return bs(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Ya(t,e,n,r){const s=n?.syntheticException||void 0,o=mn(t,e,s,r);return pt(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),Ye(o)}function Ja(t,e,n="info",r,s){const o=r?.syntheticException||void 0,i=En(t,e,o,s);return i.level=n,r?.event_id&&(i.event_id=r.event_id),Ye(i)}function mn(t,e,n,r,s){let o;if(fr(e)&&e.error)return pn(t,e.error);if(pr(e)||di(e)){const i=e;if("stack"in e)o=pn(t,e);else{const c=i.name||(pr(i)?"DOMError":"DOMException"),a=i.message?`${c}: ${i.message}`:c;o=En(t,a,n,r),Y0(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return G0(e)?pn(t,e):Rt(e)||u0(e)?(o=Wa(t,e,n,s),pt(o,{synthetic:!0}),o):(o=En(t,e,n,r),Y0(o,`${e}`),pt(o,{synthetic:!0}),o)}function En(t,e,n,r){const s={};if(r&&n){const o=hn(t,n);o.length&&(s.exception={values:[{value:e,stacktrace:{frames:o}}]}),pt(s,{synthetic:!0})}if(V0(e)){const{__sentry_template_string__:o,__sentry_template_values__:i}=e;return s.logentry={message:o,params:i},s}return s.message=e,s}function Za(t,{isUnhandledRejection:e}){const n=_i(t),r=e?"promise rejection":"exception";return fr(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:u0(t)?`Event \`${Qa(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Qa(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function el(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}}const tl=5e3;class nl extends Xc{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e},r=W.SENTRY_SDK_SOURCE||ja();ua(n,"browser",["browser"],r),super(n);const s=this,{sendDefaultPii:o,_experiments:i}=s._options,c=i?.enableLogs;n.sendClientReports&&W.document&&W.document.addEventListener("visibilitychange",()=>{W.document.visibilityState==="hidden"&&(this._flushOutcomes(),c&&cn(s))}),c&&(s.on("flush",()=>{cn(s)}),s.on("afterCaptureLog",()=>{s._logFlushIdleTimeout&&clearTimeout(s._logFlushIdleTimeout),s._logFlushIdleTimeout=setTimeout(()=>{cn(s)},tl)})),o&&(s.on("postprocessEvent",la),s.on("beforeSendSession",da))}eventFromException(e,n){return Ya(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Ja(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,s){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,s)}}const rl=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,te=R,sl=1e3;let Ds,gn,_n;function ol(t){Ve("dom",t),Ke("dom",il)}function il(){if(!te.document)return;const t=fe.bind(null,"dom"),e=Bs(t,!0);te.document.addEventListener("click",e,!1),te.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const s=te[n]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(oe(s,"addEventListener",function(o){return function(i,c,a){if(i==="click"||i=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=l[i]=l[i]||{refCount:0};if(!d.handler){const u=Bs(t);d.handler=u,o.call(this,i,u,a)}d.refCount++}catch{}return o.call(this,i,c,a)}}),oe(s,"removeEventListener",function(o){return function(i,c,a){if(i==="click"||i=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},d=l[i];d&&(d.refCount--,d.refCount<=0&&(o.call(this,i,d.handler,a),d.handler=void 0,delete l[i]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,c,a)}}))})}function cl(t){if(t.type!==gn)return!1;try{if(!t.target||t.target._sentryId!==_n)return!1}catch{}return!0}function al(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function Bs(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=ll(n);if(al(n.type,r))return;qe(n,"_sentryCaptured",!0),r&&!r._sentryId&&qe(r,"_sentryId",le());const s=n.type==="keypress"?"input":n.type;cl(n)||(t({event:n,name:s,global:e}),gn=n.type,_n=r?r._sentryId:void 0),clearTimeout(Ds),Ds=te.setTimeout(()=>{_n=void 0,gn=void 0},sl)}}function ll(t){try{return t.target}catch{return null}}let A0;function Ss(t){const e="history";Ve(e,t),Ke(e,dl)}function dl(){if(te.addEventListener("popstate",()=>{const e=te.location.href,n=A0;if(A0=e,n===e)return;fe("history",{from:n,to:e})}),!Na())return;function t(e){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=A0,o=String(r);if(A0=o,s===o)return e.apply(this,n);fe("history",{from:s,to:o})}return e.apply(this,n)}}oe(te.history,"pushState",t),oe(te.history,"replaceState",t)}const b0={};function ul(t){const e=b0[t];if(e)return e;let n=te[t];if(dn(n))return b0[t]=n.bind(te);const r=te.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const o=s.contentWindow;o?.[t]&&(n=o[t]),r.head.removeChild(s)}catch(s){rl&&w.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n&&(b0[t]=n.bind(te))}function Fs(t){b0[t]=void 0}const Ut="__sentry_xhr_v3__";function xl(t){Ve("xhr",t),Ke("xhr",fl)}function fl(){if(!te.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const s=new Error,o=De()*1e3,i=be(r[0])?r[0].toUpperCase():void 0,c=pl(r[1]);if(!i||!c)return e.apply(n,r);n[Ut]={method:i,url:c,request_headers:{}},i==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const l=n[Ut];if(l&&n.readyState===4){try{l.status_code=n.status}catch{}const d={endTimestamp:De()*1e3,startTimestamp:o,xhr:n,virtualError:s};fe("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(l,d,u){return a(),l.apply(d,u)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(l,d,u){const[m,_]=u,b=d[Ut];return b&&be(m)&&be(_)&&(b.request_headers[m.toLowerCase()]=_),l.apply(d,u)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[Ut];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const o={startTimestamp:De()*1e3,xhr:n};return fe("xhr",o),e.apply(n,r)}})}function pl(t){if(be(t))return t;try{return t.toString()}catch{}}function hl(t,e=ul("fetch")){let n=0,r=0;function s(o){const i=o.body.length;n+=i,r++;const c={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return Fs("fetch"),m0("No fetch implementation available");try{return e(t.url,c).then(a=>(n-=i,r--,{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}))}catch(a){return Fs("fetch"),n-=i,r--,m0(a)}}return aa(t,s)}const ml=30,El=50;function yn(t,e,n,r){const s={filename:t,function:e==="<anonymous>"?Ge:e,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const gl=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_l=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yl=/\((\S*)(?::(\d+))(?::(\d+))\)/,Cl=[ml,t=>{const e=gl.exec(t);if(e){const[,r,s,o]=e;return yn(r,Ge,+s,+o)}const n=_l.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const i=yl.exec(n[2]);i&&(n[2]=i[1],n[3]=i[2],n[4]=i[3])}const[s,o]=ws(n[1]||Ge,n[2]);return yn(o,s,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],Al=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Dl=si(...[Cl,[El,t=>{const e=Al.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=bl.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],s=e[1]||Ge;return[s,r]=ws(s,r),yn(r,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]),ws=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Ge,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Cn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,D0=1024,Bl="Breadcrumbs",Sl=((t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:Bl,setup(n){e.console&&Fa(vl(n)),e.dom&&ol(wl(n,e.dom)),e.xhr&&xl(Il(n)),e.fetch&&La(kl(n)),e.history&&Ss(Tl(n)),e.sentry&&n.on("beforeSendEvent",Fl(n))}}});function Fl(t){return function(n){Y()===t&&Je({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Xe(n)},{event:n})}}function wl(t,e){return function(r){if(Y()!==t)return;let s,o,i=typeof e=="object"?e.serializeAttribute:void 0,c=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;c&&c>D0&&(Cn&&w.warn(`\`dom.maxStringLength\` cannot exceed ${D0}, but a value of ${c} was configured. Sentry will use ${D0} instead.`),c=D0),typeof i=="string"&&(i=[i]);try{const l=r.event,d=Rl(l)?l.target:l;s=mr(d,{keyAttrs:i,maxStringLength:c}),o=Ei(d)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};o&&(a.data={"ui.component_name":o}),Je(a,{event:r.event,name:r.name,global:r.global})}}function vl(t){return function(n){if(Y()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:va(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;Je(r,{input:n.args,level:n.level})}}function Il(t){return function(n){if(Y()!==t)return;const{startTimestamp:r,endTimestamp:s}=n,o=n.xhr[Ut];if(!r||!s||!o)return;const{method:i,url:c,status_code:a,body:l}=o,d={method:i,url:c,status_code:a},u={xhr:n.xhr,input:l,startTimestamp:r,endTimestamp:s},m={category:"xhr",data:d,type:"http",level:ys(a)};t.emit("beforeOutgoingRequestBreadcrumb",m,u),Je(m,u)}}function kl(t){return function(n){if(Y()!==t)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const o=n.fetchData,i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:o,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",c,i),Je(c,i)}else{const o=n.response,i={...n.fetchData,status_code:o?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,o?.status;const c={input:n.args,response:o,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:i,type:"http",level:ys(i.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",a,c),Je(a,c)}}}function Tl(t){return function(n){if(Y()!==t)return;let r=n.from,s=n.to;const o=ln(W.location.href);let i=r?ln(r):void 0;const c=ln(s);i?.path||(i=o),o.protocol===c.protocol&&o.host===c.host&&(s=c.relative),o.protocol===i.protocol&&o.host===i.host&&(r=i.relative),Je({category:"navigation",data:{from:r,to:s}})}}function Rl(t){return!!t&&!!t.target}const Ol=["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"],Nl="BrowserApiErrors",Pl=((t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:Nl,setupOnce(){e.setTimeout&&oe(W,"setTimeout",vs),e.setInterval&&oe(W,"setInterval",vs),e.requestAnimationFrame&&oe(W,"requestAnimationFrame",Ml),e.XMLHttpRequest&&"XMLHttpRequest"in W&&oe(XMLHttpRequest.prototype,"send",Ll);const n=e.eventTarget;n&&(Array.isArray(n)?n:Ol).forEach(Ul)}}});function vs(t){return function(...e){const n=e[0];return e[0]=gt(n,{mechanism:{data:{function:Ne(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Ml(t){return function(e){return t.apply(this,[gt(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Ne(t)},handled:!1,type:"instrument"}})])}}function Ll(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&oe(n,s,function(o){const i={mechanism:{data:{function:s,handler:Ne(o)},handled:!1,type:"instrument"}},c=X0(o);return c&&(i.mechanism.data.handler=Ne(c)),gt(o,i)})}),t.apply(this,e)}}function Ul(t){const n=W[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(oe(n,"addEventListener",function(r){return function(s,o,i){try{Hl(o)&&(o.handleEvent=gt(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ne(o),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[s,gt(o,{mechanism:{data:{function:"addEventListener",handler:Ne(o),target:t},handled:!1,type:"instrument"}}),i])}}),oe(n,"removeEventListener",function(r){return function(s,o,i){try{const c=o.__sentry_wrapped__;c&&r.call(this,s,c,i)}catch{}return r.call(this,s,o,i)}}))}function Hl(t){return typeof t.handleEvent=="function"}const $l=()=>({name:"BrowserSession",setupOnce(){if(typeof W.document>"u"){Cn&&w.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Yr({ignoreDuration:!0}),Qr(),Ss(({from:t,to:e})=>{t!==void 0&&t!==e&&(Yr({ignoreDuration:!0}),Qr())})}}),jl="GlobalHandlers",zl=((t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:jl,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(Wl(n),Is("onerror")),e.onunhandledrejection&&(Gl(n),Is("onunhandledrejection"))}}});function Wl(t){ii(e=>{const{stackParser:n,attachStacktrace:r}=ks();if(Y()!==t||As())return;const{msg:s,url:o,line:i,column:c,error:a}=e,l=ql(mn(n,a||s,void 0,r,!1),o,i,c);l.level="error",Xr(l,{originalException:a,mechanism:{handled:!1,type:"onerror"}})})}function Gl(t){ai(e=>{const{stackParser:n,attachStacktrace:r}=ks();if(Y()!==t||As())return;const s=Vl(e),o=K0(s)?Kl(s):mn(n,s,void 0,r,!0);o.level="error",Xr(o,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Vl(t){if(K0(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function Kl(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function ql(t,e,n,r){const s=t.exception=t.exception||{},o=s.values=s.values||[],i=o[0]=o[0]||{},c=i.stacktrace=i.stacktrace||{},a=c.frames=c.frames||[],l=r,d=n,u=be(e)&&e.length>0?e:Er();return a.length===0&&a.push({colno:l,filename:u,function:Ge,in_app:!0,lineno:d}),t}function Is(t){Cn&&w.log(`Global Handler attached: ${t}`)}function ks(){return Y()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Xl=()=>({name:"HttpContext",preprocessEvent(t){if(!W.navigator&&!W.location&&!W.document)return;const e=t.request?.url||Er(),{referrer:n}=W.document||{},{userAgent:r}=W.navigator||{},s={...t.request?.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...t.request,...e&&{url:e},headers:s};t.request=o}}),Yl="cause",Jl=5,Zl="LinkedErrors",Ql=((t={})=>{const e=t.limit||Jl,n=t.key||Yl;return{name:Zl,preprocessEvent(r,s,o){const i=o.getOptions();Sa(fn,i.stackParser,n,e,r,s)}}});function ed(t){return[ga(),pa(),Pl(),Sl(),zl(),Ql(),ka(),Xl(),$l()]}const Ze={codeless:"https://alloysdk.alloy.co/",api:"https://docv-prod-api.alloy.co/"};var ie;(function(t){t.IOVATION="Iovation",t.NEURO_ID="Neuro Id",t.BIOCATCH="BioCatch",t.FRAUDNET="Experian FraudNet",t.SOCURE_DEVICE_RISK="Socure Device Risk",t.SOCURE_DIGITAL_INTELLIGENCE="Socure Digital Intelligence",t.THREATMETRIX="Threatmetrix"})(ie||(ie={}));var ne;(function(t){t.ERROR="error",t.DEBUG="debug",t.INFO="info",t.LOG="log",t.WARN="warn"})(ne||(ne={}));const Qe="intelligence_plugin_initialization",td="alloy-web-sdk";class nd extends Error{constructor(e){super(e),this.name="FetchError",this.message=e||"An error occurred while fetching the data."}}const rd={"X-Alloy-Sdk-Platform":"Web","X-Alloy-Sdk-Version":"1","Content-Type":"application/json"};function sd(){return typeof document<"u"}async function Ht({url:t,method:e,headers:n,fetchOptions:r,data:s}){const o={method:e,headers:{...rd,"X-Parent-Domain":sd()?document.referrer:"",...n},...r};e&&s&&["POST","PUT"].includes(e)&&(o.body=JSON.stringify(s));const i=await fetch(`${Ze.api}${t}`,o);if(!i.ok){const c=new nd;throw c.info=await i.json(),c.status=i.status,c}return i.json()}const de=({accessToken:t,logging:e,analytics:n,plugin:r})=>Ht({url:"metrics/logging-and-analytics",headers:{Authorization:`Bearer ${t}`},method:"POST",data:{logging:e,analytics:n,origin:td,plugin:r}}).catch(()=>{}),od="iovation";var id=async t=>{de({analytics:{metricName:Qe},logging:{message:"Iovation initialized",type:ne.INFO},plugin:ie.IOVATION,accessToken:t}),window.IGLOO=window.IGLOO||{loader:{uri_hook:"/iojs/",version:"general5",subkey:"5FExse+oA1134BhiwCF2EeQ1TfisPJGha4CpVG2nd7E="}};const e=s=>new Promise(o=>setTimeout(o,s)),n=document.createElement("script");n.src="https://mpsnare.iesnare.com/snare.js",n.type="text/javascript",n.async=!0,document.head.appendChild(n);const r=await new Promise(s=>{const o=async()=>{var i;n.removeEventListener("load",o);try{const c=typeof ioGetBlackbox=="function"?(i=ioGetBlackbox())===null||i===void 0?void 0:i.blackbox:null;s(c)}catch{de({logging:{message:"Error calling iovation third party script",type:ne.ERROR},plugin:ie.IOVATION,accessToken:t}),s("")}};n.addEventListener("load",o)});if(!r){const s=document.createElement("script");return s.src="https://scripts.alloy.com/iovation.js",s.type="text/javascript",s.async=!0,s.setAttribute("data-status","loading"),document.head.appendChild(s),await new Promise(i=>{const c=async()=>{var a;s.removeEventListener("load",c),await e(500);try{const l=(a=window.IGLOO.getBlackbox())===null||a===void 0?void 0:a.blackbox;i(l)}catch{de({logging:{message:"Error calling iovation first party script",type:ne.ERROR},plugin:ie.IOVATION,accessToken:t}),i("")}};s.addEventListener("load",c)})}return r};const cd=()=>{document.querySelectorAll("script").forEach(e=>{e.src.includes(od)&&e.remove()})};let B0;const ad=new Uint8Array(16);function ld(){if(!B0&&(B0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!B0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return B0(ad)}const j=[];for(let t=0;t<256;++t)j.push((t+256).toString(16).slice(1));function dd(t,e=0){return j[t[e+0]]+j[t[e+1]]+j[t[e+2]]+j[t[e+3]]+"-"+j[t[e+4]]+j[t[e+5]]+"-"+j[t[e+6]]+j[t[e+7]]+"-"+j[t[e+8]]+j[t[e+9]]+"-"+j[t[e+10]]+j[t[e+11]]+j[t[e+12]]+j[t[e+13]]+j[t[e+14]]+j[t[e+15]]}var Ts={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ud(t,e,n){if(Ts.randomUUID&&!t)return Ts.randomUUID();t=t||{};const r=t.random||(t.rng||ld)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,dd(r)}const Rs=(t,e)=>{let n;return sessionStorage.getItem(t)?n=sessionStorage.getItem(t):(n=e||ud(),sessionStorage.setItem(t,n)),n},Os="neuro-id.com",xd=(t,e,n,r,s)=>{de({analytics:{metricName:Qe},logging:{message:"NeuroID initialized",type:ne.INFO},plugin:ie.NEURO_ID,accessToken:s}),sessionStorage.setItem("neuroIdOpen","true");const o=Rs("identityId",t),i=encodeURIComponent(n?e.slice(5):`${e}-test`.slice(5)),c=document.createElement("script");return c.type="text/javascript",c.src=`//scripts.${Os}/c/nid-${i}.js`,c.async=!0,window.nid||(window.nid=function(...l){(window.nid.q=window.nid.q||[]).push(l)}),document.head.appendChild(c),window.nid("identify",o),r&&window.nid("setVariable","funnel",r),o},S0=(t=!1)=>{sessionStorage.getItem("neuroIdOpen")==="true"&&window.nid&&(window.nid("closeSession"),sessionStorage.setItem("neuroIdOpen","false")),t&&(window.nidLoaded&&(window.nidLoaded=!1),document.querySelectorAll("script").forEach(n=>{n.src.includes(Os)&&n.remove()}))};var fd=async(t,e)=>{const n=document.createElement("script");return n.src="https://scripts.alloy.com/devicer.min.js",n.type="text/javascript",n.async=!0,n.setAttribute("data-status","loading"),document.head.appendChild(n),await new Promise(s=>{de({analytics:{metricName:Qe},logging:{message:"Socure Device Risk initialized",type:ne.INFO},plugin:ie.SOCURE_DEVICE_RISK,accessToken:e});const o=()=>{n.removeEventListener("load",o);const i={publicKey:t,userConsent:!0,endpoint:"device.alloy.com",context:"homepage"};try{devicer.run(i,c=>{s(c.sessionId)})}catch{s("")}};n.addEventListener("load",o)})};const pd=()=>{document.querySelectorAll("script").forEach(e=>{e.src.includes("scripts.alloy.com/devicer")&&e.remove()})},Ns="sdk.dv.socure.io";var hd=async(t,e)=>{de({analytics:{metricName:Qe},logging:{message:"Socure Digital Intelligence initialized",type:ne.INFO},plugin:ie.SOCURE_DIGITAL_INTELLIGENCE,accessToken:e});const n=document.createElement("script");return n.src=`https://${Ns}/latest/device-risk-sdk.js`,n.type="text/javascript",n.defer=!0,n.setAttribute("data-status","loading"),document.head.appendChild(n),await new Promise((s,o)=>{const i=()=>{n.removeEventListener("load",i);try{SigmaDeviceManager.initialize(t),SigmaDeviceManager.getSessionToken().then(c=>{s(c)}).catch(c=>{o(c)})}catch(c){de({logging:{message:"Error initializing Socure Digital Intelligence",type:ne.ERROR},plugin:ie.SOCURE_DIGITAL_INTELLIGENCE,accessToken:e}),o(c)}};n.addEventListener("load",i),n.addEventListener("error",()=>{o(new Error("Failed to load Socure Device Risk SDK"))})})};const md=()=>{document.querySelectorAll("script").forEach(e=>{e.src.includes(Ns)&&e.remove()})},Ps="h.online-metrix.net";var Ed=(t,e)=>{de({analytics:{metricName:Qe},logging:{message:"Threatmetrix initialized",type:ne.INFO},plugin:ie.THREATMETRIX,accessToken:e});const n=Rs("tmSessionId"),r=encodeURIComponent(t),s=encodeURIComponent(n||""),o=document.createElement("script");return o.type="text/javascript",o.src=`https://${Ps}/fp/tags.js?org_id=${r}&session_id=${s}`,o.async=!0,document.head.appendChild(o),n};const gd=()=>{document.querySelectorAll("script").forEach(e=>{e.src.includes(Ps)&&e.remove()})},Ms="alloy-bc-sdk",_d=(t=10,e=100)=>{const n=Math.floor(Math.random()*(e-t+1))+t;if(n<t||n>e)throw new Error(`Internal Error: invalid sessionIdLength: ${n}`);const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@$%^&*.=+-_/~";let s="";for(let o=n;o>0;o-=1)s+=r[Math.floor(Math.random()*r.length)];return s},yd=t=>{if(!t)throw new Error("Invalid or missing options. Please provide an object containing the customerSessionId, the context, and the brand.");if(!t.context||typeof t.context!="string")throw new Error("Invalid or missing context. It must be a non-empty string.");if(!t.brand||typeof t.brand!="string")throw new Error("Invalid or missing brand. It must be a non-empty string.");if(!t.jsUrl||typeof t.jsUrl!="string")throw new Error("Invalid or missing jsUrl. This will be the js/sdk url provided by BC.");if(t.runtimePlatform==="hybrid"&&(!t.cid||typeof t.cid!="string"||t.cid.length===0))throw new Error("Invalid or missing cid. This is required when running in hybrid mode. It'll be provided by BC.");if(t.runtimePlatform==="hybrid"&&(!t.wupUrl||typeof t.wupUrl!="string"||t.wupUrl.length===0))throw new Error("Invalid or missing WUP Url. This is required when running in hybrid mode. It'll be provided by BC.")};var Cd=(t,e)=>{de({analytics:{metricName:Qe},logging:{message:"BioCatch initialized",type:ne.INFO},plugin:ie.BIOCATCH,accessToken:e}),yd(t);const n=t.runtimePlatform==="hybrid",r=document.createElement("meta");r.name="isHybrid",r.content=n?"true":"false",document.head.appendChild(r);const s=document.createElement("script");return s.type="text/javascript",s.src=t.jsUrl,s.async=!0,s.id=Ms,!n&&window.cdApi&&console.warn("BC SDK already loaded."),n&&window.bcClient&&console.warn("BC Client already loaded."),document.head.appendChild(s),new Promise((o,i)=>{s.onload=()=>{var c,a,l;try{n?((c=window.bcClient)===null||c===void 0||c.start(t.wupUrl,t.cid,t.customerSessionId,4),(a=window.bcClient)===null||a===void 0||a.changeContext(t.context),(l=window.bcClient)===null||l===void 0||l.setCustomerBrand(t.brand),o({cdApi:window.cdApi,bcClient:window.bcClient})):(window.cdApi.setCustomerSessionId(t.customerSessionId),window.cdApi.changeContext(t.context),window.cdApi.setCustomerBrand(t.brand),o({cdApi:window.cdApi,bcClient:window.bcClient}))}catch(d){i(d)}},s.onerror=c=>{i(c)}})};const Ad=()=>{document.querySelectorAll("script").forEach(e=>{e.id===Ms&&e.remove()})},bd="https://scripts.alloy.com/prefs.js",Ls="alloy-jscollector",Dd=1e4;async function Bd(t){return de({analytics:{metricName:Qe},logging:{message:"FraudNet initialized",type:ne.INFO},plugin:ie.FRAUDNET,accessToken:t}),typeof window>"u"||!window.document?{}:new Promise((e,n)=>{let r,s="",o="";const i=()=>{r!==null&&clearTimeout(r)},c=()=>{var d;o=((d=window.adx)===null||d===void 0?void 0:d.validate())||"",s&&o&&(i(),e({hdim:s,jsc:o}))},a=d=>{s=d,s&&o&&(i(),e({hdim:s,jsc:o}))};(d=>{const u=document.createElement("script");u.src=d,u.type="text/javascript",u.async=!0,u.id=Ls,u.onload=()=>{const{adx:m}=window;if(!m){i(),n(new Error("Experian FraudNet invalid JS Collector"));return}m.initiate(c,["https://globalsiteanalytics.com/resource/resource.png","https://globalsiteanalytics.com/service/hdim",null,null,null,null,a])},u.onerror=()=>{i(),de({logging:{message:"Error loading FraudNet",type:ne.ERROR},plugin:ie.FRAUDNET,accessToken:t}),n(new Error("Experian FraudNet failed to load"))},document.head.appendChild(u)})(bd),r=setTimeout(()=>{i(),n(new Error("Experian FraudNet timed out"))},Dd)})}const Sd=()=>{if(typeof window>"u"||!window.document)return;const t=document.getElementById(Ls);if(t&&t.remove(),window.adx)try{delete window.adx}catch{}},Fd=t=>{if(!t)return"Invalid or missing options. Please provide an object containing the customerSessionId, the context, and the brand.";if(!t.brand)return'"brand" is required';if(!t.context)return'"context" is required';if(!t.jsUrl)return'"jsUrl" is required';if(t.runtimePlatform==="hybrid"){if(!t.cid)return'"cid" is required for hybrid mode';if(!t.wupUrl)return'"wupUrl" is required for hybrid mode'}return null},wd=async(t,e)=>{const n=Fd(t);if(n)throw n;const r=t.customerSessionId||_d(),s={...t,customerSessionId:r},{cdApi:o,bcClient:i}=await Cd(s,e).catch(c=>{throw c});return{cdApi:o,bcClient:i,customerSessionId:r}},An=t=>Ht({url:"auth/init",method:"POST",fetchOptions:{body:JSON.stringify({id:t})}}),vd=(t,e)=>Ht({url:`client/public/${t}`,headers:{Authorization:`Bearer ${e}`,"alloy-journey-application-sync":"true"},method:"GET"}),Id=(t,e,n,r=!1)=>Ht({url:`v1/journeys/${t}/applications`,headers:{Authorization:`Bearer ${e}`,"alloy-journey-application-sync":"true","alloy-sandbox":r?"false":"true"},method:"POST",fetchOptions:{body:JSON.stringify({...n})}}),kd=(t,e,n,r,s=!1)=>Ht({url:"evaluations",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json",...n&&{"Alloy-Entity-Token":n},...r&&{"Alloy-External-Entity-ID":r},"alloy-sandbox":s?"false":"true"},method:"POST",fetchOptions:{body:JSON.stringify({...e})}}),Us=({socureDeviceId:t,socureSessionToken:e,isNeuroIdEnabled:n,neuroIdSiteId:r,iovationBlackboxId:s,threatmetrixSessionId:o,threatmetrixOrgId:i}={})=>{const c={};if(t&&(c.socure_session_id=t),e&&(c.socure_session_id=e),n&&r){const a=sessionStorage.getItem("identityId");a&&(c.neuro_user_id=a,c.site_id=r)}return o&&(c.threatmetrix_session_id=o,c.org_id=i),s&&(c.iovation_blackbox=s),c};var bn="2.6.0";const et="alloy",F={key:"",npmPackageVersion:bn};let Dn,tt,_t=!0,$t=!1,F0=null,Bn=!1,yt=!1,Hs=!1;const Td=ed().filter(t=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(t.name)),$s=new nl({dsn:"https://daf0ad474f2a2a0fb3429754a44caa47@o478884.ingest.us.sentry.io/4509204292894721",release:`alloy-web-sdk@${bn}`,stackParser:Dl,integrations:Td,transport:hl}),Ct=new Ee;Ct.setClient($s),$s.init();const Rd=async()=>{S0();const{key:t,entityToken:e,evaluationData:n,production:r,externalEntityId:s,socureDeviceId:o,socureSessionToken:i,iovationBlackboxId:c,neuroIdSiteId:a,threatmetrixSessionId:l,threatmetrixOrgId:d}=F,{access_token:u}=await An(t),m=!!a,_=e,b=Us({socureDeviceId:o,socureSessionToken:i,isNeuroIdEnabled:m,neuroIdSiteId:a,iovationBlackboxId:c,threatmetrixSessionId:l,threatmetrixOrgId:d}),D={...n,...b};return await kd(u,D,_,s,r)},Od=async t=>{var e;S0();const{key:n,journeyToken:r,production:s,socureDeviceId:o,socureSessionToken:i,iovationBlackboxId:c,neuroIdSiteId:a,threatmetrixSessionId:l,threatmetrixOrgId:d}=F;if(r){const u=t,{access_token:m}=await An(n),b=Us({socureDeviceId:o,socureSessionToken:i,isNeuroIdEnabled:!!a,neuroIdSiteId:a,iovationBlackboxId:c,threatmetrixSessionId:l,threatmetrixOrgId:d});Object.keys(b).length>=1&&(u.entities=(e=t.entities)===null||e===void 0?void 0:e.map(S=>{const f=S;return f.data={...f.data,...b},f}));const D=await Id(r,m,u,s);return F.journeyApplicationToken=D.journey_application_token,D}return null},js=()=>{try{S0(!0),cd(),pd(),md(),gd(),Sd(),Ad();const t=document.getElementById(et);t&&t.parentNode&&(t.classList.remove("alloy-preloaded"),t.parentNode.removeChild(t)),$t=!1,Bn=!1,yt=!1}catch(t){_t&&Ct.captureException(t)}},zs=t=>!!(t==="https://docv-iframe.alloy.co"||t==="https://alloysdk.alloy.co"||t.endsWith(".app.alloy.com")),Nd=t=>{const e=t.querySelector("#alloyIframe");e&&e.contentWindow&&e.contentWindow.postMessage({type:"alloy:start-plugin"},"*")},Ws=t=>{const e=t.querySelector("#alloyIframe");e&&e.contentWindow&&tt&&e.contentWindow.postMessage({type:"alloy:init-params",params:tt},"*")},Gs=()=>{if(Hs)return;const t=e=>{var n;if(!zs(e.origin)||((n=e.data)===null||n===void 0?void 0:n.type)!=="alloy:ready"||(Bn=!0,!$t))return;const r=document.getElementById(et);if(r){if(!yt){Ws(r),yt=!0;return}Nd(r),$t=!1,yt=!1}};window.addEventListener("message",t),Hs=!0},Pd=t=>{t.classList.remove("alloy-preloaded")},Md=(t,e)=>{if(!e)return;const n=document.getElementById(e),r=document.getElementsByClassName(e),s=n||r[0];s&&s.insertAdjacentElement("afterbegin",t)},Ld=async(t,e)=>{var n,r,s,o,i,c,a,l,d,u,m,_,b,D,S,f,g,C,A,x,p,h,E,P,Z,Q,H,M,ue,se,ce,ee,Re,me,$,L;const O=await vd(t,e),Oe=((r=(n=O)===null||n===void 0?void 0:n.services)===null||r===void 0?void 0:r.neuro_id)||!1,vt=((i=(o=(s=O)===null||s===void 0?void 0:s.services)===null||o===void 0?void 0:o.neuro_id)===null||i===void 0?void 0:i.siteId)||"",dt=((a=(c=O)===null||c===void 0?void 0:c.services)===null||a===void 0?void 0:a.threatmetrix)||!1,t0=((u=(d=(l=O)===null||l===void 0?void 0:l.services)===null||d===void 0?void 0:d.threatmetrix)===null||u===void 0?void 0:u.orgId)||"",ut=((_=(m=O)===null||m===void 0?void 0:m.services)===null||_===void 0?void 0:_.iovation)||!1,ae=((D=(b=O)===null||b===void 0?void 0:b.services)===null||D===void 0?void 0:D.socure_dv)||!1,xe=((g=(f=(S=O)===null||S===void 0?void 0:S.services)===null||f===void 0?void 0:f.socure_dv)===null||g===void 0?void 0:g.publicToken)||!1,Ce=((A=(C=O)===null||C===void 0?void 0:C.services)===null||A===void 0?void 0:A.socure_digital_intel)||!1,$e=((h=(p=(x=O)===null||x===void 0?void 0:x.services)===null||p===void 0?void 0:p.socure_digital_intel)===null||h===void 0?void 0:h.publicToken)||"",Qn=((Z=(P=(E=O)===null||E===void 0?void 0:E.services)===null||P===void 0?void 0:P.bc)===null||Z===void 0?void 0:Z.jsUrl)||"",U0=((M=(H=(Q=O)===null||Q===void 0?void 0:Q.services)===null||H===void 0?void 0:H.bc)===null||M===void 0?void 0:M.brand)||"",er=((se=(ue=O)===null||ue===void 0?void 0:ue.services)===null||se===void 0?void 0:se.experian_crosscore_fraudnet)||!1,tr=((Re=(ee=(ce=O)===null||ce===void 0?void 0:ce.services)===null||ee===void 0?void 0:ee.bc)===null||Re===void 0?void 0:Re.wupUrl)||"",nr=((L=($=(me=O)===null||me===void 0?void 0:me.services)===null||$===void 0?void 0:$.bc)===null||L===void 0?void 0:L.cid)||"";return{bcJsUrl:Qn,bcBrand:U0,bcWupUrl:tr,bcCid:nr,isNeuroIdEnabled:Oe,neuroIdSiteId:vt,isIovationEnabled:ut,isSocureEnabled:ae,socurePublicToken:xe,isThreatmetrixEnabled:dt,threatmetrixOrgId:t0,isSocureDigitalIntelEnabled:Ce,socureDigitalIntelPublicToken:$e,isExperianCrossCoreFraudNetEnabled:er}},Ud=async({key:t,accessToken:e,socureCustomerSessionId:n,neuroUserId:r,production:s,neuroIdFunnel:o,bcContextFromClient:i,bcCustomerSessionIdFromClient:c,runtimePlatform:a})=>{const{isNeuroIdEnabled:l,neuroIdSiteId:d,isThreatmetrixEnabled:u,threatmetrixOrgId:m,isIovationEnabled:_,isSocureEnabled:b,socurePublicToken:D,isSocureDigitalIntelEnabled:S,socureDigitalIntelPublicToken:f,bcBrand:g,bcJsUrl:C,isExperianCrossCoreFraudNetEnabled:A,bcWupUrl:x,bcCid:p}=await Ld(t,e);if(D&&b){F.socurePublicToken=D;const E=await fd(D,e);F.socureDeviceId=E}if(f&&S){F.socureDigitalIntelPublicToken=f;const E=await hd({sdkKey:f,customerSessionId:n},e);F.socureSessionToken=E}if(l&&d){F.neuroIdSiteId=d;const E=xd(r,d,s||!1,o,e);F.neuroUserId=E||void 0,o&&(F.neuroIdFunnel=o)}if(u&&m){F.threatmetrixOrgId=m;const E=Ed(m,e);F.threatmetrixSessionId=E||void 0}if(A){const E=await Bd(e);F.experianCrossCoreFraudNetHdim=E.hdim,F.experianCrossCoreFraudNetJsc=E.jsc}const h=C;if(h){const E=g,P=i;if(!E||!P)console.error('The Alloy framework has not been initialized. If "jsUrl" is provided then "brand" and "context" are required');else{const Z=await wd({brand:E,customerSessionId:c,context:P,jsUrl:h,cid:p,wupUrl:x,runtimePlatform:a},e);F.bcCustomerSessionId=Z.customerSessionId,F.bcBrand=E,F.bcContext=P,F.bcJsUrl=h,F.bcCdApi=Z.cdApi,F.bcClient=Z.bcClient}}if(_){const E=await id(e);F.iovationBlackboxId=E}},Hd=async({key:t,apiUrl:e,appUrl:n,entityToken:r,externalEntityId:s,evaluationData:o,production:i,maxEvaluationAttempts:c,documents:a,selfie:l,color:d,customStyle:u,customerSlug:m,forceMobile:_,validationPreChecks:b,showHeader:D,journeyApplicationToken:S,journeyToken:f,isSingleEntity:g,isReactNative:C,isAndroidDevice:A,neuroUserId:x,neuroIdFunnel:p,socureCustomerSessionId:h,bcContext:E,bcCustomerSessionId:P,telemetry:Z=!0,runtimePlatform:Q="web",removeClosingDelay:H,skipBehavioralPluginsFetch:M,language:ue})=>{var se,ce;_t=Z;try{if(Object.keys(F).forEach(O=>{delete F[O]}),F.key=t,F.npmPackageVersion=bn,m){const O=`https://${m}-alloysdk.api.alloy.com/`,Oe=`https://${m}-alloysdk.app.alloy.com/`;Ze.codeless=Oe,Ze.api=O}e&&n&&(Ze.codeless=n,Ze.api=e);const{access_token:ee}=await An(t);r&&(F.entityToken=r),s&&(F.externalEntityId=s),i&&(F.production=i),c&&(F.maxEvaluationAttempts=c),a&&(F.documents=a),l&&(F.selfie=l),_&&(F.forceMobile=_),D===!1&&(F.showHeader=D),b&&(F.validationPreChecks=b),S&&(F.journeyApplicationToken=S),f&&(F.journeyToken=f),g&&(F.isSingleEntity=g),M===!0&&(F.skipBehavioralPluginsFetch=M),ue&&(F.language=ue),F.skipBehavioralPluginsFetch||await Ud({key:t,accessToken:ee,socureCustomerSessionId:h,neuroUserId:x,production:i,neuroIdFunnel:p,bcContextFromClient:E,bcCustomerSessionIdFromClient:P,runtimePlatform:Q}),C&&(F.isReactNative=C),A&&(F.isAndroidDevice=A),H&&(F.removeClosingDelay=H);const Re=JSON.stringify((se=u)===null||se===void 0?void 0:se.theme),me=JSON.stringify((ce=u)===null||ce===void 0?void 0:ce.componentOverride),$={theme:Re},L={componentOverride:me};if(tt=`${Tt.stringify(F)}${o?`&${Tt.stringify(o)}`:""}${d?`&${Tt.stringify(d)}`:""}${$.theme?`&${Tt.stringify($)}`:""}${L.componentOverride?`&${Tt.stringify(L)}`:""}`,o&&(F.evaluationData=o),F0&&F.key&&tt){const O=F0;F0=null,qs(O.cb,O.anchorElement)}de({logging:{message:"alloy init called",type:ne.INFO,body:F},accessToken:ee})}catch(ee){_t&&Ct.captureException(ee)}return F},Vs=(t=!1)=>{if(t&&!tt)return`${Ze.codeless.replace(/\/?$/,"/")}?preload=true`;let e=`${Ze.codeless}?${tt}`;t&&!e.includes("preload=true")&&(e=`${e}&preload=true`);try{F.journeyApplicationToken&&!e.includes("journeyApplicationToken")&&(e=`${e}&journeyApplicationToken=${F.journeyApplicationToken}`)}catch(n){_t&&Ct.captureException(n)}return e},$d=()=>{document.getElementById("alloy-iframe-style")||document.head.insertAdjacentHTML("beforeend",`<style id="alloy-iframe-style">
|
|
16
|
+
@keyframes fade {
|
|
17
|
+
0%, 40% { opacity: 0 }
|
|
18
|
+
80% { opacity: 1 }
|
|
19
|
+
}
|
|
20
|
+
@keyframes slideopen {
|
|
21
|
+
from {
|
|
22
|
+
margin-top: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
to {
|
|
26
|
+
margin-top: 0%;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
.alloy-container {
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
position: fixed;
|
|
33
|
+
top: 0;
|
|
34
|
+
transform: none;
|
|
35
|
+
left: 0;
|
|
36
|
+
z-index: 2;
|
|
37
|
+
}
|
|
38
|
+
.alloy-container.alloy-preloaded {
|
|
39
|
+
visibility: hidden;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
}
|
|
43
|
+
@media (min-width: 768px) {
|
|
44
|
+
.alloy-container {
|
|
45
|
+
animation: slideopen 1s linear;
|
|
46
|
+
height: 720px;
|
|
47
|
+
position: absolute;
|
|
48
|
+
left: 50%;
|
|
49
|
+
top: 50%;
|
|
50
|
+
transform: translate(-50%, -50%);
|
|
51
|
+
width: 50rem;
|
|
52
|
+
}
|
|
53
|
+
.alloy-container.alloy-preloaded {
|
|
54
|
+
visibility: hidden;
|
|
55
|
+
opacity: 0;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
.alloy-iframe {
|
|
60
|
+
animation: fade 1.5s linear;
|
|
61
|
+
border: 0;
|
|
62
|
+
opacity: 1;
|
|
63
|
+
height: 100%;
|
|
64
|
+
max-height: 100%;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
@media (min-width: 768px) {
|
|
68
|
+
.alloy-iframe {
|
|
69
|
+
border-radius: 1rem;
|
|
70
|
+
box-shadow: 0 10px 20px 0 rgba(63,83,92,0.3);
|
|
71
|
+
overflow: scroll;
|
|
72
|
+
}
|
|
73
|
+
}</style>`)},Ks=(t,e=!0)=>{$d();let n=document.getElementById(et);if(!n){n=document.createElement("div"),n.className="alloy-container",n.setAttribute("aria-modal","true"),n.setAttribute("role","dialog");const r=document.createElement("iframe");r.id="alloyIframe",r.src=Vs(!e),r.allow="autoplay; camera; microphone; fullscreen; accelerometer; magnetometer; gyroscope; picture-in-picture; geolocation",r.className="alloy-iframe",r.setAttribute("aria-label","Alloy Iframe"),n.id=et,e||n.classList.add("alloy-preloaded"),document.body.appendChild(n),n.appendChild(r),Md(n,t)}return n},jd=t=>{try{Gs();let e=document.getElementById(et);e||(e=Ks(t,!1))}catch(e){_t&&Ct.captureException(e)}},qs=(t,e)=>{try{Gs(),S0();const n=document.getElementById(et),r=!!n&&n.classList.contains("alloy-preloaded");if(!F.key||!tt){r?F0={cb:t,anchorElement:e}:console.error("The Alloy framework has not been initialized. You are missing the sdk key in your initialize parameters.");return}const s=i=>{var c,a;zs(i.origin)&&((a=(c=i)===null||c===void 0?void 0:c.data)===null||a===void 0?void 0:a.type)!=="alloy:ready"&&Dn&&(window.removeEventListener("message",s),Dn(i.data),js())};window.addEventListener("message",s),Dn=t;let o=document.getElementById(et);o&&o.classList.contains("alloy-preloaded")?(Pd(o),$t=!0,yt=!1,Bn&&(Ws(o),yt=!0)):o?$t=!1:o=Ks(e)}catch(n){_t&&Ct.captureException(n)}},jt={init:Hd,preload:jd,open:qs,close:js,createJourneyApplication:Od,createEvaluation:Rd,getPublicUrl:Vs},zd={apiUrl:"https://shared-prod-ew1-01-alloysdk.api.alloy.com/",appUrl:"https://shared-prod-ew1-01-alloysdk.app.alloy.com",showHeader:!0,skipBehavioralPluginsFetch:!0},Xs=(typeof globalThis<"u"?globalThis:void 0)?.crypto||(typeof global<"u"?global:void 0)?.crypto||(typeof window<"u"?window:void 0)?.crypto||(typeof self<"u"?self:void 0)?.crypto||(typeof frames<"u"?frames:void 0)?.[0]?.crypto;let Sn;Xs?Sn=t=>{const e=[];for(let n=0,r;n<t;n+=4)e.push(Xs.getRandomValues(new Uint32Array(1))[0]);return new v(e,t)}:Sn=t=>{const e=[],n=r=>{let s=r,o=987654321;const i=4294967295;return()=>{o=36969*(o&65535)+(o>>16)&i,s=18e3*(s&65535)+(s>>16)&i;let c=(o<<16)+s&i;return c/=4294967296,c+=.5,c*(Math.random()>.5?1:-1)}};for(let r=0,s;r<t;r+=4){const o=n((s||Math.random())*4294967296);s=o()*987654071,e.push(o()*4294967296|0)}return new v(e,t)};class N{static create(...e){return new this(...e)}mixIn(e){return Object.assign(this,e)}clone(){const e=new this.constructor;return Object.assign(e,this),e}}class v extends N{constructor(e=[],n=e.length*4){super();let r=e;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),(r instanceof Int8Array||r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)),r instanceof Uint8Array){const s=r.byteLength,o=[];for(let i=0;i<s;i+=1)o[i>>>2]|=r[i]<<24-i%4*8;this.words=o,this.sigBytes=s}else this.words=e,this.sigBytes=n}static random=Sn;toString(e=w0){return e.stringify(this)}concat(e){const n=this.words,r=e.words,s=this.sigBytes,o=e.sigBytes;if(this.clamp(),s%4)for(let i=0;i<o;i+=1){const c=r[i>>>2]>>>24-i%4*8&255;n[s+i>>>2]|=c<<24-(s+i)%4*8}else for(let i=0;i<o;i+=4)n[s+i>>>2]=r[i>>>2];return this.sigBytes+=o,this}clamp(){const{words:e,sigBytes:n}=this;e[n>>>2]&=4294967295<<32-n%4*8,e.length=Math.ceil(n/4)}clone(){const e=super.clone.call(this);return e.words=this.words.slice(0),e}}const w0={stringify(t){const{words:e,sigBytes:n}=t,r=[];for(let s=0;s<n;s+=1){const o=e[s>>>2]>>>24-s%4*8&255;r.push((o>>>4).toString(16)),r.push((o&15).toString(16))}return r.join("")},parse(t){const e=t.length,n=[];for(let r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new v(n,e/2)}},Fn={stringify(t){const{words:e,sigBytes:n}=t,r=[];for(let s=0;s<n;s+=1){const o=e[s>>>2]>>>24-s%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse(t){const e=t.length,n=[];for(let r=0;r<e;r+=1)n[r>>>2]|=(t.charCodeAt(r)&255)<<24-r%4*8;return new v(n,e)}},wn={stringify(t){try{return decodeURIComponent(escape(Fn.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse(t){return Fn.parse(unescape(encodeURIComponent(t)))}};class vn extends N{constructor(){super(),this._minBufferSize=0}reset(){this._data=new v,this._nDataBytes=0}_append(e){let n=e;typeof n=="string"&&(n=wn.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes}_process(e){let n;const{_data:r,blockSize:s}=this,o=r.words,i=r.sigBytes,c=s*4;let a=i/c;e?a=Math.ceil(a):a=Math.max((a|0)-this._minBufferSize,0);const l=a*s,d=Math.min(l*4,i);if(l){for(let u=0;u<l;u+=s)this._doProcessBlock(o,u);n=o.splice(0,l),r.sigBytes-=d}return new v(n,d)}clone(){const e=super.clone.call(this);return e._data=this._data.clone(),e}}class U extends vn{constructor(e){super(),this.blockSize=512/32,this.cfg=Object.assign(new N,e),this.reset()}static _createHelper(e){return(n,r)=>new e(r).finalize(n)}static _createHmacHelper(e){return(n,r)=>new In(e,r).finalize(n)}reset(){super.reset.call(this),this._doReset()}update(e){return this._append(e),this._process(),this}finalize(e){return e&&this._append(e),this._doFinalize()}}class In extends N{constructor(e,n){super();const r=new e;this._hasher=r;let s=n;typeof s=="string"&&(s=wn.parse(s));const o=r.blockSize,i=o*4;s.sigBytes>i&&(s=r.finalize(n)),s.clamp();const c=s.clone();this._oKey=c;const a=s.clone();this._iKey=a;const l=c.words,d=a.words;for(let u=0;u<o;u+=1)l[u]^=1549556828,d[u]^=909522486;c.sigBytes=i,a.sigBytes=i,this.reset()}reset(){const e=this._hasher;e.reset(),e.update(this._iKey)}update(e){return this._hasher.update(e),this}finalize(e){const n=this._hasher,r=n.finalize(e);return n.reset(),n.finalize(this._oKey.clone().concat(r))}}const Wd=v;class y extends N{constructor(e,n){super(),this.high=e,this.low=n}}class kn extends N{constructor(e=[],n=e.length*8){super(),this.words=e,this.sigBytes=n}toX32(){const e=this.words,n=e.length,r=[];for(let s=0;s<n;s+=1){const o=e[s];r.push(o.high),r.push(o.low)}return Wd.create(r,this.sigBytes)}clone(){const e=super.clone.call(this);e.words=this.words.slice(0);const{words:n}=e,r=n.length;for(let s=0;s<r;s+=1)n[s]=n[s].clone();return e}}const Ys=(t,e,n)=>{const r=[];let s=0;for(let o=0;o<e;o+=1)if(o%4){const i=n[t.charCodeAt(o-1)]<<o%4*2,c=n[t.charCodeAt(o)]>>>6-o%4*2,a=i|c;r[s>>>2]|=a<<24-s%4*8,s+=1}return v.create(r,s)},Tn={stringify(t){const{words:e,sigBytes:n}=t,r=this._map;t.clamp();const s=[];for(let i=0;i<n;i+=3){const c=e[i>>>2]>>>24-i%4*8&255,a=e[i+1>>>2]>>>24-(i+1)%4*8&255,l=e[i+2>>>2]>>>24-(i+2)%4*8&255,d=c<<16|a<<8|l;for(let u=0;u<4&&i+u*.75<n;u+=1)s.push(r.charAt(d>>>6*(3-u)&63))}const o=r.charAt(64);if(o)for(;s.length%4;)s.push(o);return s.join("")},parse(t){let e=t.length;const n=this._map;let r=this._reverseMap;if(!r){this._reverseMap=[],r=this._reverseMap;for(let o=0;o<n.length;o+=1)r[n.charCodeAt(o)]=o}const s=n.charAt(64);if(s){const o=t.indexOf(s);o!==-1&&(e=o)}return Ys(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},B=[];for(let t=0;t<64;t+=1)B[t]=Math.abs(Math.sin(t+1))*4294967296|0;const G=(t,e,n,r,s,o,i)=>{const c=t+(e&n|~e&r)+s+i;return(c<<o|c>>>32-o)+e},V=(t,e,n,r,s,o,i)=>{const c=t+(e&r|n&~r)+s+i;return(c<<o|c>>>32-o)+e},K=(t,e,n,r,s,o,i)=>{const c=t+(e^n^r)+s+i;return(c<<o|c>>>32-o)+e},q=(t,e,n,r,s,o,i)=>{const c=t+(n^(e|~r))+s+i;return(c<<o|c>>>32-o)+e};class v0 extends U{_doReset(){this._hash=new v([1732584193,4023233417,2562383102,271733878])}_doProcessBlock(e,n){const r=e;for(let P=0;P<16;P+=1){const Z=n+P,Q=e[Z];r[Z]=(Q<<8|Q>>>24)&16711935|(Q<<24|Q>>>8)&4278255360}const s=this._hash.words,o=r[n+0],i=r[n+1],c=r[n+2],a=r[n+3],l=r[n+4],d=r[n+5],u=r[n+6],m=r[n+7],_=r[n+8],b=r[n+9],D=r[n+10],S=r[n+11],f=r[n+12],g=r[n+13],C=r[n+14],A=r[n+15];let x=s[0],p=s[1],h=s[2],E=s[3];x=G(x,p,h,E,o,7,B[0]),E=G(E,x,p,h,i,12,B[1]),h=G(h,E,x,p,c,17,B[2]),p=G(p,h,E,x,a,22,B[3]),x=G(x,p,h,E,l,7,B[4]),E=G(E,x,p,h,d,12,B[5]),h=G(h,E,x,p,u,17,B[6]),p=G(p,h,E,x,m,22,B[7]),x=G(x,p,h,E,_,7,B[8]),E=G(E,x,p,h,b,12,B[9]),h=G(h,E,x,p,D,17,B[10]),p=G(p,h,E,x,S,22,B[11]),x=G(x,p,h,E,f,7,B[12]),E=G(E,x,p,h,g,12,B[13]),h=G(h,E,x,p,C,17,B[14]),p=G(p,h,E,x,A,22,B[15]),x=V(x,p,h,E,i,5,B[16]),E=V(E,x,p,h,u,9,B[17]),h=V(h,E,x,p,S,14,B[18]),p=V(p,h,E,x,o,20,B[19]),x=V(x,p,h,E,d,5,B[20]),E=V(E,x,p,h,D,9,B[21]),h=V(h,E,x,p,A,14,B[22]),p=V(p,h,E,x,l,20,B[23]),x=V(x,p,h,E,b,5,B[24]),E=V(E,x,p,h,C,9,B[25]),h=V(h,E,x,p,a,14,B[26]),p=V(p,h,E,x,_,20,B[27]),x=V(x,p,h,E,g,5,B[28]),E=V(E,x,p,h,c,9,B[29]),h=V(h,E,x,p,m,14,B[30]),p=V(p,h,E,x,f,20,B[31]),x=K(x,p,h,E,d,4,B[32]),E=K(E,x,p,h,_,11,B[33]),h=K(h,E,x,p,S,16,B[34]),p=K(p,h,E,x,C,23,B[35]),x=K(x,p,h,E,i,4,B[36]),E=K(E,x,p,h,l,11,B[37]),h=K(h,E,x,p,m,16,B[38]),p=K(p,h,E,x,D,23,B[39]),x=K(x,p,h,E,g,4,B[40]),E=K(E,x,p,h,o,11,B[41]),h=K(h,E,x,p,a,16,B[42]),p=K(p,h,E,x,u,23,B[43]),x=K(x,p,h,E,b,4,B[44]),E=K(E,x,p,h,f,11,B[45]),h=K(h,E,x,p,A,16,B[46]),p=K(p,h,E,x,c,23,B[47]),x=q(x,p,h,E,o,6,B[48]),E=q(E,x,p,h,m,10,B[49]),h=q(h,E,x,p,C,15,B[50]),p=q(p,h,E,x,d,21,B[51]),x=q(x,p,h,E,f,6,B[52]),E=q(E,x,p,h,a,10,B[53]),h=q(h,E,x,p,D,15,B[54]),p=q(p,h,E,x,i,21,B[55]),x=q(x,p,h,E,_,6,B[56]),E=q(E,x,p,h,A,10,B[57]),h=q(h,E,x,p,u,15,B[58]),p=q(p,h,E,x,g,21,B[59]),x=q(x,p,h,E,l,6,B[60]),E=q(E,x,p,h,S,10,B[61]),h=q(h,E,x,p,c,15,B[62]),p=q(p,h,E,x,b,21,B[63]),s[0]=s[0]+x|0,s[1]=s[1]+p|0,s[2]=s[2]+h|0,s[3]=s[3]+E|0}_doFinalize(){const e=this._data,n=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;n[s>>>5]|=128<<24-s%32;const o=Math.floor(r/4294967296),i=r;n[(s+64>>>9<<4)+15]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,n[(s+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();const c=this._hash,a=c.words;for(let l=0;l<4;l+=1){const d=a[l];a[l]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360}return c}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const Gd=U._createHelper(v0),Vd=U._createHmacHelper(v0);class I0 extends N{constructor(e){super(),this.cfg=Object.assign(new N,{keySize:128/32,hasher:v0,iterations:1},e)}compute(e,n){let r;const{cfg:s}=this,o=s.hasher.create(),i=v.create(),c=i.words,{keySize:a,iterations:l}=s;for(;c.length<a;){r&&o.update(r),r=o.update(e).finalize(n),o.reset();for(let d=1;d<l;d+=1)r=o.finalize(r),o.reset();i.concat(r)}return i.sigBytes=a*4,i}}const Kd=(t,e,n)=>I0.create(n).compute(t,e);class nt extends vn{constructor(e,n,r){super(),this.cfg=Object.assign(new N,r),this._xformMode=e,this._key=n,this.reset()}static createEncryptor(e,n){return this.create(this._ENC_XFORM_MODE,e,n)}static createDecryptor(e,n){return this.create(this._DEC_XFORM_MODE,e,n)}static _createHelper(e){const n=r=>typeof r=="string"?Rn:st;return{encrypt(r,s,o){return n(s).encrypt(e,r,s,o)},decrypt(r,s,o){return n(s).decrypt(e,r,s,o)}}}reset(){super.reset.call(this),this._doReset()}process(e){return this._append(e),this._process()}finalize(e){return e&&this._append(e),this._doFinalize()}}nt._ENC_XFORM_MODE=1,nt._DEC_XFORM_MODE=2,nt.keySize=128/32,nt.ivSize=128/32;class Le extends nt{constructor(...e){super(...e),this.blockSize=1}_doFinalize(){return this._process(!0)}}class rt extends N{constructor(e,n){super(),this._cipher=e,this._iv=n}static createEncryptor(e,n){return this.Encryptor.create(e,n)}static createDecryptor(e,n){return this.Decryptor.create(e,n)}}function Js(t,e,n){const r=t;let s;const o=this._iv;o?(s=o,this._iv=void 0):s=this._prevBlock;for(let i=0;i<n;i+=1)r[e+i]^=s[i]}class At extends rt{}At.Encryptor=class extends At{processBlock(t,e){const n=this._cipher,{blockSize:r}=n;Js.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)}},At.Decryptor=class extends At{processBlock(t,e){const n=this._cipher,{blockSize:r}=n,s=t.slice(e,e+r);n.decryptBlock(t,e),Js.call(this,t,e,r),this._prevBlock=s}};const Zs={pad(t,e){const n=e*4,r=n-t.sigBytes%n,s=r<<24|r<<16|r<<8|r,o=[];for(let c=0;c<r;c+=4)o.push(s);const i=v.create(o,r);t.concat(i)},unpad(t){const e=t,n=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=n}};class Fe extends nt{constructor(e,n,r){super(e,n,Object.assign({mode:At,padding:Zs},r)),this.blockSize=128/32}reset(){let e;super.reset.call(this);const{cfg:n}=this,{iv:r,mode:s}=n;this._xformMode===this.constructor._ENC_XFORM_MODE?e=s.createEncryptor:(e=s.createDecryptor,this._minBufferSize=1),this._mode=e.call(s,this,r&&r.words),this._mode.__creator=e}_doProcessBlock(e,n){this._mode.processBlock(e,n)}_doFinalize(){let e;const{padding:n}=this.cfg;return this._xformMode===this.constructor._ENC_XFORM_MODE?(n.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),n.unpad(e)),e}}class zt extends N{constructor(e){super(),this.mixIn(e)}toString(e){return(e||this.formatter).stringify(this)}}const Qs={stringify(t){let e;const{ciphertext:n,salt:r}=t;return r?e=v.create([1398893684,1701076831]).concat(r).concat(n):e=n,e.toString(Tn)},parse(t){let e;const n=Tn.parse(t),r=n.words;return r[0]===1398893684&&r[1]===1701076831&&(e=v.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),zt.create({ciphertext:n,salt:e})}};class st extends N{static encrypt(e,n,r,s){const o=Object.assign(new N,this.cfg,s),i=e.createEncryptor(r,o),c=i.finalize(n),a=i.cfg;return zt.create({ciphertext:c,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:i.blockSize,formatter:o.format})}static decrypt(e,n,r,s){let o=n;const i=Object.assign(new N,this.cfg,s);return o=this._parse(o,i.format),e.createDecryptor(r,i).finalize(o.ciphertext)}static _parse(e,n){return typeof e=="string"?n.parse(e,this):e}}st.cfg=Object.assign(new N,{format:Qs});const eo={execute(t,e,n,r,s){let o=r;o||(o=v.random(64/8));let i;s?i=I0.create({keySize:e+n,hasher:s}).compute(t,o):i=I0.create({keySize:e+n}).compute(t,o);const c=v.create(i.words.slice(e),n*4);return i.sigBytes=e*4,zt.create({key:i,iv:c,salt:o})}};class Rn extends st{static encrypt(e,n,r,s){const o=Object.assign(new N,this.cfg,s),i=o.kdf.execute(r,e.keySize,e.ivSize,o.salt,o.hasher);o.iv=i.iv;const c=st.encrypt.call(this,e,n,i.key,o);return c.mixIn(i),c}static decrypt(e,n,r,s){let o=n;const i=Object.assign(new N,this.cfg,s);o=this._parse(o,i.format);const c=i.kdf.execute(r,e.keySize,e.ivSize,o.salt,i.hasher);return i.iv=c.iv,st.decrypt.call(this,e,o,c.key,i)}}Rn.cfg=Object.assign(st.cfg,{kdf:eo});const to=t=>t<<8&4278255360|t>>>8&16711935,no={stringify(t){const{words:e,sigBytes:n}=t,r=[];for(let s=0;s<n;s+=2){const o=e[s>>>2]>>>16-s%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse(t){const e=t.length,n=[];for(let r=0;r<e;r+=1)n[r>>>1]|=t.charCodeAt(r)<<16-r%2*16;return v.create(n,e*2)}},qd=no,Xd={stringify(t){const{words:e,sigBytes:n}=t,r=[];for(let s=0;s<n;s+=2){const o=to(e[s>>>2]>>>16-s%4*8&65535);r.push(String.fromCharCode(o))}return r.join("")},parse(t){const e=t.length,n=[];for(let r=0;r<e;r+=1)n[r>>>1]|=to(t.charCodeAt(r)<<16-r%2*16);return v.create(n,e*2)}},Yd={stringify(t,e=!0){const{words:n,sigBytes:r}=t,s=e?this._safeMap:this._map;t.clamp();const o=[];for(let c=0;c<r;c+=3){const a=n[c>>>2]>>>24-c%4*8&255,l=n[c+1>>>2]>>>24-(c+1)%4*8&255,d=n[c+2>>>2]>>>24-(c+2)%4*8&255,u=a<<16|l<<8|d;for(let m=0;m<4&&c+m*.75<r;m+=1)o.push(s.charAt(u>>>6*(3-m)&63))}const i=s.charAt(64);if(i)for(;o.length%4;)o.push(i);return o.join("")},parse(t,e=!0){let n=t.length;const r=e?this._safeMap:this._map;let s=this._reverseMap;if(!s){this._reverseMap=[],s=this._reverseMap;for(let i=0;i<r.length;i+=1)s[r.charCodeAt(i)]=i}const o=r.charAt(64);if(o){const i=t.indexOf(o);i!==-1&&(n=i)}return Ys(t,n,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safeMap:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},ot=[];class On extends U{_doReset(){this._hash=new v([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(e,n){const r=this._hash.words;let s=r[0],o=r[1],i=r[2],c=r[3],a=r[4];for(let l=0;l<80;l+=1){if(l<16)ot[l]=e[n+l]|0;else{const u=ot[l-3]^ot[l-8]^ot[l-14]^ot[l-16];ot[l]=u<<1|u>>>31}let d=(s<<5|s>>>27)+a+ot[l];l<20?d+=(o&i|~o&c)+1518500249:l<40?d+=(o^i^c)+1859775393:l<60?d+=(o&i|o&c|i&c)-1894007588:d+=(o^i^c)-899497514,a=c,c=i,i=o<<30|o>>>2,o=s,s=d}r[0]=r[0]+s|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+c|0,r[4]=r[4]+a|0}_doFinalize(){const e=this._data,n=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;return n[s>>>5]|=128<<24-s%32,n[(s+64>>>9<<4)+14]=Math.floor(r/4294967296),n[(s+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const Jd=U._createHelper(On),Zd=U._createHmacHelper(On),ro=[],so=[],Qd=t=>{const e=Math.sqrt(t);for(let n=2;n<=e;n+=1)if(!(t%n))return!1;return!0},oo=t=>(t-(t|0))*4294967296|0;let k0=2,Wt=0;for(;Wt<64;)Qd(k0)&&(Wt<8&&(ro[Wt]=oo(k0**(1/2))),so[Wt]=oo(k0**(1/3)),Wt+=1),k0+=1;const it=[];class ct extends U{_doReset(){this._hash=new v(ro.slice(0))}_doProcessBlock(e,n){const r=this._hash.words;let s=r[0],o=r[1],i=r[2],c=r[3],a=r[4],l=r[5],d=r[6],u=r[7];for(let m=0;m<64;m+=1){if(m<16)it[m]=e[n+m]|0;else{const C=it[m-15],A=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,x=it[m-2],p=(x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10;it[m]=A+it[m-7]+p+it[m-16]}const _=a&l^~a&d,b=s&o^s&i^o&i,D=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),S=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),f=u+S+_+so[m]+it[m],g=D+b;u=d,d=l,l=a,a=c+f|0,c=i,i=o,o=s,s=f+g|0}r[0]=r[0]+s|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+c|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+u|0}_doFinalize(){const e=this._data,n=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;return n[s>>>5]|=128<<24-s%32,n[(s+64>>>9<<4)+14]=Math.floor(r/4294967296),n[(s+64>>>9<<4)+15]=r,e.sigBytes=n.length*4,this._process(),this._hash}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const eu=U._createHelper(ct),tu=U._createHmacHelper(ct);class Nn extends ct{_doReset(){this._hash=new v([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])}_doFinalize(){const e=super._doFinalize.call(this);return e.sigBytes-=4,e}}const nu=ct._createHelper(Nn),ru=ct._createHmacHelper(Nn),su=[new y(1116352408,3609767458),new y(1899447441,602891725),new y(3049323471,3964484399),new y(3921009573,2173295548),new y(961987163,4081628472),new y(1508970993,3053834265),new y(2453635748,2937671579),new y(2870763221,3664609560),new y(3624381080,2734883394),new y(310598401,1164996542),new y(607225278,1323610764),new y(1426881987,3590304994),new y(1925078388,4068182383),new y(2162078206,991336113),new y(2614888103,633803317),new y(3248222580,3479774868),new y(3835390401,2666613458),new y(4022224774,944711139),new y(264347078,2341262773),new y(604807628,2007800933),new y(770255983,1495990901),new y(1249150122,1856431235),new y(1555081692,3175218132),new y(1996064986,2198950837),new y(2554220882,3999719339),new y(2821834349,766784016),new y(2952996808,2566594879),new y(3210313671,3203337956),new y(3336571891,1034457026),new y(3584528711,2466948901),new y(113926993,3758326383),new y(338241895,168717936),new y(666307205,1188179964),new y(773529912,1546045734),new y(1294757372,1522805485),new y(1396182291,2643833823),new y(1695183700,2343527390),new y(1986661051,1014477480),new y(2177026350,1206759142),new y(2456956037,344077627),new y(2730485921,1290863460),new y(2820302411,3158454273),new y(3259730800,3505952657),new y(3345764771,106217008),new y(3516065817,3606008344),new y(3600352804,1432725776),new y(4094571909,1467031594),new y(275423344,851169720),new y(430227734,3100823752),new y(506948616,1363258195),new y(659060556,3750685593),new y(883997877,3785050280),new y(958139571,3318307427),new y(1322822218,3812723403),new y(1537002063,2003034995),new y(1747873779,3602036899),new y(1955562222,1575990012),new y(2024104815,1125592928),new y(2227730452,2716904306),new y(2361852424,442776044),new y(2428436474,593698344),new y(2756734187,3733110249),new y(3204031479,2999351573),new y(3329325298,3815920427),new y(3391569614,3928383900),new y(3515267271,566280711),new y(3940187606,3454069534),new y(4118630271,4000239992),new y(116418474,1914138554),new y(174292421,2731055270),new y(289380356,3203993006),new y(460393269,320620315),new y(685471733,587496836),new y(852142971,1086792851),new y(1017036298,365543100),new y(1126000580,2618297676),new y(1288033470,3409855158),new y(1501505948,4234509866),new y(1607167915,987167468),new y(1816402316,1246189591)],bt=[];for(let t=0;t<80;t+=1)bt[t]=new y;class Dt extends U{constructor(){super(),this.blockSize=1024/32}_doReset(){this._hash=new kn([new y(1779033703,4089235720),new y(3144134277,2227873595),new y(1013904242,4271175723),new y(2773480762,1595750129),new y(1359893119,2917565137),new y(2600822924,725511199),new y(528734635,4215389547),new y(1541459225,327033209)])}_doProcessBlock(e,n){const r=this._hash.words,s=r[0],o=r[1],i=r[2],c=r[3],a=r[4],l=r[5],d=r[6],u=r[7],m=s.high;let _=s.low;const b=o.high;let D=o.low;const S=i.high;let f=i.low;const g=c.high;let C=c.low;const A=a.high;let x=a.low;const p=l.high;let h=l.low;const E=d.high;let P=d.low;const Z=u.high;let Q=u.low,H=m,M=_,ue=b,se=D,ce=S,ee=f,Re=g,me=C,$=A,L=x,O=p,Oe=h,vt=E,dt=P,t0=Z,ut=Q;for(let ae=0;ae<80;ae+=1){let xe,Ce;const $e=bt[ae];if(ae<16)$e.high=e[n+ae*2]|0,Ce=$e.high,$e.low=e[n+ae*2+1]|0,xe=$e.low;else{const jo=bt[ae-15],It=jo.high,n0=jo.low,Ox=(It>>>1|n0<<31)^(It>>>8|n0<<24)^It>>>7,zo=(n0>>>1|It<<31)^(n0>>>8|It<<24)^(n0>>>7|It<<25),Wo=bt[ae-2],kt=Wo.high,r0=Wo.low,Nx=(kt>>>19|r0<<13)^(kt<<3|r0>>>29)^kt>>>6,Go=(r0>>>19|kt<<13)^(r0<<3|kt>>>29)^(r0>>>6|kt<<26),Vo=bt[ae-7],Px=Vo.high,Mx=Vo.low,Ko=bt[ae-16],Lx=Ko.high,qo=Ko.low;xe=zo+Mx,Ce=Ox+Px+(xe>>>0<zo>>>0?1:0),xe+=Go,Ce=Ce+Nx+(xe>>>0<Go>>>0?1:0),xe+=qo,Ce=Ce+Lx+(xe>>>0<qo>>>0?1:0),$e.high=Ce,$e.low=xe}const Qn=$&O^~$&vt,U0=L&Oe^~L&dt,er=H&ue^H&ce^ue&ce,tr=M&se^M&ee^se&ee,nr=(H>>>28|M<<4)^(H<<30|M>>>2)^(H<<25|M>>>7),Lo=(M>>>28|H<<4)^(M<<30|H>>>2)^(M<<25|H>>>7),Ix=($>>>14|L<<18)^($>>>18|L<<14)^($<<23|L>>>9),kx=(L>>>14|$<<18)^(L>>>18|$<<14)^(L<<23|$>>>9),Uo=su[ae],Tx=Uo.high,Ho=Uo.low;let Ae=ut+kx,je=t0+Ix+(Ae>>>0<ut>>>0?1:0);Ae+=U0,je=je+Qn+(Ae>>>0<U0>>>0?1:0),Ae+=Ho,je=je+Tx+(Ae>>>0<Ho>>>0?1:0),Ae+=xe,je=je+Ce+(Ae>>>0<xe>>>0?1:0);const $o=Lo+tr,Rx=nr+er+($o>>>0<Lo>>>0?1:0);t0=vt,ut=dt,vt=O,dt=Oe,O=$,Oe=L,L=me+Ae|0,$=Re+je+(L>>>0<me>>>0?1:0)|0,Re=ce,me=ee,ce=ue,ee=se,ue=H,se=M,M=Ae+$o|0,H=je+Rx+(M>>>0<Ae>>>0?1:0)|0}s.low=_+M,_=s.low,s.high=m+H+(_>>>0<M>>>0?1:0),o.low=D+se,D=o.low,o.high=b+ue+(D>>>0<se>>>0?1:0),i.low=f+ee,f=i.low,i.high=S+ce+(f>>>0<ee>>>0?1:0),c.low=C+me,C=c.low,c.high=g+Re+(C>>>0<me>>>0?1:0),a.low=x+L,x=a.low,a.high=A+$+(x>>>0<L>>>0?1:0),l.low=h+Oe,h=l.low,l.high=p+O+(h>>>0<Oe>>>0?1:0),d.low=P+dt,P=d.low,d.high=E+vt+(P>>>0<dt>>>0?1:0),u.low=Q+ut,Q=u.low,u.high=Z+t0+(Q>>>0<ut>>>0?1:0)}_doFinalize(){const e=this._data,n=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;return n[s>>>5]|=128<<24-s%32,n[(s+128>>>10<<5)+30]=Math.floor(r/4294967296),n[(s+128>>>10<<5)+31]=r,e.sigBytes=n.length*4,this._process(),this._hash.toX32()}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const ou=U._createHelper(Dt),iu=U._createHmacHelper(Dt);class Pn extends Dt{_doReset(){this._hash=new kn([new y(3418070365,3238371032),new y(1654270250,914150663),new y(2438529370,812702999),new y(355462360,4144912697),new y(1731405415,4290775857),new y(2394180231,1750603025),new y(3675008525,1694076839),new y(1203062813,3204075428)])}_doFinalize(){const e=super._doFinalize.call(this);return e.sigBytes-=16,e}}const cu=Dt._createHelper(Pn),au=Dt._createHmacHelper(Pn),io=[],co=[],ao=[];let Mn=1,T0=0;for(let t=0;t<24;t+=1){io[Mn+5*T0]=(t+1)*(t+2)/2%64;const e=T0%5,n=(2*Mn+3*T0)%5;Mn=e,T0=n}for(let t=0;t<5;t+=1)for(let e=0;e<5;e+=1)co[t+5*e]=e+(2*t+3*e)%5*5;let Gt=1;for(let t=0;t<24;t+=1){let e=0,n=0;for(let r=0;r<7;r+=1){if(Gt&1){const s=(1<<r)-1;s<32?n^=1<<s:e^=1<<s-32}Gt&128?Gt=Gt<<1^113:Gt<<=1}ao[t]=y.create(e,n)}const we=[];for(let t=0;t<25;t+=1)we[t]=y.create();class Ln extends U{constructor(e){super(Object.assign({outputLength:512},e))}_doReset(){this._state=[];const e=this._state;for(let n=0;n<25;n+=1)e[n]=new y;this.blockSize=(1600-2*this.cfg.outputLength)/32}_doProcessBlock(e,n){const r=this._state,s=this.blockSize/2;for(let o=0;o<s;o+=1){let i=e[n+2*o],c=e[n+2*o+1];i=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;const a=r[o];a.high^=c,a.low^=i}for(let o=0;o<24;o+=1){for(let d=0;d<5;d+=1){let u=0,m=0;for(let b=0;b<5;b+=1){const D=r[d+5*b];u^=D.high,m^=D.low}const _=we[d];_.high=u,_.low=m}for(let d=0;d<5;d+=1){const u=we[(d+4)%5],m=we[(d+1)%5],_=m.high,b=m.low,D=u.high^(_<<1|b>>>31),S=u.low^(b<<1|_>>>31);for(let f=0;f<5;f+=1){const g=r[d+5*f];g.high^=D,g.low^=S}}for(let d=1;d<25;d+=1){let u,m;const _=r[d],b=_.high,D=_.low,S=io[d];S<32?(u=b<<S|D>>>32-S,m=D<<S|b>>>32-S):(u=D<<S-32|b>>>64-S,m=b<<S-32|D>>>64-S);const f=we[co[d]];f.high=u,f.low=m}const i=we[0],c=r[0];i.high=c.high,i.low=c.low;for(let d=0;d<5;d+=1)for(let u=0;u<5;u+=1){const m=d+5*u,_=r[m],b=we[m],D=we[(d+1)%5+5*u],S=we[(d+2)%5+5*u];_.high=b.high^~D.high&S.high,_.low=b.low^~D.low&S.low}const a=r[0],l=ao[o];a.high^=l.high,a.low^=l.low}}_doFinalize(){const e=this._data,n=e.words,r=e.sigBytes*8,s=this.blockSize*32;n[r>>>5]|=1<<24-r%32,n[(Math.ceil((r+1)/s)*s>>>5)-1]|=128,e.sigBytes=n.length*4,this._process();const o=this._state,i=this.cfg.outputLength/8,c=i/8,a=[];for(let l=0;l<c;l+=1){const d=o[l];let u=d.high,m=d.low;u=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360,m=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,a.push(m),a.push(u)}return new v(a,i)}clone(){const e=super.clone.call(this);e._state=this._state.slice(0);const n=e._state;for(let r=0;r<25;r+=1)n[r]=n[r].clone();return e}}const lu=U._createHelper(Ln),du=U._createHmacHelper(Ln);const uu=v.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),xu=v.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),fu=v.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),pu=v.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),hu=v.create([0,1518500249,1859775393,2400959708,2840853838]),mu=v.create([1352829926,1548603684,1836072691,2053994217,0]),lo=(t,e,n)=>t^e^n,uo=(t,e,n)=>t&e|~t&n,xo=(t,e,n)=>(t|~e)^n,fo=(t,e,n)=>t&n|e&~n,po=(t,e,n)=>t^(e|~n),R0=(t,e)=>t<<e|t>>>32-e;class Un extends U{_doReset(){this._hash=v.create([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(e,n){const r=e;for(let p=0;p<16;p+=1){const h=n+p,E=r[h];r[h]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}const s=this._hash.words,o=hu.words,i=mu.words,c=uu.words,a=xu.words,l=fu.words,d=pu.words;let u=s[0],m=s[1],_=s[2],b=s[3],D=s[4],S=s[0],f=s[1],g=s[2],C=s[3],A=s[4],x;for(let p=0;p<80;p+=1)x=u+r[n+c[p]]|0,p<16?x+=lo(m,_,b)+o[0]:p<32?x+=uo(m,_,b)+o[1]:p<48?x+=xo(m,_,b)+o[2]:p<64?x+=fo(m,_,b)+o[3]:x+=po(m,_,b)+o[4],x|=0,x=R0(x,l[p]),x=x+D|0,u=D,D=b,b=R0(_,10),_=m,m=x,x=S+r[n+a[p]]|0,p<16?x+=po(f,g,C)+i[0]:p<32?x+=fo(f,g,C)+i[1]:p<48?x+=xo(f,g,C)+i[2]:p<64?x+=uo(f,g,C)+i[3]:x+=lo(f,g,C)+i[4],x|=0,x=R0(x,d[p]),x=x+A|0,S=A,A=C,C=R0(g,10),g=f,f=x;x=s[1]+_+C|0,s[1]=s[2]+b+A|0,s[2]=s[3]+D+S|0,s[3]=s[4]+u+f|0,s[4]=s[0]+m+g|0,s[0]=x}_doFinalize(){const e=this._data,n=e.words,r=this._nDataBytes*8,s=e.sigBytes*8;n[s>>>5]|=128<<24-s%32,n[(s+64>>>9<<4)+14]=(r<<8|r>>>24)&16711935|(r<<24|r>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();const o=this._hash,i=o.words;for(let c=0;c<5;c+=1){const a=i[c];i[c]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}return o}clone(){const e=super.clone.call(this);return e._hash=this._hash.clone(),e}}const Eu=U._createHelper(Un),gu=U._createHmacHelper(Un);class ho extends N{constructor(e){super(),this.cfg=Object.assign(new N,{keySize:128/32,hasher:ct,iterations:25e4},e)}compute(e,n){const{cfg:r}=this,s=In.create(r.hasher,e),o=v.create(),i=v.create([1]),c=o.words,a=i.words,{keySize:l,iterations:d}=r;for(;c.length<l;){const u=s.update(n).finalize(i);s.reset();const m=u.words,_=m.length;let b=u;for(let D=1;D<d;D+=1){b=s.finalize(b),s.reset();const S=b.words;for(let f=0;f<_;f+=1)m[f]^=S[f]}o.concat(u),a[0]+=1}return o.sigBytes=l*4,o}}const _u=(t,e,n)=>ho.create(n).compute(t,e),re=[],mo=[],Eo=[],go=[],_o=[],yo=[],Hn=[],$n=[],jn=[],zn=[],pe=[];for(let t=0;t<256;t+=1)t<128?pe[t]=t<<1:pe[t]=t<<1^283;let he=0,ve=0;for(let t=0;t<256;t+=1){let e=ve^ve<<1^ve<<2^ve<<3^ve<<4;e=e>>>8^e&255^99,re[he]=e,mo[e]=he;const n=pe[he],r=pe[n],s=pe[r];let o=pe[e]*257^e*16843008;Eo[he]=o<<24|o>>>8,go[he]=o<<16|o>>>16,_o[he]=o<<8|o>>>24,yo[he]=o,o=s*16843009^r*65537^n*257^he*16843008,Hn[e]=o<<24|o>>>8,$n[e]=o<<16|o>>>16,jn[e]=o<<8|o>>>24,zn[e]=o,he?(he=n^pe[pe[pe[s^n]]],ve^=pe[pe[ve]]):(ve=1,he=ve)}const yu=[0,1,2,4,8,16,32,64,128,27,54];class Wn extends Fe{_doReset(){let e;if(this._nRounds&&this._keyPriorReset===this._key)return;this._keyPriorReset=this._key;const n=this._keyPriorReset,r=n.words,s=n.sigBytes/4;this._nRounds=s+6;const i=(this._nRounds+1)*4;this._keySchedule=[];const c=this._keySchedule;for(let l=0;l<i;l+=1)l<s?c[l]=r[l]:(e=c[l-1],l%s?s>6&&l%s===4&&(e=re[e>>>24]<<24|re[e>>>16&255]<<16|re[e>>>8&255]<<8|re[e&255]):(e=e<<8|e>>>24,e=re[e>>>24]<<24|re[e>>>16&255]<<16|re[e>>>8&255]<<8|re[e&255],e^=yu[l/s|0]<<24),c[l]=c[l-s]^e);this._invKeySchedule=[];const a=this._invKeySchedule;for(let l=0;l<i;l+=1){const d=i-l;l%4?e=c[d]:e=c[d-4],l<4||d<=4?a[l]=e:a[l]=Hn[re[e>>>24]]^$n[re[e>>>16&255]]^jn[re[e>>>8&255]]^zn[re[e&255]]}}encryptBlock(e,n){this._doCryptBlock(e,n,this._keySchedule,Eo,go,_o,yo,re)}decryptBlock(e,n){const r=e;let s=r[n+1];r[n+1]=r[n+3],r[n+3]=s,this._doCryptBlock(r,n,this._invKeySchedule,Hn,$n,jn,zn,mo),s=r[n+1],r[n+1]=r[n+3],r[n+3]=s}_doCryptBlock(e,n,r,s,o,i,c,a){const l=e,d=this._nRounds;let u=l[n]^r[0],m=l[n+1]^r[1],_=l[n+2]^r[2],b=l[n+3]^r[3],D=4;for(let A=1;A<d;A+=1){const x=s[u>>>24]^o[m>>>16&255]^i[_>>>8&255]^c[b&255]^r[D];D+=1;const p=s[m>>>24]^o[_>>>16&255]^i[b>>>8&255]^c[u&255]^r[D];D+=1;const h=s[_>>>24]^o[b>>>16&255]^i[u>>>8&255]^c[m&255]^r[D];D+=1;const E=s[b>>>24]^o[u>>>16&255]^i[m>>>8&255]^c[_&255]^r[D];D+=1,u=x,m=p,_=h,b=E}const S=(a[u>>>24]<<24|a[m>>>16&255]<<16|a[_>>>8&255]<<8|a[b&255])^r[D];D+=1;const f=(a[m>>>24]<<24|a[_>>>16&255]<<16|a[b>>>8&255]<<8|a[u&255])^r[D];D+=1;const g=(a[_>>>24]<<24|a[b>>>16&255]<<16|a[u>>>8&255]<<8|a[m&255])^r[D];D+=1;const C=(a[b>>>24]<<24|a[u>>>16&255]<<16|a[m>>>8&255]<<8|a[_&255])^r[D];D+=1,l[n]=S,l[n+1]=f,l[n+2]=g,l[n+3]=C}}Wn.keySize=256/32;const Cu=Fe._createHelper(Wn),Au=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],Co=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],bu=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],Du=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],Bu=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679];function Bt(t,e){const n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function O0(t,e){const n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}class at extends Fe{constructor(e,n,r){super(e,n,r),this.blockSize=64/32}_doReset(){const n=this._key.words,r=[];for(let i=0;i<56;i+=1){const c=Au[i]-1;r[i]=n[c>>>5]>>>31-c%32&1}this._subKeys=[];const s=this._subKeys;for(let i=0;i<16;i+=1){s[i]=[];const c=s[i],a=bu[i];for(let l=0;l<24;l+=1)c[l/6|0]|=r[(Co[l]-1+a)%28]<<31-l%6,c[4+(l/6|0)]|=r[28+(Co[l+24]-1+a)%28]<<31-l%6;c[0]=c[0]<<1|c[0]>>>31;for(let l=1;l<7;l+=1)c[l]>>>=(l-1)*4+3;c[7]=c[7]<<5|c[7]>>>27}this._invSubKeys=[];const o=this._invSubKeys;for(let i=0;i<16;i+=1)o[i]=s[15-i]}encryptBlock(e,n){this._doCryptBlock(e,n,this._subKeys)}decryptBlock(e,n){this._doCryptBlock(e,n,this._invSubKeys)}_doCryptBlock(e,n,r){const s=e;this._lBlock=e[n],this._rBlock=e[n+1],Bt.call(this,4,252645135),Bt.call(this,16,65535),O0.call(this,2,858993459),O0.call(this,8,16711935),Bt.call(this,1,1431655765);for(let i=0;i<16;i+=1){const c=r[i],a=this._lBlock,l=this._rBlock;let d=0;for(let u=0;u<8;u+=1)d|=Du[u][((l^c[u])&Bu[u])>>>0];this._lBlock=l,this._rBlock=a^d}const o=this._lBlock;this._lBlock=this._rBlock,this._rBlock=o,Bt.call(this,1,1431655765),O0.call(this,8,16711935),O0.call(this,2,858993459),Bt.call(this,16,65535),Bt.call(this,4,252645135),s[n]=this._lBlock,s[n+1]=this._rBlock}}at.keySize=64/32,at.ivSize=64/32;const Su=Fe._createHelper(at);class N0 extends Fe{_doReset(){const n=this._key.words;if(n.length!==2&&n.length!==4&&n.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");const r=n.slice(0,2),s=n.length<4?n.slice(0,2):n.slice(2,4),o=n.length<6?n.slice(0,2):n.slice(4,6);this._des1=at.createEncryptor(v.create(r)),this._des2=at.createEncryptor(v.create(s)),this._des3=at.createEncryptor(v.create(o))}encryptBlock(e,n){this._des1.encryptBlock(e,n),this._des2.decryptBlock(e,n),this._des3.encryptBlock(e,n)}decryptBlock(e,n){this._des3.decryptBlock(e,n),this._des2.encryptBlock(e,n),this._des1.decryptBlock(e,n)}}N0.keySize=192/32,N0.ivSize=64/32;const Fu=Fe._createHelper(N0),ge=[],Ie=[],I=[];function Gn(){const t=this._X,e=this._C;for(let n=0;n<8;n+=1)Ie[n]=e[n];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<Ie[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<Ie[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<Ie[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<Ie[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<Ie[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<Ie[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<Ie[6]>>>0?1:0)|0,this._b=e[7]>>>0<Ie[7]>>>0?1:0;for(let n=0;n<8;n+=1){const r=t[n]+e[n],s=r&65535,o=r>>>16,i=((s*s>>>17)+s*o>>>15)+o*o,c=((r&4294901760)*r|0)+((r&65535)*r|0);I[n]=i^c}t[0]=I[0]+(I[7]<<16|I[7]>>>16)+(I[6]<<16|I[6]>>>16)|0,t[1]=I[1]+(I[0]<<8|I[0]>>>24)+I[7]|0,t[2]=I[2]+(I[1]<<16|I[1]>>>16)+(I[0]<<16|I[0]>>>16)|0,t[3]=I[3]+(I[2]<<8|I[2]>>>24)+I[1]|0,t[4]=I[4]+(I[3]<<16|I[3]>>>16)+(I[2]<<16|I[2]>>>16)|0,t[5]=I[5]+(I[4]<<8|I[4]>>>24)+I[3]|0,t[6]=I[6]+(I[5]<<16|I[5]>>>16)+(I[4]<<16|I[4]>>>16)|0,t[7]=I[7]+(I[6]<<8|I[6]>>>24)+I[5]|0}class Ao extends Le{constructor(...e){super(...e),this.blockSize=128/32,this.ivSize=64/32}_doReset(){const e=this._key.words,{iv:n}=this.cfg;for(let o=0;o<4;o+=1)e[o]=(e[o]<<8|e[o]>>>24)&16711935|(e[o]<<24|e[o]>>>8)&4278255360;this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16];const r=this._X;this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];const s=this._C;this._b=0;for(let o=0;o<4;o+=1)Gn.call(this);for(let o=0;o<8;o+=1)s[o]^=r[o+4&7];if(n){const o=n.words,i=o[0],c=o[1],a=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,l=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,d=a>>>16|l&4294901760,u=l<<16|a&65535;s[0]^=a,s[1]^=d,s[2]^=l,s[3]^=u,s[4]^=a,s[5]^=d,s[6]^=l,s[7]^=u;for(let m=0;m<4;m+=1)Gn.call(this)}}_doProcessBlock(e,n){const r=e,s=this._X;Gn.call(this),ge[0]=s[0]^s[5]>>>16^s[3]<<16,ge[1]=s[2]^s[7]>>>16^s[5]<<16,ge[2]=s[4]^s[1]>>>16^s[7]<<16,ge[3]=s[6]^s[3]>>>16^s[1]<<16;for(let o=0;o<4;o+=1)ge[o]=(ge[o]<<8|ge[o]>>>24)&16711935|(ge[o]<<24|ge[o]>>>8)&4278255360,r[n+o]^=ge[o]}}const wu=Le._createHelper(Ao),_e=[],ke=[],k=[];function Vn(){const t=this._X,e=this._C;for(let n=0;n<8;n+=1)ke[n]=e[n];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<ke[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<ke[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<ke[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<ke[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<ke[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<ke[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<ke[6]>>>0?1:0)|0,this._b=e[7]>>>0<ke[7]>>>0?1:0;for(let n=0;n<8;n+=1){const r=t[n]+e[n],s=r&65535,o=r>>>16,i=((s*s>>>17)+s*o>>>15)+o*o,c=((r&4294901760)*r|0)+((r&65535)*r|0);k[n]=i^c}t[0]=k[0]+(k[7]<<16|k[7]>>>16)+(k[6]<<16|k[6]>>>16)|0,t[1]=k[1]+(k[0]<<8|k[0]>>>24)+k[7]|0,t[2]=k[2]+(k[1]<<16|k[1]>>>16)+(k[0]<<16|k[0]>>>16)|0,t[3]=k[3]+(k[2]<<8|k[2]>>>24)+k[1]|0,t[4]=k[4]+(k[3]<<16|k[3]>>>16)+(k[2]<<16|k[2]>>>16)|0,t[5]=k[5]+(k[4]<<8|k[4]>>>24)+k[3]|0,t[6]=k[6]+(k[5]<<16|k[5]>>>16)+(k[4]<<16|k[4]>>>16)|0,t[7]=k[7]+(k[6]<<8|k[6]>>>24)+k[5]|0}class bo extends Le{constructor(...e){super(...e),this.blockSize=128/32,this.ivSize=64/32}_doReset(){const e=this._key.words,{iv:n}=this.cfg;this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16];const r=this._X;this._C=[e[2]<<16|e[2]>>>16,e[0]&4294901760|e[1]&65535,e[3]<<16|e[3]>>>16,e[1]&4294901760|e[2]&65535,e[0]<<16|e[0]>>>16,e[2]&4294901760|e[3]&65535,e[1]<<16|e[1]>>>16,e[3]&4294901760|e[0]&65535];const s=this._C;this._b=0;for(let o=0;o<4;o+=1)Vn.call(this);for(let o=0;o<8;o+=1)s[o]^=r[o+4&7];if(n){const o=n.words,i=o[0],c=o[1],a=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,l=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,d=a>>>16|l&4294901760,u=l<<16|a&65535;s[0]^=a,s[1]^=d,s[2]^=l,s[3]^=u,s[4]^=a,s[5]^=d,s[6]^=l,s[7]^=u;for(let m=0;m<4;m+=1)Vn.call(this)}}_doProcessBlock(e,n){const r=e,s=this._X;Vn.call(this),_e[0]=s[0]^s[5]>>>16^s[3]<<16,_e[1]=s[2]^s[7]>>>16^s[5]<<16,_e[2]=s[4]^s[1]>>>16^s[7]<<16,_e[3]=s[6]^s[3]>>>16^s[1]<<16;for(let o=0;o<4;o+=1)_e[o]=(_e[o]<<8|_e[o]>>>24)&16711935|(_e[o]<<24|_e[o]>>>8)&4278255360,r[n+o]^=_e[o]}}const vu=Le._createHelper(bo);function Do(){const t=this._S;let e=this._i,n=this._j,r=0;for(let s=0;s<4;s+=1){e=(e+1)%256,n=(n+t[e])%256;const o=t[e];t[e]=t[n],t[n]=o,r|=t[(t[e]+t[n])%256]<<24-s*8}return this._i=e,this._j=n,r}class Vt extends Le{_doReset(){const e=this._key,n=e.words,r=e.sigBytes;this._S=[];const s=this._S;for(let o=0;o<256;o+=1)s[o]=o;for(let o=0,i=0;o<256;o+=1){const c=o%r,a=n[c>>>2]>>>24-c%4*8&255;i=(i+s[o]+a)%256;const l=s[o];s[o]=s[i],s[i]=l}this._j=0,this._i=this._j}_doProcessBlock(e,n){const r=e;r[n]^=Do.call(this)}}Vt.keySize=256/32,Vt.ivSize=0;const Iu=Le._createHelper(Vt);class Bo extends Vt{constructor(...e){super(...e),Object.assign(this.cfg,{drop:192})}_doReset(){super._doReset.call(this);for(let e=this.cfg.drop;e>0;e-=1)Do.call(this)}}const ku=Le._createHelper(Bo),St=16,Tu=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],Ru=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],Kn={pbox:[],sbox:[]};function So(t,e){const n=e>>24&255,r=e>>16&255,s=e>>8&255,o=e&255;let i=t.sbox[0][n]+t.sbox[1][r];return i=i^t.sbox[2][s],i=i+t.sbox[3][o],i}function qn(t,e,n){let r=e,s=n,o;for(let i=0;i<St;++i)r=r^t.pbox[i],s=So(t,r)^s,o=r,r=s,s=o;return o=r,r=s,s=o,s=s^t.pbox[St],r=r^t.pbox[St+1],{left:r,right:s}}function Ou(t,e,n){let r=e,s=n,o;for(let i=St+1;i>1;--i)r=r^t.pbox[i],s=So(t,r)^s,o=r,r=s,s=o;return o=r,r=s,s=o,s=s^t.pbox[1],r=r^t.pbox[0],{left:r,right:s}}function Nu(t,e,n){for(let c=0;c<4;c++){t.sbox[c]=[];for(let a=0;a<256;a++)t.sbox[c][a]=Ru[c][a]}let r=0;for(let c=0;c<St+2;c++)t.pbox[c]=Tu[c]^e[r],r++,r>=n&&(r=0);let s=0,o=0,i=0;for(let c=0;c<St+2;c+=2)i=qn(t,s,o),s=i.left,o=i.right,t.pbox[c]=s,t.pbox[c+1]=o;for(let c=0;c<4;c++)for(let a=0;a<256;a+=2)i=qn(t,s,o),s=i.left,o=i.right,t.sbox[c][a]=s,t.sbox[c][a+1]=o;return!0}class P0 extends Fe{constructor(e,n,r){super(e,n,r),this.blockSize=64/32}_doReset(){if(this._keyPriorReset===this._key)return;const e=this._keyPriorReset=this._key,n=e.words,r=e.sigBytes/4;Nu(Kn,n,r)}encryptBlock(e,n){const r=qn(Kn,e[n],e[n+1]);e[n]=r.left,e[n+1]=r.right}decryptBlock(e,n){const r=Ou(Kn,e[n],e[n+1]);e[n]=r.left,e[n+1]=r.right}}P0.keySize=128/32,P0.ivSize=64/32;const Pu=Fe._createHelper(P0);function Fo(t,e,n,r){const s=t;let o;const i=this._iv;i?(o=i.slice(0),this._iv=void 0):o=this._prevBlock,r.encryptBlock(o,0);for(let c=0;c<n;c+=1)s[e+c]^=o[c]}class Kt extends rt{}Kt.Encryptor=class extends Kt{processBlock(t,e){const n=this._cipher,{blockSize:r}=n;Fo.call(this,t,e,r,n),this._prevBlock=t.slice(e,e+r)}},Kt.Decryptor=class extends Kt{processBlock(t,e){const n=this._cipher,{blockSize:r}=n,s=t.slice(e,e+r);Fo.call(this,t,e,r,n),this._prevBlock=s}};class qt extends rt{}qt.Encryptor=class extends qt{processBlock(t,e){const n=t,r=this._cipher,{blockSize:s}=r,o=this._iv;let i=this._counter;o&&(this._counter=o.slice(0),i=this._counter,this._iv=void 0);const c=i.slice(0);r.encryptBlock(c,0),i[s-1]=i[s-1]+1|0;for(let a=0;a<s;a+=1)n[e+a]^=c[a]}},qt.Decryptor=qt.Encryptor;const wo=t=>{let e=t;if((t>>24&255)===255){let n=t>>16&255,r=t>>8&255,s=t&255;n===255?(n=0,r===255?(r=0,s===255?s=0:s+=1):r+=1):n+=1,e=0,e+=n<<16,e+=r<<8,e+=s}else e+=1<<24;return e},Mu=t=>{const e=t;return e[0]=wo(e[0]),e[0]===0&&(e[1]=wo(e[1])),e};class Xt extends rt{}Xt.Encryptor=class extends Xt{processBlock(t,e){const n=t,r=this._cipher,{blockSize:s}=r,o=this._iv;let i=this._counter;o&&(this._counter=o.slice(0),i=this._counter,this._iv=void 0),Mu(i);const c=i.slice(0);r.encryptBlock(c,0);for(let a=0;a<s;a+=1)n[e+a]^=c[a]}},Xt.Decryptor=Xt.Encryptor;class Yt extends rt{}Yt.Encryptor=class extends Yt{processBlock(t,e){this._cipher.encryptBlock(t,e)}},Yt.Decryptor=class extends Yt{processBlock(t,e){this._cipher.decryptBlock(t,e)}};class Jt extends rt{}Jt.Encryptor=class extends Jt{processBlock(t,e){const n=t,r=this._cipher,{blockSize:s}=r,o=this._iv;let i=this._keystream;o&&(this._keystream=o.slice(0),i=this._keystream,this._iv=void 0),r.encryptBlock(i,0);for(let c=0;c<s;c+=1)n[e+c]^=i[c]}},Jt.Decryptor=Jt.Encryptor;const Lu={pad(t,e){const n=t,r=n.sigBytes,s=e*4,o=s-r%s,i=r+o-1;n.clamp(),n.words[i>>>2]|=o<<24-i%4*8,n.sigBytes+=o},unpad(t){const e=t,n=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=n}},Uu={pad(t,e){const n=e*4,r=n-t.sigBytes%n;t.concat(v.random(r-1)).concat(v.create([r<<24],1))},unpad(t){const e=t,n=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=n}},Xn={pad(t,e){const n=t,r=e*4;n.clamp(),n.sigBytes+=r-(t.sigBytes%r||r)},unpad(t){const e=t,n=e.words;for(let r=e.sigBytes-1;r>=0;r-=1)if(n[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},Hu={lib:{Base:N,WordArray:v,BufferedBlockAlgorithm:vn,Hasher:U,Cipher:nt,StreamCipher:Le,BlockCipherMode:rt,BlockCipher:Fe,CipherParams:zt,SerializableCipher:st,PasswordBasedCipher:Rn},x64:{Word:y,WordArray:kn},enc:{Hex:w0,Latin1:Fn,Utf8:wn,Utf16:qd,Utf16BE:no,Utf16LE:Xd,Base64:Tn,Base64url:Yd},algo:{HMAC:In,MD5:v0,SHA1:On,SHA224:Nn,SHA256:ct,SHA384:Pn,SHA512:Dt,SHA3:Ln,RIPEMD160:Un,PBKDF2:ho,EvpKDF:I0,AES:Wn,DES:at,TripleDES:N0,Rabbit:Ao,RabbitLegacy:bo,RC4:Vt,RC4Drop:Bo,Blowfish:P0},mode:{CBC:At,CFB:Kt,CTR:qt,CTRGladman:Xt,ECB:Yt,OFB:Jt},pad:{Pkcs7:Zs,AnsiX923:Lu,Iso10126:Uu,Iso97971:{pad(t,e){t.concat(v.create([2147483648],1)),Xn.pad(t,e)},unpad(t){const e=t;Xn.unpad(e),e.sigBytes-=1}},NoPadding:{pad(){},unpad(){}},ZeroPadding:Xn},format:{OpenSSL:Qs,Hex:{stringify(t){return t.ciphertext.toString(w0)},parse(t){const e=w0.parse(t);return zt.create({ciphertext:e})}}},kdf:{OpenSSL:eo},MD5:Gd,HmacMD5:Vd,SHA1:Jd,HmacSHA1:Zd,SHA224:nu,HmacSHA224:ru,SHA256:eu,HmacSHA256:tu,SHA384:cu,HmacSHA384:au,SHA512:ou,HmacSHA512:iu,SHA3:lu,HmacSHA3:du,RIPEMD160:Eu,HmacRIPEMD160:gu,PBKDF2:_u,EvpKDF:Kd,AES:Cu,DES:Su,TripleDES:Fu,Rabbit:wu,RabbitLegacy:vu,RC4:Iu,RC4Drop:ku,Blowfish:Pu};let Zt=null;function $u(t){Zt=t}function vo(){const t=new Uint32Array(2),e=globalThis.crypto.getRandomValues(t);return(e[0]*2**20+(e[1]>>>12))*2**-52}function ju(){let t=Date.now();return"xxxxxxx-xxxxxxxxxxxx-xxxxxx-xxxxxxx".replaceAll(/[xy]/g,e=>{const n=Math.trunc((t+vo()*16)%16);return t=Math.trunc(t/16),(e==="x"?n:n&3|8).toString(16)})}function zu(){const t=Date.now(),e=Zt?Hu.HmacSHA1("",Zt.applicationId).toString():"";return"xxxxxxx-xxxxxxxxxxxx-xxxxxx-xxxxxxx".replaceAll(/[xy]/g,(n,r)=>{if(r<t.toString().length||e===""){const s=Math.trunc((t+vo()*16)%16);return(n=="x"?s:s&3|8).toString(16)}return e.charAt(r)})}function Wu(){const t=sessionStorage.getItem("sessionId");if(t)return t;const e=zu();return sessionStorage.setItem("sessionId",e),e}async function Gu(){if(!Zt)throw new Error("CustomerVerificationSDK: auth state not initialised. Call sdk.init() first.");const{token:t,hmac:e}=Zt,n=new Date().toUTCString(),r=ju(),s=`x-aux-date: ${n}
|
|
74
|
+
x-mod-nonce: ${r}`,o=new TextEncoder,i=await globalThis.crypto.subtle.importKey("raw",o.encode(e),{name:"HMAC",hash:"SHA-1"},!1,["sign"]),c=await globalThis.crypto.subtle.sign("HMAC",i,o.encode(s)),a=btoa(Array.from(new Uint8Array(c),l=>String.fromCodePoint(l)).join("")).replaceAll("+","%2B").replaceAll("/","%2F").replaceAll("=","%3D");return{"x-aux-date":n,"x-mod-nonce":r,Authorization:`Signature keyId="${t}",algorithm="hmac-sha1",headers="x-aux-date x-mod-nonce",signature="${a}"`}}function Vu(t,e){return{version:t,init:e}}function Ku(t){typeof window>"u"||(window.ModulrCustomerVerificationSdk=t)}const Io="https://api.modulrfinance.com/api",qu="https://api-sandbox.modulrfinance.com/api-sandbox",Xu="https://api-dev.aws.modulrfinance.io/api-dev",Ft={baseUrl:Io},Yu={"x-mod-version":"1"},Ju=5e3,Zu=6e4,z="#111111",Ue="#FFFFFF",ko="#78808F",M0="#D8DFEB",Qu="#EFF1F5",ex="#008756",tx="#D91E18",He="4px",To="8px",Qt="0",Yn=`0 0 0 4px ${M0}`,nx={theme:{primaryColor:z,backgroundColor:Ue,textColor:z,borderRadius:He,iconColor:z,successColor:ex,errorColor:tx},componentOverride:{PrimaryButton:{default:{backgroundColor:z,textColor:Ue,borderRadius:He,border:z,boxShadow:Qt},hover:{backgroundColor:ko,textColor:Ue,borderRadius:He,border:ko,boxShadow:Qt},focus:{backgroundColor:z,textColor:Ue,borderRadius:He,border:z,boxShadow:Yn}},ExitButton:{default:{backgroundColor:Ue,textColor:z,borderRadius:He,border:z,boxShadow:Qt},hover:{backgroundColor:M0,textColor:z,borderRadius:He,border:`2px solid ${z}`,boxShadow:Yn},focus:{backgroundColor:Ue,textColor:z,borderRadius:He,border:z,boxShadow:Yn}},Header:{default:{backgroundColor:Ue,textColor:z,border:"none",boxShadow:Qt,borderRadius:To}},HelpBanner:{default:{backgroundColor:Qu,textColor:z,border:M0,boxShadow:"0 4px 6px 0 rgba(17, 17, 17, 0.1)",borderRadius:To,iconColor:z}},PhoneInput:{default:{backgroundColor:Ue,textColor:z,border:M0,boxShadow:Qt,borderRadius:He}}}},rx=async(t,e)=>{if(!t.url.startsWith(Ft.baseUrl))return e(t);const n=await Gu();return e({...t,init:{...t.init,headers:{...t.init.headers,...n}}})},sx=(t,e)=>{if(!t.url.startsWith(Ft.baseUrl))return e(t);const n=t.init?.method?.toUpperCase()??"GET",r=t.init?.body!=null;return e({...t,init:{...t.init,headers:{Accept:"application/json",...Yu,"x-mod-session":Wu(),...r||n!=="GET"?{"Content-Type":"application/json"}:{},...t.init?.headers}}})};function ox(t){return(e,n={})=>t.reduceRight((s,o)=>i=>o(i,s),s=>fetch(s.url,s.init))({url:e,init:n})}const ix=ox([sx,rx,async(t,e)=>{const n=await e(t);if(!n.ok){const r=await n.json().catch(()=>({}));throw Object.assign(new Error(`HTTP ${n.status}`),{status:n.status,error:r??{}})}return n}]),Jn="mod-cvsdk-spinner",cx=50,ax=5,lx=20,dx=180,ux=150;function xx(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}class fx extends HTMLElement{static observedAttributes=["size","stroke-width","text"];shadow;constructor(){super(),this.shadow=this.attachShadow({mode:"open"})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}get size(){const e=Number(this.getAttribute("size"));return e>0?e:cx}get strokeWidth(){const e=Number(this.getAttribute("stroke-width"));return e>0?e:ax}get text(){return this.getAttribute("text")??""}render(){if(!this.isConnected)return;const{size:e,strokeWidth:n,text:r}=this,s=e/2-n,o=e/2,i=s/lx,c=Math.round(dx*i),a=Math.round(ux*i),l=r?`<div class="loader-text">${xx(r)}</div>`:"";this.shadow.innerHTML=`
|
|
75
|
+
<style>
|
|
76
|
+
:host {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
color: var(--cvs-spinner-color, #0f7ff2);
|
|
81
|
+
font-family: Arial, sans-serif;
|
|
82
|
+
}
|
|
83
|
+
.loader {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
}
|
|
89
|
+
.loader-text {
|
|
90
|
+
color: var(--cvs-text-color, #184966);
|
|
91
|
+
font-size: 24px;
|
|
92
|
+
font-weight: 700;
|
|
93
|
+
line-height: 32px;
|
|
94
|
+
margin-bottom: 40px;
|
|
95
|
+
text-align: center;
|
|
96
|
+
}
|
|
97
|
+
svg {
|
|
98
|
+
color: var(--cvs-spinner-color, #0f7ff2);
|
|
99
|
+
vertical-align: middle;
|
|
100
|
+
fill: currentColor;
|
|
101
|
+
animation: spin 0.75s linear infinite;
|
|
102
|
+
}
|
|
103
|
+
circle { fill: none; stroke: currentColor; }
|
|
104
|
+
.circle-1 { opacity: 0.4; }
|
|
105
|
+
.circle-2 {
|
|
106
|
+
stroke-dasharray: ${c};
|
|
107
|
+
stroke-dashoffset: ${a};
|
|
108
|
+
}
|
|
109
|
+
@keyframes spin { 100% { transform: rotate(360deg); } }
|
|
110
|
+
</style>
|
|
111
|
+
<div class="loader">
|
|
112
|
+
${l}
|
|
113
|
+
<svg height="${e}" width="${e}" class="default-spinner">
|
|
114
|
+
<circle class="circle-1" cx="${o}" cy="${o}" r="${s}" stroke-width="${n}"></circle>
|
|
115
|
+
<circle class="circle-2" cx="${o}" cy="${o}" r="${s}" stroke-width="${n}"></circle>
|
|
116
|
+
</svg>
|
|
117
|
+
</div>
|
|
118
|
+
`}}function px(){customElements.get(Jn)||customElements.define(Jn,fx)}var X=(t=>(t.NEW="NEW",t.IN_PROGRESS="IN_PROGRESS",t.PENDING_STEP_UP="PENDING_STEP_UP",t.SUBMITTED="SUBMITTED",t.APPROVED="APPROVED",t.DECLINED="DECLINED",t.MANUAL_REVIEW="MANUAL_REVIEW",t))(X||{}),ye=(t=>(t.NEW="NEW",t.IN_PROGRESS="IN_PROGRESS",t.PENDING_STEP_UP="PENDING_STEP_UP",t.SUBMITTED="SUBMITTED",t.APPROVED="APPROVED",t.DECLINED="DECLINED",t.MANUAL_REVIEW="MANUAL_REVIEW",t))(ye||{}),Te=(t=>(t.SUCCESS="SUCCESS",t.ERROR="ERROR",t.OPENED="OPENED",t.CLOSED="CLOSED",t))(Te||{});const hx="0.0.1",wt="CustomerVerificationSDK",J={INIT_SUCCESS:"CustomerVerificationSDK initialized successfully",INIT_FAILED:"Failed to initialize SDK",OPEN_SUCCESS:"Opening Onboarding verification form",OPEN_FORM_SUCCESS:"Opening onboarding form",CLOSE_SUCCESS:"SDK closed successfully",FORM_NEW:"The application is ready. Please provide the requested details to proceed.",FORM_IN_PROGRESS:"The application is in progress. Please complete and submit the required details to continue.",EVENT_NEW:"The application is ready. Please provide the requested details to proceed.",EVENT_IN_PROGRESS:"The application is in progress. Please complete and submit the required details to continue.",EVENT_PENDING_STEP_UP:"Additional information is required to complete this application. Please provide the requested details to proceed.",EVENT_SUBMITTED:"The application has been submitted and is being processed. No further action is required unless notified. The Customer Verification SDK will now close.",EVENT_APPROVED:"The application has been approved. No further action is required. The Customer Verification SDK will now close.",EVENT_DECLINED:"There has been a problem with this application, please reach out to your Modulr contact for details. No further action is required. The Customer Verification SDK will now close.",EVENT_MANUAL_REVIEW:"The application is under review. No further action is required unless notified. The Customer Verification SDK will now close."};px();const Zn="data-cvs-embedded-styles",mx="data-cvs-dummy-component",Ex="data-cvs-dummy-overlay",gx="data-cvs-spinner-overlay",_x="data-cvs-spinner-component";function lt(t){return{type:Te.ERROR,message:t instanceof Error?t.message:String(t)}}function yx(t){const e=`${Zn}-${t}`;if(document.getElementById(e))return;const n=document.createElement("style");n.id=e,n.setAttribute(Zn,t),n.textContent=`
|
|
119
|
+
#${t} #alloy,
|
|
120
|
+
#${t} .alloy-container {
|
|
121
|
+
display: flex;
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
`,document.head.appendChild(n)}function Ro(t){document.getElementById(`${Zn}-${t}`)?.remove()}function Cx(t){const e=document.createElement("div");return e.setAttribute(mx,"true"),e.setAttribute("role","status"),e.textContent=t,Object.assign(e.style,{alignItems:"center",background:"#ffffff",border:"1px solid #d9dee7",boxSizing:"border-box",color:"#172033",display:"flex",fontFamily:"Arial, sans-serif",fontSize:"16px",fontWeight:"600",justifyContent:"center",lineHeight:"24px",minHeight:"160px",padding:"24px",textAlign:"center",width:"100%"}),e}function Ax(t){const e=document.createElement("div");return e.setAttribute(Ex,"true"),Object.assign(e.style,{alignItems:"center",background:"rgba(23, 32, 51, 0.48)",bottom:"0",display:"flex",justifyContent:"center",left:"0",padding:"24px",position:"fixed",right:"0",top:"0",zIndex:"2147483647"}),Object.assign(t.style,{maxWidth:"420px",minHeight:"180px"}),e.appendChild(t),e}class bx{isReady=!1;formMessage;activeDummyRoot;activeSpinnerRoot;activeContainerId;activeOnClose;activeOnError;activeOnComplete;activeCloseCleanup;onAlloyComplete;hasOpenedAlloy=!1;markReady(e){this.isReady=!0,this.formMessage=void 0,this.onAlloyComplete=e?.onAlloyComplete,this.hasOpenedAlloy=!1}markReadyForForm(e){this.isReady=!0,this.formMessage=e,this.onAlloyComplete=void 0,this.hasOpenedAlloy=!1}setCloseCleanup(e){this.activeCloseCleanup?.(),this.activeCloseCleanup=e}runAndClearOnComplete(e,n){const r=this.activeOnComplete;this.activeOnComplete=void 0;try{r?.(e)}catch(s){n?.(lt(s))}}runAndClearCloseCleanup(){const e=this.activeCloseCleanup;this.activeCloseCleanup=void 0,e?.()}runAndClearOnClose(){const e=this.activeOnClose;this.activeOnClose=void 0,e?.()}showSpinner(e,n){this.removeSpinner();const r=document.createElement(Jn);if(r.setAttribute(_x,"true"),r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("size","64"),r.setAttribute("stroke-width","6"),n&&r.setAttribute("text",n),e){const o=document.getElementById(e);if(!o)return;Object.assign(r.style,{alignItems:"center",backgroundColor:"#ffffff",display:"flex",height:"100%",justifyContent:"center",minHeight:"220px",width:"100%"}),o.appendChild(r),this.activeSpinnerRoot=r;return}const s=document.createElement("div");s.setAttribute(gx,"true"),Object.assign(s.style,{alignItems:"center",backgroundColor:"#ffffff",bottom:"0",display:"flex",justifyContent:"center",left:"0",position:"fixed",right:"0",top:"0",zIndex:"2147483647"}),s.appendChild(r),document.body.appendChild(s),this.activeSpinnerRoot=s}removeSpinner(){this.activeSpinnerRoot?.remove(),this.activeSpinnerRoot=void 0}removeDummyComponent(){this.activeDummyRoot?.remove(),this.activeDummyRoot=void 0}showDummyComponent(e,n){this.removeDummyComponent();const r=Cx(e);if(n){const o=document.getElementById(n);if(!o)throw new Error(`${wt}: Container with id "${n}" was not found.`);o.appendChild(r),this.activeContainerId=n,this.activeDummyRoot=r;return}const s=Ax(r);document.body.appendChild(s),this.activeDummyRoot=s}closeInternally(e){try{this.hasOpenedAlloy&&jt.close()}catch(n){e?.(lt(n))}finally{this.runAndClearCloseCleanup(),this.hasOpenedAlloy=!1,this.removeDummyComponent(),this.removeSpinner(),this.runAndClearOnClose(),this.activeOnError=void 0,this.activeOnComplete=void 0,this.activeContainerId&&(Ro(this.activeContainerId),this.activeContainerId=void 0),this.isReady=!1,this.formMessage=void 0}}async open(e){if(!this.isReady){const n=new Error(`${wt}: SDK must be initialized before calling open(). Call init() and wait for the onEvent callback before calling open().`);throw e?.onError?.(lt(n)),n}this.activeOnClose=e?.onClose,this.activeOnError=e?.onError,this.activeOnComplete=e?.onComplete;try{if(this.formMessage){this.showDummyComponent(this.formMessage,e?.containerId),e?.onSuccess?.({type:Te.OPENED,message:J.OPEN_FORM_SUCCESS});return}const n=r=>{this.showSpinner(this.activeContainerId,e?.loadingText),this.onAlloyComplete?.(r)};e?.containerId?(this.activeContainerId=e.containerId,yx(e.containerId),jt.open(n,e.containerId)):jt.open(n),this.hasOpenedAlloy=!0,e?.onSuccess?.({type:Te.OPENED,message:J.OPEN_SUCCESS})}catch(n){throw this.activeOnClose=void 0,this.activeOnError=void 0,this.activeOnComplete=void 0,this.hasOpenedAlloy=!1,e?.onError?.(lt(n)),n}}close(e){if(!this.isReady){const n=new Error(`${wt}: SDK must be initialized before calling close(). Call init() and wait for the onEvent callback before calling close().`);throw e?.onError?.(lt(n)),n}try{this.hasOpenedAlloy&&jt.close(),e?.onSuccess?.({type:Te.CLOSED,message:J.CLOSE_SUCCESS})}catch(n){throw this.activeOnError?.(lt(n)),e?.onError?.(lt(n)),n}finally{this.runAndClearCloseCleanup(),this.hasOpenedAlloy=!1,this.removeDummyComponent(),this.removeSpinner(),this.runAndClearOnClose(),this.activeOnError=void 0,this.activeOnComplete=void 0,this.activeContainerId&&(Ro(this.activeContainerId),this.activeContainerId=void 0)}}}function e0(t){return typeof t!="string"||t.trim().length===0}function L0(t){return{type:Te.ERROR,message:t instanceof Error?t.message:String(t)}}function Dx(t){const e=[];if(e0(t.applicationId)&&e.push("applicationId"),e0(t.token)&&e.push("token"),e0(t.hmac)&&e.push("hmac"),e.length>0){const n=`${wt}: The following fields are required in the configuration: ${e.join(", ")}. Please provide valid values for all required fields when calling init.`;console.error(n);const r=new Error(n);throw t.onError?.(L0(r)),r}}async function Oo(t){return await(await ix(`${Ft.baseUrl}/applications/${t.applicationId}/status`)).json()}async function No(t){Dx(t),t.baseUrl?Ft.baseUrl=t.baseUrl:t.isDev?Ft.baseUrl=Xu:Ft.baseUrl=t.production===!1?qu:Io,$u({applicationId:t.applicationId,token:t.token,hmac:t.hmac});let e;try{e=await Oo(t)}catch(r){const s=r instanceof Error?r.message:String(r);throw t.onError?.({type:Te.ERROR,message:`${J.INIT_FAILED}: ${s}`}),r}t.onSuccess?.({type:Te.SUCCESS,message:J.INIT_SUCCESS});const n=new bx;return Fx(e,t,n),n}function Po(t,e,n){let r;switch(t.status){case X.SUBMITTED:r={type:ye.SUBMITTED,message:J.EVENT_SUBMITTED};break;case X.APPROVED:r={type:ye.APPROVED,message:J.EVENT_APPROVED};break;case X.DECLINED:r={type:ye.DECLINED,message:J.EVENT_DECLINED};break;case X.MANUAL_REVIEW:r={type:ye.MANUAL_REVIEW,message:J.EVENT_MANUAL_REVIEW};break;default:return!1}return e.onEvent?.(r),n.runAndClearOnComplete(r,s=>e.onError?.(s)),n.closeInternally(s=>e.onError?.(s)),!0}function Bx(t,e){const n={type:ye.MANUAL_REVIEW,message:J.EVENT_MANUAL_REVIEW};t.onEvent?.(n),e.runAndClearOnComplete(n,r=>t.onError?.(r)),e.closeInternally(r=>t.onError?.(r))}function Sx(t){return t===X.NEW||t===X.IN_PROGRESS||t===X.PENDING_STEP_UP}async function Fx(t,e,n){switch(t.status){case X.NEW:n.markReadyForForm(J.FORM_NEW),e.onEvent?.({type:ye.NEW,message:J.EVENT_NEW});break;case X.IN_PROGRESS:n.markReadyForForm(J.FORM_IN_PROGRESS),e.onEvent?.({type:ye.IN_PROGRESS,message:J.EVENT_IN_PROGRESS});break;case X.PENDING_STEP_UP:await vx(t,e,n);break;case X.SUBMITTED:case X.APPROVED:case X.DECLINED:case X.MANUAL_REVIEW:Po(t,e,n);break;default:e.onError?.(L0(new Error(`${wt}: Unknown application status: ${t.status}`)))}}function wx(t,e){let n=!1,r=!1;const s=setTimeout(()=>{n||(i(),Bx(t,e))},Zu),o=setInterval(()=>{c()},Ju),i=()=>{n||(n=!0,clearInterval(o),clearTimeout(s))};e.setCloseCleanup(i);async function c(){if(!(n||r)){r=!0;try{const a=await Oo(t);if(n)return;if(Po(a,t,e)){i();return}Sx(a.status)||(i(),t.onError?.(L0(new Error(`${wt}: Unknown application status: ${a.status}`))))}catch{}finally{r=!1}}}}async function vx(t,e,n){const r=e.customStyle??nx,s={...e0(t.externalApplicationId)?{}:{journeyApplicationToken:t.externalApplicationId},...e0(t.externalWorkflowId)?{}:{journeyToken:t.externalWorkflowId},key:t.externalWorkflowSdkId};try{await jt.init({...zd,...s,customStyle:r});let o=!1;n.markReady({onAlloyComplete:()=>{o||(o=!0,wx(e,n))}}),e.onEvent?.({type:ye.PENDING_STEP_UP,message:J.EVENT_PENDING_STEP_UP})}catch(o){e.onError?.(L0(o))}}const Mo=Vu(hx,No);Ku(Mo),xt.ApplicationStatus=X,xt.ModulrCustomerVerificationSdk=Mo,xt.SdkEventType=ye,xt.SdkResultType=Te,xt.init=No,Object.defineProperty(xt,Symbol.toStringTag,{value:"Module"})})(this.ModulrCustomerVerificationSdk=this.ModulrCustomerVerificationSdk||{});
|
|
127
|
+
//# sourceMappingURL=modulr-customer-verification-sdk.js.map
|
package/index.d.ts
ADDED