@stitch-money/client 3.8.1 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -42,7 +42,7 @@ interface SamsungPayPaymentResult {
42
42
  status: 'CHARGED' | 'REJECTED' | 'CANCELED' | 'ERRED';
43
43
  provider?: string;
44
44
  }
45
- type SamsungPayAllowedBrands = 'visa' | 'mastercard';
45
+ type SamsungPayAllowedBrands = 'visa' | 'mastercard' | 'amex';
46
46
  interface SamsungPayPaymentCredential {
47
47
  card_brand: string;
48
48
  card_last4digit: string;
package/build/index.js CHANGED
@@ -1,15 +1,27 @@
1
1
  "use client"
2
- var ft=Object.create;var Y=Object.defineProperty,pt=Object.defineProperties,dt=Object.getOwnPropertyDescriptor,yt=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols,mt=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var J=(e,t,r)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))q.call(t,r)&&J(e,r,t[r]);if(L)for(var r of L(t))de.call(t,r)&&J(e,r,t[r]);return e},ye=(e,t)=>pt(e,yt(t));var ge=(e,t)=>{var r={};for(var n in e)q.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&L)for(var n of L(e))t.indexOf(n)<0&&de.call(e,n)&&(r[n]=e[n]);return r};var ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Rt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gt(t))!q.call(e,i)&&i!==r&&Y(e,i,{get:()=>t[i],enumerable:!(n=dt(t,i))||n.enumerable});return e};var bt=(e,t,r)=>(r=e!=null?ft(mt(e)):{},Rt(t||!e||!e.__esModule?Y(r,"default",{value:e,enumerable:!0}):r,e));var E=(e,t,r)=>(J(e,typeof t!="symbol"?t+"":t,r),r);var m=(e,t,r)=>new Promise((n,i)=>{var s=a=>{try{u(r.next(a))}catch(c){i(c)}},o=a=>{try{u(r.throw(a))}catch(c){i(c)}},u=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,o);u((r=r.apply(e,t)).next())});var Te=ht((vr,Ae)=>{"use strict";var Q=class e extends Error{constructor(t){super(e._prepareSuperMessage(t)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,e)}static _prepareSuperMessage(t){try{return JSON.stringify(t)}catch(r){return String(t)}}},At=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],ee=Symbol(".toJSON called"),Tt=e=>{e[ee]=!0;let t=e.toJSON();return delete e[ee],t},te=({from:e,seen:t,to_:r,forceEnumerable:n,maxDepth:i,depth:s})=>{let o=r||(Array.isArray(e)?[]:{});if(t.push(e),s>=i)return o;if(typeof e.toJSON=="function"&&e[ee]!==!0)return Tt(e);for(let[u,a]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(a)){o[u]="[object Buffer]";continue}if(typeof a!="function"){if(!a||typeof a!="object"){o[u]=a;continue}if(!t.includes(e[u])){s++,o[u]=te({from:e[u],seen:t.slice(),forceEnumerable:n,maxDepth:i,depth:s});continue}o[u]="[Circular]"}}for(let{property:u,enumerable:a}of At)typeof e[u]=="string"&&Object.defineProperty(o,u,{value:e[u],enumerable:n?!0:a,configurable:!0,writable:!0});return o},Ct=(e,t={})=>{let{maxDepth:r=Number.POSITIVE_INFINITY}=t;return typeof e=="object"&&e!==null?te({from:e,seen:[],forceEnumerable:!0,maxDepth:r,depth:0}):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:e},xt=(e,t={})=>{let{maxDepth:r=Number.POSITIVE_INFINITY}=t;if(e instanceof Error)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let n=new Error;return te({from:e,seen:[],to_:n,maxDepth:r,depth:0}),n}return new Q(e)};Ae.exports={serializeError:Ct,deserializeError:xt}});var me=(n=>(n.ApplePay="APPLE_PAY",n.SamsungPay="SAMSUNG_PAY",n.GooglePay="GOOGLE_PAY",n))(me||{});var D=function(){return D=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},D.apply(this,arguments)};function he(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Re(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}function St(e,t){return function(r,n){return Object.prototype.hasOwnProperty.call(r,n)}(e,t)?e[t]:void 0}function Et(e,t,r,n){var i,s=document,o="securitypolicyviolation",u=function(c){var l=new URL(e,location.href),f=c.blockedURI;f!==l.href&&f!==l.protocol.slice(0,-1)&&f!==l.origin||(i=c,a())};s.addEventListener(o,u);var a=function(){return s.removeEventListener(o,u)};return n==null||n.then(a,a),Promise.resolve().then(t).then(function(c){return a(),c},function(c){return new Promise(function(l){var f=new MessageChannel;f.port1.onmessage=function(){return l()},f.port2.postMessage(null)}).then(function(){if(a(),i)return r(i);throw c})})}var be={default:"endpoint"};var Se="Blocked by CSP",Ee="The endpoint parameter is not a valid URL";var Pt="API key required";var _t="3.11.4",H="Failed to load the JS script of the agent",W="9319";function vt(e,t){var r,n,i,s,o,u,a,c=[],l=(r=function(d){var g=Re([],d,!0);return{current:function(){return g[0]},postpone:function(){var h=g.shift();h!==void 0&&g.push(h)},exclude:function(){g.shift()}}}(e),s=100,o=3e3,u=0,n=function(){return Math.random()*Math.min(o,s*Math.pow(2,u++))},i=new Set,[r.current(),function(d,g){var h,b=g instanceof Error?g.message:"";if(b===Se||b===Ee)r.exclude(),h=0;else if(b===W)r.exclude();else if(b===H){var A=Date.now()-d.getTime()<50,w=r.current();w&&A&&!i.has(w)&&(i.add(w),h=0),r.postpone()}else r.postpone();var N=r.current();return N===void 0?void 0:[N,h!=null?h:d.getTime()+n()-Date.now()]}]),f=l[0],p=l[1];if(f===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var y=function(d){var g=new Date,h=function(A){return c.push({url:d,startedAt:g,finishedAt:new Date,error:A})},b=t(d);return b.then(function(){return h()},h),b.catch(function(A){if(a!=null||(a=A),c.length>=5)throw a;var w=p(g,A);if(!w)throw a;var N,ut=w[0],ct=w[1];return(N=ct,new Promise(function(lt){return setTimeout(lt,N)})).then(function(){return y(ut)})})};return y(f).then(function(d){return[d,c]})}var Pe="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",_e=Pe;function ve(e){var t;e.scriptUrlPattern;var r=e.token,n=e.apiKey,i=n===void 0?r:n,s=he(e,["scriptUrlPattern","token","apiKey"]),o=(t=St(e,"scriptUrlPattern"))!==null&&t!==void 0?t:Pe,u=function(){var l=[],f=function(){l.push({time:new Date,state:document.visibilityState})},p=function(y,d,g,h){return y.addEventListener(d,g,h),function(){return y.removeEventListener(d,g,h)}}(document,"visibilitychange",f);return f(),[l,p]}(),a=u[0],c=u[1];return Promise.resolve().then(function(){if(!i||typeof i!="string")throw new Error(Pt);var l=function(f,p){return(Array.isArray(f)?f:[f]).map(function(y){return function(d,g){var h=encodeURIComponent;return d.replace(/<[^<>]+>/g,function(b){return b==="<version>"?"3":b==="<apiKey>"?h(g):b==="<loaderVersion>"?h(_t):b})}(String(y),p)})}(o,i);return vt(l,wt)}).catch(function(l){throw c(),function(f){return f instanceof Error&&f.message===W?new Error(H):f}(l)}).then(function(l){var f=l[0],p=l[1];return c(),f.load(D(D({},s),{ldi:{attempts:p,visibilityStates:a}}))})}function wt(e){return Et(e,function(){return function(t){return new Promise(function(r,n){if(function(u){if(URL.prototype)try{return new URL(u,location.href),!1}catch(a){if(a instanceof Error&&a.name==="TypeError")return!0;throw a}}(t))throw new Error(Ee);var i=document.createElement("script"),s=function(){var u;return(u=i.parentNode)===null||u===void 0?void 0:u.removeChild(i)},o=document.head||document.getElementsByTagName("head")[0];i.onload=function(){s(),r()},i.onerror=function(){s(),n(new Error(H))},i.async=!0,i.src=t,o.appendChild(i)})}(e)},function(){throw new Error(Se)}).then(Ot)}function Ot(){var e=window,t="__fpjs_p_l_b",r=e[t];if(function(n,i){var s,o=(s=Object.getOwnPropertyDescriptor)===null||s===void 0?void 0:s.call(Object,n,i);o!=null&&o.configurable?delete n[i]:o&&!o.writable||(n[i]=void 0)}(e,t),typeof(r==null?void 0:r.load)!="function")throw new Error(W);return r}var X,Z;function we(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r}function Oe(t){return m(this,arguments,function*({config:e}){return yield ve({apiKey:e.publicKey,endpoint:[e.endpoint,be],scriptUrlPattern:[e.scriptUrlPattern,_e],region:"eu"})})}function Ie(i){return m(this,arguments,function*({config:e,clientId:t,agent:r,payerId:n}){if((e==null?void 0:e.disabled)===!0){let o={disabled:!0,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:"",visitorId:""}};return btoa(JSON.stringify(o))}if((e==null?void 0:e.disabled)===!1&&(e!=null&&e.useEmulation)&&(t!=null&&t.startsWith("test"))){let o={disabled:!1,emulated:!0,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:`${Date.now()}.${we(6)}`,visitorId:we(20)}};return btoa(JSON.stringify(o))}if(r!==void 0&&(e==null?void 0:e.disabled)===!1){let o=Date.now();if(X!==void 0&&Z!==void 0&&o-Z<e.cacheDurationInSeconds*1e3)return btoa(JSON.stringify(X));try{let u=yield r.get({linkedId:t,tag:{payerId:n}}),a={disabled:!1,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:u.requestId,visitorId:u.visitorId}};return X=a,Z=o,btoa(JSON.stringify(a))}catch(u){let a={error:{outcome:"Failed",message:`Error: ${JSON.stringify(u)}`}};return btoa(JSON.stringify(a))}}return btoa(JSON.stringify({error:{outcome:"Failed",message:"Attempted to get fingerprint data but either runtime config or the agent are not present"}}))})}var Ce=bt(Te());function re(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Nt="https://analytics.stitch.money/query",ne={loggingUrl:Nt},G={};function ie(e={}){let n=e,{loggingUrl:t}=n,r=ge(n,["loggingUrl"]);typeof t=="string"&&t.length>0&&(ne.loggingUrl=t),G=_(_({sessionId:re()},G),r)}function xe(){var e,t,r;return((t=(e=window==null?void 0:window.location)==null?void 0:e.ancestorOrigins)==null?void 0:t.length)>0?Object.values((r=window==null?void 0:window.location)==null?void 0:r.ancestorOrigins).join(","):(document==null?void 0:document.referrer)||void 0}function oe(e,t){return m(this,null,function*(){try{yield fetch(ne.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_EVENT",event:{message:e,metadata:_(_({hostname:xe()},G),t)}})})}catch(r){try{yield S("[logEvent] Error logging event",r,t)}catch(n){}}})}function S(e,t,r){return m(this,null,function*(){try{yield fetch(ne.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_ERROR",error:{message:e,error:(0,Ce.serializeError)(t),metadata:_(_({hostname:xe()},G),r)}})})}catch(n){}})}function Dt(e){return typeof e=="number"}function Mt(e){return typeof e=="string"}function jt(e){return typeof e=="bigint"}function De(e){return!!e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function Me(e){return e!=null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}var je=new WeakSet;function M(e){return je.add(e),e}function ke(e,t){return M({type:"object",fields:e,text:t})}function kt(e,t){return M({type:"array",items:e,text:t})}function V(e,t){return M({type:"opaque",value:e,text:t})}function $t(e,t){return M({type:"scalar",value:e,text:t})}function $e(e,t){return t!==void 0?M(ye(_({},e),{text:t})):e}function Ue(e,t){let r=new Map([...e.fields,...t]);return ke(r,e.text)}function Fe(e){return je.has(e)}function Ut(e,t,r){r.add(e);let n=[];for(let i of e)n.push(ue(i,void 0,r));return kt(n,t)}function Le(e,t,r){r.add(e);let n=new Map;for(let i of Object.keys(e)){let s=e[i];n.set(i,ue(s,void 0,r))}return ke(n,t)}function ue(e,t,r){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e.getMonth=="function"?$t(e,t):Fe(e)?$e(e,t):Array.isArray(e)?r.has(e)?V("<circular ref>",t):Ut(e,t,r):Me(e)?r.has(e)?V("<circular ref>",t):Le(e,t,r):V(typeof e=="function"?"<function>":"???",t)}function O(e,t){return ue(e,t,new WeakSet)}function Ge(e,t){return Le(e,t,new WeakSet)}var I=" ";function ae(e){return e.indexOf(`
3
- `)>=0}function ce(e,t=I){return ae(e)?e.split(`
4
- `).map(r=>`${t}${r}`).join(`
5
- `):`${t}${e}`}var Ft=/'/g;function T(e){return typeof e=="string"?"'"+e.replace(Ft,"\\'")+"'":JSON.stringify(e)}function z(e,t=[]){let r=[];if(e.type==="array"){let s=e.items,o=0;for(let u of s)for(let a of z(u,[...t,o++]))r.push(a)}else if(e.type==="object"){let s=e.fields;for(let[o,u]of s)for(let a of z(u,[...t,o]))r.push(a)}let n=e.text;if(!n)return r;let i;return t.length===0?i="":t.length===1?i=typeof t[0]=="number"?`Value at index ${t[0]}: `:`Value at key ${T(t[0])}: `:i=`Value at keypath ${T(t.map(String).join("."))}: `,[...r,`${i}${n}`]}function Lt(e,t=80){let r=JSON.stringify(e);if(r.length<=t)return r;let n=`${e.substring(0,t-15)}...`;return r=`${JSON.stringify(n)} [truncated]`,r}function Gt(e,t){let{items:r}=e;if(r.length===0)return"[]";let n=[];for(let i of r){let[s,o]=le(i,`${t}${I}`);n.push(`${t}${I}${s},`),o!==void 0&&n.push(ce(o,`${t}${I}`))}return["[",...n,`${t}]`].join(`
6
- `)}function Vt(e,t){let{fields:r}=e;if(r.size===0)return"{}";let n=[];for(let[i,s]of r){let o=Ve(i),u=`${t}${I}${" ".repeat(o.length+2)}`,[a,c]=le(s,`${t}${I}`);n.push(`${t}${I}${o}: ${a},`),c!==void 0&&n.push(ce(c,u))}return["{",...n,`${t}}`].join(`
7
- `)}function Ve(e){return typeof e=="string"?Lt(e):typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"?e.toString():e===null?"null":e===void 0?"undefined":De(e)?`new Date(${T(e.toISOString())})`:e instanceof Date?"(Invalid Date)":"(unserializable)"}function le(e,t=""){let r;e.type==="array"?r=Gt(e,t):e.type==="object"?r=Vt(e,t):e.type==="scalar"?r=Ve(e.value):r=e.value;let n=e.text;if(n!==void 0){let i="^".repeat(ae(r)?1:r.length);return[r,[i,n].join(ae(n)?`
8
- `:" ")]}else return[r,void 0]}function zt(e){let[t,r]=le(e);return r!==void 0?`${t}
9
- ${r}`:t}function Kt(e){return z(e,[]).join(`
10
- `)}function ze(e){return{ok:!0,value:e,error:void 0}}function Ke(e){return{ok:!1,value:void 0,error:e}}function Bt(e){return t=>{try{let r=e(t);return ze(r)}catch(r){return Ke(O(t,r instanceof Error?r.message:String(r)))}}}function Jt(e,t){let r=t(e);if(typeof r=="string"){let n=new Error(`
11
- ${r}`);return n.name="Decoding error",n}else return r}function R(e){function t(l){return e(l,ze,f=>Ke(Fe(f)?f:O(l,f)))}function r(l,f=zt){let p=t(l);if(p.ok)return p.value;throw Jt(p.error,f)}function n(l){return t(l).value}function i(l){return o(Bt(l))}function s(l,f){return a(p=>l(p)?null:f)}function o(l){return R((f,p,y)=>{let d=t(f);if(!d.ok)return d;let g=Ne(l)?l:l(d.value,p,y);return Ne(g)?g.decode(d.value):g})}function u(l){return o(l)}function a(l){return o((f,p,y)=>{let d=l(f);return d===null?p(f):y(typeof d=="string"?O(f,d):d)})}function c(l){return R((f,p,y)=>{let d=t(f);return d.ok?d:y(O(d.error,l))})}return Yt({verify:r,value:n,decode:t,transform:i,refine:s,reject:a,describe:c,then:o,pipe:u})}var Be=new WeakSet;function Yt(e){return Be.add(e),e}function Ne(e){return Be.has(e)}var qt=R((e,t,r)=>Array.isArray(e)?t(e):r("Must be an array"));function Ht(e,t,r,n){let i=[];for(let s=0;s<e.length;++s){let o=e[s];if(o.ok)i.push(o.value);else{let u=o.error,a=t.slice();return a.splice(s,1,O(u,u.text?`${u.text} (at index ${s})`:`index ${s}`)),n(O(a))}}return r(i)}function Wt(e){let t=e.decode;return qt.then((r,n,i)=>{let s=r.map(t);return Ht(s,r,n,i)})}function Xt(e){return R((t,r,n)=>t instanceof e?r(t):n(`Must be ${e.name} instance`))}function Je(e){return R(t=>e().decode(t))}function Zt(e,t){let r=new Set;for(let n of e)t.has(n)||r.add(n);return r}var Ye=R((e,t,r)=>Me(e)?t(e):r("Must be an object"));function j(e){let t=new Set(Object.keys(e));return Ye.then((r,n,i)=>{let s=new Set(Object.keys(r)),o=Zt(t,s),u={},a=null;for(let c of Object.keys(e)){let l=e[c],f=r[c],p=l.decode(f);if(p.ok){let y=p.value;y!==void 0&&(u[c]=y),o.delete(c)}else{let y=p.error;f===void 0?o.add(c):(a===null&&(a=new Map),a.set(c,y))}}if(a||o.size>0){let c=Ge(r);if(a&&(c=Ue(c,a)),o.size>0){let l=Array.from(o).map(T).join(", "),f=o.size>1?"keys":"key";c=$e(c,`Missing ${f}: ${l}`)}return i(c)}return n(u)})}var se=`Either:
12
- `;function Qt(e){return`-${ce(e).substring(1)}`}function er(e){return e.startsWith(se)?e.substring(se.length):Qt(e)}function fe(...e){if(e.length===0)throw new Error("Pass at least one decoder to either()");return R((t,r,n)=>{let i=[];for(let o=0;o<e.length;o++){let u=e[o].decode(t);if(u.ok)return u;i.push(u.error)}let s=se+i.map(o=>er(z(o).join(`
2
+ var Xn=Object.create;var ue=Object.defineProperty,Kn=Object.defineProperties,qn=Object.getOwnPropertyDescriptor,Qn=Object.getOwnPropertyDescriptors,er=Object.getOwnPropertyNames,ce=Object.getOwnPropertySymbols,tr=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty,ct=Object.prototype.propertyIsEnumerable;var xe=(e,t,n)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t)=>{for(var n in t||(t={}))Oe.call(t,n)&&xe(e,n,t[n]);if(ce)for(var n of ce(t))ct.call(t,n)&&xe(e,n,t[n]);return e},ut=(e,t)=>Kn(e,Qn(t));var lt=(e,t)=>{var n={};for(var r in e)Oe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ce)for(var r of ce(e))t.indexOf(r)<0&&ct.call(e,r)&&(n[r]=e[r]);return n};var nr=(e,t)=>()=>(e&&(t=e(e=0)),t);var rr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),or=(e,t)=>{for(var n in t)ue(e,n,{get:t[n],enumerable:!0})},ir=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of er(t))!Oe.call(e,o)&&o!==n&&ue(e,o,{get:()=>t[o],enumerable:!(r=qn(t,o))||r.enumerable});return e};var ft=(e,t,n)=>(n=e!=null?Xn(tr(e)):{},ir(t||!e||!e.__esModule?ue(n,"default",{value:e,enumerable:!0}):n,e));var k=(e,t,n)=>(xe(e,typeof t!="symbol"?t+"":t,n),n);var h=(e,t,n)=>new Promise((r,o)=>{var s=l=>{try{c(n.next(l))}catch(f){o(f)}},a=l=>{try{c(n.throw(l))}catch(f){o(f)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});var Me=rr((ga,Et)=>{"use strict";var ke=class e extends Error{constructor(t){super(e._prepareSuperMessage(t)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,e)}static _prepareSuperMessage(t){try{return JSON.stringify(t)}catch(n){return String(t)}}},gr=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],Te=Symbol(".toJSON called"),yr=e=>{e[Te]=!0;let t=e.toJSON();return delete e[Te],t},Ne=({from:e,seen:t,to_:n,forceEnumerable:r,maxDepth:o,depth:s})=>{let a=n||(Array.isArray(e)?[]:{});if(t.push(e),s>=o)return a;if(typeof e.toJSON=="function"&&e[Te]!==!0)return yr(e);for(let[c,l]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(l)){a[c]="[object Buffer]";continue}if(typeof l!="function"){if(!l||typeof l!="object"){a[c]=l;continue}if(!t.includes(e[c])){s++,a[c]=Ne({from:e[c],seen:t.slice(),forceEnumerable:r,maxDepth:o,depth:s});continue}a[c]="[Circular]"}}for(let{property:c,enumerable:l}of gr)typeof e[c]=="string"&&Object.defineProperty(a,c,{value:e[c],enumerable:r?!0:l,configurable:!0,writable:!0});return a},hr=(e,t={})=>{let{maxDepth:n=Number.POSITIVE_INFINITY}=t;return typeof e=="object"&&e!==null?Ne({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0}):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:e},br=(e,t={})=>{let{maxDepth:n=Number.POSITIVE_INFINITY}=t;if(e instanceof Error)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let r=new Error;return Ne({from:e,seen:[],to_:r,maxDepth:n,depth:0}),r}return new ke(e)};Et.exports={serializeError:hr,deserializeError:br}});var dn={};or(dn,{componentsToDebugString:()=>Be,default:()=>vi,getFullscreenElement:()=>Xt,getUnstableAudioFingerprint:()=>qt,getUnstableCanvasFingerprint:()=>Qt,getUnstableHardwareConcurrency:()=>nn,getUnstableScreenFrame:()=>tn,getUnstableScreenResolution:()=>en,getWebGLContext:()=>ze,hashComponents:()=>Je,isAndroid:()=>be,isChromium:()=>H,isDesktopWebKit:()=>he,isEdgeHTML:()=>Bt,isGecko:()=>z,isSamsungInternet:()=>Kt,isTrident:()=>Ye,isWebKit:()=>C,load:()=>fn,loadSources:()=>zt,murmurX64Hash128:()=>Si,prepareForSources:()=>ln,sources:()=>un,transformSource:()=>Nr,withIframe:()=>He});function ge(e,t){return new Promise(n=>setTimeout(n,e,t))}function vr(){return new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Sr(e,t=1/0){let{requestIdleCallback:n}=window;return n?new Promise(r=>n.call(window,()=>r(),{timeout:t})):ge(Math.min(e,t))}function ye(e){return!!e&&typeof e.then=="function"}function Ct(e,t){try{let n=e();ye(n)?n.then(r=>t(!0,r),r=>t(!1,r)):t(!0,n)}catch(n){t(!1,n)}}function kt(e,t,n=16){return h(this,null,function*(){let r=Array(e.length),o=Date.now();for(let s=0;s<e.length;++s){r[s]=t(e[s],s);let a=Date.now();a>=o+n&&(o=a,yield vr())}return r})}function Q(e){return e.then(void 0,()=>{}),e}function Rr(e,t){for(let n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function Pr(e,t){return!Rr(e,t)}function Ze(e){return parseInt(e)}function T(e){return parseFloat(e)}function F(e,t){return typeof e=="number"&&isNaN(e)?t:e}function E(e){return e.reduce((t,n)=>t+(n?1:0),0)}function Zt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{let n=1/t;return Math.round(e*n)/n}}function Er(e){var t,n;let r=`Unexpected syntax '${e}'`,o=/^\s*([a-z-]*)(.*)$/i.exec(e),s=o[1]||void 0,a={},c=/([.:#][\w-]+|\[.+?\])/gi,l=(f,i)=>{a[f]=a[f]||[],a[f].push(i)};for(;;){let f=c.exec(o[2]);if(!f)break;let i=f[0];switch(i[0]){case".":l("class",i.slice(1));break;case"#":l("id",i.slice(1));break;case"[":{let u=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(i);if(u)l(u[1],(n=(t=u[4])!==null&&t!==void 0?t:u[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[s,a]}function _r(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function D(e,t){let n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,a=t[0]>>>16,c=t[0]&65535,l=t[1]>>>16,f=t[1]&65535,i=0,u=0,d=0,g=0;g+=s+f,d+=g>>>16,g&=65535,d+=o+l,u+=d>>>16,d&=65535,u+=r+c,i+=u>>>16,u&=65535,i+=n+a,i&=65535,e[0]=i<<16|u,e[1]=d<<16|g}function A(e,t){let n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,a=t[0]>>>16,c=t[0]&65535,l=t[1]>>>16,f=t[1]&65535,i=0,u=0,d=0,g=0;g+=s*f,d+=g>>>16,g&=65535,d+=o*f,u+=d>>>16,d&=65535,d+=s*l,u+=d>>>16,d&=65535,u+=r*f,i+=u>>>16,u&=65535,u+=o*l,i+=u>>>16,u&=65535,u+=s*c,i+=u>>>16,u&=65535,i+=n*f+r*l+o*c+s*a,i&=65535,e[0]=i<<16|u,e[1]=d<<16|g}function U(e,t){let n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function x(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function S(e,t){e[0]^=t[0],e[1]^=t[1]}function Tt(e){let t=[0,e[0]>>>1];S(e,t),A(e,Ir),t[1]=e[0]>>>1,S(e,t),A(e,xr),t[1]=e[0]>>>1,S(e,t)}function Yt(e,t){let n=_r(e);t=t||0;let r=[0,n.length],o=r[1]%16,s=r[1]-o,a=[0,t],c=[0,t],l=[0,0],f=[0,0],i;for(i=0;i<s;i=i+16)l[0]=n[i+4]|n[i+5]<<8|n[i+6]<<16|n[i+7]<<24,l[1]=n[i]|n[i+1]<<8|n[i+2]<<16|n[i+3]<<24,f[0]=n[i+12]|n[i+13]<<8|n[i+14]<<16|n[i+15]<<24,f[1]=n[i+8]|n[i+9]<<8|n[i+10]<<16|n[i+11]<<24,A(l,de),U(l,31),A(l,pe),S(a,l),U(a,27),D(a,c),A(a,Nt),D(a,Or),A(f,pe),U(f,33),A(f,de),S(c,f),U(c,31),D(c,a),A(c,Nt),D(c,Ar);l[0]=0,l[1]=0,f[0]=0,f[1]=0;let u=[0,0];switch(o){case 15:u[1]=n[i+14],x(u,48),S(f,u);case 14:u[1]=n[i+13],x(u,40),S(f,u);case 13:u[1]=n[i+12],x(u,32),S(f,u);case 12:u[1]=n[i+11],x(u,24),S(f,u);case 11:u[1]=n[i+10],x(u,16),S(f,u);case 10:u[1]=n[i+9],x(u,8),S(f,u);case 9:u[1]=n[i+8],S(f,u),A(f,pe),U(f,33),A(f,de),S(c,f);case 8:u[1]=n[i+7],x(u,56),S(l,u);case 7:u[1]=n[i+6],x(u,48),S(l,u);case 6:u[1]=n[i+5],x(u,40),S(l,u);case 5:u[1]=n[i+4],x(u,32),S(l,u);case 4:u[1]=n[i+3],x(u,24),S(l,u);case 3:u[1]=n[i+2],x(u,16),S(l,u);case 2:u[1]=n[i+1],x(u,8),S(l,u);case 1:u[1]=n[i],S(l,u),A(l,de),U(l,31),A(l,pe),S(a,l)}return S(a,r),S(c,r),D(a,c),D(c,a),Tt(a),Tt(c),D(a,c),D(c,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)}function Cr(e){var t;return R({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
3
+ `)},e)}function kr(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Ht(e){return typeof e!="function"}function Tr(e,t){let n=Q(new Promise(r=>{let o=Date.now();Ct(e.bind(null,t),(...s)=>{let a=Date.now()-o;if(!s[0])return r(()=>({error:s[1],duration:a}));let c=s[1];if(Ht(c))return r(()=>({value:c,duration:a}));r(()=>new Promise(l=>{let f=Date.now();Ct(c,(...i)=>{let u=a+Date.now()-f;if(!i[0])return l({error:i[1],duration:u});l({value:i[1],duration:u})})}))})}));return function(){return n.then(o=>o())}}function zt(e,t,n,r){let o=Object.keys(e).filter(a=>Pr(n,a)),s=Q(kt(o,a=>Tr(e[a],t),r));return function(){return h(this,null,function*(){let c=yield s,l=yield kt(c,u=>Q(u()),r),f=yield Promise.all(l),i={};for(let u=0;u<o.length;++u)i[o[u]]=f[u];return i})}}function Nr(e,t){let n=r=>Ht(r)?t(r):()=>{let o=r();return ye(o)?o.then(t):t(o)};return r=>{let o=e(r);return ye(o)?o.then(n):n(o)}}function Ye(){let e=window,t=navigator;return E(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Bt(){let e=window,t=navigator;return E(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Ye()}function H(){let e=window,t=navigator;return E(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function C(){let e=window,t=navigator;return E(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function he(){let e=window,{HTMLElement:t,Document:n}=e;return E(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function ee(){let e=window;return kr(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function z(){var e,t;let n=window;return E(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Mr(){let e=window,t=navigator,{CSS:n}=e;return E(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}function Jt(){let{CSS:e}=window;return E([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Lr(){let e=window;return E([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Fr(){let e=window,{URLPattern:t}=e;return E(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Dr(){let e=window;return E(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function te(){let e=window,t=navigator,{CSS:n,HTMLButtonElement:r}=e;return E([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function jr(){if(navigator.platform==="iPad")return!0;let e=screen,t=e.width/e.height;return E(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Xt(){let e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Vr(){let e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function be(){let e=H(),t=z(),n=window,r=navigator,o="connection";return e?E([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?E(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Kt(){let e=navigator,t=window,n=Audio.prototype,{visualViewport:r}=t;return E(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function Gr(){return $r()?-4:qt()}function qt(){let e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Wr())return-1;let n=4500,r=5e3,o=new t(1,r,44100),s=o.createOscillator();s.type="triangle",s.frequency.value=1e4;let a=o.createDynamicsCompressor();a.threshold.value=-50,a.knee.value=40,a.ratio.value=12,a.attack.value=0,a.release.value=.25,s.connect(a),a.connect(o.destination),s.start(0);let[c,l]=Ur(o),f=Q(c.then(i=>Zr(i.getChannelData(0).subarray(n)),i=>{if(i.name==="timeout"||i.name==="suspended")return-3;throw i}));return()=>(l(),f)}function Wr(){return C()&&!he()&&!Dr()}function $r(){return C()&&te()&&ee()||H()&&Kt()&&Fr()}function Ur(e){let s=()=>{};return[new Promise((c,l)=>{let f=!1,i=0,u=0;e.oncomplete=m=>c(m.renderedBuffer);let d=()=>{setTimeout(()=>l(Mt("timeout")),Math.min(500,u+5e3-Date.now()))},g=()=>{try{let m=e.startRendering();switch(ye(m)&&Q(m),e.state){case"running":u=Date.now(),f&&d();break;case"suspended":document.hidden||i++,f&&i>=3?l(Mt("suspended")):setTimeout(g,500);break}}catch(m){l(m)}};g(),s=()=>{f||(f=!0,u>0&&d())}}),s]}function Zr(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function Mt(e){let t=new Error(e);return t.name=e,t}function He(e,t,n=50){return h(this,null,function*(){var r,o,s;let a=document;for(;!a.body;)yield ge(n);let c=a.createElement("iframe");try{for(yield new Promise((l,f)=>{let i=!1,u=()=>{i=!0,l()},d=p=>{i=!0,f(p)};c.onload=u,c.onerror=d;let{style:g}=c;g.setProperty("display","block","important"),g.position="absolute",g.top="0",g.left="0",g.visibility="hidden",t&&"srcdoc"in c?c.srcdoc=t:c.src="about:blank",a.body.appendChild(c);let m=()=>{var p,y;i||(((y=(p=c.contentWindow)===null||p===void 0?void 0:p.document)===null||y===void 0?void 0:y.readyState)==="complete"?u():setTimeout(m,10))};m()});!(!((o=(r=c.contentWindow)===null||r===void 0?void 0:r.document)===null||o===void 0)&&o.body);)yield ge(n);return yield e(c,c.contentWindow)}finally{(s=c.parentNode)===null||s===void 0||s.removeChild(c)}})}function Yr(e){let[t,n]=Er(e),r=document.createElement(t!=null?t:"div");for(let o of Object.keys(n)){let s=n[o].join(" ");o==="style"?Hr(r.style,s):r.setAttribute(o,s)}return r}function Hr(e,t){for(let n of t.split(";")){let r=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(r){let[,o,s,,a]=r;e.setProperty(o,s,a||"")}}}function zr(){let e=window;for(;;){let t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}function Xr(){return He((n,r)=>h(this,[n,r],function*(e,{document:t}){let o=t.body;o.style.fontSize=Jr;let s=t.createElement("div");s.style.setProperty("visibility","hidden","important");let a={},c={},l=p=>{let y=t.createElement("span"),{style:w}=y;return w.position="absolute",w.top="0",w.left="0",w.fontFamily=p,y.textContent=Br,s.appendChild(y),y},f=(p,y)=>l(`'${p}',${y}`),i=()=>Z.map(l),u=()=>{let p={};for(let y of Lt)p[y]=Z.map(w=>f(y,w));return p},d=p=>Z.some((y,w)=>p[w].offsetWidth!==a[y]||p[w].offsetHeight!==c[y]),g=i(),m=u();o.appendChild(s);for(let p=0;p<Z.length;p++)a[Z[p]]=g[p].offsetWidth,c[Z[p]]=g[p].offsetHeight;return Lt.filter(p=>d(m[p]))}))}function Kr(){let e=navigator.plugins;if(!e)return;let t=[];for(let n=0;n<e.length;++n){let r=e[n];if(!r)continue;let o=[];for(let s=0;s<r.length;++s){let a=r[s];o.push({type:a.type,suffixes:a.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:o})}return t}function qr(){return Qt(io())}function Qt(e){let t=!1,n,r,[o,s]=Qr();return eo(o,s)?(t=to(s),e?n=r="skipped":[n,r]=no(o,s)):n=r="unsupported",{winding:t,geometry:n,text:r}}function Qr(){let e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function eo(e,t){return!!(t&&e.toDataURL)}function to(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function no(e,t){ro(e,t);let n=Ve(e),r=Ve(e);return n!==r?["unstable","unstable"]:(oo(e,t),[Ve(e),n])}function ro(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';let n="Cwm fjordbank gly \u{1F603}";t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function oo(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(let[n,r,o]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(r,o,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Ve(e){return e.toDataURL()}function io(){let e=C()&&te()&&ee(),t=z()&&Mr();return e||t}function ao(){let e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=Ze(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch(o){n=!1}let r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function so(){return navigator.oscpu}function co(){let e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))H()&&Lr()||t.push(e.languages);else if(typeof e.languages=="string"){let r=e.languages;r&&t.push(r.split(","))}return t}function uo(){return window.screen.colorDepth}function lo(){return F(T(navigator.deviceMemory),void 0)}function fo(){if(!(C()&&te()&&ee()))return en()}function en(){let e=screen,t=r=>F(Ze(r),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}function go(){if(Ge!==void 0)return;let e=()=>{let t=$e();Ue(t)?Ge=setTimeout(e,po):(me=t,Ge=void 0)};e()}function tn(){return go(),()=>h(this,null,function*(){let e=$e();if(Ue(e)){if(me)return[...me];Xt()&&(yield Vr(),e=$e())}return Ue(e)||(me=e),e})}function yo(){let e=C()&&te()&&ee(),t=z()&&Jt();if(e||t)return()=>Promise.resolve(void 0);let n=tn();return()=>h(this,null,function*(){let r=yield n(),o=s=>s===null?null:Zt(s,mo);return[o(r[0]),o(r[1]),o(r[2]),o(r[3])]})}function $e(){let e=screen;return[F(T(e.availTop),null),F(T(e.width)-T(e.availWidth)-F(T(e.availLeft),0),null),F(T(e.height)-T(e.availHeight)-F(T(e.availTop),0),null),F(T(e.availLeft),null)]}function Ue(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function ho(){let e=nn();return e!==void 0&&z()&&Jt()?e>=8?8:4:e}function nn(){return F(Ze(navigator.hardwareConcurrency),void 0)}function bo(){var e;let t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){let r=new t().resolvedOptions().timeZone;if(r)return r}let n=-wo();return`UTC${n>=0?"+":""}${n}`}function wo(){let e=new Date().getFullYear();return Math.max(T(new Date(e,0,1).getTimezoneOffset()),T(new Date(e,6,1).getTimezoneOffset()))}function vo(){try{return!!window.sessionStorage}catch(e){return!0}}function So(){try{return!!window.localStorage}catch(e){return!0}}function Ro(){if(!(Ye()||Bt()))try{return!!window.indexedDB}catch(e){return!0}}function Po(){return!!window.openDatabase}function Eo(){return navigator.cpuClass}function _o(){let{platform:e}=navigator;return e==="MacIntel"&&C()&&!he()?jr()?"iPad":"iPhone":e}function Io(){return navigator.vendor||""}function xo(){let e=[];for(let t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){let n=window[t];n&&typeof n=="object"&&e.push(t)}return e.sort()}function Oo(){let e=document;try{e.cookie="cookietest=1; SameSite=Strict;";let t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}}function Ao(){let e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Co(){return h(this,arguments,function*({debug:e}={}){if(!ko())return;let t=Ao(),n=Object.keys(t),r=[].concat(...n.map(a=>t[a])),o=yield To(r);e&&No(t,o);let s=n.filter(a=>{let c=t[a];return E(c.map(f=>o[f]))>c.length*.6});return s.sort(),s})}function ko(){return C()||be()}function To(e){return h(this,null,function*(){var t;let n=document,r=n.createElement("div"),o=new Array(e.length),s={};Ft(r);for(let a=0;a<e.length;++a){let c=Yr(e[a]);c.tagName==="DIALOG"&&c.show();let l=n.createElement("div");Ft(l),l.appendChild(c),r.appendChild(l),o[a]=c}for(;!n.body;)yield ge(50);n.body.appendChild(r);try{for(let a=0;a<e.length;++a)o[a].offsetParent||(s[e[a]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return s})}function Ft(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function No(e,t){let n="DOM blockers debug:\n```";for(let r of Object.keys(e)){n+=`
4
+ ${r}:`;for(let o of e[r])n+=`
5
+ ${t[o]?"\u{1F6AB}":"\u27A1\uFE0F"} ${o}`}console.log(`${n}
6
+ \`\`\``)}function Mo(){for(let e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function Lo(){if(Dt("inverted"))return!0;if(Dt("none"))return!1}function Dt(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Fo(){if(jt("active"))return!0;if(jt("none"))return!1}function jt(e){return matchMedia(`(forced-colors: ${e})`).matches}function jo(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=Do;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function Vo(){if(Y("no-preference"))return 0;if(Y("high")||Y("more"))return 1;if(Y("low")||Y("less"))return-1;if(Y("forced"))return 10}function Y(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Go(){if(Vt("reduce"))return!0;if(Vt("no-preference"))return!1}function Vt(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Wo(){if(Gt("reduce"))return!0;if(Gt("no-preference"))return!1}function Gt(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function $o(){if(Wt("high"))return!0;if(Wt("standard"))return!1}function Wt(e){return matchMedia(`(dynamic-range: ${e})`).matches}function Uo(){let e=b.acos||I,t=b.acosh||I,n=b.asin||I,r=b.asinh||I,o=b.atanh||I,s=b.atan||I,a=b.sin||I,c=b.sinh||I,l=b.cos||I,f=b.cosh||I,i=b.tan||I,u=b.tanh||I,d=b.exp||I,g=b.expm1||I,m=b.log1p||I,p=v=>b.pow(b.PI,v),y=v=>b.log(v+b.sqrt(v*v-1)),w=v=>b.log(v+b.sqrt(v*v+1)),N=v=>b.log((1+v)/(1-v))/2,O=v=>b.exp(v)-1/b.exp(v)/2,V=v=>(b.exp(v)+1/b.exp(v))/2,Ee=v=>b.exp(v)-1,_e=v=>(b.exp(2*v)-1)/(b.exp(2*v)+1),Ie=v=>b.log(1+v);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:y(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:w(1),atanh:o(.5),atanhPf:N(.5),atan:s(.5),sin:a(-1e300),sinh:c(1),sinhPf:O(1),cos:l(10.000000000123),cosh:f(1),coshPf:V(1),tan:i(-1e300),tanh:u(1),tanhPf:_e(1),exp:d(1),expm1:g(1),expm1Pf:Ee(1),log1p:m(10),log1pPf:Ie(10),powPI:p(-100)}}function Yo(){return Ho((e,t)=>{let n={},r={};for(let o of Object.keys(We)){let[s={},a=Zo]=We[o],c=e.createElement("span");c.textContent=a,c.style.whiteSpace="nowrap";for(let l of Object.keys(s)){let f=s[l];f!==void 0&&(c.style[l]=f)}n[o]=c,t.append(e.createElement("br"),c)}for(let o of Object.keys(We))r[o]=n[o].getBoundingClientRect().width;return r})}function Ho(e,t=4e3){return He((n,r)=>{let o=r.document,s=o.body,a=s.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",H()?s.style.zoom=`${1/r.devicePixelRatio}`:C()&&(s.style.zoom="reset");let c=o.createElement("div");return c.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),s.appendChild(c),e(o,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function zo(){return navigator.pdfViewerEnabled}function Bo(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function Jo(){let{ApplePaySession:e}=window;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(Xo())return-3;try{return e.canMakePayments()?1:0}catch(t){return Ko(t)}}function Ko(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function qo(){var e;let t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}function oi({cache:e}){var t,n,r,o,s,a;let c=ze(e);if(!c)return rn;if(!cn(c))return on;let l=sn()?null:c.getExtension(an);return{version:((t=c.getParameter(c.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=c.getParameter(c.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:l?(r=c.getParameter(l.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((o=c.getParameter(c.RENDERER))===null||o===void 0?void 0:o.toString())||"",rendererUnmasked:l?(s=c.getParameter(l.UNMASKED_RENDERER_WEBGL))===null||s===void 0?void 0:s.toString():"",shadingLanguageVersion:((a=c.getParameter(c.SHADING_LANGUAGE_VERSION))===null||a===void 0?void 0:a.toString())||""}}function ii({cache:e}){let t=ze(e);if(!t)return rn;if(!cn(t))return on;let n=t.getSupportedExtensions(),r=t.getContextAttributes(),o=[],s=[],a=[],c=[],l=[];if(r)for(let i of Object.keys(r))s.push(`${i}=${r[i]}`);let f=$t(t);for(let i of f){let u=t[i];a.push(`${i}=${u}${Qo.has(u)?`=${t.getParameter(u)}`:""}`)}if(n)for(let i of n){if(i===an&&sn()||i===ri&&ci())continue;let u=t.getExtension(i);if(!u){o.push(i);continue}for(let d of $t(u)){let g=u[d];c.push(`${d}=${g}${ei.has(g)?`=${t.getParameter(g)}`:""}`)}}for(let i of ti)for(let u of ni){let d=ai(t,i,u);l.push(`${i}.${u}=${d.join(",")}`)}return c.sort(),a.sort(),{contextAttributes:s,parameters:a,shaderPrecisions:l,extensions:n,extensionParameters:c,unsupportedExtensions:o}}function ze(e){if(e.webgl)return e.webgl.context;let t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(let r of["webgl","experimental-webgl"]){try{n=t.getContext(r)}catch(o){}if(n)break}return e.webgl={context:n},n}function ai(e,t,n){let r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function $t(e){return Object.keys(e.__proto__).filter(si)}function si(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function sn(){return z()}function ci(){return H()||C()}function cn(e){return typeof e.getParameter=="function"}function ui(){if(!(be()||C()))return-2;if(!window.AudioContext)return-1;let t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function li(){if(!window.Intl)return-1;let e=window.Intl.DateTimeFormat;if(!e)return-2;let t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}function fi(e){return zt(un,e,[])}function pi(e){let t=mi(e),n=gi(t);return{score:t,comment:di.replace(/\$/g,`${n}`)}}function mi(e){if(be())return .4;if(C())return he()&&!(te()&&ee())?.5:.3;let t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function gi(e){return Zt(.99+.01*e,1e-4)}function yi(e){let t="";for(let n of Object.keys(e).sort()){let r=e[n],o="error"in r?"error":JSON.stringify(r.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${o}`}return t}function Be(e){return JSON.stringify(e,(t,n)=>n instanceof Error?Cr(n):n,2)}function Je(e){return Yt(yi(e))}function hi(e){let t,n=pi(e);return{get visitorId(){return t===void 0&&(t=Je(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:Ut}}function ln(e=50){return Sr(e,e*2)}function bi(e,t){let n=Date.now();return{get(o){return h(this,null,function*(){let s=Date.now(),a=yield e(),c=hi(a);return(t||o!=null&&o.debug)&&console.log(`Copy the text below to get the debug data:
7
+
8
+ \`\`\`
9
+ version: ${c.version}
10
+ userAgent: ${navigator.userAgent}
11
+ timeBetweenLoadAndGet: ${s-n}
12
+ visitorId: ${c.visitorId}
13
+ components: ${Be(a)}
14
+ \`\`\``),c})}}}function wi(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{let e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Ut}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}function fn(){return h(this,arguments,function*(e={}){let{delayFallback:t,debug:n,monitoring:r=!0}=e;r&&wi(),yield ln(t);let o=fi({cache:{},debug:n});return bi(o,n)})}var Ut,Ir,xr,de,pe,Nt,Or,Ar,Br,Jr,Z,Lt,po,mo,me,Ge,Do,b,I,Zo,We,Xo,rn,on,Qo,ei,ti,ni,an,ri,un,di,vi,Si,pn=nr(()=>{"use strict";Ut="5.1.0";Ir=[4283543511,3981806797],xr=[3301882366,444984403];de=[2277735313,289559509],pe=[1291169091,658871167],Nt=[0,5],Or=[0,1390208809],Ar=[0,944331445];Br="mmMwWLliI0O&1",Jr="48px",Z=["monospace","sans-serif","serif"],Lt=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];po=2500,mo=10;Do=100;b=Math,I=()=>0;Zo="mmMwWLliI0fiflO&1",We={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};Xo=zr;rn=-1,on=-2,Qo=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),ei=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),ti=["FRAGMENT_SHADER","VERTEX_SHADER"],ni=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],an="WEBGL_debug_renderer_info",ri="WEBGL_polygon_mode";un={fonts:Xr,domBlockers:Co,fontPreferences:Yo,audio:Gr,screenFrame:yo,canvas:qr,osCpu:so,languages:co,colorDepth:uo,deviceMemory:lo,screenResolution:fo,hardwareConcurrency:ho,timezone:bo,sessionStorage:vo,localStorage:So,indexedDB:Ro,openDatabase:Po,cpuClass:Eo,platform:_o,plugins:Kr,touchSupport:ao,vendor:Io,vendorFlavors:xo,cookiesEnabled:Oo,colorGamut:Mo,invertedColors:Lo,forcedColors:Fo,monochrome:jo,contrast:Vo,reducedMotion:Go,reducedTransparency:Wo,hdr:$o,math:Uo,pdfViewerEnabled:zo,architecture:Bo,applePay:Jo,privateClickMeasurement:qo,audioBaseLatency:ui,dateTimeLocale:li,webGlBasics:oi,webGlExtensions:ii};di="$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score";vi={load:fn,hashComponents:Je,componentsToDebugString:Be},Si=Yt});var dt=(r=>(r.ApplePay="APPLE_PAY",r.SamsungPay="SAMSUNG_PAY",r.GooglePay="GOOGLE_PAY",r))(dt||{});var ar=["visa","mastercard"];function K(e){let t=e==null?void 0:e.allowedNetworks;return t&&t.length>0?[...t]:[...ar]}function pt(e){switch(e){case"mastercard":return"masterCard";case"visa":case"amex":return e}}function mt(e){switch(e){case"visa":return"VISA";case"mastercard":return"MASTERCARD";case"amex":return"AMEX"}}function gt(e){switch(e){case"visa":case"mastercard":case"amex":return e}}var q=function(){return q=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},q.apply(this,arguments)};function yt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ht(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function sr(e,t){return function(n,r){return Object.prototype.hasOwnProperty.call(n,r)}(e,t)?e[t]:void 0}function cr(e,t,n,r){var o,s=document,a="securitypolicyviolation",c=function(f){var i=new URL(e,location.href),u=f.blockedURI;u!==i.href&&u!==i.protocol.slice(0,-1)&&u!==i.origin||(o=f,l())};s.addEventListener(a,c);var l=function(){return s.removeEventListener(a,c)};return r==null||r.then(l,l),Promise.resolve().then(t).then(function(f){return l(),f},function(f){return new Promise(function(i){var u=new MessageChannel;u.port1.onmessage=function(){return i()},u.port2.postMessage(null)}).then(function(){if(l(),o)return n(o);throw f})})}var bt={default:"endpoint"};var wt="Blocked by CSP",vt="The endpoint parameter is not a valid URL";var ur="API key required";var lr="3.11.4",Ae="Failed to load the JS script of the agent",Ce="9319";function fr(e,t){var n,r,o,s,a,c,l,f=[],i=(n=function(m){var p=ht([],m,!0);return{current:function(){return p[0]},postpone:function(){var y=p.shift();y!==void 0&&p.push(y)},exclude:function(){p.shift()}}}(e),s=100,a=3e3,c=0,r=function(){return Math.random()*Math.min(a,s*Math.pow(2,c++))},o=new Set,[n.current(),function(m,p){var y,w=p instanceof Error?p.message:"";if(w===wt||w===vt)n.exclude(),y=0;else if(w===Ce)n.exclude();else if(w===Ae){var N=Date.now()-m.getTime()<50,O=n.current();O&&N&&!o.has(O)&&(o.add(O),y=0),n.postpone()}else n.postpone();var V=n.current();return V===void 0?void 0:[V,y!=null?y:m.getTime()+r()-Date.now()]}]),u=i[0],d=i[1];if(u===void 0)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var g=function(m){var p=new Date,y=function(N){return f.push({url:m,startedAt:p,finishedAt:new Date,error:N})},w=t(m);return w.then(function(){return y()},y),w.catch(function(N){if(l!=null||(l=N),f.length>=5)throw l;var O=d(p,N);if(!O)throw l;var V,Ee=O[0],_e=O[1];return(V=_e,new Promise(function(Ie){return setTimeout(Ie,V)})).then(function(){return g(Ee)})})};return g(u).then(function(m){return[m,f]})}var St="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",Rt=St;function Pt(e){var t;e.scriptUrlPattern;var n=e.token,r=e.apiKey,o=r===void 0?n:r,s=yt(e,["scriptUrlPattern","token","apiKey"]),a=(t=sr(e,"scriptUrlPattern"))!==null&&t!==void 0?t:St,c=function(){var i=[],u=function(){i.push({time:new Date,state:document.visibilityState})},d=function(g,m,p,y){return g.addEventListener(m,p,y),function(){return g.removeEventListener(m,p,y)}}(document,"visibilitychange",u);return u(),[i,d]}(),l=c[0],f=c[1];return Promise.resolve().then(function(){if(!o||typeof o!="string")throw new Error(ur);var i=function(u,d){return(Array.isArray(u)?u:[u]).map(function(g){return function(m,p){var y=encodeURIComponent;return m.replace(/<[^<>]+>/g,function(w){return w==="<version>"?"3":w==="<apiKey>"?y(p):w==="<loaderVersion>"?y(lr):w})}(String(g),d)})}(a,o);return fr(i,dr)}).catch(function(i){throw f(),function(u){return u instanceof Error&&u.message===Ce?new Error(Ae):u}(i)}).then(function(i){var u=i[0],d=i[1];return f(),u.load(q(q({},s),{ldi:{attempts:d,visibilityStates:l}}))})}function dr(e){return cr(e,function(){return function(t){return new Promise(function(n,r){if(function(c){if(URL.prototype)try{return new URL(c,location.href),!1}catch(l){if(l instanceof Error&&l.name==="TypeError")return!0;throw l}}(t))throw new Error(vt);var o=document.createElement("script"),s=function(){var c;return(c=o.parentNode)===null||c===void 0?void 0:c.removeChild(o)},a=document.head||document.getElementsByTagName("head")[0];o.onload=function(){s(),n()},o.onerror=function(){s(),r(new Error(Ae))},o.async=!0,o.src=t,a.appendChild(o)})}(e)},function(){throw new Error(wt)}).then(pr)}function pr(){var e=window,t="__fpjs_p_l_b",n=e[t];if(function(r,o){var s,a=(s=Object.getOwnPropertyDescriptor)===null||s===void 0?void 0:s.call(Object,r,o);a!=null&&a.configurable?delete r[o]:a&&!a.writable||(r[o]=void 0)}(e,t),typeof(n==null?void 0:n.load)!="function")throw new Error(Ce);return n}var _t=ft(Me());function L(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var wr="https://analytics.stitch.money/query",Le={loggingUrl:wr},le={};function Fe(e={}){let r=e,{loggingUrl:t}=r,n=lt(r,["loggingUrl"]);typeof t=="string"&&t.length>0&&(Le.loggingUrl=t),le=R(R({sessionId:L()},le),n)}function It(){var e,t,n;return((t=(e=window==null?void 0:window.location)==null?void 0:e.ancestorOrigins)==null?void 0:t.length)>0?Object.values((n=window==null?void 0:window.location)==null?void 0:n.ancestorOrigins).join(","):(document==null?void 0:document.referrer)||void 0}function De(e,t){return h(this,null,function*(){try{yield fetch(Le.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_EVENT",event:{message:e,metadata:R(R({hostname:It()},le),t)}})})}catch(n){try{yield P("[logEvent] Error logging event",n,t)}catch(r){}}})}function P(e,t,n){return h(this,null,function*(){try{yield fetch(Le.loggingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"LOG_ERROR",error:{message:e,error:(0,_t.serializeError)(t),metadata:R(R({hostname:It()},le),n)}})})}catch(r){}})}var gn=ft(Me());var je;function fe(e,t=0){let n=typeof e=="string"?(je!=null?je:je=new TextEncoder).encode(e):e,r=n,o=t+374761393&4294967295,s=0;if(r.length>=16){let c=[t+2654435761+2246822519&4294967295,t+2246822519&4294967295,t+0&4294967295,t-2654435761&4294967295],l=n,f=l.length-16,i=0;for(s=0;(s&4294967280)<=f;s+=4){let u=s,d=l[u+0]+(l[u+1]<<8),g=l[u+2]+(l[u+3]<<8),m=d*2246822519+(g*2246822519<<16),p=c[i]+m&4294967295;p=p<<13|p>>>19;let y=p&65535,w=p>>>16;c[i]=y*2654435761+(w*2654435761<<16)&4294967295,i=i+1&3}o=(c[0]<<1|c[0]>>>31)+(c[1]<<7|c[1]>>>25)+(c[2]<<12|c[2]>>>20)+(c[3]<<18|c[3]>>>14)&4294967295}o=o+n.length&4294967295;let a=n.length-4;for(;s<=a;s+=4){let c=s,l=r[c+0]+(r[c+1]<<8),f=r[c+2]+(r[c+3]<<8),i=l*3266489917+(f*3266489917<<16);o=o+i&4294967295,o=o<<17|o>>>15,o=(o&65535)*668265263+((o>>>16)*668265263<<16)&4294967295}for(;s<r.length;++s){let c=r[s];o=o+c*374761393,o=o<<11|o>>>21,o=(o&65535)*2654435761+((o>>>16)*2654435761<<16)&4294967295}return o=o^o>>>15,o=((o&65535)*2246822519&4294967295)+((o>>>16)*2246822519<<16),o=o^o>>>13,o=((o&65535)*3266489917&4294967295)+((o>>>16)*3266489917<<16),o=o^o>>>16,o<0?o+4294967296:o}function xt(e){let t={};if(e===null||typeof e!="object")return t;for(let[n,r]of Object.entries(e)){if(r===null||typeof r!="object")continue;let{value:o}=r;if(o!==void 0){if(typeof o=="string"||typeof o=="number"){t[n]=o.toString();continue}try{let s=JSON.stringify(o);if(s===void 0)continue;t[n]=fe(s,0).toString()}catch(s){continue}}}return t}var Ot="stitch-fp-session-id";function At(){try{let e=localStorage.getItem(Ot);return e||(e=L(),localStorage.setItem(Ot,e)),e}catch(e){return}}var Xe,Ke,qe;function mn(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}function Ri(e){var r;let t=e.cause,n=t!=null?typeof t=="object"&&"message"in t?t.message:typeof t=="object"?"Unknown cause":String(t):void 0;return R(R(R({message:(r=e.message)!=null?r:"Unknown error",name:e.name},typeof e.code=="string"&&{code:e.code}),typeof e.requestId=="string"&&{requestId:e.requestId}),n&&{cause:n})}function yn(t){return h(this,arguments,function*({config:e}){let n={apiKey:e.publicKey,endpoint:[e.endpoint,bt],scriptUrlPattern:[e.scriptUrlPattern,Rt],region:"eu"},r=Pt(n);if(e.ossEnabled!==!0)return{proAgent:yield r};let[o,s]=yield Promise.all([r,Promise.resolve().then(()=>(pn(),dn)).then(a=>a.load()).catch(a=>{P("OSS fingerprint agent load failed",a,{source:"fingerprint-stitch"})})]);return R({proAgent:o},s!==void 0&&{ossAgent:s})})}function hn(s){return h(this,arguments,function*({config:e,clientId:t,agent:n,payerId:r,sdkVersion:o}){let a=(e==null?void 0:e.ossEnabled)===!0;if((e==null?void 0:e.disabled)===!0){let l={disabled:!0,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:"",visitorId:""}};return btoa(JSON.stringify(l))}if((e==null?void 0:e.disabled)===!1&&(e!=null&&e.useEmulation)&&(t!=null&&t.startsWith("test"))){let l=R({disabled:!1,emulated:!0,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:`${Date.now()}.${mn(6)}`,visitorId:mn(20)}},a&&{oss:{fingerprintHash:L().replace(/-/g,"").slice(0,8),rawSignals:{},sessionId:L(),source:"stitch-oss-web"}});return btoa(JSON.stringify(l))}if(n!==void 0&&(e==null?void 0:e.disabled)===!1){let l=Date.now();if(Xe!==void 0&&Ke!==void 0&&qe!==void 0&&qe.ossEnabled===a&&l-Ke<e.cacheDurationInSeconds*1e3)return btoa(JSON.stringify(Xe));try{let f={linkedId:t,tag:{payerId:r}},i,u;if(a&&n.ossAgent!==void 0){let[m,p]=yield Promise.allSettled([n.proAgent.get(f),n.ossAgent.get()]);if(m.status==="rejected")throw m.reason;i=m.value,p.status==="fulfilled"?u=p.value:P("OSS fingerprint collection failed",p.reason,{source:"fingerprint-stitch"})}else i=yield n.proAgent.get(f);let d;if(u!==void 0)try{if(typeof u.visitorId!="string"||u.visitorId.length===0)throw new Error("OSS fingerprint payload missing visitorId");d={fingerprintHash:u.visitorId,rawSignals:xt(u.components),sessionId:At(),source:"stitch-oss-web"}}catch(m){P("OSS fingerprint payload construction failed",m,{source:"fingerprint-stitch"})}let g=R({disabled:!1,emulated:!1,fingerprintDetails:{timestamp:new Date().toISOString(),requestId:i.requestId,visitorId:i.visitorId}},d!==void 0&&{oss:d});return Xe=g,Ke=l,qe={ossEnabled:a},btoa(JSON.stringify(g))}catch(f){let i=Ri((0,gn.serializeError)(f)),u=i.name&&i.name!=="Error"?`${i.name}: ${i.message}`:i.message,d={error:R(R(R(R({outcome:"Failed",message:u||"Unknown error"},i.code&&{code:i.code}),i.cause&&{cause:i.cause}),i.requestId&&{requestId:i.requestId}),o&&{sdkVersion:o})};return btoa(JSON.stringify(d))}}let c={error:R({outcome:"Failed",message:"Attempted to get fingerprint data but either runtime config or the agent are not present"},o&&{sdkVersion:o})};return btoa(JSON.stringify(c))})}function Pi(e){return typeof e=="number"}function Ei(e){return typeof e=="string"}function _i(e){return typeof e=="bigint"}function wn(e){return!!e&&Object.prototype.toString.call(e)==="[object Date]"&&!isNaN(e)}function vn(e){return e!=null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"}var Sn=new WeakSet;function ne(e){return Sn.add(e),e}function Rn(e,t){return ne({type:"object",fields:e,text:t})}function Ii(e,t){return ne({type:"array",items:e,text:t})}function we(e,t){return ne({type:"opaque",value:e,text:t})}function xi(e,t){return ne({type:"scalar",value:e,text:t})}function Pn(e,t){return t!==void 0?ne(ut(R({},e),{text:t})):e}function En(e,t){let n=new Map([...e.fields,...t]);return Rn(n,e.text)}function _n(e){return Sn.has(e)}function Oi(e,t,n){n.add(e);let r=[];for(let o of e)r.push(tt(o,void 0,n));return Ii(r,t)}function In(e,t,n){n.add(e);let r=new Map;for(let o of Object.keys(e)){let s=e[o];r.set(o,tt(s,void 0,n))}return Rn(r,t)}function tt(e,t,n){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e.getMonth=="function"?xi(e,t):_n(e)?Pn(e,t):Array.isArray(e)?n.has(e)?we("<circular ref>",t):Oi(e,t,n):vn(e)?n.has(e)?we("<circular ref>",t):In(e,t,n):we(typeof e=="function"?"<function>":"???",t)}function G(e,t){return tt(e,t,new WeakSet)}function xn(e,t){return In(e,t,new WeakSet)}var W=" ";function Qe(e){return e.indexOf(`
15
+ `)>=0}function nt(e,t=W){return Qe(e)?e.split(`
16
+ `).map(n=>`${t}${n}`).join(`
17
+ `):`${t}${e}`}var Ai=/'/g;function $(e){return typeof e=="string"?"'"+e.replace(Ai,"\\'")+"'":JSON.stringify(e)}function ve(e,t=[]){let n=[];if(e.type==="array"){let s=e.items,a=0;for(let c of s)for(let l of ve(c,[...t,a++]))n.push(l)}else if(e.type==="object"){let s=e.fields;for(let[a,c]of s)for(let l of ve(c,[...t,a]))n.push(l)}let r=e.text;if(!r)return n;let o;return t.length===0?o="":t.length===1?o=typeof t[0]=="number"?`Value at index ${t[0]}: `:`Value at key ${$(t[0])}: `:o=`Value at keypath ${$(t.map(String).join("."))}: `,[...n,`${o}${r}`]}function Ci(e,t=80){let n=JSON.stringify(e);if(n.length<=t)return n;let r=`${e.substring(0,t-15)}...`;return n=`${JSON.stringify(r)} [truncated]`,n}function ki(e,t){let{items:n}=e;if(n.length===0)return"[]";let r=[];for(let o of n){let[s,a]=rt(o,`${t}${W}`);r.push(`${t}${W}${s},`),a!==void 0&&r.push(nt(a,`${t}${W}`))}return["[",...r,`${t}]`].join(`
18
+ `)}function Ti(e,t){let{fields:n}=e;if(n.size===0)return"{}";let r=[];for(let[o,s]of n){let a=On(o),c=`${t}${W}${" ".repeat(a.length+2)}`,[l,f]=rt(s,`${t}${W}`);r.push(`${t}${W}${a}: ${l},`),f!==void 0&&r.push(nt(f,c))}return["{",...r,`${t}}`].join(`
19
+ `)}function On(e){return typeof e=="string"?Ci(e):typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"?e.toString():e===null?"null":e===void 0?"undefined":wn(e)?`new Date(${$(e.toISOString())})`:e instanceof Date?"(Invalid Date)":"(unserializable)"}function rt(e,t=""){let n;e.type==="array"?n=ki(e,t):e.type==="object"?n=Ti(e,t):e.type==="scalar"?n=On(e.value):n=e.value;let r=e.text;if(r!==void 0){let o="^".repeat(Qe(n)?1:n.length);return[n,[o,r].join(Qe(r)?`
20
+ `:" ")]}else return[n,void 0]}function Ni(e){let[t,n]=rt(e);return n!==void 0?`${t}
21
+ ${n}`:t}function Mi(e){return ve(e,[]).join(`
22
+ `)}function An(e){return{ok:!0,value:e,error:void 0}}function Cn(e){return{ok:!1,value:void 0,error:e}}function Li(e){return t=>{try{let n=e(t);return An(n)}catch(n){return Cn(G(t,n instanceof Error?n.message:String(n)))}}}function Fi(e,t){let n=t(e);if(typeof n=="string"){let r=new Error(`
23
+ ${n}`);return r.name="Decoding error",r}else return n}function _(e){function t(i){return e(i,An,u=>Cn(_n(u)?u:G(i,u)))}function n(i,u=Ni){let d=t(i);if(d.ok)return d.value;throw Fi(d.error,u)}function r(i){return t(i).value}function o(i){return a(Li(i))}function s(i,u){return l(d=>i(d)?null:u)}function a(i){return _((u,d,g)=>{let m=t(u);if(!m.ok)return m;let p=bn(i)?i:i(m.value,d,g);return bn(p)?p.decode(m.value):p})}function c(i){return a(i)}function l(i){return a((u,d,g)=>{let m=i(u);return m===null?d(u):g(typeof m=="string"?G(u,m):m)})}function f(i){return _((u,d,g)=>{let m=t(u);return m.ok?m:g(G(m.error,i))})}return Di({verify:n,value:r,decode:t,transform:o,refine:s,reject:l,describe:f,then:a,pipe:c})}var kn=new WeakSet;function Di(e){return kn.add(e),e}function bn(e){return kn.has(e)}var ji=_((e,t,n)=>Array.isArray(e)?t(e):n("Must be an array"));function Vi(e,t,n,r){let o=[];for(let s=0;s<e.length;++s){let a=e[s];if(a.ok)o.push(a.value);else{let c=a.error,l=t.slice();return l.splice(s,1,G(c,c.text?`${c.text} (at index ${s})`:`index ${s}`)),r(G(l))}}return n(o)}function ot(e){let t=e.decode;return ji.then((n,r,o)=>{let s=n.map(t);return Vi(s,n,r,o)})}function Gi(e){return _((t,n,r)=>t instanceof e?n(t):r(`Must be ${e.name} instance`))}function Tn(e){return _(t=>e().decode(t))}function Wi(e,t){let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}var Nn=_((e,t,n)=>vn(e)?t(e):n("Must be an object"));function B(e){let t=new Set(Object.keys(e));return Nn.then((n,r,o)=>{let s=new Set(Object.keys(n)),a=Wi(t,s),c={},l=null;for(let f of Object.keys(e)){let i=e[f],u=n[f],d=i.decode(u);if(d.ok){let g=d.value;g!==void 0&&(c[f]=g),a.delete(f)}else{let g=d.error;u===void 0?a.add(f):(l===null&&(l=new Map),l.set(f,g))}}if(l||a.size>0){let f=xn(n);if(l&&(f=En(f,l)),a.size>0){let i=Array.from(a).map($).join(", "),u=a.size>1?"keys":"key";f=Pn(f,`Missing ${u}: ${i}`)}return o(f)}return r(c)})}var et=`Either:
24
+ `;function $i(e){return`-${nt(e).substring(1)}`}function Ui(e){return e.startsWith(et)?e.substring(et.length):$i(e)}function re(...e){if(e.length===0)throw new Error("Pass at least one decoder to either()");return _((t,n,r)=>{let o=[];for(let a=0;a<e.length;a++){let c=e[a].decode(t);if(c.ok)return c;o.push(c.error)}let s=et+o.map(a=>Ui(ve(a).join(`
13
25
  `))).join(`
14
- `);return n(s)})}var tr=qe(null),Tr=qe(void 0),Cr=R((e,t,r)=>e==null?t(e):r("Must be undefined or null"));function qe(e){return R((t,r,n)=>t===e?r(e):n(`Must be ${typeof e=="symbol"?String(e):T(e)}`))}var xr=R((e,t,r)=>t(e));var K=R((e,t,r)=>typeof e=="boolean"?t(e):r("Must be boolean")),Nr=R((e,t,r)=>t(!!e));function rr(e,t){let r=t!==void 0?e:void 0,n=t!==void 0?t:e;return Ye.then((i,s,o)=>{var c;let u={},a=new Map;for(let l of Object.keys(i)){let f=i[l],p=r==null?void 0:r.decode(l);if((p==null?void 0:p.ok)===!1)return o(O(i,`Invalid key ${T(l)}: ${Kt(p.error)}`));let y=(c=p==null?void 0:p.value)!=null?c:l,d=n.decode(f);d.ok?a.size===0&&(u[y]=d.value):(a.set(l,d.error),u={})}return a.size>0?o(Ue(Ge(i),a)):s(u)})}var nr=/^([A-Za-z]{3,9}(?:[+][A-Za-z]{3,9})?):\/\/(?:([-;:&=+$,\w]+)@)?(?:([A-Za-z0-9.-]+)(?::([0-9]{2,5}))?)(\/(?:[-+~%/.,\w]*)?(?:\?[-+=&;%@.,/\w]*)?(?:#[.,!/\w]*)?)?$/,He=R((e,t,r)=>Mt(e)?t(e):r("Must be string")),C=v(/\S/,"Must be non-empty string");function v(e,t){return He.refine(r=>e.test(r),t)}var Dr=v(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"Must be email"),ir=fe(v(nr,"Must be URL").transform(e=>new URL(e)),Xt(URL)),Mr=ir.refine(e=>e.protocol==="https:","Must be an HTTPS URL"),jr=v(/^[a-z_][a-z0-9_]*$/i,"Must be valid identifier");var We=v(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Must be uuid"),kr=We.refine(e=>e[14]==="1","Must be uuidv1"),$r=We.refine(e=>e[14]==="4","Must be uuidv4"),or=v(/^[0-9]+$/,"Must only contain digits"),Ur=v(/^[0-9a-f]+$/i,"Must only contain hexadecimal digits"),Fr=or.transform(Number),ar=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:[.]\d+)?(?:Z|[+-]\d{2}:?\d{2})$/,sr=R((e,t,r)=>De(e)?t(e):r("Must be a Date")),ur=v(ar,"Must be ISO8601 format").transform(e=>{let t=new Date(e);if(isNaN(t.getTime()))throw new Error("Must be valid date/time value");return t}),Lr=fe(sr,ur).describe("Must be a Date or date string"),cr=R((e,t,r)=>Dt(e)?t(e):r("Must be number")),k=cr.refine(e=>Number.isFinite(e),"Number must be finite"),lr=k.refine(e=>Number.isInteger(e),"Number must be an integer"),Xe=k.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),Gr=lr.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),Vr=R((e,t,r)=>jt(e)?t(e):r("Must be bigint")),fr=Je(()=>rr(Ze)),pr=Je(()=>Wt(Ze)),Ze=fe(tr,He,k,K,fr,pr).describe("Must be valid JSON value");var B=3,Qe=500,dr=j({analytics:j({changeEventDebounceDelayMs:Xe}),evervault:j({teamId:C,appId:C}),fingerprint:j({disabled:K,useEmulation:K,publicKey:C,endpoint:C,scriptUrlPattern:C,cacheDurationInSeconds:k})});function $(e,t){return m(this,null,function*(){try{let r=0;for(;r<B;)try{let n=yield fetch(`https://public-keys.stitch.money/${e}`,{signal:t});if(n.ok)return{type:"success",runtimeConfig:dr.verify(yield n.json())};if(r++,r===B)return{type:"error",error:new Error(`[${$.name}] Failed to retrieve runtime config after ${B} attempts. public-keys worker returned ${n.status} response`)};yield new Promise(i=>setTimeout(i,Qe))}catch(n){if(r++,r===B)throw n;yield new Promise(i=>setTimeout(i,Qe))}return{type:"error",error:new Error(`[${$.name}] Failed to retrieve runtime config`)}}catch(r){return r instanceof Error?{type:"error",error:r}:typeof r=="string"?{type:"error",error:new Error(r)}:{type:"error",error:new Error(`[${$.name}] Failed to retrieve runtime config. Unknown error thrown`)}}})}import{v4 as mr}from"uuid";var yr="9ba67dd8d5b247cfb3f76e",U={version:"2",serviceId:yr,protocol:"PROTOCOL_3DS",allowedBrands:["visa","mastercard"]};function et(){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","MASTERCARD"]}}]}}function tt(e){return m(this,null,function*(){if(!window.ApplePaySession)return!1;let t=ApplePaySession;if(t.applePayCapabilities&&e)try{return(yield t.applePayCapabilities(e)).paymentCredentialStatus!=="applePayUnsupported"}catch(r){S("[determineApplePaySupport] failed to get applePayCapabilities, falling back to canMakePayments",r,{merchantIdentifier:e})}return t.canMakePayments()})}function rt(){if(!window.ApplePaySession)return-1;let t=r=>r===0?-1:ApplePaySession.supportsVersion(r)?r:t(r-1);return t(14)}function nt(e){return m(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(et())).result}catch(t){return!1}})}function it(e){return m(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(U)).result}catch(t){return!1}})}var P=class extends Error{constructor(t){super(t),this.name="SessionError"}};var F=e=>e instanceof Error?e.toString():JSON.stringify(e);var ot="3.8.0";var hr="[onvalidatemerchant]",at="[onpaymentauthorized]",x="[onClickSamsungPaySessionHandler]",pe="[onClickGooglePaySessionHandler]",st=class{constructor(t){E(this,"onCancelPayment");E(this,"clientId");E(this,"gatewayMerchantId");E(this,"applePayIsSupported",!1);E(this,"samsungPayIsSupported",!1);E(this,"googlePayIsSupported",!1);E(this,"runtimeConfig");E(this,"fingerprintAgent");E(this,"googlePayClient");E(this,"samsungPayClient");var o,u,a;ie({source:"wallets-client",version:ot});let{onCancelPayment:r,clientId:n,gatewayMerchantId:i}=t,s=(a=(u=(o=globalThis.google)==null?void 0:o.payments)==null?void 0:u.api)==null?void 0:a.PaymentsClient;this.googlePayClient=s?new s({environment:n!=null&&n.startsWith("test-")?"TEST":"PRODUCTION"}):void 0,this.samsungPayClient=window.SamsungPay?new window.SamsungPay.PaymentClient({environment:n!=null&&n.startsWith("test-")?"STAGE":"PRODUCTION",nonce:mr()}):void 0,this.onCancelPayment=r!=null?r:()=>{},this.clientId=n,this.gatewayMerchantId=i,this.loadFingerprintAgent()}loadRuntimeConfig(){return m(this,null,function*(){var t,r;if(this.runtimeConfig===void 0&&this.clientId){let n=yield $(this.clientId);if(n.type==="error"){let i=(r=(t=n.error)==null?void 0:t.message)!=null?r:"Failed to load runtime configuration";throw S(i,n.error,{clientId:this.clientId}),n.error?n.error:new Error(i)}this.runtimeConfig=n.runtimeConfig}})}loadFingerprintAgent(){return m(this,null,function*(){this.fingerprintAgent===void 0&&(this.runtimeConfig===void 0&&(yield this.loadRuntimeConfig()),this.runtimeConfig!==void 0&&!this.runtimeConfig.fingerprint.disabled&&(this.fingerprintAgent=yield Oe({config:this.runtimeConfig.fingerprint})))})}fingerprint(){return m(this,null,function*(){var r;let t=yield Ie({config:(r=this.runtimeConfig)==null?void 0:r.fingerprint,agent:this.fingerprintAgent,clientId:this.clientId});return ie({fingerprint:t}),t})}supportedPaymentMethods(){return m(this,null,function*(){let t=[];return this.applePayIsSupported=yield tt(this.gatewayMerchantId),this.applePayIsSupported&&t.push("APPLE_PAY"),this.samsungPayIsSupported=yield it(this.samsungPayClient),this.samsungPayIsSupported&&t.push("SAMSUNG_PAY"),this.googlePayIsSupported=yield nt(this.googlePayClient),this.googlePayIsSupported&&t.push("GOOGLE_PAY"),t})}onClickApplePaySessionHandler(t,r,n,i,s,o){let u=rt();return()=>{var l,f;let a={countryCode:"ZA",currencyCode:t,supportedNetworks:["visa","masterCard"],merchantCapabilities:["supports3DS"],total:{label:n,amount:r.toString()}};o&&(a.recurringPaymentRequest={paymentDescription:n,billingAgreement:o.billingAgreement,regularBilling:{label:n,amount:((l=o.recurringAmount)!=null?l:r).toString(),paymentTiming:"recurring",recurringPaymentIntervalUnit:o.recurringIntervalUnit,recurringPaymentIntervalCount:(f=o.recurringIntervalCount)!=null?f:1},managementURL:o.managementUrl});let c;try{c=new ApplePaySession(u,a)}catch(p){S("Failed to create Apple Pay session",p,{clientId:this.clientId});return}c.onvalidatemerchant=p=>m(this,null,function*(){try{let y=yield i(p.validationURL);c==null||c.completeMerchantValidation(y)}catch(y){throw S(`${hr} Failed to complete merchant validation`,y,{clientId:this.clientId}),new P(`Failed to complete merchant validation: ${F(y)}`)}}),c.onpaymentauthorized=p=>m(this,null,function*(){try{let y=p.payment.token,d=yield this.fingerprint(),g=yield s(y,d);switch(g.status){case"TransactionPending":case"TransactionSuccess":{c==null||c.completePayment(ApplePaySession.STATUS_SUCCESS);break}case"TransactionFailure":{c==null||c.completePayment(ApplePaySession.STATUS_FAILURE);break}default:{let h="Invalid transaction status",b=new P(`${h} ${g.status}`);throw S(`${at} Invalid transaction status`,b,{clientId:this.clientId}),b}}}catch(y){throw c==null||c.completePayment(ApplePaySession.STATUS_FAILURE),S(`${at} Failed to create payment`,y,{clientId:this.clientId}),new P(`Failed to create payment: ${F(y)}`)}}),c.oncancel=()=>{this.onCancelPayment()},c.begin()}}onClickSamsungPaySessionHandler(t,r,n,i,s,o,u){return()=>m(this,null,function*(){if(!this.samsungPayClient){let a="Samsung Pay client not initialized",c=new Error(a);throw S(`${x} ${a}`,c,{clientId:this.clientId}),c}try{let a={orderNumber:i,merchant:{name:n,url:s,id:o,countryCode:"ZA"},amount:{option:"FORMAT_TOTAL_PRICE_ONLY",currency:t,total:r}},c=yield this.fingerprint();oe(`${x} Loading payment sheet`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentMethods:U,transactionDetail:a}});let l=yield this.samsungPayClient.loadPaymentSheet(U,a);oe(`${x} Received payment credential`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentCredential:l}});let f=yield u(l,c);switch(f.status){case"TransactionPending":break;case"TransactionFailure":{this.samsungPayClient.notify({status:"REJECTED"});break}case"TransactionSuccess":{this.samsungPayClient.notify({status:"CHARGED"});break}default:{this.samsungPayClient.notify({status:"ERRED"});let p=`${x} Invalid transaction status: ${f.status}`,y=new P(p);throw S(p,y,{clientId:this.clientId,type:"SAMSUNG_PAY"}),y}}}catch(a){throw S(`${x} Failed to create payment`,a,{clientId:this.clientId,type:"SAMSUNG_PAY"}),new P(`${x} Failed to create payment: ${F(a)}`)}})}onClickGooglePaySessionHandler(t){return r=>m(this,null,function*(){try{let n=yield this.fingerprint(),i=yield t(r.paymentMethodData.tokenizationData.token,n);switch(i.status){case"TransactionPending":case"TransactionFailure":case"TransactionSuccess":break;default:{let s=`${pe} Invalid transaction status: ${i.status}`,o=new P(s);throw S(s,o,{clientId:this.clientId}),o}}}catch(n){throw S(`${pe} Failed to create payment`,n,{clientId:this.clientId}),new P(`${pe} Failed to create payment: ${F(n)}`)}})}};export{st as StitchWalletClientSdk,me as WalletType};
26
+ `);return r(s)})}function Mn(e){return _((t,n,r)=>{let o=e.find(s=>s===t);return o!==void 0?n(o):r(`Must be one of ${e.map(s=>$(s)).join(", ")}`)})}function Ln(e){return typeof e=="function"?e():e}var Zi=Dn(null),Yi=Dn(void 0),Hi=_((e,t,n)=>e==null?t(e):n("Must be undefined or null"));function Fn(e,t){let n=re(Yi,e);return arguments.length>=2?n.transform(r=>r!=null?r:Ln(t)):n}function it(e,t){let n=re(Hi,e);return arguments.length>=2?n.transform(r=>r!=null?r:Ln(t)):n}function Dn(e){return _((t,n,r)=>t===e?n(e):r(`Must be ${typeof e=="symbol"?String(e):$(e)}`))}var Fa=_((e,t,n)=>t(e));var oe=_((e,t,n)=>typeof e=="boolean"?t(e):n("Must be boolean")),Da=_((e,t,n)=>t(!!e));function zi(e,t){let n=t!==void 0?e:void 0,r=t!==void 0?t:e;return Nn.then((o,s,a)=>{var f;let c={},l=new Map;for(let i of Object.keys(o)){let u=o[i],d=n==null?void 0:n.decode(i);if((d==null?void 0:d.ok)===!1)return a(G(o,`Invalid key ${$(i)}: ${Mi(d.error)}`));let g=(f=d==null?void 0:d.value)!=null?f:i,m=r.decode(u);m.ok?l.size===0&&(c[g]=m.value):(l.set(i,m.error),c={})}return l.size>0?a(En(xn(o),l)):s(c)})}var Bi=/^([A-Za-z]{3,9}(?:[+][A-Za-z]{3,9})?):\/\/(?:([-;:&=+$,\w]+)@)?(?:([A-Za-z0-9.-]+)(?::([0-9]{2,5}))?)(\/(?:[-+~%/.,\w]*)?(?:\?[-+=&;%@.,/\w]*)?(?:#[.,!/\w]*)?)?$/,jn=_((e,t,n)=>Ei(e)?t(e):n("Must be string")),J=j(/\S/,"Must be non-empty string");function j(e,t){return jn.refine(n=>e.test(n),t)}var ja=j(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"Must be email"),Ji=re(j(Bi,"Must be URL").transform(e=>new URL(e)),Gi(URL)),Va=Ji.refine(e=>e.protocol==="https:","Must be an HTTPS URL"),Ga=j(/^[a-z_][a-z0-9_]*$/i,"Must be valid identifier");var Vn=j(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Must be uuid"),Wa=Vn.refine(e=>e[14]==="1","Must be uuidv1"),$a=Vn.refine(e=>e[14]==="4","Must be uuidv4"),Xi=j(/^[0-9]+$/,"Must only contain digits"),Ua=j(/^[0-9a-f]+$/i,"Must only contain hexadecimal digits"),Za=Xi.transform(Number),Ki=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:[.]\d+)?(?:Z|[+-]\d{2}:?\d{2})$/,qi=_((e,t,n)=>wn(e)?t(e):n("Must be a Date")),Qi=j(Ki,"Must be ISO8601 format").transform(e=>{let t=new Date(e);if(isNaN(t.getTime()))throw new Error("Must be valid date/time value");return t}),Ya=re(qi,Qi).describe("Must be a Date or date string"),ea=_((e,t,n)=>Pi(e)?t(e):n("Must be number")),ie=ea.refine(e=>Number.isFinite(e),"Number must be finite"),ta=ie.refine(e=>Number.isInteger(e),"Number must be an integer"),Gn=ie.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),Ha=ta.refine(e=>e>=0&&!Object.is(e,-0),"Number must be positive"),za=_((e,t,n)=>_i(e)?t(e):n("Must be bigint")),na=Tn(()=>zi(Wn)),ra=Tn(()=>ot(Wn)),Wn=re(Zi,jn,ie,oe,na,ra).describe("Must be valid JSON value");var Se=3,$n=500,oa=Mn(["visa","mastercard","amex"]),Re=it(B({allowedNetworks:it(ot(oa))})),ia=B({analytics:B({changeEventDebounceDelayMs:Gn}),evervault:B({teamId:J,appId:J}),fingerprint:B({disabled:oe,useEmulation:oe,ossEnabled:Fn(oe),publicKey:J,endpoint:J,scriptUrlPattern:J,cacheDurationInSeconds:ie}),card:Re,apple:Re,google:Re,samsung:Re});function ae(e,t){return h(this,null,function*(){try{let n=0;for(;n<Se;)try{let r=yield fetch(`https://public-keys.stitch.money/${e}`,{signal:t});if(r.ok)return{type:"success",runtimeConfig:ia.verify(yield r.json())};if(n++,n===Se)return{type:"error",error:new Error(`[${ae.name}] Failed to retrieve runtime config after ${Se} attempts. public-keys worker returned ${r.status} response`)};yield new Promise(o=>setTimeout(o,$n))}catch(r){if(n++,n===Se)throw r;yield new Promise(o=>setTimeout(o,$n))}return{type:"error",error:new Error(`[${ae.name}] Failed to retrieve runtime config`)}}catch(n){return n instanceof Error?{type:"error",error:n}:typeof n=="string"?{type:"error",error:new Error(n)}:{type:"error",error:new Error(`[${ae.name}] Failed to retrieve runtime config. Unknown error thrown`)}}})}import{v4 as ca}from"uuid";var aa="9ba67dd8d5b247cfb3f76e";function Pe(e){return{version:"2",serviceId:aa,protocol:"PROTOCOL_3DS",allowedBrands:K(e==null?void 0:e.samsung).map(t=>gt(t))}}function Un(e){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["CRYPTOGRAM_3DS"],allowedCardNetworks:K(e==null?void 0:e.google).map(t=>mt(t))}}]}}function Zn(e){return h(this,null,function*(){if(!window.ApplePaySession)return!1;let t=ApplePaySession;if(t.applePayCapabilities&&e)try{return(yield t.applePayCapabilities(e)).paymentCredentialStatus!=="applePayUnsupported"}catch(n){P("[determineApplePaySupport] failed to get applePayCapabilities, falling back to canMakePayments",n,{merchantIdentifier:e})}return t.canMakePayments()})}function Yn(){if(!window.ApplePaySession)return-1;let t=n=>n===0?-1:ApplePaySession.supportsVersion(n)?n:t(n-1);return t(14)}function Hn(e,t){return h(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(Un(t))).result}catch(n){return!1}})}function zn(e,t){return h(this,null,function*(){if(!e)return!1;try{return(yield e.isReadyToPay(Pe(t))).result}catch(n){return!1}})}var M=class extends Error{constructor(t){super(t),this.name="SessionError"}};var se=e=>e instanceof Error?e.toString():JSON.stringify(e);var at="3.10.0";var ua="[onvalidatemerchant]",Bn="[onpaymentauthorized]",X="[onClickSamsungPaySessionHandler]",st="[onClickGooglePaySessionHandler]",Jn=class{constructor(t){k(this,"onCancelPayment");k(this,"clientId");k(this,"gatewayMerchantId");k(this,"applePayIsSupported",!1);k(this,"samsungPayIsSupported",!1);k(this,"googlePayIsSupported",!1);k(this,"runtimeConfig");k(this,"fingerprintAgent");k(this,"googlePayClient");k(this,"samsungPayClient");var a,c,l;Fe({source:"wallets-client",version:at});let{onCancelPayment:n,clientId:r,gatewayMerchantId:o}=t,s=(l=(c=(a=globalThis.google)==null?void 0:a.payments)==null?void 0:c.api)==null?void 0:l.PaymentsClient;this.googlePayClient=s?new s({environment:r!=null&&r.startsWith("test-")?"TEST":"PRODUCTION"}):void 0,this.samsungPayClient=window.SamsungPay?new window.SamsungPay.PaymentClient({environment:r!=null&&r.startsWith("test-")?"STAGE":"PRODUCTION",nonce:ca()}):void 0,this.onCancelPayment=n!=null?n:()=>{},this.clientId=r,this.gatewayMerchantId=o,this.loadFingerprintAgent()}loadRuntimeConfig(){return h(this,null,function*(){var t,n;if(this.runtimeConfig===void 0&&this.clientId){let r=yield ae(this.clientId);if(r.type==="error"){let o=(n=(t=r.error)==null?void 0:t.message)!=null?n:"Failed to load runtime configuration";throw P(o,r.error,{clientId:this.clientId}),r.error?r.error:new Error(o)}this.runtimeConfig=r.runtimeConfig}})}loadFingerprintAgent(){return h(this,null,function*(){this.fingerprintAgent===void 0&&(this.runtimeConfig===void 0&&(yield this.loadRuntimeConfig()),this.runtimeConfig!==void 0&&!this.runtimeConfig.fingerprint.disabled&&(this.fingerprintAgent=yield yn({config:this.runtimeConfig.fingerprint})))})}fingerprint(){return h(this,null,function*(){var n;let t=yield hn({config:(n=this.runtimeConfig)==null?void 0:n.fingerprint,agent:this.fingerprintAgent,clientId:this.clientId,sdkVersion:at});return Fe({fingerprint:t}),t})}supportedPaymentMethods(){return h(this,null,function*(){let t=[];try{yield this.loadRuntimeConfig()}catch(n){}return this.applePayIsSupported=yield Zn(this.gatewayMerchantId),this.applePayIsSupported&&t.push("APPLE_PAY"),this.samsungPayIsSupported=yield zn(this.samsungPayClient,this.runtimeConfig),this.samsungPayIsSupported&&t.push("SAMSUNG_PAY"),this.googlePayIsSupported=yield Hn(this.googlePayClient,this.runtimeConfig),this.googlePayIsSupported&&t.push("GOOGLE_PAY"),t})}onClickApplePaySessionHandler(t,n,r,o,s,a){let c=Yn();return()=>{var u,d,g;let l=K((u=this.runtimeConfig)==null?void 0:u.apple).map(m=>pt(m)),f={countryCode:"ZA",currencyCode:t,supportedNetworks:l,merchantCapabilities:["supports3DS"],total:{label:r,amount:n.toString()}};a&&(f.recurringPaymentRequest={paymentDescription:r,billingAgreement:a.billingAgreement,regularBilling:{label:r,amount:((d=a.recurringAmount)!=null?d:n).toString(),paymentTiming:"recurring",recurringPaymentIntervalUnit:a.recurringIntervalUnit,recurringPaymentIntervalCount:(g=a.recurringIntervalCount)!=null?g:1},managementURL:a.managementUrl});let i;try{i=new ApplePaySession(c,f)}catch(m){P("Failed to create Apple Pay session",m,{clientId:this.clientId});return}i.onvalidatemerchant=m=>h(this,null,function*(){try{let p=yield o(m.validationURL);if(!i)throw new Error("ApplePaySession is missing");if(p==null||typeof p!="object")throw new Error(`verifyCallbackResponse is not an object: ${JSON.stringify(p)}`);if(Object.keys(p).length===0)throw new Error(`verifyCallbackResponse is an empty object: ${JSON.stringify(p)}`);i.completeMerchantValidation(p)}catch(p){throw P(`${ua} Failed to complete merchant validation`,p,{clientId:this.clientId}),new M(`Failed to complete merchant validation: ${se(p)}`)}}),i.onpaymentauthorized=m=>h(this,null,function*(){try{let p=m.payment.token,y=yield this.fingerprint(),w=yield s(p,y);switch(w.status){case"TransactionPending":case"TransactionSuccess":{i==null||i.completePayment(ApplePaySession.STATUS_SUCCESS);break}case"TransactionFailure":{i==null||i.completePayment(ApplePaySession.STATUS_FAILURE);break}default:{let N="Invalid transaction status",O=new M(`${N} ${w.status}`);throw P(`${Bn} Invalid transaction status`,O,{clientId:this.clientId}),O}}}catch(p){throw i==null||i.completePayment(ApplePaySession.STATUS_FAILURE),P(`${Bn} Failed to create payment`,p,{clientId:this.clientId}),new M(`Failed to create payment: ${se(p)}`)}}),i.oncancel=()=>{this.onCancelPayment()},i.begin()}}onClickSamsungPaySessionHandler(t,n,r,o,s,a,c){return()=>h(this,null,function*(){if(!this.samsungPayClient){let l="Samsung Pay client not initialized",f=new Error(l);throw P(`${X} ${l}`,f,{clientId:this.clientId}),f}try{let l={orderNumber:o,merchant:{name:r,url:s,id:a,countryCode:"ZA"},amount:{option:"FORMAT_TOTAL_PRICE_ONLY",currency:t,total:n}},f=yield this.fingerprint(),i=Pe(this.runtimeConfig);De(`${X} Loading payment sheet`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentMethods:i,transactionDetail:l}});let u=yield this.samsungPayClient.loadPaymentSheet(i,l);De(`${X} Received payment credential`,{clientId:this.clientId,type:"SAMSUNG_PAY",samsungPay:{paymentCredential:u}});let d=yield c(u,f);switch(d.status){case"TransactionPending":break;case"TransactionFailure":{this.samsungPayClient.notify({status:"REJECTED"});break}case"TransactionSuccess":{this.samsungPayClient.notify({status:"CHARGED"});break}default:{this.samsungPayClient.notify({status:"ERRED"});let g=`${X} Invalid transaction status: ${d.status}`,m=new M(g);throw P(g,m,{clientId:this.clientId,type:"SAMSUNG_PAY"}),m}}}catch(l){throw P(`${X} Failed to create payment`,l,{clientId:this.clientId,type:"SAMSUNG_PAY"}),new M(`${X} Failed to create payment: ${se(l)}`)}})}onClickGooglePaySessionHandler(t){return n=>h(this,null,function*(){try{let r=yield this.fingerprint(),o=yield t(n.paymentMethodData.tokenizationData.token,r);switch(o.status){case"TransactionPending":case"TransactionFailure":case"TransactionSuccess":break;default:{let s=`${st} Invalid transaction status: ${o.status}`,a=new M(s);throw P(s,a,{clientId:this.clientId}),a}}}catch(r){throw P(`${st} Failed to create payment`,r,{clientId:this.clientId}),new M(`${st} Failed to create payment: ${se(r)}`)}})}};export{Jn as StitchWalletClientSdk,dt as WalletType};
15
27
  //# sourceMappingURL=index.js.map