@zerohash-sdk/fiat-account-link-js 1.15.2 → 1.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -2
- package/dist/index.js +49 -49
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -247,15 +247,20 @@ declare abstract class BaseJsSdk<Config extends BaseConfig<never> = BaseConfig>
|
|
|
247
247
|
return this.scriptLoadingPromise;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
private async waitForWebComponent(
|
|
250
|
+
private async waitForWebComponent() {
|
|
251
251
|
if (this.getWebComponent()) {
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
// The script has already loaded (loadScript awaited its onLoad); this only
|
|
256
|
+
// covers the window until the custom element registers. Under load (CI, slow
|
|
257
|
+
// devices) that can take longer than a few seconds, so the grace period is
|
|
258
|
+
// generous — a genuine load failure still fails fast via loadScript's
|
|
259
|
+
// onError, not this timer.
|
|
255
260
|
return new Promise<void>((resolve, reject) => {
|
|
256
261
|
const timeoutId = setTimeout(() => {
|
|
257
262
|
reject(new Error(`Timeout waiting for ${this.webComponentTag} to be defined`));
|
|
258
|
-
},
|
|
263
|
+
}, DEFAULT_WEB_COMPONENT_TIMEOUT_MS);
|
|
259
264
|
|
|
260
265
|
customElements
|
|
261
266
|
.whenDefined(this.webComponentTag)
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const y = "production", z = "JWT token is required and must be a string.",
|
|
1
|
+
const y = "production", z = "JWT token is required and must be a string.", M = {
|
|
2
2
|
dev: "https://grafana-faro-collector.dev.0hash.com/collect",
|
|
3
3
|
cert: "https://grafana-faro-collector.cert.zerohash.com/collect",
|
|
4
4
|
prod: "https://grafana-faro-collector.zerohash.com/collect",
|
|
@@ -6,7 +6,7 @@ const y = "production", z = "JWT token is required and must be a string.", F = {
|
|
|
6
6
|
"eu-prod": "https://grafana-faro-collector.zerohash.eu/collect",
|
|
7
7
|
sandbox: "https://grafana-faro-collector.cert.zerohash.com/collect",
|
|
8
8
|
production: "https://grafana-faro-collector.zerohash.com/collect"
|
|
9
|
-
},
|
|
9
|
+
}, F = (t) => {
|
|
10
10
|
if (!t || typeof t != "string")
|
|
11
11
|
return null;
|
|
12
12
|
const e = t.split(".");
|
|
@@ -21,37 +21,37 @@ const y = "production", z = "JWT token is required and must be a string.", F = {
|
|
|
21
21
|
} catch {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
},
|
|
24
|
+
}, O = (t, e) => F(e) !== "eu" ? t : t === "cert" ? "eu-cert" : t === "prod" ? "eu-prod" : t, U = (t) => {
|
|
25
25
|
if (!t || typeof t != "string")
|
|
26
26
|
return {};
|
|
27
27
|
const e = t.split(".");
|
|
28
28
|
if (e.length < 2)
|
|
29
29
|
return {};
|
|
30
30
|
try {
|
|
31
|
-
const r = e[1].replace(/-/g, "+").replace(/_/g, "/"), n = r + "===".slice(0, (4 - r.length % 4) % 4), o = typeof atob < "u" ? atob(n) : Buffer.from(n, "base64").toString("utf-8"),
|
|
31
|
+
const r = e[1].replace(/-/g, "+").replace(/_/g, "/"), n = r + "===".slice(0, (4 - r.length % 4) % 4), o = typeof atob < "u" ? atob(n) : Buffer.from(n, "base64").toString("utf-8"), d = JSON.parse(o), i = d?.payload ?? {}, s = (a) => typeof a == "string" && a.length > 0 ? a : void 0;
|
|
32
32
|
return {
|
|
33
33
|
participantCode: s(i.participant_code),
|
|
34
34
|
platformName: s(i.platform_name),
|
|
35
|
-
platformCode: s(
|
|
35
|
+
platformCode: s(d.platform_code),
|
|
36
36
|
region: s(i.region)
|
|
37
37
|
};
|
|
38
38
|
} catch {
|
|
39
39
|
return {};
|
|
40
40
|
}
|
|
41
41
|
}, N = (t, e, r) => {
|
|
42
|
-
const n =
|
|
42
|
+
const n = O(e, r);
|
|
43
43
|
return t[n] ?? t[e] ?? t.prod;
|
|
44
|
-
},
|
|
45
|
-
const n =
|
|
44
|
+
}, W = (t, e, r) => {
|
|
45
|
+
const n = O(e, r);
|
|
46
46
|
return t[n] ?? t[e];
|
|
47
47
|
}, w = () => {
|
|
48
|
-
},
|
|
48
|
+
}, P = () => {
|
|
49
49
|
const t = new Uint8Array(8);
|
|
50
50
|
return globalThis.crypto.getRandomValues(t), Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
51
51
|
}, $ = (t, e) => {
|
|
52
|
-
const r =
|
|
52
|
+
const r = P(), n = globalThis.__ZH_WEB_SDK_VERSION__, o = {};
|
|
53
53
|
t.claims.participantCode && (o.participant_code = t.claims.participantCode), t.claims.platformName && (o.platform_name = t.claims.platformName), t.claims.platformCode && (o.platform_code = t.claims.platformCode), t.claims.region && (o.region = t.claims.region), n && (o.zh_web_sdk_version = n);
|
|
54
|
-
const
|
|
54
|
+
const d = {
|
|
55
55
|
meta: {
|
|
56
56
|
app: { name: t.appName, version: e ?? "unknown", environment: t.env },
|
|
57
57
|
session: { id: r, attributes: o },
|
|
@@ -73,7 +73,7 @@ const y = "production", z = "JWT token is required and must be a string.", F = {
|
|
|
73
73
|
}
|
|
74
74
|
]
|
|
75
75
|
};
|
|
76
|
-
return { sessionId: r, payload:
|
|
76
|
+
return { sessionId: r, payload: d };
|
|
77
77
|
}, B = (t, e, r) => {
|
|
78
78
|
if (!t || typeof fetch > "u")
|
|
79
79
|
return;
|
|
@@ -89,49 +89,49 @@ const y = "production", z = "JWT token is required and must be a string.", F = {
|
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}, V = (t) => {
|
|
92
|
-
const { webComponentTag: e, appName: r, appVersion: n, scriptUrls: o, fallbackScriptUrls:
|
|
92
|
+
const { webComponentTag: e, appName: r, appVersion: n, scriptUrls: o, fallbackScriptUrls: d, collectorUrls: i, env: s, jwt: a, timeoutMs: S = 15e3, onLoad: v, onError: I } = t;
|
|
93
93
|
if (typeof document > "u")
|
|
94
94
|
return w;
|
|
95
95
|
const h = `${e}-script-${s}`;
|
|
96
96
|
if (customElements.get(e) || document.getElementById(h))
|
|
97
97
|
return w;
|
|
98
|
-
const A =
|
|
99
|
-
let m = !1,
|
|
98
|
+
const A = U(a), D = t.report ?? ((l) => B(i && W(i, s, a), l, n));
|
|
99
|
+
let m = !1, T = 0, g;
|
|
100
100
|
const f = () => {
|
|
101
101
|
g !== void 0 && clearTimeout(g);
|
|
102
|
-
}, _ = (l, u,
|
|
102
|
+
}, _ = (l, u, c) => {
|
|
103
103
|
if (m)
|
|
104
104
|
return;
|
|
105
|
-
const k = Math.round(performance.now() -
|
|
105
|
+
const k = Math.round(performance.now() - T), b = {
|
|
106
106
|
webComponentTag: e,
|
|
107
107
|
appName: r,
|
|
108
108
|
env: s,
|
|
109
109
|
scriptUrl: u,
|
|
110
110
|
reason: l,
|
|
111
|
-
triedFallback:
|
|
111
|
+
triedFallback: c,
|
|
112
112
|
elapsedMs: k,
|
|
113
113
|
claims: A
|
|
114
114
|
};
|
|
115
|
-
D(
|
|
116
|
-
const E =
|
|
115
|
+
D(b);
|
|
116
|
+
const E = c ? void 0 : N(d ?? {}, s, a);
|
|
117
117
|
if (E && E !== u) {
|
|
118
|
-
|
|
118
|
+
C(E, !0);
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
|
-
m = !0, f(), document.getElementById(h)?.remove(), I?.(
|
|
122
|
-
},
|
|
123
|
-
f(),
|
|
124
|
-
const
|
|
125
|
-
|
|
121
|
+
m = !0, f(), document.getElementById(h)?.remove(), I?.(b);
|
|
122
|
+
}, C = (l, u) => {
|
|
123
|
+
f(), T = performance.now();
|
|
124
|
+
const c = document.createElement("script");
|
|
125
|
+
c.id = h, c.src = l, c.type = "module", c.async = !0, c.onload = () => {
|
|
126
126
|
setTimeout(() => {
|
|
127
127
|
m || (customElements.get(e) ? (m = !0, f(), v?.()) : _("not-defined", l, u));
|
|
128
128
|
}, 0);
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
return
|
|
129
|
+
}, c.onerror = () => _("network", l, u), g = setTimeout(() => _("timeout", l, u), S), document.getElementById(h)?.remove(), document.head.appendChild(c);
|
|
130
|
+
}, R = N(o, s, a);
|
|
131
|
+
return R ? (C(R, !1), () => {
|
|
132
132
|
m = !0, f();
|
|
133
133
|
}) : w;
|
|
134
|
-
}, j = {};
|
|
134
|
+
}, j = {}, H = 1e4;
|
|
135
135
|
class J {
|
|
136
136
|
config;
|
|
137
137
|
state;
|
|
@@ -234,7 +234,7 @@ class J {
|
|
|
234
234
|
webComponentTag: this.webComponentTag,
|
|
235
235
|
appName: this.webComponentTag,
|
|
236
236
|
scriptUrls: this.getEffectiveScriptUrls(),
|
|
237
|
-
collectorUrls:
|
|
237
|
+
collectorUrls: M,
|
|
238
238
|
env: this.getEnvironment(),
|
|
239
239
|
jwt: this.config.jwt,
|
|
240
240
|
onLoad: e,
|
|
@@ -251,16 +251,16 @@ class J {
|
|
|
251
251
|
return this.scriptLoadingPromise;
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
async waitForWebComponent(
|
|
254
|
+
async waitForWebComponent() {
|
|
255
255
|
if (!this.getWebComponent())
|
|
256
|
-
return new Promise((
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
},
|
|
256
|
+
return new Promise((e, r) => {
|
|
257
|
+
const n = setTimeout(() => {
|
|
258
|
+
r(new Error(`Timeout waiting for ${this.webComponentTag} to be defined`));
|
|
259
|
+
}, H);
|
|
260
260
|
customElements.whenDefined(this.webComponentTag).then(() => {
|
|
261
|
-
clearTimeout(
|
|
262
|
-
}).catch((
|
|
263
|
-
clearTimeout(
|
|
261
|
+
clearTimeout(n), e();
|
|
262
|
+
}).catch((o) => {
|
|
263
|
+
clearTimeout(n), r(o);
|
|
264
264
|
});
|
|
265
265
|
});
|
|
266
266
|
}
|
|
@@ -282,18 +282,18 @@ class J {
|
|
|
282
282
|
}), e;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
const p = {
|
|
286
|
-
local:
|
|
285
|
+
const x = {}, G = typeof import.meta < "u" && x?.VITE_LOCAL_CDN_HOST || "http://localhost:5173", p = {
|
|
286
|
+
local: G,
|
|
287
287
|
dev: "https://sdk-cdn.dev.0hash.com",
|
|
288
288
|
cert: "https://sdk-cdn.cert.zerohash.com",
|
|
289
289
|
prod: "https://sdk-cdn.zerohash.com",
|
|
290
290
|
"eu-cert": "https://sdk-cdn.cert.zerohash.eu",
|
|
291
291
|
"eu-prod": "https://sdk-cdn.zerohash.eu"
|
|
292
|
-
},
|
|
293
|
-
const { eu: n = !1, legacyAliases: o = !1, local:
|
|
294
|
-
local: i(
|
|
292
|
+
}, K = "https://sdk-cdn.gating.0hash.com", Y = (t, e, r = {}) => {
|
|
293
|
+
const { eu: n = !1, legacyAliases: o = !1, local: d = p.local } = r, i = (a) => `${a}/${t}/${e}`, s = {
|
|
294
|
+
local: i(d),
|
|
295
295
|
dev: i(p.dev),
|
|
296
|
-
gating: i(
|
|
296
|
+
gating: i(K),
|
|
297
297
|
cert: i(p.cert),
|
|
298
298
|
prod: i(p.prod)
|
|
299
299
|
};
|
|
@@ -303,7 +303,7 @@ var L;
|
|
|
303
303
|
(function(t) {
|
|
304
304
|
t.NETWORK_ERROR = "network_error", t.AUTH_ERROR = "auth_error", t.NOT_FOUND_ERROR = "not_found_error", t.VALIDATION_ERROR = "validation_error", t.SERVER_ERROR = "server_error", t.CLIENT_ERROR = "client_error", t.UNKNOWN_ERROR = "unknown_error";
|
|
305
305
|
})(L || (L = {}));
|
|
306
|
-
class
|
|
306
|
+
class q extends J {
|
|
307
307
|
errorMessages = {
|
|
308
308
|
ALREADY_RENDERED: "FiatAccountLink widget is already rendered. Call destroy() before rendering again.",
|
|
309
309
|
NOT_RENDERED: "FiatAccountLink widget is not rendered. Call render() first.",
|
|
@@ -311,7 +311,7 @@ class G extends J {
|
|
|
311
311
|
SCRIPT_LOAD_FAILED: "Failed to load the Connect FiatAccountLink script.",
|
|
312
312
|
WEB_COMPONENT_NOT_DEFINED: "Web component is not defined. Script may not be loaded."
|
|
313
313
|
};
|
|
314
|
-
scriptUrls =
|
|
314
|
+
scriptUrls = Y("fiat-account-link-web", "index.js", {
|
|
315
315
|
legacyAliases: !0,
|
|
316
316
|
eu: !0
|
|
317
317
|
});
|
|
@@ -334,6 +334,6 @@ class G extends J {
|
|
|
334
334
|
}
|
|
335
335
|
export {
|
|
336
336
|
L as ErrorCode,
|
|
337
|
-
|
|
338
|
-
|
|
337
|
+
q as FiatAccountLink,
|
|
338
|
+
q as default
|
|
339
339
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c
|
|
1
|
+
(function(a,c){typeof exports=="object"&&typeof module<"u"?c(exports):typeof define=="function"&&define.amd?define(["exports"],c):(a=typeof globalThis<"u"?globalThis:a||self,c(a.FiatAccountLink={}))})(this,(function(a){"use strict";var c=typeof document<"u"?document.currentScript:null;const y="production",I="JWT token is required and must be a string.",A={dev:"https://grafana-faro-collector.dev.0hash.com/collect",cert:"https://grafana-faro-collector.cert.zerohash.com/collect",prod:"https://grafana-faro-collector.zerohash.com/collect","eu-cert":"https://grafana-faro-collector.cert.zerohash.eu/collect","eu-prod":"https://grafana-faro-collector.zerohash.eu/collect",sandbox:"https://grafana-faro-collector.cert.zerohash.com/collect",production:"https://grafana-faro-collector.zerohash.com/collect"},D=t=>{if(!t||typeof t!="string")return null;const e=t.split(".");if(e.length<2)return null;try{const n=e[1].replace(/-/g,"+").replace(/_/g,"/"),r=n+"===".slice(0,(4-n.length%4)%4),o=typeof atob<"u"?atob(r):Buffer.from(r,"base64").toString("utf-8"),s=JSON.parse(o)?.payload?.region;if(typeof s!="string")return null;const i=s.toLowerCase();return i==="us"||i==="eu"?i:null}catch{return null}},w=(t,e)=>D(e)!=="eu"?t:t==="cert"?"eu-cert":t==="prod"?"eu-prod":t,U=t=>{if(!t||typeof t!="string")return{};const e=t.split(".");if(e.length<2)return{};try{const n=e[1].replace(/-/g,"+").replace(/_/g,"/"),r=n+"===".slice(0,(4-n.length%4)%4),o=typeof atob<"u"?atob(r):Buffer.from(r,"base64").toString("utf-8"),u=JSON.parse(o),s=u?.payload??{},i=d=>typeof d=="string"&&d.length>0?d:void 0;return{participantCode:i(s.participant_code),platformName:i(s.platform_name),platformCode:i(u.platform_code),region:i(s.region)}}catch{return{}}},b=(t,e,n)=>{const r=w(e,n);return t[r]??t[e]??t.prod},k=(t,e,n)=>{const r=w(e,n);return t[r]??t[e]},E=()=>{},F=()=>{const t=new Uint8Array(8);return globalThis.crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")},M=(t,e)=>{const n=F(),r=globalThis.__ZH_WEB_SDK_VERSION__,o={};t.claims.participantCode&&(o.participant_code=t.claims.participantCode),t.claims.platformName&&(o.platform_name=t.claims.platformName),t.claims.platformCode&&(o.platform_code=t.claims.platformCode),t.claims.region&&(o.region=t.claims.region),r&&(o.zh_web_sdk_version=r);const u={meta:{app:{name:t.appName,version:e??"unknown",environment:t.env},session:{id:n,attributes:o},browser:typeof navigator<"u"?{userAgent:navigator.userAgent}:void 0,page:typeof window<"u"?{url:window.location.origin}:void 0},logs:[{message:`Failed to load the script for ${t.webComponentTag} from ${t.env} environment.`,level:"error",timestamp:new Date().toISOString(),context:{web_component:t.webComponentTag,script_url:t.scriptUrl,reason:t.reason,tried_fallback:String(t.triedFallback),elapsed_ms:String(t.elapsedMs)}}]};return{sessionId:n,payload:u}},z=(t,e,n)=>{if(!t||typeof fetch>"u")return;const{sessionId:r,payload:o}=M(e,n);try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","x-faro-session-id":r},body:JSON.stringify(o),keepalive:!0}).catch(()=>{})}catch{}},P=t=>{const{webComponentTag:e,appName:n,appVersion:r,scriptUrls:o,fallbackScriptUrls:u,collectorUrls:s,env:i,jwt:d,timeoutMs:J=15e3,onLoad:x,onError:q}=t;if(typeof document>"u")return E;const g=`${e}-script-${i}`;if(customElements.get(e)||document.getElementById(g))return E;const G=U(d),K=t.report??(f=>z(s&&k(s,i,d),f,r));let h=!1,N=0,T;const _=()=>{T!==void 0&&clearTimeout(T)},C=(f,m,l)=>{if(h)return;const Y=Math.round(performance.now()-N),v={webComponentTag:e,appName:n,env:i,scriptUrl:m,reason:f,triedFallback:l,elapsedMs:Y,claims:G};K(v);const R=l?void 0:b(u??{},i,d);if(R&&R!==m){S(R,!0);return}h=!0,_(),document.getElementById(g)?.remove(),q?.(v)},S=(f,m)=>{_(),N=performance.now();const l=document.createElement("script");l.id=g,l.src=f,l.type="module",l.async=!0,l.onload=()=>{setTimeout(()=>{h||(customElements.get(e)?(h=!0,_(),x?.()):C("not-defined",f,m))},0)},l.onerror=()=>C("network",f,m),T=setTimeout(()=>C("timeout",f,m),J),document.getElementById(g)?.remove(),document.head.appendChild(l)},O=b(o,i,d);return O?(S(O,!1),()=>{h=!0,_()}):E},W={},j=1e4;class ${config;state;scriptLoadingPromise;constructor(e){if(!e.jwt||typeof e.jwt!="string")throw new Error(I);this.config={...e,env:e.env||y,theme:e.theme},this.state={initialized:!1,scriptLoaded:!1,container:null,element:null}}async render(e){if(!e||!(e instanceof HTMLElement))throw new Error(this.errorMessages.INVALID_CONTAINER);if(this.state.initialized)throw new Error(this.errorMessages.ALREADY_RENDERED);try{await this.ensureScriptLoaded();const n=this.createWebComponent();e.innerHTML="",e.appendChild(n),this.state.container=e,this.state.element=n,this.state.initialized=!0}catch(n){throw console.error("Failed to render widget:",n),n}}updateConfig(e){if(!this.state.initialized||!this.state.element)throw new Error(this.errorMessages.NOT_RENDERED);const n=this.state.element;Object.entries(e).forEach(([r,o])=>{o&&(this.config[r]=o,n[r]=o)})}destroy(){this.state.initialized&&(this.state.element&&this.state.element.parentNode&&this.state.element.parentNode.removeChild(this.state.element),this.state.container&&(this.state.container.innerHTML=""),this.state.container=null,this.state.element=null,this.state.initialized=!1)}isRendered(){return this.state.initialized}getConfig(){return{...this.config}}getEnvironment(){return this.config.env||y}getScriptId(){return`${this.webComponentTag}-script-${this.getEnvironment()}`}isScriptLoaded(){return!!document.getElementById(this.getScriptId())}getWebComponent(){return customElements.get(this.webComponentTag)}getEffectiveScriptUrls(){if(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:c&&c.tagName.toUpperCase()==="SCRIPT"&&c.src||new URL("index.umd.cjs",document.baseURI).href}<"u"){const e=W.VITE_SCRIPT_URL;if(e)return{[this.getEnvironment()]:e}}return this.scriptUrls}async loadScript(){if(!(this.getWebComponent()||this.isScriptLoaded())){if(this.scriptLoadingPromise)return this.scriptLoadingPromise;this.scriptLoadingPromise=new Promise((e,n)=>{P({webComponentTag:this.webComponentTag,appName:this.webComponentTag,scriptUrls:this.getEffectiveScriptUrls(),collectorUrls:A,env:this.getEnvironment(),jwt:this.config.jwt,onLoad:e,onError:r=>{n(new Error(r.reason==="not-defined"?this.errorMessages.WEB_COMPONENT_NOT_DEFINED:`${this.errorMessages.SCRIPT_LOAD_FAILED} (${this.getEnvironment()})`))}})});try{await this.scriptLoadingPromise}catch(e){throw this.scriptLoadingPromise=void 0,e}return this.scriptLoadingPromise}}async waitForWebComponent(){if(!this.getWebComponent())return new Promise((e,n)=>{const r=setTimeout(()=>{n(new Error(`Timeout waiting for ${this.webComponentTag} to be defined`))},j);customElements.whenDefined(this.webComponentTag).then(()=>{clearTimeout(r),e()}).catch(o=>{clearTimeout(r),n(o)})})}async ensureScriptLoaded(){if(!this.state.scriptLoaded)try{await this.loadScript(),await this.waitForWebComponent(),this.state.scriptLoaded=!0}catch(e){throw console.error("Failed to load Connect script:",e),e}}createWebComponent(){const e=document.createElement(this.webComponentTag);return Object.entries(this.config).forEach(([n,r])=>{r&&(e[n]=r)}),e}}const B={},p={local:typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:c&&c.tagName.toUpperCase()==="SCRIPT"&&c.src||new URL("index.umd.cjs",document.baseURI).href}<"u"&&B?.VITE_LOCAL_CDN_HOST||"http://localhost:5173",dev:"https://sdk-cdn.dev.0hash.com",cert:"https://sdk-cdn.cert.zerohash.com",prod:"https://sdk-cdn.zerohash.com","eu-cert":"https://sdk-cdn.cert.zerohash.eu","eu-prod":"https://sdk-cdn.zerohash.eu"},V="https://sdk-cdn.gating.0hash.com",H=(t,e,n={})=>{const{eu:r=!1,legacyAliases:o=!1,local:u=p.local}=n,s=d=>`${d}/${t}/${e}`,i={local:s(u),dev:s(p.dev),gating:s(V),cert:s(p.cert),prod:s(p.prod)};return o&&(i.sandbox=s(p.cert),i.production=s(p.prod)),r&&(i["eu-cert"]=s(p["eu-cert"]),i["eu-prod"]=s(p["eu-prod"])),i};a.ErrorCode=void 0,(function(t){t.NETWORK_ERROR="network_error",t.AUTH_ERROR="auth_error",t.NOT_FOUND_ERROR="not_found_error",t.VALIDATION_ERROR="validation_error",t.SERVER_ERROR="server_error",t.CLIENT_ERROR="client_error",t.UNKNOWN_ERROR="unknown_error"})(a.ErrorCode||(a.ErrorCode={}));class L extends ${errorMessages={ALREADY_RENDERED:"FiatAccountLink widget is already rendered. Call destroy() before rendering again.",NOT_RENDERED:"FiatAccountLink widget is not rendered. Call render() first.",INVALID_CONTAINER:"Invalid container element provided.",SCRIPT_LOAD_FAILED:"Failed to load the Connect FiatAccountLink script.",WEB_COMPONENT_NOT_DEFINED:"Web component is not defined. Script may not be loaded."};scriptUrls=H("fiat-account-link-web","index.js",{legacyAliases:!0,eu:!0});webComponentTag="zerohash-fiat-account-link";render(e){return super.render(e)}updateConfig(e){return super.updateConfig(e)}getConfig(){return super.getConfig()}isRendered(){return super.isRendered()}destroy(){return super.destroy()}}a.FiatAccountLink=L,a.default=L,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|