@sendity/client 0.1.12 → 0.1.13
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/components/sendity.d.ts +1 -0
- package/dist/sendity-client.js +213 -206
- package/package.json +1 -1
|
@@ -98,6 +98,7 @@ export declare class Sendity extends HTMLElement {
|
|
|
98
98
|
private configureRealtime;
|
|
99
99
|
private subscribeToBroadcasting;
|
|
100
100
|
private startPolling;
|
|
101
|
+
private handleVerificationReceived;
|
|
101
102
|
private handleAuthenticated;
|
|
102
103
|
private stopAuthTransports;
|
|
103
104
|
private dispatchPublicEvent;
|
package/dist/sendity-client.js
CHANGED
|
@@ -793,8 +793,8 @@ class Ne extends He {
|
|
|
793
793
|
let d = String(this.options.namespace ?? "").replace(
|
|
794
794
|
/\./g,
|
|
795
795
|
"\\"
|
|
796
|
-
),
|
|
797
|
-
i(
|
|
796
|
+
), l = s.startsWith(d) ? s.substring(d.length + 1) : "." + s;
|
|
797
|
+
i(l, a);
|
|
798
798
|
}), this;
|
|
799
799
|
}
|
|
800
800
|
/**
|
|
@@ -948,7 +948,7 @@ class Et extends He {
|
|
|
948
948
|
*/
|
|
949
949
|
on(i, s) {
|
|
950
950
|
return this.listeners[i] = this.listeners[i] || [], this.events[i] || (this.events[i] = (a, d) => {
|
|
951
|
-
this.name === a && this.listeners[i] && this.listeners[i].forEach((
|
|
951
|
+
this.name === a && this.listeners[i] && this.listeners[i].forEach((l) => l(d));
|
|
952
952
|
}, this.socket.on(i, this.events[i])), this.listeners[i].push(s), this;
|
|
953
953
|
}
|
|
954
954
|
/**
|
|
@@ -1645,7 +1645,7 @@ class Ji {
|
|
|
1645
1645
|
function Yi(g) {
|
|
1646
1646
|
return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g;
|
|
1647
1647
|
}
|
|
1648
|
-
var
|
|
1648
|
+
var Re = { exports: {} };
|
|
1649
1649
|
var gt;
|
|
1650
1650
|
function Zi() {
|
|
1651
1651
|
return gt || (gt = 1, (function(g, i) {
|
|
@@ -1820,7 +1820,7 @@ function Zi() {
|
|
|
1820
1820
|
b.d(v, {
|
|
1821
1821
|
default: () => (
|
|
1822
1822
|
/* binding */
|
|
1823
|
-
|
|
1823
|
+
le
|
|
1824
1824
|
)
|
|
1825
1825
|
});
|
|
1826
1826
|
class E {
|
|
@@ -1829,10 +1829,10 @@ function Zi() {
|
|
|
1829
1829
|
}
|
|
1830
1830
|
create(e) {
|
|
1831
1831
|
this.lastId++;
|
|
1832
|
-
var t = this.lastId, r = this.prefix + t, o = this.name + "[" + t + "]", c = !1,
|
|
1832
|
+
var t = this.lastId, r = this.prefix + t, o = this.name + "[" + t + "]", c = !1, h = function() {
|
|
1833
1833
|
c || (e.apply(null, arguments), c = !0);
|
|
1834
1834
|
};
|
|
1835
|
-
return this[t] =
|
|
1835
|
+
return this[t] = h, { number: t, id: r, name: o, callback: h };
|
|
1836
1836
|
}
|
|
1837
1837
|
remove(e) {
|
|
1838
1838
|
delete this[e.number];
|
|
@@ -1877,17 +1877,17 @@ function Zi() {
|
|
|
1877
1877
|
o.loading[e].push(r);
|
|
1878
1878
|
else {
|
|
1879
1879
|
o.loading[e] = [r];
|
|
1880
|
-
var c = w.createScriptRequest(o.getPath(e, t)),
|
|
1881
|
-
if (o.receivers.remove(
|
|
1880
|
+
var c = w.createScriptRequest(o.getPath(e, t)), h = o.receivers.create(function(f) {
|
|
1881
|
+
if (o.receivers.remove(h), o.loading[e]) {
|
|
1882
1882
|
var y = o.loading[e];
|
|
1883
1883
|
delete o.loading[e];
|
|
1884
|
-
for (var T = function(
|
|
1885
|
-
|
|
1884
|
+
for (var T = function(L) {
|
|
1885
|
+
L || c.cleanup();
|
|
1886
1886
|
}, _ = 0; _ < y.length; _++)
|
|
1887
1887
|
y[_](f, T);
|
|
1888
1888
|
}
|
|
1889
1889
|
});
|
|
1890
|
-
c.send(
|
|
1890
|
+
c.send(h);
|
|
1891
1891
|
}
|
|
1892
1892
|
}
|
|
1893
1893
|
getRoot(e) {
|
|
@@ -1983,12 +1983,12 @@ function Zi() {
|
|
|
1983
1983
|
const jt = function(n, e, t, r, o) {
|
|
1984
1984
|
const c = w.createXHR();
|
|
1985
1985
|
c.open("POST", t.endpoint, !0), c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
1986
|
-
for (var
|
|
1987
|
-
c.setRequestHeader(
|
|
1986
|
+
for (var h in t.headers)
|
|
1987
|
+
c.setRequestHeader(h, t.headers[h]);
|
|
1988
1988
|
if (t.headersProvider != null) {
|
|
1989
1989
|
let f = t.headersProvider();
|
|
1990
|
-
for (var
|
|
1991
|
-
c.setRequestHeader(
|
|
1990
|
+
for (var h in f)
|
|
1991
|
+
c.setRequestHeader(h, f[h]);
|
|
1992
1992
|
}
|
|
1993
1993
|
return c.onreadystatechange = function() {
|
|
1994
1994
|
if (c.readyState === 4)
|
|
@@ -2183,17 +2183,17 @@ function Zi() {
|
|
|
2183
2183
|
function Jt(n) {
|
|
2184
2184
|
var e = [], t = [];
|
|
2185
2185
|
return (function r(o, c) {
|
|
2186
|
-
var
|
|
2186
|
+
var h, f, y;
|
|
2187
2187
|
switch (typeof o) {
|
|
2188
2188
|
case "object":
|
|
2189
2189
|
if (!o)
|
|
2190
2190
|
return null;
|
|
2191
|
-
for (
|
|
2192
|
-
if (e[
|
|
2193
|
-
return { $ref: t[
|
|
2191
|
+
for (h = 0; h < e.length; h += 1)
|
|
2192
|
+
if (e[h] === o)
|
|
2193
|
+
return { $ref: t[h] };
|
|
2194
2194
|
if (e.push(o), t.push(c), Object.prototype.toString.apply(o) === "[object Array]")
|
|
2195
|
-
for (y = [],
|
|
2196
|
-
y[
|
|
2195
|
+
for (y = [], h = 0; h < o.length; h += 1)
|
|
2196
|
+
y[h] = r(o[h], c + "[" + h + "]");
|
|
2197
2197
|
else {
|
|
2198
2198
|
y = {};
|
|
2199
2199
|
for (f in o)
|
|
@@ -2237,21 +2237,21 @@ function Zi() {
|
|
|
2237
2237
|
}
|
|
2238
2238
|
log(e, ...t) {
|
|
2239
2239
|
var r = Dt.apply(this, arguments);
|
|
2240
|
-
|
|
2240
|
+
le.log ? le.log(r) : le.logToConsole && e.bind(this)(r);
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
|
-
const
|
|
2243
|
+
const R = new Yt();
|
|
2244
2244
|
var Zt = function(n, e, t, r, o) {
|
|
2245
|
-
(t.headers !== void 0 || t.headersProvider != null) &&
|
|
2245
|
+
(t.headers !== void 0 || t.headersProvider != null) && R.warn(`To send headers with the ${r.toString()} request, you must use AJAX, rather than JSONP.`);
|
|
2246
2246
|
var c = n.nextAuthCallbackID.toString();
|
|
2247
2247
|
n.nextAuthCallbackID++;
|
|
2248
|
-
var
|
|
2248
|
+
var h = n.getDocument(), f = h.createElement("script");
|
|
2249
2249
|
n.auth_callbacks[c] = function(_) {
|
|
2250
2250
|
o(null, _);
|
|
2251
2251
|
};
|
|
2252
2252
|
var y = "Pusher.auth_callbacks['" + c + "']";
|
|
2253
2253
|
f.src = t.endpoint + "?callback=" + encodeURIComponent(y) + "&" + e;
|
|
2254
|
-
var T =
|
|
2254
|
+
var T = h.getElementsByTagName("head")[0] || h.documentElement;
|
|
2255
2255
|
T.insertBefore(f, T.firstChild);
|
|
2256
2256
|
};
|
|
2257
2257
|
const Qt = Zt;
|
|
@@ -2291,10 +2291,10 @@ function Zi() {
|
|
|
2291
2291
|
}
|
|
2292
2292
|
var nn = function(n, e) {
|
|
2293
2293
|
return function(t, r) {
|
|
2294
|
-
var o = "http" + (e ? "s" : "") + "://", c = o + (n.host || n.options.host) + n.options.path,
|
|
2295
|
-
k.remove(f),
|
|
2294
|
+
var o = "http" + (e ? "s" : "") + "://", c = o + (n.host || n.options.host) + n.options.path, h = w.createJSONPRequest(c, t), f = w.ScriptReceivers.create(function(y, T) {
|
|
2295
|
+
k.remove(f), h.cleanup(), T && T.host && (n.host = T.host), r && r(y, T);
|
|
2296
2296
|
});
|
|
2297
|
-
|
|
2297
|
+
h.send(f);
|
|
2298
2298
|
};
|
|
2299
2299
|
}, rn = {
|
|
2300
2300
|
name: "jsonp",
|
|
@@ -2387,15 +2387,15 @@ function Zi() {
|
|
|
2387
2387
|
emit(e, t, r) {
|
|
2388
2388
|
for (var o = 0; o < this.global_callbacks.length; o++)
|
|
2389
2389
|
this.global_callbacks[o](e, t);
|
|
2390
|
-
var c = this.callbacks.get(e),
|
|
2391
|
-
if (r ?
|
|
2390
|
+
var c = this.callbacks.get(e), h = [];
|
|
2391
|
+
if (r ? h.push(t, r) : t && h.push(t), c && c.length > 0)
|
|
2392
2392
|
for (var o = 0; o < c.length; o++)
|
|
2393
|
-
c[o].fn.apply(c[o].context || window,
|
|
2393
|
+
c[o].fn.apply(c[o].context || window, h);
|
|
2394
2394
|
else this.failThrough && this.failThrough(e, t);
|
|
2395
2395
|
return this;
|
|
2396
2396
|
}
|
|
2397
2397
|
}
|
|
2398
|
-
class
|
|
2398
|
+
class hn extends G {
|
|
2399
2399
|
constructor(e, t, r, o, c) {
|
|
2400
2400
|
super(), this.initialize = w.transportConnectionInitializer, this.hooks = e, this.name = t, this.priority = r, this.key = o, this.options = c, this.state = "new", this.timeline = c.timeline, this.activityTimeout = c.activityTimeout, this.id = this.timeline.generateUniqueID();
|
|
2401
2401
|
}
|
|
@@ -2416,7 +2416,7 @@ function Zi() {
|
|
|
2416
2416
|
this.onError(t), this.changeState("closed");
|
|
2417
2417
|
}), !1;
|
|
2418
2418
|
}
|
|
2419
|
-
return this.bindListeners(),
|
|
2419
|
+
return this.bindListeners(), R.debug("Connecting", { transport: this.name, url: e }), this.changeState("connecting"), !0;
|
|
2420
2420
|
}
|
|
2421
2421
|
close() {
|
|
2422
2422
|
return this.socket ? (this.socket.close(), !0) : !1;
|
|
@@ -2482,10 +2482,10 @@ function Zi() {
|
|
|
2482
2482
|
return this.hooks.isSupported(e);
|
|
2483
2483
|
}
|
|
2484
2484
|
createConnection(e, t, r, o) {
|
|
2485
|
-
return new
|
|
2485
|
+
return new hn(this.hooks, e, t, r, o);
|
|
2486
2486
|
}
|
|
2487
2487
|
}
|
|
2488
|
-
var
|
|
2488
|
+
var ln = new ee({
|
|
2489
2489
|
urls: on,
|
|
2490
2490
|
handlesActivityChecks: !1,
|
|
2491
2491
|
supportsPing: !1,
|
|
@@ -2518,7 +2518,7 @@ function Zi() {
|
|
|
2518
2518
|
return w.isXHRSupported();
|
|
2519
2519
|
}
|
|
2520
2520
|
}, un = new ee(U({}, Ke, Xe)), pn = new ee(U({}, Ve, Xe)), fn = {
|
|
2521
|
-
ws:
|
|
2521
|
+
ws: ln,
|
|
2522
2522
|
xhr_streaming: un,
|
|
2523
2523
|
xhr_polling: pn
|
|
2524
2524
|
};
|
|
@@ -2578,13 +2578,13 @@ function Zi() {
|
|
|
2578
2578
|
o = U({}, o, {
|
|
2579
2579
|
activityTimeout: this.pingDelay
|
|
2580
2580
|
});
|
|
2581
|
-
var c = this.transport.createConnection(e, t, r, o),
|
|
2582
|
-
c.unbind("open", f), c.bind("closed", y),
|
|
2581
|
+
var c = this.transport.createConnection(e, t, r, o), h = null, f = function() {
|
|
2582
|
+
c.unbind("open", f), c.bind("closed", y), h = N.now();
|
|
2583
2583
|
}, y = (T) => {
|
|
2584
2584
|
if (c.unbind("closed", y), T.code === 1002 || T.code === 1003)
|
|
2585
2585
|
this.manager.reportDeath();
|
|
2586
|
-
else if (!T.wasClean &&
|
|
2587
|
-
var _ = N.now() -
|
|
2586
|
+
else if (!T.wasClean && h) {
|
|
2587
|
+
var _ = N.now() - h;
|
|
2588
2588
|
_ < 2 * this.maxPingDelay && (this.manager.reportDeath(), this.pingDelay = Math.max(_ / 2, this.minPingDelay));
|
|
2589
2589
|
}
|
|
2590
2590
|
};
|
|
@@ -2660,7 +2660,7 @@ function Zi() {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
send_event(e, t, r) {
|
|
2662
2662
|
var o = { event: e, data: t };
|
|
2663
|
-
return r && (o.channel = r),
|
|
2663
|
+
return r && (o.channel = r), R.debug("Event sent", o), this.send(Y.encodeMessage(o));
|
|
2664
2664
|
}
|
|
2665
2665
|
ping() {
|
|
2666
2666
|
this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
|
|
@@ -2682,7 +2682,7 @@ function Zi() {
|
|
|
2682
2682
|
});
|
|
2683
2683
|
}
|
|
2684
2684
|
if (o !== void 0) {
|
|
2685
|
-
switch (
|
|
2685
|
+
switch (R.debug("Event recd", o), o.event) {
|
|
2686
2686
|
case "pusher:error":
|
|
2687
2687
|
this.emit("error", {
|
|
2688
2688
|
type: "PusherError",
|
|
@@ -2767,7 +2767,7 @@ function Zi() {
|
|
|
2767
2767
|
class Ce extends G {
|
|
2768
2768
|
constructor(e, t) {
|
|
2769
2769
|
super(function(r, o) {
|
|
2770
|
-
|
|
2770
|
+
R.debug("No callbacks on " + e + " for " + r);
|
|
2771
2771
|
}), this.name = e, this.pusher = t, this.subscribed = !1, this.subscriptionPending = !1, this.subscriptionCancelled = !1;
|
|
2772
2772
|
}
|
|
2773
2773
|
authorize(e, t) {
|
|
@@ -2778,7 +2778,7 @@ function Zi() {
|
|
|
2778
2778
|
throw new p("Event '" + e + "' does not start with 'client-'");
|
|
2779
2779
|
if (!this.subscribed) {
|
|
2780
2780
|
var r = x.buildLogSuffix("triggeringClientEvents");
|
|
2781
|
-
|
|
2781
|
+
R.warn(`Client event triggered before channel 'subscription_succeeded' event . ${r}`);
|
|
2782
2782
|
}
|
|
2783
2783
|
return this.pusher.send_event(e, t, this.name);
|
|
2784
2784
|
}
|
|
@@ -2804,7 +2804,7 @@ function Zi() {
|
|
|
2804
2804
|
}
|
|
2805
2805
|
subscribe() {
|
|
2806
2806
|
this.subscribed || (this.subscriptionPending = !0, this.subscriptionCancelled = !1, this.authorize(this.pusher.connection.socket_id, (e, t) => {
|
|
2807
|
-
e ? (this.subscriptionPending = !1,
|
|
2807
|
+
e ? (this.subscriptionPending = !1, R.error(e.toString()), this.emit("pusher:subscription_error", Object.assign({}, {
|
|
2808
2808
|
type: "AuthError",
|
|
2809
2809
|
error: e.message
|
|
2810
2810
|
}, e instanceof q ? { status: e.status } : {}))) : this.pusher.send_event("pusher:subscribe", {
|
|
@@ -2868,23 +2868,23 @@ function Zi() {
|
|
|
2868
2868
|
}
|
|
2869
2869
|
var Tn = function(n, e, t, r) {
|
|
2870
2870
|
function o(c) {
|
|
2871
|
-
return c instanceof t ? c : new t(function(
|
|
2872
|
-
|
|
2871
|
+
return c instanceof t ? c : new t(function(h) {
|
|
2872
|
+
h(c);
|
|
2873
2873
|
});
|
|
2874
2874
|
}
|
|
2875
|
-
return new (t || (t = Promise))(function(c,
|
|
2875
|
+
return new (t || (t = Promise))(function(c, h) {
|
|
2876
2876
|
function f(_) {
|
|
2877
2877
|
try {
|
|
2878
2878
|
T(r.next(_));
|
|
2879
|
-
} catch (
|
|
2880
|
-
|
|
2879
|
+
} catch (L) {
|
|
2880
|
+
h(L);
|
|
2881
2881
|
}
|
|
2882
2882
|
}
|
|
2883
2883
|
function y(_) {
|
|
2884
2884
|
try {
|
|
2885
2885
|
T(r.throw(_));
|
|
2886
|
-
} catch (
|
|
2887
|
-
|
|
2886
|
+
} catch (L) {
|
|
2887
|
+
h(L);
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
2890
|
function T(_) {
|
|
@@ -2906,8 +2906,8 @@ function Zi() {
|
|
|
2906
2906
|
} else if (yield this.pusher.user.signinDonePromise, this.pusher.user.user_data != null)
|
|
2907
2907
|
this.members.setMyID(this.pusher.user.user_data.id);
|
|
2908
2908
|
else {
|
|
2909
|
-
let
|
|
2910
|
-
|
|
2909
|
+
let h = x.buildLogSuffix("authorizationEndpoint");
|
|
2910
|
+
R.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${h}, or the user should be signed in.`), t("Invalid auth response");
|
|
2911
2911
|
return;
|
|
2912
2912
|
}
|
|
2913
2913
|
t(r, o);
|
|
@@ -2980,32 +2980,32 @@ function Zi() {
|
|
|
2980
2980
|
}
|
|
2981
2981
|
handleEncryptedEvent(e, t) {
|
|
2982
2982
|
if (!this.key) {
|
|
2983
|
-
|
|
2983
|
+
R.debug("Received encrypted event before key has been retrieved from the authEndpoint");
|
|
2984
2984
|
return;
|
|
2985
2985
|
}
|
|
2986
2986
|
if (!t.ciphertext || !t.nonce) {
|
|
2987
|
-
|
|
2987
|
+
R.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + t);
|
|
2988
2988
|
return;
|
|
2989
2989
|
}
|
|
2990
2990
|
let r = (0, Se.decode)(t.ciphertext);
|
|
2991
2991
|
if (r.length < this.nacl.secretbox.overheadLength) {
|
|
2992
|
-
|
|
2992
|
+
R.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${r.length}`);
|
|
2993
2993
|
return;
|
|
2994
2994
|
}
|
|
2995
2995
|
let o = (0, Se.decode)(t.nonce);
|
|
2996
2996
|
if (o.length < this.nacl.secretbox.nonceLength) {
|
|
2997
|
-
|
|
2997
|
+
R.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${o.length}`);
|
|
2998
2998
|
return;
|
|
2999
2999
|
}
|
|
3000
3000
|
let c = this.nacl.secretbox.open(r, o, this.key);
|
|
3001
3001
|
if (c === null) {
|
|
3002
|
-
|
|
3003
|
-
if (
|
|
3004
|
-
|
|
3002
|
+
R.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, (h, f) => {
|
|
3003
|
+
if (h) {
|
|
3004
|
+
R.error(`Failed to make a request to the authEndpoint: ${f}. Unable to fetch new key, so dropping encrypted event`);
|
|
3005
3005
|
return;
|
|
3006
3006
|
}
|
|
3007
3007
|
if (c = this.nacl.secretbox.open(r, o, this.key), c === null) {
|
|
3008
|
-
|
|
3008
|
+
R.error("Failed to decrypt event with new key. Dropping encrypted event");
|
|
3009
3009
|
return;
|
|
3010
3010
|
}
|
|
3011
3011
|
this.emit(e, this.getDataToEmit(c));
|
|
@@ -3023,7 +3023,7 @@ function Zi() {
|
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
|
-
class
|
|
3026
|
+
class Rn extends G {
|
|
3027
3027
|
constructor(e, t) {
|
|
3028
3028
|
super(), this.state = "initialized", this.connection = null, this.key = e, this.options = t, this.timeline = this.options.timeline, this.usingTLS = this.options.useTLS, this.errorCallbacks = this.buildErrorCallbacks(), this.connectionCallbacks = this.buildConnectionCallbacks(this.errorCallbacks), this.handshakeCallbacks = this.buildHandshakeCallbacks(this.errorCallbacks);
|
|
3029
3029
|
var r = w.getNetwork();
|
|
@@ -3175,14 +3175,14 @@ function Zi() {
|
|
|
3175
3175
|
var r = this.state;
|
|
3176
3176
|
if (this.state = e, r !== e) {
|
|
3177
3177
|
var o = e;
|
|
3178
|
-
o === "connected" && (o += " with new socket ID " + t.socket_id),
|
|
3178
|
+
o === "connected" && (o += " with new socket ID " + t.socket_id), R.debug("State changed", r + " -> " + o), this.timeline.info({ state: e, params: t }), this.emit("state_change", { previous: r, current: e }), this.emit(e, t);
|
|
3179
3179
|
}
|
|
3180
3180
|
}
|
|
3181
3181
|
shouldRetry() {
|
|
3182
3182
|
return this.state === "connecting" || this.state === "connected";
|
|
3183
3183
|
}
|
|
3184
3184
|
}
|
|
3185
|
-
class
|
|
3185
|
+
class Ln {
|
|
3186
3186
|
constructor() {
|
|
3187
3187
|
this.channels = {};
|
|
3188
3188
|
}
|
|
@@ -3223,10 +3223,10 @@ function Zi() {
|
|
|
3223
3223
|
}
|
|
3224
3224
|
var Wn = {
|
|
3225
3225
|
createChannels() {
|
|
3226
|
-
return new
|
|
3226
|
+
return new Ln();
|
|
3227
3227
|
},
|
|
3228
3228
|
createConnectionManager(n, e) {
|
|
3229
|
-
return new
|
|
3229
|
+
return new Rn(n, e);
|
|
3230
3230
|
},
|
|
3231
3231
|
createChannel(n, e) {
|
|
3232
3232
|
return new Ce(n, e);
|
|
@@ -3276,30 +3276,30 @@ function Zi() {
|
|
|
3276
3276
|
return $e(this.strategies, N.method("isSupported"));
|
|
3277
3277
|
}
|
|
3278
3278
|
connect(e, t) {
|
|
3279
|
-
var r = this.strategies, o = 0, c = this.timeout,
|
|
3280
|
-
T ? t(null, T) : (o = o + 1, this.loop && (o = o % r.length), o < r.length ? (c && (c = c * 2, this.timeoutLimit && (c = Math.min(c, this.timeoutLimit))),
|
|
3279
|
+
var r = this.strategies, o = 0, c = this.timeout, h = null, f = (y, T) => {
|
|
3280
|
+
T ? t(null, T) : (o = o + 1, this.loop && (o = o % r.length), o < r.length ? (c && (c = c * 2, this.timeoutLimit && (c = Math.min(c, this.timeoutLimit))), h = this.tryStrategy(r[o], e, { timeout: c, failFast: this.failFast }, f)) : t(!0));
|
|
3281
3281
|
};
|
|
3282
|
-
return
|
|
3282
|
+
return h = this.tryStrategy(r[o], e, { timeout: c, failFast: this.failFast }, f), {
|
|
3283
3283
|
abort: function() {
|
|
3284
|
-
|
|
3284
|
+
h.abort();
|
|
3285
3285
|
},
|
|
3286
3286
|
forceMinPriority: function(y) {
|
|
3287
|
-
e = y,
|
|
3287
|
+
e = y, h && h.forceMinPriority(y);
|
|
3288
3288
|
}
|
|
3289
3289
|
};
|
|
3290
3290
|
}
|
|
3291
3291
|
tryStrategy(e, t, r, o) {
|
|
3292
|
-
var c = null,
|
|
3292
|
+
var c = null, h = null;
|
|
3293
3293
|
return r.timeout > 0 && (c = new J(r.timeout, function() {
|
|
3294
|
-
|
|
3295
|
-
})),
|
|
3294
|
+
h.abort(), o(!0);
|
|
3295
|
+
})), h = e.connect(t, function(f, y) {
|
|
3296
3296
|
f && c && c.isRunning() && !r.failFast || (c && c.ensureAborted(), o(f, y));
|
|
3297
3297
|
}), {
|
|
3298
3298
|
abort: function() {
|
|
3299
|
-
c && c.ensureAborted(),
|
|
3299
|
+
c && c.ensureAborted(), h.abort();
|
|
3300
3300
|
},
|
|
3301
3301
|
forceMinPriority: function(f) {
|
|
3302
|
-
|
|
3302
|
+
h.forceMinPriority(f);
|
|
3303
3303
|
}
|
|
3304
3304
|
};
|
|
3305
3305
|
}
|
|
@@ -3313,20 +3313,20 @@ function Zi() {
|
|
|
3313
3313
|
}
|
|
3314
3314
|
connect(e, t) {
|
|
3315
3315
|
return Hn(this.strategies, e, function(r, o) {
|
|
3316
|
-
return function(c,
|
|
3316
|
+
return function(c, h) {
|
|
3317
3317
|
if (o[r].error = c, c) {
|
|
3318
3318
|
Nn(o) && t(!0);
|
|
3319
3319
|
return;
|
|
3320
3320
|
}
|
|
3321
3321
|
ie(o, function(f) {
|
|
3322
|
-
f.forceMinPriority(
|
|
3323
|
-
}), t(null,
|
|
3322
|
+
f.forceMinPriority(h.transport.priority);
|
|
3323
|
+
}), t(null, h);
|
|
3324
3324
|
};
|
|
3325
3325
|
});
|
|
3326
3326
|
}
|
|
3327
3327
|
}
|
|
3328
3328
|
function Hn(n, e, t) {
|
|
3329
|
-
var r = Be(n, function(o, c,
|
|
3329
|
+
var r = Be(n, function(o, c, h, f) {
|
|
3330
3330
|
return o.connect(e, t(c, f));
|
|
3331
3331
|
});
|
|
3332
3332
|
return {
|
|
@@ -3356,20 +3356,20 @@ function Zi() {
|
|
|
3356
3356
|
return this.strategy.isSupported();
|
|
3357
3357
|
}
|
|
3358
3358
|
connect(e, t) {
|
|
3359
|
-
var r = this.usingTLS, o = Un(r), c = o && o.cacheSkipCount ? o.cacheSkipCount : 0,
|
|
3359
|
+
var r = this.usingTLS, o = Un(r), c = o && o.cacheSkipCount ? o.cacheSkipCount : 0, h = [this.strategy];
|
|
3360
3360
|
if (o && o.timestamp + this.ttl >= N.now()) {
|
|
3361
3361
|
var f = this.transports[o.transport];
|
|
3362
3362
|
f && (["ws", "wss"].includes(o.transport) || c > 3 ? (this.timeline.info({
|
|
3363
3363
|
cached: !0,
|
|
3364
3364
|
transport: o.transport,
|
|
3365
3365
|
latency: o.latency
|
|
3366
|
-
}),
|
|
3366
|
+
}), h.push(new Z([f], {
|
|
3367
3367
|
timeout: o.latency * 2 + 1e3,
|
|
3368
3368
|
failFast: !0
|
|
3369
3369
|
}))) : c++);
|
|
3370
3370
|
}
|
|
3371
|
-
var y = N.now(), T =
|
|
3372
|
-
|
|
3371
|
+
var y = N.now(), T = h.pop().connect(e, function _(L, ue) {
|
|
3372
|
+
L ? (Qe(r), h.length > 0 ? (y = N.now(), T = h.pop().connect(e, _)) : t(L)) : (On(r, ue.transport.name, N.now() - y, c), t(null, ue));
|
|
3373
3373
|
});
|
|
3374
3374
|
return {
|
|
3375
3375
|
abort: function() {
|
|
@@ -3432,8 +3432,8 @@ function Zi() {
|
|
|
3432
3432
|
abort: function() {
|
|
3433
3433
|
c.ensureAborted(), o && o.abort();
|
|
3434
3434
|
},
|
|
3435
|
-
forceMinPriority: function(
|
|
3436
|
-
e =
|
|
3435
|
+
forceMinPriority: function(h) {
|
|
3436
|
+
e = h, o && o.forceMinPriority(h);
|
|
3437
3437
|
}
|
|
3438
3438
|
};
|
|
3439
3439
|
}
|
|
@@ -3480,7 +3480,7 @@ function Zi() {
|
|
|
3480
3480
|
hostNonTLS: n.wsHost + ":" + n.wsPort,
|
|
3481
3481
|
hostTLS: n.wsHost + ":" + n.wssPort,
|
|
3482
3482
|
httpPath: n.wsPath
|
|
3483
|
-
}),
|
|
3483
|
+
}), h = Object.assign({}, c, {
|
|
3484
3484
|
useTLS: !0
|
|
3485
3485
|
}), f = Object.assign({}, e, {
|
|
3486
3486
|
hostNonTLS: n.httpHost + ":" + n.httpPort,
|
|
@@ -3497,16 +3497,16 @@ function Zi() {
|
|
|
3497
3497
|
lives: 2,
|
|
3498
3498
|
minPingDelay: 1e4,
|
|
3499
3499
|
maxPingDelay: n.activityTimeout
|
|
3500
|
-
}),
|
|
3500
|
+
}), L = o("ws", "ws", 3, c, T), ue = o("wss", "ws", 3, h, T), Wi = o("sockjs", "sockjs", 1, f), ot = o("xhr_streaming", "xhr_streaming", 1, f, _), Hi = o("xdr_streaming", "xdr_streaming", 1, f, _), at = o("xhr_polling", "xhr_polling", 1, f), Ni = o("xdr_polling", "xdr_polling", 1, f), ct = new Z([L], y), Ii = new Z([ue], y), zi = new Z([Wi], y), dt = new Z([
|
|
3501
3501
|
new re(se(ot), ot, Hi)
|
|
3502
|
-
], y), lt = new Z([
|
|
3503
|
-
new re(se(at), at, Ni)
|
|
3504
3502
|
], y), ht = new Z([
|
|
3503
|
+
new re(se(at), at, Ni)
|
|
3504
|
+
], y), lt = new Z([
|
|
3505
3505
|
new re(se(dt), new xe([
|
|
3506
3506
|
dt,
|
|
3507
|
-
new de(
|
|
3508
|
-
]),
|
|
3509
|
-
], y), Ae = new re(se(
|
|
3507
|
+
new de(ht, { delay: 4e3 })
|
|
3508
|
+
]), ht)
|
|
3509
|
+
], y), Ae = new re(se(lt), lt, zi), Pe;
|
|
3510
3510
|
return e.useTLS ? Pe = new xe([
|
|
3511
3511
|
ct,
|
|
3512
3512
|
new de(Ae, { delay: 2e3 })
|
|
@@ -3514,7 +3514,7 @@ function Zi() {
|
|
|
3514
3514
|
ct,
|
|
3515
3515
|
new de(Ii, { delay: 2e3 }),
|
|
3516
3516
|
new de(Ae, { delay: 5e3 })
|
|
3517
|
-
]), new zn(new qn(new re(se(
|
|
3517
|
+
]), new zn(new qn(new re(se(L), Pe, Ae)), r, {
|
|
3518
3518
|
ttl: 18e5,
|
|
3519
3519
|
timeline: e.timeline,
|
|
3520
3520
|
useTLS: e.useTLS
|
|
@@ -3869,7 +3869,7 @@ function Zi() {
|
|
|
3869
3869
|
(function(n) {
|
|
3870
3870
|
n[n.ERROR = 3] = "ERROR", n[n.INFO = 6] = "INFO", n[n.DEBUG = 7] = "DEBUG";
|
|
3871
3871
|
})(_e || (_e = {}));
|
|
3872
|
-
const
|
|
3872
|
+
const he = _e;
|
|
3873
3873
|
class di {
|
|
3874
3874
|
constructor(e, t, r) {
|
|
3875
3875
|
this.key = e, this.session = t, this.events = [], this.options = r || {}, this.sent = 0, this.uniqueID = 0;
|
|
@@ -3878,13 +3878,13 @@ function Zi() {
|
|
|
3878
3878
|
e <= this.options.level && (this.events.push(U({}, t, { timestamp: N.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
|
|
3879
3879
|
}
|
|
3880
3880
|
error(e) {
|
|
3881
|
-
this.log(
|
|
3881
|
+
this.log(he.ERROR, e);
|
|
3882
3882
|
}
|
|
3883
3883
|
info(e) {
|
|
3884
|
-
this.log(
|
|
3884
|
+
this.log(he.INFO, e);
|
|
3885
3885
|
}
|
|
3886
3886
|
debug(e) {
|
|
3887
|
-
this.log(
|
|
3887
|
+
this.log(he.DEBUG, e);
|
|
3888
3888
|
}
|
|
3889
3889
|
isEmpty() {
|
|
3890
3890
|
return this.events.length === 0;
|
|
@@ -3908,7 +3908,7 @@ function Zi() {
|
|
|
3908
3908
|
return this.uniqueID++, this.uniqueID;
|
|
3909
3909
|
}
|
|
3910
3910
|
}
|
|
3911
|
-
class
|
|
3911
|
+
class hi {
|
|
3912
3912
|
constructor(e, t, r, o) {
|
|
3913
3913
|
this.name = e, this.priority = t, this.transport = r, this.options = o || {};
|
|
3914
3914
|
}
|
|
@@ -3922,27 +3922,27 @@ function Zi() {
|
|
|
3922
3922
|
if (this.priority < e)
|
|
3923
3923
|
return it(new H(), t);
|
|
3924
3924
|
} else return it(new M(), t);
|
|
3925
|
-
var r = !1, o = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), c = null,
|
|
3926
|
-
o.unbind("initialized",
|
|
3925
|
+
var r = !1, o = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), c = null, h = function() {
|
|
3926
|
+
o.unbind("initialized", h), o.connect();
|
|
3927
3927
|
}, f = function() {
|
|
3928
|
-
c = K.createHandshake(o, function(
|
|
3929
|
-
r = !0, _(), t(null,
|
|
3928
|
+
c = K.createHandshake(o, function(L) {
|
|
3929
|
+
r = !0, _(), t(null, L);
|
|
3930
3930
|
});
|
|
3931
|
-
}, y = function(
|
|
3932
|
-
_(), t(
|
|
3931
|
+
}, y = function(L) {
|
|
3932
|
+
_(), t(L);
|
|
3933
3933
|
}, T = function() {
|
|
3934
3934
|
_();
|
|
3935
|
-
var
|
|
3936
|
-
|
|
3935
|
+
var L;
|
|
3936
|
+
L = ae(o), t(new z(L));
|
|
3937
3937
|
}, _ = function() {
|
|
3938
|
-
o.unbind("initialized",
|
|
3938
|
+
o.unbind("initialized", h), o.unbind("open", f), o.unbind("error", y), o.unbind("closed", T);
|
|
3939
3939
|
};
|
|
3940
|
-
return o.bind("initialized",
|
|
3940
|
+
return o.bind("initialized", h), o.bind("open", f), o.bind("error", y), o.bind("closed", T), o.initialize(), {
|
|
3941
3941
|
abort: () => {
|
|
3942
3942
|
r || (_(), c ? c.close() : o.close());
|
|
3943
3943
|
},
|
|
3944
|
-
forceMinPriority: (
|
|
3945
|
-
r || this.priority <
|
|
3944
|
+
forceMinPriority: (L) => {
|
|
3945
|
+
r || this.priority < L && (c ? c.close() : o.close());
|
|
3946
3946
|
}
|
|
3947
3947
|
};
|
|
3948
3948
|
}
|
|
@@ -3957,13 +3957,13 @@ function Zi() {
|
|
|
3957
3957
|
}
|
|
3958
3958
|
};
|
|
3959
3959
|
}
|
|
3960
|
-
const { Transports:
|
|
3960
|
+
const { Transports: li } = w;
|
|
3961
3961
|
var ui = function(n, e, t, r, o, c) {
|
|
3962
|
-
var
|
|
3963
|
-
if (!
|
|
3962
|
+
var h = li[t];
|
|
3963
|
+
if (!h)
|
|
3964
3964
|
throw new V(t);
|
|
3965
3965
|
var f = (!n.enabledTransports || qe(n.enabledTransports, e) !== -1) && (!n.disabledTransports || qe(n.disabledTransports, e) === -1), y;
|
|
3966
|
-
return f ? (o = Object.assign({ ignoreNullOrigin: n.ignoreNullOrigin }, o), y = new
|
|
3966
|
+
return f ? (o = Object.assign({ ignoreNullOrigin: n.ignoreNullOrigin }, o), y = new hi(e, r, c ? c.getAssistant(h) : h, o)) : y = pi, y;
|
|
3967
3967
|
}, pi = {
|
|
3968
3968
|
isSupported: function() {
|
|
3969
3969
|
return !1;
|
|
@@ -3986,7 +3986,7 @@ function Zi() {
|
|
|
3986
3986
|
throw "You must pass an options object";
|
|
3987
3987
|
if (n.cluster == null)
|
|
3988
3988
|
throw "Options object must provide a cluster";
|
|
3989
|
-
"disableStats" in n &&
|
|
3989
|
+
"disableStats" in n && R.warn("The disableStats option is deprecated in favor of enableStats");
|
|
3990
3990
|
}
|
|
3991
3991
|
const mi = (n, e) => {
|
|
3992
3992
|
var t = "socket_id=" + encodeURIComponent(n.socketId);
|
|
@@ -4033,8 +4033,8 @@ function Zi() {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
};
|
|
4035
4035
|
return (o, c) => {
|
|
4036
|
-
const
|
|
4037
|
-
t(
|
|
4036
|
+
const h = n.channel(o.channelName);
|
|
4037
|
+
t(h, r).authorize(o.socketId, c);
|
|
4038
4038
|
};
|
|
4039
4039
|
};
|
|
4040
4040
|
function rt(n, e) {
|
|
@@ -4099,7 +4099,7 @@ function Zi() {
|
|
|
4099
4099
|
class Ai extends G {
|
|
4100
4100
|
constructor(e) {
|
|
4101
4101
|
super(function(t, r) {
|
|
4102
|
-
|
|
4102
|
+
R.debug(`No callbacks on watchlist events for ${t}`);
|
|
4103
4103
|
}), this.pusher = e, this.bindWatchlistInternalEvent();
|
|
4104
4104
|
}
|
|
4105
4105
|
handleEvent(e) {
|
|
@@ -4120,14 +4120,14 @@ function Zi() {
|
|
|
4120
4120
|
n = r, e = o;
|
|
4121
4121
|
}), resolve: n, reject: e };
|
|
4122
4122
|
}
|
|
4123
|
-
const
|
|
4124
|
-
class
|
|
4123
|
+
const Ri = Pi;
|
|
4124
|
+
class Li extends G {
|
|
4125
4125
|
constructor(e) {
|
|
4126
4126
|
super(function(t, r) {
|
|
4127
|
-
|
|
4127
|
+
R.debug("No callbacks on user for " + t);
|
|
4128
4128
|
}), this.signin_requested = !1, this.user_data = null, this.serverToUserChannel = null, this.signinDonePromise = null, this._signinDoneResolve = null, this._onAuthorize = (t, r) => {
|
|
4129
4129
|
if (t) {
|
|
4130
|
-
|
|
4130
|
+
R.warn(`Error during signin: ${t}`), this._cleanup();
|
|
4131
4131
|
return;
|
|
4132
4132
|
}
|
|
4133
4133
|
this.pusher.send_event("pusher:signin", {
|
|
@@ -4153,11 +4153,11 @@ function Zi() {
|
|
|
4153
4153
|
try {
|
|
4154
4154
|
this.user_data = JSON.parse(e.user_data);
|
|
4155
4155
|
} catch {
|
|
4156
|
-
|
|
4156
|
+
R.error(`Failed parsing user data after signin: ${e.user_data}`), this._cleanup();
|
|
4157
4157
|
return;
|
|
4158
4158
|
}
|
|
4159
4159
|
if (typeof this.user_data.id != "string" || this.user_data.id === "") {
|
|
4160
|
-
|
|
4160
|
+
R.error(`user_data doesn't contain an id. user_data: ${this.user_data}`), this._cleanup();
|
|
4161
4161
|
return;
|
|
4162
4162
|
}
|
|
4163
4163
|
this._signinDoneResolve(), this._subscribeChannels();
|
|
@@ -4176,7 +4176,7 @@ function Zi() {
|
|
|
4176
4176
|
_newSigninPromiseIfNeeded() {
|
|
4177
4177
|
if (!this.signin_requested || this.signinDonePromise && !this.signinDonePromise.done)
|
|
4178
4178
|
return;
|
|
4179
|
-
const { promise: e, resolve: t } =
|
|
4179
|
+
const { promise: e, resolve: t } = Ri();
|
|
4180
4180
|
e.done = !1;
|
|
4181
4181
|
const r = () => {
|
|
4182
4182
|
e.done = !0;
|
|
@@ -4201,7 +4201,7 @@ function Zi() {
|
|
|
4201
4201
|
features: j.getClientFeatures(),
|
|
4202
4202
|
params: this.config.timelineParams || {},
|
|
4203
4203
|
limit: 50,
|
|
4204
|
-
level:
|
|
4204
|
+
level: he.INFO,
|
|
4205
4205
|
version: S.VERSION
|
|
4206
4206
|
}), this.config.enableStats && (this.timelineSender = K.createTimelineSender(this.timeline, {
|
|
4207
4207
|
host: this.config.statsHost,
|
|
@@ -4218,19 +4218,19 @@ function Zi() {
|
|
|
4218
4218
|
}), this.connection.bind("connected", () => {
|
|
4219
4219
|
this.subscribeAll(), this.timelineSender && this.timelineSender.send(this.connection.isUsingTLS());
|
|
4220
4220
|
}), this.connection.bind("message", (o) => {
|
|
4221
|
-
var c = o.event,
|
|
4221
|
+
var c = o.event, h = c.indexOf("pusher_internal:") === 0;
|
|
4222
4222
|
if (o.channel) {
|
|
4223
4223
|
var f = this.channel(o.channel);
|
|
4224
4224
|
f && f.handleEvent(o);
|
|
4225
4225
|
}
|
|
4226
|
-
|
|
4226
|
+
h || this.global_emitter.emit(o.event, o.data);
|
|
4227
4227
|
}), this.connection.bind("connecting", () => {
|
|
4228
4228
|
this.channels.disconnect();
|
|
4229
4229
|
}), this.connection.bind("disconnected", () => {
|
|
4230
4230
|
this.channels.disconnect();
|
|
4231
4231
|
}), this.connection.bind("error", (o) => {
|
|
4232
|
-
|
|
4233
|
-
}), j.instances.push(this), this.timeline.info({ instances: j.instances.length }), this.user = new
|
|
4232
|
+
R.warn(o);
|
|
4233
|
+
}), j.instances.push(this), this.timeline.info({ instances: j.instances.length }), this.user = new Li(this), j.isReady && this.connect();
|
|
4234
4234
|
}
|
|
4235
4235
|
switchCluster(e) {
|
|
4236
4236
|
const { appKey: t, cluster: r } = e;
|
|
@@ -4292,7 +4292,7 @@ function Zi() {
|
|
|
4292
4292
|
}
|
|
4293
4293
|
}
|
|
4294
4294
|
j.instances = [], j.isReady = !1, j.logToConsole = !1, j.Runtime = w, j.ScriptReceivers = w.ScriptReceivers, j.DependenciesReceivers = w.DependenciesReceivers, j.auth_callbacks = w.auth_callbacks;
|
|
4295
|
-
const
|
|
4295
|
+
const le = j;
|
|
4296
4296
|
function ji(n) {
|
|
4297
4297
|
if (n == null)
|
|
4298
4298
|
throw "You must pass your app key when you instantiate Pusher.";
|
|
@@ -4320,14 +4320,14 @@ function Zi() {
|
|
|
4320
4320
|
for (var b in v)
|
|
4321
4321
|
d.o(v, b) && !d.o(m, b) && Object.defineProperty(m, b, { enumerable: !0, get: v[b] });
|
|
4322
4322
|
}, d.o = (m, v) => Object.prototype.hasOwnProperty.call(m, v);
|
|
4323
|
-
var
|
|
4324
|
-
return
|
|
4323
|
+
var l = d(721);
|
|
4324
|
+
return l;
|
|
4325
4325
|
})()
|
|
4326
4326
|
));
|
|
4327
|
-
})(
|
|
4327
|
+
})(Re)), Re.exports;
|
|
4328
4328
|
}
|
|
4329
4329
|
var Qi = Zi();
|
|
4330
|
-
const er = /* @__PURE__ */ Yi(Qi),
|
|
4330
|
+
const er = /* @__PURE__ */ Yi(Qi), Le = "/vendor/sendity-client/tailwind.css", Rt = {
|
|
4331
4331
|
labels: {
|
|
4332
4332
|
email: "Email",
|
|
4333
4333
|
whatsapp: "WhatsApp"
|
|
@@ -4557,7 +4557,7 @@ Code: (Code)`,
|
|
|
4557
4557
|
Kod: (Code)`,
|
|
4558
4558
|
whatsappText: "Prijavi me u (Host) ovim kodom: (Code)"
|
|
4559
4559
|
}
|
|
4560
|
-
},
|
|
4560
|
+
}, hr = {
|
|
4561
4561
|
labels: {
|
|
4562
4562
|
email: "Ηλεκτρονικό ταχυδρομείο",
|
|
4563
4563
|
whatsapp: "WhatsApp"
|
|
@@ -4580,7 +4580,7 @@ Kod: (Code)`,
|
|
|
4580
4580
|
Κωδικός: (Code)`,
|
|
4581
4581
|
whatsappText: "Σύνδεσέ με στο (Host) με αυτόν τον κωδικό: (Code)"
|
|
4582
4582
|
}
|
|
4583
|
-
},
|
|
4583
|
+
}, lr = {
|
|
4584
4584
|
labels: {
|
|
4585
4585
|
email: "E-posta",
|
|
4586
4586
|
whatsapp: "WhatsApp"
|
|
@@ -5017,7 +5017,7 @@ Kode: (Code)`,
|
|
|
5017
5017
|
Код: (Code)`,
|
|
5018
5018
|
whatsappText: "Увійти в (Host) з цим кодом: (Code)"
|
|
5019
5019
|
}
|
|
5020
|
-
},
|
|
5020
|
+
}, Rr = {
|
|
5021
5021
|
labels: {
|
|
5022
5022
|
email: "Email",
|
|
5023
5023
|
whatsapp: "WhatsApp"
|
|
@@ -5040,7 +5040,7 @@ Kode: (Code)`,
|
|
|
5040
5040
|
Kod: (Code)`,
|
|
5041
5041
|
whatsappText: "Prijavi me na (Host) ovim kodom: (Code)"
|
|
5042
5042
|
}
|
|
5043
|
-
},
|
|
5043
|
+
}, Lr = {
|
|
5044
5044
|
labels: {
|
|
5045
5045
|
email: "Е-пошта",
|
|
5046
5046
|
whatsapp: "WhatsApp"
|
|
@@ -5437,7 +5437,7 @@ function Vr(g) {
|
|
|
5437
5437
|
return Kr.includes(g);
|
|
5438
5438
|
}
|
|
5439
5439
|
const Xr = {
|
|
5440
|
-
en:
|
|
5440
|
+
en: Rt,
|
|
5441
5441
|
de: tr,
|
|
5442
5442
|
fr: nr,
|
|
5443
5443
|
es: ir,
|
|
@@ -5447,8 +5447,8 @@ const Xr = {
|
|
|
5447
5447
|
da: ar,
|
|
5448
5448
|
nl: cr,
|
|
5449
5449
|
hr: dr,
|
|
5450
|
-
el:
|
|
5451
|
-
tr:
|
|
5450
|
+
el: hr,
|
|
5451
|
+
tr: lr,
|
|
5452
5452
|
"de-he": ur,
|
|
5453
5453
|
ru: pr,
|
|
5454
5454
|
sv: fr,
|
|
@@ -5467,8 +5467,8 @@ const Xr = {
|
|
|
5467
5467
|
hu: _r,
|
|
5468
5468
|
no: Ar,
|
|
5469
5469
|
uk: Pr,
|
|
5470
|
-
bs:
|
|
5471
|
-
mk:
|
|
5470
|
+
bs: Rr,
|
|
5471
|
+
mk: Lr,
|
|
5472
5472
|
is: jr,
|
|
5473
5473
|
ga: Wr,
|
|
5474
5474
|
mt: Hr,
|
|
@@ -5495,19 +5495,19 @@ function bt(g) {
|
|
|
5495
5495
|
return vt(s) ? s : null;
|
|
5496
5496
|
}
|
|
5497
5497
|
function F(g) {
|
|
5498
|
-
return Xr[g] ??
|
|
5498
|
+
return Xr[g] ?? Rt;
|
|
5499
5499
|
}
|
|
5500
5500
|
const yt = `<svg role="img" viewBox="0 0 512 512" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>Email</title><path d="M64 112c-8.8 0-16 7.2-16 16l0 22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1l0-22.1c0-8.8-7.2-16-16-16L64 112zM48 212.2L48 384c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-171.8L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128z"/></svg>
|
|
5501
|
-
`, wt = '<svg role="img" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>WhatsApp</title><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>', Jr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.998 9.332A5.002 5.002 0 0 1 13.2 5.5H11a1 1 0 1 0 0 2h4.5a1 1 0 0 0 1-1V2a1 1 0 1 0-2 0v1.74A7.002 7.002 0 0 0 3 9.332a1 1 0 1 0 1.998 0ZM15.002 10.668A5.002 5.002 0 0 1 6.8 14.5H9a1 1 0 1 0 0-2H4.5a1 1 0 0 0-1 1V18a1 1 0 1 0 2 0v-1.74a7.002 7.002 0 0 0 11.5-5.592 1 1 0 1 0-1.998 0Z" clip-rule="evenodd" /></svg>', Yr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM7.22 6.22a.75.75 0 0 0-1.06 1.06L8.88 10l-2.72 2.72a.75.75 0 1 0 1.06 1.06L9.94 11.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11 10l2.72-2.72a.75.75 0 0 0-1.06-1.06L9.94 8.94 7.22 6.22Z" clip-rule="evenodd" /></svg>', ze = "sendityAuthRequest", Zr = "https://sendity.io/api/sendity", Qr = 600 * 1e3, es = 5e3, ts = 15e3, ns = 1e3, je = 2e3, fe = 220,
|
|
5501
|
+
`, wt = '<svg role="img" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><title>WhatsApp</title><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>', Jr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M4.998 9.332A5.002 5.002 0 0 1 13.2 5.5H11a1 1 0 1 0 0 2h4.5a1 1 0 0 0 1-1V2a1 1 0 1 0-2 0v1.74A7.002 7.002 0 0 0 3 9.332a1 1 0 1 0 1.998 0ZM15.002 10.668A5.002 5.002 0 0 1 6.8 14.5H9a1 1 0 1 0 0-2H4.5a1 1 0 0 0-1 1V18a1 1 0 1 0 2 0v-1.74a7.002 7.002 0 0 0 11.5-5.592 1 1 0 1 0-1.998 0Z" clip-rule="evenodd" /></svg>', Yr = '<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM7.22 6.22a.75.75 0 0 0-1.06 1.06L8.88 10l-2.72 2.72a.75.75 0 1 0 1.06 1.06L9.94 11.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11 10l2.72-2.72a.75.75 0 0 0-1.06-1.06L9.94 8.94 7.22 6.22Z" clip-rule="evenodd" /></svg>', ze = "sendityAuthRequest", Zr = "https://sendity.io/api/sendity", Qr = 600 * 1e3, es = 5e3, ts = 15e3, ns = 1e3, je = 2e3, fe = 220, Lt = 0;
|
|
5502
5502
|
function Ue(g, i) {
|
|
5503
5503
|
return `sendity:auth-request:${encodeURIComponent(g)}:${encodeURIComponent(i)}`;
|
|
5504
5504
|
}
|
|
5505
5505
|
function Ct(g, i, s, a = Date.now()) {
|
|
5506
5506
|
g.removeItem(ze);
|
|
5507
|
-
const d = Ue(i, s),
|
|
5508
|
-
if (!
|
|
5507
|
+
const d = Ue(i, s), l = g.getItem(d);
|
|
5508
|
+
if (!l) return null;
|
|
5509
5509
|
try {
|
|
5510
|
-
const m = JSON.parse(
|
|
5510
|
+
const m = JSON.parse(l);
|
|
5511
5511
|
if (typeof m.id != "string" || typeof m.clientSecret != "string" || typeof m.createdAt != "number")
|
|
5512
5512
|
throw new Error("invalid stored auth request");
|
|
5513
5513
|
return a - m.createdAt >= Qr ? (g.removeItem(d), null) : { id: m.id, clientSecret: m.clientSecret };
|
|
@@ -5536,7 +5536,7 @@ function ss(g, i) {
|
|
|
5536
5536
|
}
|
|
5537
5537
|
}
|
|
5538
5538
|
function os(g, i, s) {
|
|
5539
|
-
return g === "push" ? { start: !1, delayMs: 0 } : g === "polling" || !i || !s ? { start: !0, delayMs: 0 } : { start: !0, delayMs:
|
|
5539
|
+
return g === "push" ? { start: !1, delayMs: 0 } : g === "polling" || !i || !s ? { start: !0, delayMs: 0 } : { start: !0, delayMs: Lt };
|
|
5540
5540
|
}
|
|
5541
5541
|
const ve = class ve extends HTMLElement {
|
|
5542
5542
|
constructor() {
|
|
@@ -5547,8 +5547,8 @@ const ve = class ve extends HTMLElement {
|
|
|
5547
5547
|
this.injectTailwind(i);
|
|
5548
5548
|
const s = document.createElement("div");
|
|
5549
5549
|
s.innerHTML = ft;
|
|
5550
|
-
const a = s.querySelector("template"), d = a ? a.content.cloneNode(!0) : document.createRange().createContextualFragment(ft),
|
|
5551
|
-
|
|
5550
|
+
const a = s.querySelector("template"), d = a ? a.content.cloneNode(!0) : document.createRange().createContextualFragment(ft), l = document.createElement("style");
|
|
5551
|
+
l.textContent = Bi, i.appendChild(l), i.appendChild(d);
|
|
5552
5552
|
}
|
|
5553
5553
|
static get observedAttributes() {
|
|
5554
5554
|
return ["server-url", "public-key", "lang", "transport", "hide-footer", "footer", "authenticated-event-delay-ms", "variant", "no-card"];
|
|
@@ -5621,11 +5621,11 @@ const ve = class ve extends HTMLElement {
|
|
|
5621
5621
|
s.textContent = a.tailwindCssText;
|
|
5622
5622
|
else {
|
|
5623
5623
|
const d = document.createElement("link");
|
|
5624
|
-
d.rel = "stylesheet", d.href =
|
|
5624
|
+
d.rel = "stylesheet", d.href = Le, i.insertBefore(d, s);
|
|
5625
5625
|
}
|
|
5626
5626
|
return;
|
|
5627
5627
|
}
|
|
5628
|
-
a.tailwindLoading || (a.tailwindLoading = fetch(
|
|
5628
|
+
a.tailwindLoading || (a.tailwindLoading = fetch(Le).then((d) => d.ok ? d.text() : Promise.reject(new Error(`HTTP ${d.status}`))).then((d) => {
|
|
5629
5629
|
a.tailwindCssText = d;
|
|
5630
5630
|
}).catch((d) => {
|
|
5631
5631
|
console.warn("[sendity-auth] Failed to load Tailwind CSS for Shadow DOM", d), a.tailwindCssText = "";
|
|
@@ -5635,7 +5635,7 @@ const ve = class ve extends HTMLElement {
|
|
|
5635
5635
|
s.textContent = a.tailwindCssText;
|
|
5636
5636
|
else {
|
|
5637
5637
|
const d = document.createElement("link");
|
|
5638
|
-
d.rel = "stylesheet", d.href =
|
|
5638
|
+
d.rel = "stylesheet", d.href = Le, i.insertBefore(d, s);
|
|
5639
5639
|
}
|
|
5640
5640
|
});
|
|
5641
5641
|
}
|
|
@@ -5694,8 +5694,8 @@ const ve = class ve extends HTMLElement {
|
|
|
5694
5694
|
this.footerTimerEl.setAttribute("hidden", "");
|
|
5695
5695
|
return;
|
|
5696
5696
|
}
|
|
5697
|
-
const a = Math.max(0, Math.floor((s - Date.now()) / 1e3)), d = Math.floor(a / 60),
|
|
5698
|
-
this.footerTimerEl.textContent = `${d}:${
|
|
5697
|
+
const a = Math.max(0, Math.floor((s - Date.now()) / 1e3)), d = Math.floor(a / 60), l = String(a % 60).padStart(2, "0");
|
|
5698
|
+
this.footerTimerEl.textContent = `${d}:${l}`, this.footerTimerEl.classList.toggle("low", a > 0 && a <= 60), this.footerTimerEl.removeAttribute("hidden"), a <= 0 && this.timerInterval !== null && (clearInterval(this.timerInterval), this.timerInterval = null, this.showExpiredState());
|
|
5699
5699
|
};
|
|
5700
5700
|
i(), this.timerInterval = window.setInterval(i, 1e3);
|
|
5701
5701
|
}
|
|
@@ -5719,8 +5719,8 @@ const ve = class ve extends HTMLElement {
|
|
|
5719
5719
|
this.verifiersEl.innerHTML = "", this.verifiersEl.classList.remove("is-two", "verifiers--exiting"), this.verifiersEl.removeAttribute("aria-hidden");
|
|
5720
5720
|
const s = document.createElement("button");
|
|
5721
5721
|
s.type = "button", s.className = "chan error", s.addEventListener("click", () => {
|
|
5722
|
-
s.disabled = !0, this.requestNewAuthRequest().catch((
|
|
5723
|
-
console.warn("[sendity-auth] failed to request a new code",
|
|
5722
|
+
s.disabled = !0, this.requestNewAuthRequest().catch((l) => {
|
|
5723
|
+
console.warn("[sendity-auth] failed to request a new code", l), s.disabled = !1;
|
|
5724
5724
|
});
|
|
5725
5725
|
});
|
|
5726
5726
|
const a = document.createElement("span");
|
|
@@ -5751,8 +5751,8 @@ const ve = class ve extends HTMLElement {
|
|
|
5751
5751
|
}, s = (E) => this.getAttribute(E) ?? void 0, a = s("server-url")?.trim() || Zr, d = s("public-key")?.trim();
|
|
5752
5752
|
if (!d)
|
|
5753
5753
|
throw new Error("Missing required sendity-auth attribute: public-key");
|
|
5754
|
-
const
|
|
5755
|
-
return { serverUrl: a, publicKey: d, lang:
|
|
5754
|
+
const l = bt(s("lang")) ?? i.lang, m = s("transport"), v = m === "push" || m === "polling" ? m : i.transport, b = this.parseAuthenticatedEventDelayMs(s("authenticated-event-delay-ms"));
|
|
5755
|
+
return { serverUrl: a, publicKey: d, lang: l, transport: v, authenticatedEventDelayMs: b };
|
|
5756
5756
|
}
|
|
5757
5757
|
parseAuthenticatedEventDelayMs(i) {
|
|
5758
5758
|
if (i === void 0 || i.trim() === "") return je;
|
|
@@ -5770,24 +5770,24 @@ const ve = class ve extends HTMLElement {
|
|
|
5770
5770
|
body: JSON.stringify({ public_key: s })
|
|
5771
5771
|
});
|
|
5772
5772
|
if (!d.ok) throw new Error(`Auth request creation failed: ${d.status}`);
|
|
5773
|
-
const
|
|
5774
|
-
if (!
|
|
5775
|
-
const m = this.extractClientSecret(
|
|
5773
|
+
const l = await d.json();
|
|
5774
|
+
if (!l.id) throw new Error("Missing id from server response");
|
|
5775
|
+
const m = this.extractClientSecret(l);
|
|
5776
5776
|
if (!m) throw new Error("Missing client secret from server response");
|
|
5777
|
-
return is(a, i, s, { id: String(
|
|
5778
|
-
verificationId: String(
|
|
5779
|
-
code:
|
|
5777
|
+
return is(a, i, s, { id: String(l.id), clientSecret: m }), this.activeAuthRequestId = String(l.id), this.activeAuthRequestSecret = m, this.updateActiveAuthRequestExpiry(l), this.applyVerifyUrlsFromResponse(l), this.updateCode(l.formattedCode ?? l.code), this.dispatchPublicEvent("sendity:challenge-created", {
|
|
5778
|
+
verificationId: String(l.id),
|
|
5779
|
+
code: l.formattedCode ?? l.code ?? "",
|
|
5780
5780
|
channel: this.primaryChannel(this.activeVerifyUrls)
|
|
5781
|
-
}),
|
|
5781
|
+
}), l;
|
|
5782
5782
|
}
|
|
5783
5783
|
async step() {
|
|
5784
5784
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
5785
|
-
const { serverUrl: i, publicKey: s } = this.currentConfig, a = me(), d = Ct(a, i, s),
|
|
5786
|
-
if (!
|
|
5785
|
+
const { serverUrl: i, publicKey: s } = this.currentConfig, a = me(), d = Ct(a, i, s), l = d?.id;
|
|
5786
|
+
if (!l)
|
|
5787
5787
|
return await this.createAuthRequest(i, s, a);
|
|
5788
|
-
this.activeAuthRequestId =
|
|
5788
|
+
this.activeAuthRequestId = l, this.activeAuthRequestSecret = d.clientSecret;
|
|
5789
5789
|
const m = await fetch(
|
|
5790
|
-
this.authRequestStatusUrl(i,
|
|
5790
|
+
this.authRequestStatusUrl(i, l),
|
|
5791
5791
|
this.authRequestStatusInit(d.clientSecret)
|
|
5792
5792
|
);
|
|
5793
5793
|
if (m.status !== 200)
|
|
@@ -5804,9 +5804,9 @@ const ve = class ve extends HTMLElement {
|
|
|
5804
5804
|
configureRealtime(i) {
|
|
5805
5805
|
this.currentConfig || (this.currentConfig = this.resolveConfig());
|
|
5806
5806
|
const { transport: s } = this.currentConfig, a = i?.broadcasting, d = !!(a?.key && a.channel && a.authEndpoint);
|
|
5807
|
-
let
|
|
5808
|
-
s !== "polling" && d && a ?
|
|
5809
|
-
const m = os(s, d,
|
|
5807
|
+
let l = !1;
|
|
5808
|
+
s !== "polling" && d && a ? l = this.subscribeToBroadcasting(a) : s === "push" && console.warn("[sendity-auth] Push transport requested, but server response does not contain broadcasting metadata");
|
|
5809
|
+
const m = os(s, d, l);
|
|
5810
5810
|
m.start && this.startPolling(m.delayMs);
|
|
5811
5811
|
}
|
|
5812
5812
|
subscribeToBroadcasting(i) {
|
|
@@ -5833,11 +5833,13 @@ const ve = class ve extends HTMLElement {
|
|
|
5833
5833
|
client_secret: this.activeAuthRequestSecret
|
|
5834
5834
|
}
|
|
5835
5835
|
}
|
|
5836
|
-
}), this.echo.private(i.channel).listen(
|
|
5836
|
+
}), this.echo.private(i.channel).listen(".verification.received", (d) => {
|
|
5837
|
+
this.handleVerificationReceived(d);
|
|
5838
|
+
}).listen(i.event ?? ".authenticated", (d) => {
|
|
5837
5839
|
this.handleAuthenticated(d);
|
|
5838
5840
|
}), !0;
|
|
5839
5841
|
} catch (s) {
|
|
5840
|
-
return console.warn("[sendity-auth] realtime subscription failed, falling back to polling if enabled", s), this.currentConfig.transport === "auto" && this.startPolling(
|
|
5842
|
+
return console.warn("[sendity-auth] realtime subscription failed, falling back to polling if enabled", s), this.currentConfig.transport === "auto" && this.startPolling(Lt), !1;
|
|
5841
5843
|
}
|
|
5842
5844
|
}
|
|
5843
5845
|
startPolling(i) {
|
|
@@ -5851,6 +5853,11 @@ const ve = class ve extends HTMLElement {
|
|
|
5851
5853
|
this.fallbackPollTimer = null, s();
|
|
5852
5854
|
}, i) : s();
|
|
5853
5855
|
}
|
|
5856
|
+
handleVerificationReceived(i) {
|
|
5857
|
+
if (this.authenticated) return;
|
|
5858
|
+
const s = i.auth_request_id ?? i.authRequestId;
|
|
5859
|
+
this.activeAuthRequestId && s && s !== this.activeAuthRequestId || this.showSuccess(i);
|
|
5860
|
+
}
|
|
5854
5861
|
handleAuthenticated(i) {
|
|
5855
5862
|
if (this.authenticated) return;
|
|
5856
5863
|
if (!i.authorization) {
|
|
@@ -5887,7 +5894,7 @@ const ve = class ve extends HTMLElement {
|
|
|
5887
5894
|
return s.startsWith("mailto:") ? "email" : s.startsWith("whatsapp:") || s.startsWith("whatsapp://") ? "whatsapp" : "unknown";
|
|
5888
5895
|
}
|
|
5889
5896
|
applyVerifyUrlsFromResponse(i) {
|
|
5890
|
-
const s = Array.isArray(i.verify_urls) ? i.verify_urls : Array.isArray(i.verifyUrls) ? i.verifyUrls : [], a = Array.isArray(i.verification_endpoints) ? i.verification_endpoints.map((
|
|
5897
|
+
const s = Array.isArray(i.verify_urls) ? i.verify_urls : Array.isArray(i.verifyUrls) ? i.verifyUrls : [], a = Array.isArray(i.verification_endpoints) ? i.verification_endpoints.map((l) => typeof l.url == "string" ? l.url : typeof l.scheme == "string" && typeof l.recipient == "string" ? `${l.scheme}:${l.recipient}` : "") : [], d = rs([...s, ...a].map(String));
|
|
5891
5898
|
d.length !== 0 && (this.activeVerifyUrls = [...new Set(d)], this.renderVerifiers(this.activeVerifyUrls));
|
|
5892
5899
|
}
|
|
5893
5900
|
authRequestStatusUrl(i, s) {
|
|
@@ -6026,9 +6033,9 @@ const ve = class ve extends HTMLElement {
|
|
|
6026
6033
|
);
|
|
6027
6034
|
if (!d.ok)
|
|
6028
6035
|
throw new Error(`Authorization fetch failed: ${d.status}`);
|
|
6029
|
-
const
|
|
6030
|
-
if (
|
|
6031
|
-
this.handleAuthenticated(
|
|
6036
|
+
const l = await d.json();
|
|
6037
|
+
if (l.status === "verified" && l.authorization) {
|
|
6038
|
+
this.handleAuthenticated(l);
|
|
6032
6039
|
return;
|
|
6033
6040
|
}
|
|
6034
6041
|
throw new Error("Verified auth request did not include authorization");
|
|
@@ -6095,8 +6102,8 @@ const ve = class ve extends HTMLElement {
|
|
|
6095
6102
|
if (d.protocol === "mailto:")
|
|
6096
6103
|
return decodeURIComponent(d.pathname || d.href.replace(/^mailto:/, "").split("?")[0]) || null;
|
|
6097
6104
|
if (d.protocol === "whatsapp:" || d.protocol === "whatsapp://") {
|
|
6098
|
-
const
|
|
6099
|
-
return
|
|
6105
|
+
const l = d.searchParams.get("phone") || d.pathname.replace(/^\/+/, "");
|
|
6106
|
+
return l ? `+${l.replace(/^\+/, "")}` : null;
|
|
6100
6107
|
}
|
|
6101
6108
|
} catch {
|
|
6102
6109
|
if (a.startsWith("mailto:")) return a.replace(/^mailto:/, "").split("?")[0] || null;
|
|
@@ -6182,8 +6189,8 @@ const ve = class ve extends HTMLElement {
|
|
|
6182
6189
|
const W = document.createElement("span");
|
|
6183
6190
|
W.textContent = this.orLabel(s.lang), k.appendChild(W), this.verifiersEl.appendChild(k);
|
|
6184
6191
|
}
|
|
6185
|
-
const
|
|
6186
|
-
|
|
6192
|
+
const l = document.createElement("div");
|
|
6193
|
+
l.className = "opt";
|
|
6187
6194
|
const m = document.createElement("a");
|
|
6188
6195
|
m.className = "chan " + this.channelClass(a), m.href = this.buildLink(a, s.lang), m.target = "_blank", m.rel = "noopener noreferrer", m.addEventListener("click", () => {
|
|
6189
6196
|
this.footerWaitTimer !== null && (clearTimeout(this.footerWaitTimer), this.footerWaitTimer = null), this.showFooterWaitingState();
|
|
@@ -6194,13 +6201,13 @@ const ve = class ve extends HTMLElement {
|
|
|
6194
6201
|
k.className = "icon", k.setAttribute("aria-hidden", "true"), k.innerHTML = v, m.appendChild(k);
|
|
6195
6202
|
}
|
|
6196
6203
|
const b = document.createElement("span");
|
|
6197
|
-
b.className = "label", b.textContent = this.channelLabel(a, s.lang), m.appendChild(b),
|
|
6204
|
+
b.className = "label", b.textContent = this.channelLabel(a, s.lang), m.appendChild(b), l.appendChild(m);
|
|
6198
6205
|
const E = this.destinationText(a, s.lang);
|
|
6199
6206
|
if (E) {
|
|
6200
6207
|
const k = document.createElement("a");
|
|
6201
|
-
k.className = "dest", k.href = m.href, k.target = "_blank", k.rel = "noopener noreferrer", k.textContent = E,
|
|
6208
|
+
k.className = "dest", k.href = m.href, k.target = "_blank", k.rel = "noopener noreferrer", k.textContent = E, l.appendChild(k);
|
|
6202
6209
|
}
|
|
6203
|
-
this.verifiersEl.appendChild(
|
|
6210
|
+
this.verifiersEl.appendChild(l);
|
|
6204
6211
|
});
|
|
6205
6212
|
}
|
|
6206
6213
|
channelClass(i) {
|
|
@@ -6219,8 +6226,8 @@ const ve = class ve extends HTMLElement {
|
|
|
6219
6226
|
if (d === "email") return a.labels.email;
|
|
6220
6227
|
if (d === "whatsapp") return a.labels.whatsapp;
|
|
6221
6228
|
try {
|
|
6222
|
-
const
|
|
6223
|
-
return
|
|
6229
|
+
const l = new URL(i, window.location.origin);
|
|
6230
|
+
return l.protocol.startsWith("http") ? l.hostname : l.protocol.replace(":", "");
|
|
6224
6231
|
} catch {
|
|
6225
6232
|
return i;
|
|
6226
6233
|
}
|
|
@@ -6228,17 +6235,17 @@ const ve = class ve extends HTMLElement {
|
|
|
6228
6235
|
destinationText(i, s) {
|
|
6229
6236
|
const d = F(s).ui.toPrefix ?? "to";
|
|
6230
6237
|
try {
|
|
6231
|
-
const
|
|
6232
|
-
if (
|
|
6233
|
-
const m = decodeURIComponent(
|
|
6238
|
+
const l = new URL(i, window.location.origin);
|
|
6239
|
+
if (l.protocol === "mailto:") {
|
|
6240
|
+
const m = decodeURIComponent(l.pathname || l.href.replace(/^mailto:/, "").split("?")[0]);
|
|
6234
6241
|
return m ? `${d} ${m}` : null;
|
|
6235
6242
|
}
|
|
6236
|
-
if (
|
|
6237
|
-
const m =
|
|
6243
|
+
if (l.protocol === "whatsapp:" || l.protocol === "whatsapp://") {
|
|
6244
|
+
const m = l.searchParams.get("phone") || l.pathname.replace(/^\/+/, "");
|
|
6238
6245
|
return m ? `${d} +${m.replace(/^\+/, "")}` : null;
|
|
6239
6246
|
}
|
|
6240
|
-
if (
|
|
6241
|
-
const m =
|
|
6247
|
+
if (l.protocol.startsWith("http") && (l.hostname === "wa.me" || l.hostname === "api.whatsapp.com")) {
|
|
6248
|
+
const m = l.pathname.replace(/^\/+/, "").replace(/[^0-9]/g, "");
|
|
6242
6249
|
return m ? `${d} +${m}` : null;
|
|
6243
6250
|
}
|
|
6244
6251
|
} catch {
|
|
@@ -6266,16 +6273,16 @@ const ve = class ve extends HTMLElement {
|
|
|
6266
6273
|
}
|
|
6267
6274
|
}
|
|
6268
6275
|
buildLink(i, s) {
|
|
6269
|
-
const a = this.lastCode, d = F(s),
|
|
6276
|
+
const a = this.lastCode, d = F(s), l = window.location.host;
|
|
6270
6277
|
if (!a) return i;
|
|
6271
6278
|
if (i.startsWith("mailto:")) {
|
|
6272
|
-
const [m, v = ""] = i.split("?"), b = new URLSearchParams(v), E = this.applyTemplate(d.templates.emailSubject,
|
|
6279
|
+
const [m, v = ""] = i.split("?"), b = new URLSearchParams(v), E = this.applyTemplate(d.templates.emailSubject, l, a), k = this.applyTemplate(d.templates.emailBody, l, a);
|
|
6273
6280
|
b.set("subject", E), b.set("body", k);
|
|
6274
6281
|
const W = this.toQuery(b);
|
|
6275
6282
|
return `${m}?${W}`;
|
|
6276
6283
|
}
|
|
6277
6284
|
if (i.startsWith("whatsapp:") || i.startsWith("whatsapp://")) {
|
|
6278
|
-
const [m, v = ""] = i.split("?"), b = new URLSearchParams(v), E = this.applyTemplate(d.templates.whatsappText,
|
|
6285
|
+
const [m, v = ""] = i.split("?"), b = new URLSearchParams(v), E = this.applyTemplate(d.templates.whatsappText, l, a);
|
|
6279
6286
|
b.set("text", E);
|
|
6280
6287
|
const k = this.toQuery(b);
|
|
6281
6288
|
return `${m}?${k}`;
|
|
@@ -6291,8 +6298,8 @@ const ve = class ve extends HTMLElement {
|
|
|
6291
6298
|
toQuery(i) {
|
|
6292
6299
|
const s = [];
|
|
6293
6300
|
return i.forEach((a, d) => {
|
|
6294
|
-
const
|
|
6295
|
-
s.push(`${
|
|
6301
|
+
const l = encodeURIComponent(d), m = encodeURIComponent(a);
|
|
6302
|
+
s.push(`${l}=${m}`);
|
|
6296
6303
|
}), s.join("&");
|
|
6297
6304
|
}
|
|
6298
6305
|
joinUrl(i, s) {
|