@one-payments/web-components 1.6.2 → 1.6.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.js +308 -233
- package/dist/one-payment.d.ts +2 -0
- package/dist/one-payment.d.ts.map +1 -1
- package/dist/one-payment.js +91 -9
- package/dist/one-payment.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -75,7 +75,7 @@ const { is: Fe, defineProperty: Oe, getOwnPropertyDescriptor: ze, getOwnProperty
|
|
|
75
75
|
return r;
|
|
76
76
|
} }, Yt = (e, t) => !Fe(e, t), te = { attribute: !0, type: String, converter: bt, reflect: !1, useDefault: !1, hasChanged: Yt };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), z.litPropertyMetadata ?? (z.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
-
let
|
|
78
|
+
let G = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
81
81
|
}
|
|
@@ -278,15 +278,15 @@ let K = class extends HTMLElement {
|
|
|
278
278
|
firstUpdated(t) {
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
|
-
|
|
281
|
+
G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[nt("elementProperties")] = /* @__PURE__ */ new Map(), G[nt("finalized")] = /* @__PURE__ */ new Map(), Et == null || Et({ ReactiveElement: G }), (z.reactiveElementVersions ?? (z.reactiveElementVersions = [])).push("2.1.1");
|
|
282
282
|
/**
|
|
283
283
|
* @license
|
|
284
284
|
* Copyright 2017 Google LLC
|
|
285
285
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
286
286
|
*/
|
|
287
|
-
const st = globalThis, vt = st.trustedTypes, ee = vt ? vt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pe = "$lit$", F = `lit$${Math.random().toFixed(9).slice(2)}$`, me = "?" + F, je = `<${me}>`,
|
|
287
|
+
const st = globalThis, vt = st.trustedTypes, ee = vt ? vt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, pe = "$lit$", F = `lit$${Math.random().toFixed(9).slice(2)}$`, me = "?" + F, je = `<${me}>`, K = document, lt = () => K.createComment(""), ct = (e) => e === null || typeof e != "object" && typeof e != "function", Vt = Array.isArray, Ke = (e) => Vt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", It = `[
|
|
288
288
|
\f\r]`, it = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, re = /-->/g, ie = />/g, H = RegExp(`>|${It}(?:([^\\s"'>=/]+)(${It}*=${It}*(?:[^
|
|
289
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, se = /"/g, fe = /^(?:script|style|textarea|title)$/i,
|
|
289
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, se = /"/g, fe = /^(?:script|style|textarea|title)$/i, Ge = (e) => (t, ...r) => ({ _$litType$: e, strings: t, values: r }), g = Ge(1), W = Symbol.for("lit-noChange"), I = Symbol.for("lit-nothing"), oe = /* @__PURE__ */ new WeakMap(), Y = K.createTreeWalker(K, 129);
|
|
290
290
|
function ge(e, t) {
|
|
291
291
|
if (!Vt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
292
292
|
return ee !== void 0 ? ee.createHTML(t) : t;
|
|
@@ -336,7 +336,7 @@ class dt {
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
static createElement(t, r) {
|
|
339
|
-
const i =
|
|
339
|
+
const i = K.createElement("template");
|
|
340
340
|
return i.innerHTML = t, i;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -358,7 +358,7 @@ class We {
|
|
|
358
358
|
return this._$AM._$AU;
|
|
359
359
|
}
|
|
360
360
|
u(t) {
|
|
361
|
-
const { el: { content: r }, parts: i } = this._$AD, n = ((t == null ? void 0 : t.creationScope) ??
|
|
361
|
+
const { el: { content: r }, parts: i } = this._$AD, n = ((t == null ? void 0 : t.creationScope) ?? K).importNode(r, !0);
|
|
362
362
|
Y.currentNode = n;
|
|
363
363
|
let s = Y.nextNode(), o = 0, l = 0, a = i[0];
|
|
364
364
|
for (; a !== void 0; ) {
|
|
@@ -368,7 +368,7 @@ class We {
|
|
|
368
368
|
}
|
|
369
369
|
o !== (a == null ? void 0 : a.index) && (s = Y.nextNode(), o++);
|
|
370
370
|
}
|
|
371
|
-
return Y.currentNode =
|
|
371
|
+
return Y.currentNode = K, n;
|
|
372
372
|
}
|
|
373
373
|
p(t) {
|
|
374
374
|
let r = 0;
|
|
@@ -395,7 +395,7 @@ class ht {
|
|
|
395
395
|
return this._$AB;
|
|
396
396
|
}
|
|
397
397
|
_$AI(t, r = this) {
|
|
398
|
-
t = J(this, t, r), ct(t) ? t === I || t == null || t === "" ? (this._$AH !== I && this._$AR(), this._$AH = I) : t !== this._$AH && t !== W && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
398
|
+
t = J(this, t, r), ct(t) ? t === I || t == null || t === "" ? (this._$AH !== I && this._$AR(), this._$AH = I) : t !== this._$AH && t !== W && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ke(t) ? this.k(t) : this._(t);
|
|
399
399
|
}
|
|
400
400
|
O(t) {
|
|
401
401
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -404,7 +404,7 @@ class ht {
|
|
|
404
404
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
405
405
|
}
|
|
406
406
|
_(t) {
|
|
407
|
-
this._$AH !== I && ct(this._$AH) ? this._$AA.nextSibling.data = t : this.T(
|
|
407
|
+
this._$AH !== I && ct(this._$AH) ? this._$AA.nextSibling.data = t : this.T(K.createTextNode(t)), this._$AH = t;
|
|
408
408
|
}
|
|
409
409
|
$(t) {
|
|
410
410
|
var s;
|
|
@@ -521,7 +521,7 @@ const er = (e, t, r) => {
|
|
|
521
521
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
522
522
|
*/
|
|
523
523
|
const j = globalThis;
|
|
524
|
-
class ot extends
|
|
524
|
+
class ot extends G {
|
|
525
525
|
constructor() {
|
|
526
526
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
527
527
|
}
|
|
@@ -617,7 +617,8 @@ var f = {
|
|
|
617
617
|
TNG: "tng",
|
|
618
618
|
ALIPAYCN: "alipaycn",
|
|
619
619
|
ALIPAYHK: "alipayhk",
|
|
620
|
-
GCASH: "gcash"
|
|
620
|
+
GCASH: "gcash",
|
|
621
|
+
KONBINI: "konbini"
|
|
621
622
|
}, T = {
|
|
622
623
|
IDLE: "idle",
|
|
623
624
|
INITIALIZING: "initializing",
|
|
@@ -1013,6 +1014,10 @@ var cr = class {
|
|
|
1013
1014
|
id: "gcash",
|
|
1014
1015
|
enabled: !0,
|
|
1015
1016
|
priority: h++
|
|
1017
|
+
}), (u.includes("konbini") || m.includes("payments_konbini")) && d.push({
|
|
1018
|
+
id: "konbini",
|
|
1019
|
+
enabled: !0,
|
|
1020
|
+
priority: h++
|
|
1016
1021
|
});
|
|
1017
1022
|
}), this.setState({
|
|
1018
1023
|
status: T.READY,
|
|
@@ -1138,6 +1143,8 @@ var cr = class {
|
|
|
1138
1143
|
return "alipayhk";
|
|
1139
1144
|
case "gcash":
|
|
1140
1145
|
return "gcash";
|
|
1146
|
+
case "konbini":
|
|
1147
|
+
return "konbini";
|
|
1141
1148
|
default:
|
|
1142
1149
|
return "qr";
|
|
1143
1150
|
}
|
|
@@ -1317,7 +1324,7 @@ var cr = class {
|
|
|
1317
1324
|
this.stopPolling();
|
|
1318
1325
|
return;
|
|
1319
1326
|
}
|
|
1320
|
-
const r = t.selectedMethod === "promptpay" || t.selectedMethod === "duitnow" || t.selectedMethod === "gopay" || t.selectedMethod === "boost" || t.selectedMethod === "shopeepay" || t.selectedMethod === "atom" || t.selectedMethod === "dana" || t.selectedMethod === "tng" || t.selectedMethod === "alipaycn" || t.selectedMethod === "alipayhk" || t.selectedMethod === "gcash";
|
|
1327
|
+
const r = t.selectedMethod === "promptpay" || t.selectedMethod === "duitnow" || t.selectedMethod === "gopay" || t.selectedMethod === "boost" || t.selectedMethod === "shopeepay" || t.selectedMethod === "atom" || t.selectedMethod === "dana" || t.selectedMethod === "tng" || t.selectedMethod === "alipaycn" || t.selectedMethod === "alipayhk" || t.selectedMethod === "gcash" || t.selectedMethod === "konbini";
|
|
1321
1328
|
if (e.qrCode && !this.ignoreQRInPolling && !r) {
|
|
1322
1329
|
this.emit({
|
|
1323
1330
|
type: "qr_code_received",
|
|
@@ -1439,6 +1446,16 @@ var cr = class {
|
|
|
1439
1446
|
});
|
|
1440
1447
|
return;
|
|
1441
1448
|
}
|
|
1449
|
+
if (t.selectedMethod === "konbini") {
|
|
1450
|
+
this.stopPolling(), this.emit({
|
|
1451
|
+
type: "konbini_redirect",
|
|
1452
|
+
payload: {
|
|
1453
|
+
redirectUrl: e.nextActionUrl,
|
|
1454
|
+
methodId: t.selectedMethod
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1442
1459
|
if (t.selectedMethod === "paynow" && !this.ignoreQRInPolling) {
|
|
1443
1460
|
this.emit({
|
|
1444
1461
|
type: "qr_code_received",
|
|
@@ -1536,7 +1553,7 @@ var cr = class {
|
|
|
1536
1553
|
r(e);
|
|
1537
1554
|
});
|
|
1538
1555
|
}
|
|
1539
|
-
}, dr = "https://images.ctfassets.net/c3n7jozh84hr/2A5qlS6JkUsOyFVPzQ0KlK/22b497afd71030ef1a44a52394b15027/______2022-06-30_11.03.43.png", ur = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/xLSOJpNvMp7cBKdvDln0B/eb2f53a0a3f2317750739dceff9df413/______2022-06-30_10.59.00.png", hr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4Iq13VoxktB3amHFbQK1yb/f2fe12add0dac233d56c22cf5651c65c/image-20220630-030728.png", pr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/mjau5Tqscwu9tbhRLFbmJ/a66cd2894060b2d3a94b75d7f4e65355/______2022-07-04_17.05.18.png", mr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1M4DBVFhOrkprPmjxZwS7M/c4a90840d3846b926d3a5524392435fe/Boost.svg", fr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1BYCLeHNQEyPXBjlIdu09h/71d67c5be3975f77091bf45c7ab58f65/ShopeePay.svg", gr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/61LYQ3RuziTGisarZgaAV1/309f3f1e569609dd0b0095857d6382b5/__2022-05-31_11.44.42.png", yr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/79Uj5xItEZE7L51j2oh6IV/6af4cfefdd65834305931fd16f652d87/DANA.svg", br = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/15FHwC4H3W0JrNvsqy6TWH/5d18aa44231c55d6457389e17ac7ea0c/TnG.svg", vr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/5EK8VF1nACmJ0KpPocLuR7/785178078004e82cb69782c570623b8c/Alipay.svg", wr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3sNSjVq0K9mq5whYcGJhBe/78857434adff807c8e293425491e0bd4/AlipayHK.svg", xr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4WAO5JJPUOrZ9jBA0Vf4tf/c3896e1a5508efa0c569bd3eaa577dad/GCash.svg", Q = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, V = function(e, t, r, i, n, s, o, l, a, c) {
|
|
1556
|
+
}, dr = "https://images.ctfassets.net/c3n7jozh84hr/2A5qlS6JkUsOyFVPzQ0KlK/22b497afd71030ef1a44a52394b15027/______2022-06-30_11.03.43.png", ur = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/xLSOJpNvMp7cBKdvDln0B/eb2f53a0a3f2317750739dceff9df413/______2022-06-30_10.59.00.png", hr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4Iq13VoxktB3amHFbQK1yb/f2fe12add0dac233d56c22cf5651c65c/image-20220630-030728.png", pr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/mjau5Tqscwu9tbhRLFbmJ/a66cd2894060b2d3a94b75d7f4e65355/______2022-07-04_17.05.18.png", mr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1M4DBVFhOrkprPmjxZwS7M/c4a90840d3846b926d3a5524392435fe/Boost.svg", fr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/1BYCLeHNQEyPXBjlIdu09h/71d67c5be3975f77091bf45c7ab58f65/ShopeePay.svg", gr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/61LYQ3RuziTGisarZgaAV1/309f3f1e569609dd0b0095857d6382b5/__2022-05-31_11.44.42.png", yr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/79Uj5xItEZE7L51j2oh6IV/6af4cfefdd65834305931fd16f652d87/DANA.svg", br = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/15FHwC4H3W0JrNvsqy6TWH/5d18aa44231c55d6457389e17ac7ea0c/TnG.svg", vr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/5EK8VF1nACmJ0KpPocLuR7/785178078004e82cb69782c570623b8c/Alipay.svg", wr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/3sNSjVq0K9mq5whYcGJhBe/78857434adff807c8e293425491e0bd4/AlipayHK.svg", xr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/4WAO5JJPUOrZ9jBA0Vf4tf/c3896e1a5508efa0c569bd3eaa577dad/GCash.svg", Sr = "https://www.airwallex.com/docs/assets/contentful/images.ctfassets.net/c3n7jozh84hr/2k2M0v6xdd5HvUNxX2sYCi/c9de881648bdd61adb15ec1941f2d47e/konbini_420x280.png", Q = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, V = function(e, t, r, i, n, s, o, l, a, c) {
|
|
1540
1557
|
var d = this;
|
|
1541
1558
|
d.numeralDecimalMark = e || ".", d.numeralIntegerScale = t > 0 ? t : 0, d.numeralDecimalScale = r >= 0 ? r : 2, d.numeralThousandsGroupStyle = i || V.groupStyle.thousand, d.numeralPositiveOnly = !!n, d.stripLeadingZeroes = s !== !1, d.prefix = o || o === "" ? o : "", d.signBeforePrefix = !!l, d.tailPrefix = !!a, d.delimiter = c || c === "" ? c : ",", d.delimiterRE = c ? new RegExp("\\" + c, "g") : "";
|
|
1542
1559
|
};
|
|
@@ -1566,7 +1583,7 @@ V.prototype = {
|
|
|
1566
1583
|
return t.tailPrefix ? i + s.toString() + (t.numeralDecimalScale > 0 ? o.toString() : "") + t.prefix : n + s.toString() + (t.numeralDecimalScale > 0 ? o.toString() : "");
|
|
1567
1584
|
}
|
|
1568
1585
|
};
|
|
1569
|
-
var
|
|
1586
|
+
var Pr = V, ye = function(e, t, r) {
|
|
1570
1587
|
var i = this;
|
|
1571
1588
|
i.date = [], i.blocks = [], i.datePattern = e, i.dateMin = t.split("-").reverse().map(function(n) {
|
|
1572
1589
|
return parseInt(n, 10);
|
|
@@ -1653,7 +1670,7 @@ ye.prototype = {
|
|
|
1653
1670
|
return t ? (e < 10 ? "000" : e < 100 ? "00" : e < 1e3 ? "0" : "") + e : (e < 10 ? "0" : "") + e;
|
|
1654
1671
|
}
|
|
1655
1672
|
};
|
|
1656
|
-
var
|
|
1673
|
+
var kr = ye, be = function(e, t) {
|
|
1657
1674
|
var r = this;
|
|
1658
1675
|
r.time = [], r.blocks = [], r.timePattern = e, r.timeFormat = t, r.initBlocks();
|
|
1659
1676
|
};
|
|
@@ -1762,7 +1779,7 @@ ve.prototype = {
|
|
|
1762
1779
|
return r = r.replace(/[()]/g, ""), r = r.replace(/[\s-]/g, t.delimiter), r;
|
|
1763
1780
|
}
|
|
1764
1781
|
};
|
|
1765
|
-
var
|
|
1782
|
+
var Cr = ve, Bt = {
|
|
1766
1783
|
blocks: {
|
|
1767
1784
|
uatp: [4, 5, 6],
|
|
1768
1785
|
amex: [4, 6, 5],
|
|
@@ -1829,7 +1846,7 @@ var kr = ve, Bt = {
|
|
|
1829
1846
|
blocks: t ? this.getStrictBlocks(r.general) : r.general
|
|
1830
1847
|
};
|
|
1831
1848
|
}
|
|
1832
|
-
},
|
|
1849
|
+
}, _r = Bt, Er = {
|
|
1833
1850
|
noop: function() {
|
|
1834
1851
|
},
|
|
1835
1852
|
strip: function(e, t) {
|
|
@@ -1958,7 +1975,7 @@ var kr = ve, Bt = {
|
|
|
1958
1975
|
isAndroidBackspaceKeydown: function(e, t) {
|
|
1959
1976
|
return !this.isAndroid() || !e || !t ? !1 : t === e.slice(0, -1);
|
|
1960
1977
|
}
|
|
1961
|
-
},
|
|
1978
|
+
}, Ir = Er, Nr = {
|
|
1962
1979
|
// Maybe change to object-assign
|
|
1963
1980
|
// for now just keep it as simple
|
|
1964
1981
|
assign: function(e, t) {
|
|
@@ -1966,7 +1983,7 @@ var kr = ve, Bt = {
|
|
|
1966
1983
|
}, e.phone = !!t.phone, e.phoneRegionCode = t.phoneRegionCode || "AU", e.phoneFormatter = {}, e.time = !!t.time, e.timePattern = t.timePattern || ["h", "m", "s"], e.timeFormat = t.timeFormat || "24", e.timeFormatter = {}, e.date = !!t.date, e.datePattern = t.datePattern || ["d", "m", "Y"], e.dateMin = t.dateMin || "", e.dateMax = t.dateMax || "", e.dateFormatter = {}, e.numeral = !!t.numeral, e.numeralIntegerScale = t.numeralIntegerScale > 0 ? t.numeralIntegerScale : 0, e.numeralDecimalScale = t.numeralDecimalScale >= 0 ? t.numeralDecimalScale : 2, e.numeralDecimalMark = t.numeralDecimalMark || ".", e.numeralThousandsGroupStyle = t.numeralThousandsGroupStyle || "thousand", e.numeralPositiveOnly = !!t.numeralPositiveOnly, e.stripLeadingZeroes = t.stripLeadingZeroes !== !1, e.signBeforePrefix = !!t.signBeforePrefix, e.tailPrefix = !!t.tailPrefix, e.swapHiddenInput = !!t.swapHiddenInput, e.numericOnly = e.creditCard || e.date || !!t.numericOnly, e.uppercase = !!t.uppercase, e.lowercase = !!t.lowercase, e.prefix = e.creditCard || e.date ? "" : t.prefix || "", e.noImmediatePrefix = !!t.noImmediatePrefix, e.prefixLength = e.prefix.length, e.rawValueTrimPrefix = !!t.rawValueTrimPrefix, e.copyDelimiter = !!t.copyDelimiter, e.initValue = t.initValue !== void 0 && t.initValue !== null ? t.initValue.toString() : "", e.delimiter = t.delimiter || t.delimiter === "" ? t.delimiter : t.date ? "/" : t.time ? ":" : t.numeral ? "," : (t.phone, " "), e.delimiterLength = e.delimiter.length, e.delimiterLazyShow = !!t.delimiterLazyShow, e.delimiters = t.delimiters || [], e.blocks = t.blocks || [], e.blocksLength = e.blocks.length, e.root = typeof Q == "object" && Q ? Q : window, e.document = t.document || e.root.document, e.maxLength = 0, e.backspace = !1, e.result = "", e.onValueChanged = t.onValueChanged || function() {
|
|
1967
1984
|
}, e;
|
|
1968
1985
|
}
|
|
1969
|
-
},
|
|
1986
|
+
}, Dr = Nr, k = function(e, t) {
|
|
1970
1987
|
var r = this, i = !1;
|
|
1971
1988
|
if (typeof e == "string" ? (r.element = document.querySelector(e), i = document.querySelectorAll(e).length > 1) : typeof e.length < "u" && e.length > 0 ? (r.element = e[0], i = e.length > 1) : r.element = e, !r.element)
|
|
1972
1989
|
throw new Error("[cleave.js] Please check the element");
|
|
@@ -1975,16 +1992,16 @@ var kr = ve, Bt = {
|
|
|
1975
1992
|
console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.");
|
|
1976
1993
|
} catch {
|
|
1977
1994
|
}
|
|
1978
|
-
t.initValue = r.element.value, r.properties =
|
|
1995
|
+
t.initValue = r.element.value, r.properties = k.DefaultProperties.assign({}, t), r.init();
|
|
1979
1996
|
};
|
|
1980
|
-
|
|
1997
|
+
k.prototype = {
|
|
1981
1998
|
init: function() {
|
|
1982
1999
|
var e = this, t = e.properties;
|
|
1983
2000
|
if (!t.numeral && !t.phone && !t.creditCard && !t.time && !t.date && t.blocksLength === 0 && !t.prefix) {
|
|
1984
2001
|
e.onInput(t.initValue);
|
|
1985
2002
|
return;
|
|
1986
2003
|
}
|
|
1987
|
-
t.maxLength =
|
|
2004
|
+
t.maxLength = k.Util.getMaxLength(t.blocks), e.isAndroid = k.Util.isAndroid(), e.lastInputValue = "", e.isBackward = "", e.onChangeListener = e.onChange.bind(e), e.onKeyDownListener = e.onKeyDown.bind(e), e.onFocusListener = e.onFocus.bind(e), e.onCutListener = e.onCut.bind(e), e.onCopyListener = e.onCopy.bind(e), e.initSwapHiddenInput(), e.element.addEventListener("input", e.onChangeListener), e.element.addEventListener("keydown", e.onKeyDownListener), e.element.addEventListener("focus", e.onFocusListener), e.element.addEventListener("cut", e.onCutListener), e.element.addEventListener("copy", e.onCopyListener), e.initPhoneFormatter(), e.initDateFormatter(), e.initTimeFormatter(), e.initNumeralFormatter(), (t.initValue || t.prefix && !t.noImmediatePrefix) && e.onInput(t.initValue);
|
|
1988
2005
|
},
|
|
1989
2006
|
initSwapHiddenInput: function() {
|
|
1990
2007
|
var e = this, t = e.properties;
|
|
@@ -1995,7 +2012,7 @@ A.prototype = {
|
|
|
1995
2012
|
},
|
|
1996
2013
|
initNumeralFormatter: function() {
|
|
1997
2014
|
var e = this, t = e.properties;
|
|
1998
|
-
t.numeral && (t.numeralFormatter = new
|
|
2015
|
+
t.numeral && (t.numeralFormatter = new k.NumeralFormatter(
|
|
1999
2016
|
t.numeralDecimalMark,
|
|
2000
2017
|
t.numeralIntegerScale,
|
|
2001
2018
|
t.numeralDecimalScale,
|
|
@@ -2010,17 +2027,17 @@ A.prototype = {
|
|
|
2010
2027
|
},
|
|
2011
2028
|
initTimeFormatter: function() {
|
|
2012
2029
|
var e = this, t = e.properties;
|
|
2013
|
-
t.time && (t.timeFormatter = new
|
|
2030
|
+
t.time && (t.timeFormatter = new k.TimeFormatter(t.timePattern, t.timeFormat), t.blocks = t.timeFormatter.getBlocks(), t.blocksLength = t.blocks.length, t.maxLength = k.Util.getMaxLength(t.blocks));
|
|
2014
2031
|
},
|
|
2015
2032
|
initDateFormatter: function() {
|
|
2016
2033
|
var e = this, t = e.properties;
|
|
2017
|
-
t.date && (t.dateFormatter = new
|
|
2034
|
+
t.date && (t.dateFormatter = new k.DateFormatter(t.datePattern, t.dateMin, t.dateMax), t.blocks = t.dateFormatter.getBlocks(), t.blocksLength = t.blocks.length, t.maxLength = k.Util.getMaxLength(t.blocks));
|
|
2018
2035
|
},
|
|
2019
2036
|
initPhoneFormatter: function() {
|
|
2020
2037
|
var e = this, t = e.properties;
|
|
2021
2038
|
if (t.phone)
|
|
2022
2039
|
try {
|
|
2023
|
-
t.phoneFormatter = new
|
|
2040
|
+
t.phoneFormatter = new k.PhoneFormatter(
|
|
2024
2041
|
new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),
|
|
2025
2042
|
t.delimiter
|
|
2026
2043
|
);
|
|
@@ -2033,23 +2050,23 @@ A.prototype = {
|
|
|
2033
2050
|
t.lastInputValue = t.element.value, t.isBackward = r === 8;
|
|
2034
2051
|
},
|
|
2035
2052
|
onChange: function(e) {
|
|
2036
|
-
var t = this, r = t.properties, i =
|
|
2053
|
+
var t = this, r = t.properties, i = k.Util;
|
|
2037
2054
|
t.isBackward = t.isBackward || e.inputType === "deleteContentBackward";
|
|
2038
2055
|
var n = i.getPostDelimiter(t.lastInputValue, r.delimiter, r.delimiters);
|
|
2039
2056
|
t.isBackward && n ? r.postDelimiterBackspace = n : r.postDelimiterBackspace = !1, this.onInput(this.element.value);
|
|
2040
2057
|
},
|
|
2041
2058
|
onFocus: function() {
|
|
2042
2059
|
var e = this, t = e.properties;
|
|
2043
|
-
e.lastInputValue = e.element.value, t.prefix && t.noImmediatePrefix && !e.element.value && this.onInput(t.prefix),
|
|
2060
|
+
e.lastInputValue = e.element.value, t.prefix && t.noImmediatePrefix && !e.element.value && this.onInput(t.prefix), k.Util.fixPrefixCursor(e.element, t.prefix, t.delimiter, t.delimiters);
|
|
2044
2061
|
},
|
|
2045
2062
|
onCut: function(e) {
|
|
2046
|
-
|
|
2063
|
+
k.Util.checkFullSelection(this.element.value) && (this.copyClipboardData(e), this.onInput(""));
|
|
2047
2064
|
},
|
|
2048
2065
|
onCopy: function(e) {
|
|
2049
|
-
|
|
2066
|
+
k.Util.checkFullSelection(this.element.value) && this.copyClipboardData(e);
|
|
2050
2067
|
},
|
|
2051
2068
|
copyClipboardData: function(e) {
|
|
2052
|
-
var t = this, r = t.properties, i =
|
|
2069
|
+
var t = this, r = t.properties, i = k.Util, n = t.element.value, s = "";
|
|
2053
2070
|
r.copyDelimiter ? s = n : s = i.stripDelimiters(n, r.delimiter, r.delimiters);
|
|
2054
2071
|
try {
|
|
2055
2072
|
e.clipboardData ? e.clipboardData.setData("Text", s) : window.clipboardData.setData("Text", s), e.preventDefault();
|
|
@@ -2057,7 +2074,7 @@ A.prototype = {
|
|
|
2057
2074
|
}
|
|
2058
2075
|
},
|
|
2059
2076
|
onInput: function(e) {
|
|
2060
|
-
var t = this, r = t.properties, i =
|
|
2077
|
+
var t = this, r = t.properties, i = k.Util, n = i.getPostDelimiter(e, r.delimiter, r.delimiters);
|
|
2061
2078
|
if (!r.numeral && r.postDelimiterBackspace && !n && (e = i.headStr(e, e.length - r.postDelimiterBackspace.length)), r.phone) {
|
|
2062
2079
|
r.prefix && (!r.noImmediatePrefix || e.length) ? r.result = r.prefix + r.phoneFormatter.format(e).slice(r.prefix.length) : r.result = r.phoneFormatter.format(e), t.updateValueState();
|
|
2063
2080
|
return;
|
|
@@ -2080,11 +2097,11 @@ A.prototype = {
|
|
|
2080
2097
|
), t.updateValueState();
|
|
2081
2098
|
},
|
|
2082
2099
|
updateCreditCardPropsByValue: function(e) {
|
|
2083
|
-
var t = this, r = t.properties, i =
|
|
2084
|
-
i.headStr(r.result, 4) !== i.headStr(e, 4) && (n =
|
|
2100
|
+
var t = this, r = t.properties, i = k.Util, n;
|
|
2101
|
+
i.headStr(r.result, 4) !== i.headStr(e, 4) && (n = k.CreditCardDetector.getInfo(e, r.creditCardStrictMode), r.blocks = n.blocks, r.blocksLength = r.blocks.length, r.maxLength = i.getMaxLength(r.blocks), r.creditCardType !== n.type && (r.creditCardType = n.type, r.onCreditCardTypeChanged.call(t, r.creditCardType)));
|
|
2085
2102
|
},
|
|
2086
2103
|
updateValueState: function() {
|
|
2087
|
-
var e = this, t =
|
|
2104
|
+
var e = this, t = k.Util, r = e.properties;
|
|
2088
2105
|
if (e.element) {
|
|
2089
2106
|
var i = e.element.selectionEnd, n = e.element.value, s = r.result;
|
|
2090
2107
|
if (i = t.getNextCursorPosition(i, n, s, r.delimiter, r.delimiters), e.isAndroid) {
|
|
@@ -2115,7 +2132,7 @@ A.prototype = {
|
|
|
2115
2132
|
e = e != null ? e.toString() : "", r.numeral && (e = e.replace(".", r.numeralDecimalMark)), r.postDelimiterBackspace = !1, t.element.value = e, t.onInput(e);
|
|
2116
2133
|
},
|
|
2117
2134
|
getRawValue: function() {
|
|
2118
|
-
var e = this, t = e.properties, r =
|
|
2135
|
+
var e = this, t = e.properties, r = k.Util, i = e.element.value;
|
|
2119
2136
|
return t.rawValueTrimPrefix && (i = r.getPrefixStrippedValue(i, t.prefix, t.prefixLength, t.result, t.delimiter, t.delimiters, t.noImmediatePrefix, t.tailPrefix, t.signBeforePrefix)), t.numeral ? i = t.numeralFormatter.getRawValue(i) : i = r.stripDelimiters(i, t.delimiter, t.delimiters), i;
|
|
2120
2137
|
},
|
|
2121
2138
|
getISOFormatDate: function() {
|
|
@@ -2137,19 +2154,19 @@ A.prototype = {
|
|
|
2137
2154
|
return "[Cleave Object]";
|
|
2138
2155
|
}
|
|
2139
2156
|
};
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
(typeof Q == "object" && Q ? Q : window).Cleave =
|
|
2148
|
-
var ae =
|
|
2157
|
+
k.NumeralFormatter = Pr;
|
|
2158
|
+
k.DateFormatter = kr;
|
|
2159
|
+
k.TimeFormatter = Ar;
|
|
2160
|
+
k.PhoneFormatter = Cr;
|
|
2161
|
+
k.CreditCardDetector = _r;
|
|
2162
|
+
k.Util = Ir;
|
|
2163
|
+
k.DefaultProperties = Dr;
|
|
2164
|
+
(typeof Q == "object" && Q ? Q : window).Cleave = k;
|
|
2165
|
+
var ae = k, pt = {}, Mr = function() {
|
|
2149
2166
|
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
2150
2167
|
}, we = {}, M = {};
|
|
2151
2168
|
let jt;
|
|
2152
|
-
const
|
|
2169
|
+
const Tr = [
|
|
2153
2170
|
0,
|
|
2154
2171
|
// Not used
|
|
2155
2172
|
26,
|
|
@@ -2199,7 +2216,7 @@ M.getSymbolSize = function(t) {
|
|
|
2199
2216
|
return t * 4 + 17;
|
|
2200
2217
|
};
|
|
2201
2218
|
M.getSymbolTotalCodewords = function(t) {
|
|
2202
|
-
return
|
|
2219
|
+
return Tr[t];
|
|
2203
2220
|
};
|
|
2204
2221
|
M.getBCHDigit = function(e) {
|
|
2205
2222
|
let t = 0;
|
|
@@ -2273,7 +2290,7 @@ xe.prototype = {
|
|
|
2273
2290
|
this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
|
|
2274
2291
|
}
|
|
2275
2292
|
};
|
|
2276
|
-
var
|
|
2293
|
+
var $r = xe;
|
|
2277
2294
|
function mt(e) {
|
|
2278
2295
|
if (!e || e < 1)
|
|
2279
2296
|
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
@@ -2292,7 +2309,7 @@ mt.prototype.xor = function(e, t, r) {
|
|
|
2292
2309
|
mt.prototype.isReserved = function(e, t) {
|
|
2293
2310
|
return this.reservedBit[e * this.size + t];
|
|
2294
2311
|
};
|
|
2295
|
-
var
|
|
2312
|
+
var Rr = mt, Se = {};
|
|
2296
2313
|
(function(e) {
|
|
2297
2314
|
const t = M.getSymbolSize;
|
|
2298
2315
|
e.getRowColCoords = function(i) {
|
|
@@ -2312,9 +2329,9 @@ var $r = mt, Se = {};
|
|
|
2312
2329
|
};
|
|
2313
2330
|
})(Se);
|
|
2314
2331
|
var Pe = {};
|
|
2315
|
-
const
|
|
2332
|
+
const Lr = M.getSymbolSize, le = 7;
|
|
2316
2333
|
Pe.getPositions = function(t) {
|
|
2317
|
-
const r =
|
|
2334
|
+
const r = Lr(t);
|
|
2318
2335
|
return [
|
|
2319
2336
|
// top-left
|
|
2320
2337
|
[0, 0],
|
|
@@ -2324,7 +2341,7 @@ Pe.getPositions = function(t) {
|
|
|
2324
2341
|
[0, r - le]
|
|
2325
2342
|
];
|
|
2326
2343
|
};
|
|
2327
|
-
var
|
|
2344
|
+
var ke = {};
|
|
2328
2345
|
(function(e) {
|
|
2329
2346
|
e.Patterns = {
|
|
2330
2347
|
PATTERN000: 0,
|
|
@@ -2419,8 +2436,8 @@ var Ae = {};
|
|
|
2419
2436
|
}
|
|
2420
2437
|
return l;
|
|
2421
2438
|
};
|
|
2422
|
-
})(
|
|
2423
|
-
var
|
|
2439
|
+
})(ke);
|
|
2440
|
+
var kt = {};
|
|
2424
2441
|
const O = Pt, ft = [
|
|
2425
2442
|
// L M Q H
|
|
2426
2443
|
1,
|
|
@@ -2746,7 +2763,7 @@ const O = Pt, ft = [
|
|
|
2746
2763
|
2040,
|
|
2747
2764
|
2430
|
|
2748
2765
|
];
|
|
2749
|
-
|
|
2766
|
+
kt.getBlocksCount = function(t, r) {
|
|
2750
2767
|
switch (r) {
|
|
2751
2768
|
case O.L:
|
|
2752
2769
|
return ft[(t - 1) * 4 + 0];
|
|
@@ -2760,7 +2777,7 @@ At.getBlocksCount = function(t, r) {
|
|
|
2760
2777
|
return;
|
|
2761
2778
|
}
|
|
2762
2779
|
};
|
|
2763
|
-
|
|
2780
|
+
kt.getTotalCodewordsCount = function(t, r) {
|
|
2764
2781
|
switch (r) {
|
|
2765
2782
|
case O.L:
|
|
2766
2783
|
return gt[(t - 1) * 4 + 0];
|
|
@@ -2774,7 +2791,7 @@ At.getTotalCodewordsCount = function(t, r) {
|
|
|
2774
2791
|
return;
|
|
2775
2792
|
}
|
|
2776
2793
|
};
|
|
2777
|
-
var
|
|
2794
|
+
var Ae = {}, At = {};
|
|
2778
2795
|
const at = new Uint8Array(512), wt = new Uint8Array(256);
|
|
2779
2796
|
(function() {
|
|
2780
2797
|
let t = 1;
|
|
@@ -2783,18 +2800,18 @@ const at = new Uint8Array(512), wt = new Uint8Array(256);
|
|
|
2783
2800
|
for (let r = 255; r < 512; r++)
|
|
2784
2801
|
at[r] = at[r - 255];
|
|
2785
2802
|
})();
|
|
2786
|
-
|
|
2803
|
+
At.log = function(t) {
|
|
2787
2804
|
if (t < 1) throw new Error("log(" + t + ")");
|
|
2788
2805
|
return wt[t];
|
|
2789
2806
|
};
|
|
2790
|
-
|
|
2807
|
+
At.exp = function(t) {
|
|
2791
2808
|
return at[t];
|
|
2792
2809
|
};
|
|
2793
|
-
|
|
2810
|
+
At.mul = function(t, r) {
|
|
2794
2811
|
return t === 0 || r === 0 ? 0 : at[wt[t] + wt[r]];
|
|
2795
2812
|
};
|
|
2796
2813
|
(function(e) {
|
|
2797
|
-
const t =
|
|
2814
|
+
const t = At;
|
|
2798
2815
|
e.mul = function(i, n) {
|
|
2799
2816
|
const s = new Uint8Array(i.length + n.length - 1);
|
|
2800
2817
|
for (let o = 0; o < i.length; o++)
|
|
@@ -2818,15 +2835,15 @@ kt.mul = function(t, r) {
|
|
|
2818
2835
|
n = e.mul(n, new Uint8Array([1, t.exp(s)]));
|
|
2819
2836
|
return n;
|
|
2820
2837
|
};
|
|
2821
|
-
})(
|
|
2822
|
-
const Ce =
|
|
2823
|
-
function
|
|
2838
|
+
})(Ae);
|
|
2839
|
+
const Ce = Ae;
|
|
2840
|
+
function Kt(e) {
|
|
2824
2841
|
this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree);
|
|
2825
2842
|
}
|
|
2826
|
-
|
|
2843
|
+
Kt.prototype.initialize = function(t) {
|
|
2827
2844
|
this.degree = t, this.genPoly = Ce.generateECPolynomial(this.degree);
|
|
2828
2845
|
};
|
|
2829
|
-
|
|
2846
|
+
Kt.prototype.encode = function(t) {
|
|
2830
2847
|
if (!this.genPoly)
|
|
2831
2848
|
throw new Error("Encoder not initialized");
|
|
2832
2849
|
const r = new Uint8Array(t.length + this.degree);
|
|
@@ -2838,33 +2855,33 @@ Gt.prototype.encode = function(t) {
|
|
|
2838
2855
|
}
|
|
2839
2856
|
return i;
|
|
2840
2857
|
};
|
|
2841
|
-
var
|
|
2842
|
-
|
|
2858
|
+
var Br = Kt, _e = {}, q = {}, Gt = {};
|
|
2859
|
+
Gt.isValid = function(t) {
|
|
2843
2860
|
return !isNaN(t) && t >= 1 && t <= 40;
|
|
2844
2861
|
};
|
|
2845
2862
|
var L = {};
|
|
2846
|
-
const Ee = "[0-9]+",
|
|
2863
|
+
const Ee = "[0-9]+", Ur = "[A-Z $%*+\\-./:]+";
|
|
2847
2864
|
let ut = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
2848
2865
|
ut = ut.replace(/u/g, "\\u");
|
|
2849
|
-
const
|
|
2866
|
+
const Fr = "(?:(?![A-Z0-9 $%*+\\-./:]|" + ut + `)(?:.|[\r
|
|
2850
2867
|
]))+`;
|
|
2851
2868
|
L.KANJI = new RegExp(ut, "g");
|
|
2852
2869
|
L.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
2853
|
-
L.BYTE = new RegExp(
|
|
2870
|
+
L.BYTE = new RegExp(Fr, "g");
|
|
2854
2871
|
L.NUMERIC = new RegExp(Ee, "g");
|
|
2855
|
-
L.ALPHANUMERIC = new RegExp(
|
|
2856
|
-
const
|
|
2872
|
+
L.ALPHANUMERIC = new RegExp(Ur, "g");
|
|
2873
|
+
const Or = new RegExp("^" + ut + "$"), zr = new RegExp("^" + Ee + "$"), qr = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
2857
2874
|
L.testKanji = function(t) {
|
|
2858
|
-
return
|
|
2875
|
+
return Or.test(t);
|
|
2859
2876
|
};
|
|
2860
2877
|
L.testNumeric = function(t) {
|
|
2861
|
-
return
|
|
2878
|
+
return zr.test(t);
|
|
2862
2879
|
};
|
|
2863
2880
|
L.testAlphanumeric = function(t) {
|
|
2864
|
-
return
|
|
2881
|
+
return qr.test(t);
|
|
2865
2882
|
};
|
|
2866
2883
|
(function(e) {
|
|
2867
|
-
const t =
|
|
2884
|
+
const t = Gt, r = L;
|
|
2868
2885
|
e.NUMERIC = {
|
|
2869
2886
|
id: "Numeric",
|
|
2870
2887
|
bit: 1,
|
|
@@ -2923,7 +2940,7 @@ L.testAlphanumeric = function(t) {
|
|
|
2923
2940
|
};
|
|
2924
2941
|
})(q);
|
|
2925
2942
|
(function(e) {
|
|
2926
|
-
const t = M, r =
|
|
2943
|
+
const t = M, r = kt, i = Pt, n = q, s = Gt, o = 7973, l = t.getBCHDigit(o);
|
|
2927
2944
|
function a(p, u, m) {
|
|
2928
2945
|
for (let v = 1; v <= 40; v++)
|
|
2929
2946
|
if (u <= e.getCapacity(v, m, p))
|
|
@@ -2952,17 +2969,17 @@ L.testAlphanumeric = function(t) {
|
|
|
2952
2969
|
typeof v > "u" && (v = n.BYTE);
|
|
2953
2970
|
const C = t.getSymbolTotalCodewords(u), w = r.getTotalCodewordsCount(u, m), x = (C - w) * 8;
|
|
2954
2971
|
if (v === n.MIXED) return x;
|
|
2955
|
-
const
|
|
2972
|
+
const b = x - c(v, u);
|
|
2956
2973
|
switch (v) {
|
|
2957
2974
|
case n.NUMERIC:
|
|
2958
|
-
return Math.floor(
|
|
2975
|
+
return Math.floor(b / 10 * 3);
|
|
2959
2976
|
case n.ALPHANUMERIC:
|
|
2960
|
-
return Math.floor(
|
|
2977
|
+
return Math.floor(b / 11 * 2);
|
|
2961
2978
|
case n.KANJI:
|
|
2962
|
-
return Math.floor(
|
|
2979
|
+
return Math.floor(b / 13);
|
|
2963
2980
|
case n.BYTE:
|
|
2964
2981
|
default:
|
|
2965
|
-
return Math.floor(
|
|
2982
|
+
return Math.floor(b / 8);
|
|
2966
2983
|
}
|
|
2967
2984
|
}, e.getBestVersionForData = function(u, m) {
|
|
2968
2985
|
let v;
|
|
@@ -2986,18 +3003,18 @@ L.testAlphanumeric = function(t) {
|
|
|
2986
3003
|
};
|
|
2987
3004
|
})(_e);
|
|
2988
3005
|
var Ie = {};
|
|
2989
|
-
const Ut = M, Ne = 1335,
|
|
3006
|
+
const Ut = M, Ne = 1335, Hr = 21522, ce = Ut.getBCHDigit(Ne);
|
|
2990
3007
|
Ie.getEncodedBits = function(t, r) {
|
|
2991
3008
|
const i = t.bit << 3 | r;
|
|
2992
3009
|
let n = i << 10;
|
|
2993
3010
|
for (; Ut.getBCHDigit(n) - ce >= 0; )
|
|
2994
3011
|
n ^= Ne << Ut.getBCHDigit(n) - ce;
|
|
2995
|
-
return (i << 10 | n) ^
|
|
3012
|
+
return (i << 10 | n) ^ Hr;
|
|
2996
3013
|
};
|
|
2997
3014
|
var De = {};
|
|
2998
|
-
const
|
|
3015
|
+
const Yr = q;
|
|
2999
3016
|
function Z(e) {
|
|
3000
|
-
this.mode =
|
|
3017
|
+
this.mode = Yr.NUMERIC, this.data = e.toString();
|
|
3001
3018
|
}
|
|
3002
3019
|
Z.getBitsLength = function(t) {
|
|
3003
3020
|
return 10 * Math.floor(t / 3) + (t % 3 ? t % 3 * 3 + 1 : 0);
|
|
@@ -3015,8 +3032,8 @@ Z.prototype.write = function(t) {
|
|
|
3015
3032
|
const s = this.data.length - r;
|
|
3016
3033
|
s > 0 && (i = this.data.substr(r), n = parseInt(i, 10), t.put(n, s * 3 + 1));
|
|
3017
3034
|
};
|
|
3018
|
-
var
|
|
3019
|
-
const
|
|
3035
|
+
var Vr = Z;
|
|
3036
|
+
const jr = q, Mt = [
|
|
3020
3037
|
"0",
|
|
3021
3038
|
"1",
|
|
3022
3039
|
"2",
|
|
@@ -3064,7 +3081,7 @@ const Vr = q, Mt = [
|
|
|
3064
3081
|
":"
|
|
3065
3082
|
];
|
|
3066
3083
|
function X(e) {
|
|
3067
|
-
this.mode =
|
|
3084
|
+
this.mode = jr.ALPHANUMERIC, this.data = e;
|
|
3068
3085
|
}
|
|
3069
3086
|
X.getBitsLength = function(t) {
|
|
3070
3087
|
return 11 * Math.floor(t / 2) + 6 * (t % 2);
|
|
@@ -3083,7 +3100,7 @@ X.prototype.write = function(t) {
|
|
|
3083
3100
|
}
|
|
3084
3101
|
this.data.length % 2 && t.put(Mt.indexOf(this.data[r]), 6);
|
|
3085
3102
|
};
|
|
3086
|
-
var
|
|
3103
|
+
var Kr = X;
|
|
3087
3104
|
const Gr = q;
|
|
3088
3105
|
function tt(e) {
|
|
3089
3106
|
this.mode = Gr.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
|
|
@@ -3101,10 +3118,10 @@ tt.prototype.write = function(e) {
|
|
|
3101
3118
|
for (let t = 0, r = this.data.length; t < r; t++)
|
|
3102
3119
|
e.put(this.data[t], 8);
|
|
3103
3120
|
};
|
|
3104
|
-
var
|
|
3105
|
-
const
|
|
3121
|
+
var Qr = tt;
|
|
3122
|
+
const Wr = q, Jr = M;
|
|
3106
3123
|
function et(e) {
|
|
3107
|
-
this.mode =
|
|
3124
|
+
this.mode = Wr.KANJI, this.data = e;
|
|
3108
3125
|
}
|
|
3109
3126
|
et.getBitsLength = function(t) {
|
|
3110
3127
|
return t * 13;
|
|
@@ -3118,7 +3135,7 @@ et.prototype.getBitsLength = function() {
|
|
|
3118
3135
|
et.prototype.write = function(e) {
|
|
3119
3136
|
let t;
|
|
3120
3137
|
for (t = 0; t < this.data.length; t++) {
|
|
3121
|
-
let r =
|
|
3138
|
+
let r = Jr.toSJIS(this.data[t]);
|
|
3122
3139
|
if (r >= 33088 && r <= 40956)
|
|
3123
3140
|
r -= 33088;
|
|
3124
3141
|
else if (r >= 57408 && r <= 60351)
|
|
@@ -3131,7 +3148,7 @@ Make sure your charset is UTF-8`
|
|
|
3131
3148
|
r = (r >>> 8 & 255) * 192 + (r & 255), e.put(r, 13);
|
|
3132
3149
|
}
|
|
3133
3150
|
};
|
|
3134
|
-
var
|
|
3151
|
+
var Zr = et, Me = { exports: {} };
|
|
3135
3152
|
(function(e) {
|
|
3136
3153
|
var t = {
|
|
3137
3154
|
single_source_shortest_paths: function(r, i, n) {
|
|
@@ -3197,28 +3214,28 @@ var Jr = et, Me = { exports: {} };
|
|
|
3197
3214
|
};
|
|
3198
3215
|
e.exports = t;
|
|
3199
3216
|
})(Me);
|
|
3200
|
-
var
|
|
3217
|
+
var Xr = Me.exports;
|
|
3201
3218
|
(function(e) {
|
|
3202
|
-
const t = q, r =
|
|
3219
|
+
const t = q, r = Vr, i = Kr, n = Qr, s = Zr, o = L, l = M, a = Xr;
|
|
3203
3220
|
function c(w) {
|
|
3204
3221
|
return unescape(encodeURIComponent(w)).length;
|
|
3205
3222
|
}
|
|
3206
|
-
function d(w, x,
|
|
3207
|
-
const
|
|
3208
|
-
let
|
|
3209
|
-
for (; (
|
|
3210
|
-
|
|
3211
|
-
data:
|
|
3212
|
-
index:
|
|
3223
|
+
function d(w, x, b) {
|
|
3224
|
+
const y = [];
|
|
3225
|
+
let A;
|
|
3226
|
+
for (; (A = w.exec(b)) !== null; )
|
|
3227
|
+
y.push({
|
|
3228
|
+
data: A[0],
|
|
3229
|
+
index: A.index,
|
|
3213
3230
|
mode: x,
|
|
3214
|
-
length:
|
|
3231
|
+
length: A[0].length
|
|
3215
3232
|
});
|
|
3216
|
-
return
|
|
3233
|
+
return y;
|
|
3217
3234
|
}
|
|
3218
3235
|
function h(w) {
|
|
3219
|
-
const x = d(o.NUMERIC, t.NUMERIC, w),
|
|
3220
|
-
let
|
|
3221
|
-
return l.isKanjiModeEnabled() ? (
|
|
3236
|
+
const x = d(o.NUMERIC, t.NUMERIC, w), b = d(o.ALPHANUMERIC, t.ALPHANUMERIC, w);
|
|
3237
|
+
let y, A;
|
|
3238
|
+
return l.isKanjiModeEnabled() ? (y = d(o.BYTE, t.BYTE, w), A = d(o.KANJI, t.KANJI, w)) : (y = d(o.BYTE_KANJI, t.BYTE, w), A = []), x.concat(b, y, A).sort(function(E, $) {
|
|
3222
3239
|
return E.index - $.index;
|
|
3223
3240
|
}).map(function(E) {
|
|
3224
3241
|
return {
|
|
@@ -3241,69 +3258,69 @@ var Zr = Me.exports;
|
|
|
3241
3258
|
}
|
|
3242
3259
|
}
|
|
3243
3260
|
function u(w) {
|
|
3244
|
-
return w.reduce(function(x,
|
|
3245
|
-
const
|
|
3246
|
-
return
|
|
3261
|
+
return w.reduce(function(x, b) {
|
|
3262
|
+
const y = x.length - 1 >= 0 ? x[x.length - 1] : null;
|
|
3263
|
+
return y && y.mode === b.mode ? (x[x.length - 1].data += b.data, x) : (x.push(b), x);
|
|
3247
3264
|
}, []);
|
|
3248
3265
|
}
|
|
3249
3266
|
function m(w) {
|
|
3250
3267
|
const x = [];
|
|
3251
|
-
for (let
|
|
3252
|
-
const
|
|
3253
|
-
switch (
|
|
3268
|
+
for (let b = 0; b < w.length; b++) {
|
|
3269
|
+
const y = w[b];
|
|
3270
|
+
switch (y.mode) {
|
|
3254
3271
|
case t.NUMERIC:
|
|
3255
3272
|
x.push([
|
|
3256
|
-
|
|
3257
|
-
{ data:
|
|
3258
|
-
{ data:
|
|
3273
|
+
y,
|
|
3274
|
+
{ data: y.data, mode: t.ALPHANUMERIC, length: y.length },
|
|
3275
|
+
{ data: y.data, mode: t.BYTE, length: y.length }
|
|
3259
3276
|
]);
|
|
3260
3277
|
break;
|
|
3261
3278
|
case t.ALPHANUMERIC:
|
|
3262
3279
|
x.push([
|
|
3263
|
-
|
|
3264
|
-
{ data:
|
|
3280
|
+
y,
|
|
3281
|
+
{ data: y.data, mode: t.BYTE, length: y.length }
|
|
3265
3282
|
]);
|
|
3266
3283
|
break;
|
|
3267
3284
|
case t.KANJI:
|
|
3268
3285
|
x.push([
|
|
3269
|
-
|
|
3270
|
-
{ data:
|
|
3286
|
+
y,
|
|
3287
|
+
{ data: y.data, mode: t.BYTE, length: c(y.data) }
|
|
3271
3288
|
]);
|
|
3272
3289
|
break;
|
|
3273
3290
|
case t.BYTE:
|
|
3274
3291
|
x.push([
|
|
3275
|
-
{ data:
|
|
3292
|
+
{ data: y.data, mode: t.BYTE, length: c(y.data) }
|
|
3276
3293
|
]);
|
|
3277
3294
|
}
|
|
3278
3295
|
}
|
|
3279
3296
|
return x;
|
|
3280
3297
|
}
|
|
3281
3298
|
function v(w, x) {
|
|
3282
|
-
const
|
|
3283
|
-
let
|
|
3299
|
+
const b = {}, y = { start: {} };
|
|
3300
|
+
let A = ["start"];
|
|
3284
3301
|
for (let _ = 0; _ < w.length; _++) {
|
|
3285
3302
|
const E = w[_], $ = [];
|
|
3286
3303
|
for (let U = 0; U < E.length; U++) {
|
|
3287
3304
|
const R = E[U], rt = "" + _ + U;
|
|
3288
|
-
$.push(rt),
|
|
3289
|
-
for (let _t = 0; _t <
|
|
3290
|
-
const B =
|
|
3291
|
-
|
|
3305
|
+
$.push(rt), b[rt] = { node: R, lastCount: 0 }, y[rt] = {};
|
|
3306
|
+
for (let _t = 0; _t < A.length; _t++) {
|
|
3307
|
+
const B = A[_t];
|
|
3308
|
+
b[B] && b[B].node.mode === R.mode ? (y[B][rt] = p(b[B].lastCount + R.length, R.mode) - p(b[B].lastCount, R.mode), b[B].lastCount += R.length) : (b[B] && (b[B].lastCount = R.length), y[B][rt] = p(R.length, R.mode) + 4 + t.getCharCountIndicator(R.mode, x));
|
|
3292
3309
|
}
|
|
3293
3310
|
}
|
|
3294
|
-
|
|
3311
|
+
A = $;
|
|
3295
3312
|
}
|
|
3296
|
-
for (let _ = 0; _ <
|
|
3297
|
-
|
|
3298
|
-
return { map:
|
|
3313
|
+
for (let _ = 0; _ < A.length; _++)
|
|
3314
|
+
y[A[_]].end = 0;
|
|
3315
|
+
return { map: y, table: b };
|
|
3299
3316
|
}
|
|
3300
3317
|
function C(w, x) {
|
|
3301
|
-
let
|
|
3302
|
-
const
|
|
3303
|
-
if (
|
|
3304
|
-
throw new Error('"' + w + '" cannot be encoded with mode ' + t.toString(
|
|
3305
|
-
Suggested mode is: ` + t.toString(
|
|
3306
|
-
switch (
|
|
3318
|
+
let b;
|
|
3319
|
+
const y = t.getBestModeForData(w);
|
|
3320
|
+
if (b = t.from(x, y), b !== t.BYTE && b.bit < y.bit)
|
|
3321
|
+
throw new Error('"' + w + '" cannot be encoded with mode ' + t.toString(b) + `.
|
|
3322
|
+
Suggested mode is: ` + t.toString(y));
|
|
3323
|
+
switch (b === t.KANJI && !l.isKanjiModeEnabled() && (b = t.BYTE), b) {
|
|
3307
3324
|
case t.NUMERIC:
|
|
3308
3325
|
return new r(w);
|
|
3309
3326
|
case t.ALPHANUMERIC:
|
|
@@ -3315,11 +3332,11 @@ var Zr = Me.exports;
|
|
|
3315
3332
|
}
|
|
3316
3333
|
}
|
|
3317
3334
|
e.fromArray = function(x) {
|
|
3318
|
-
return x.reduce(function(
|
|
3319
|
-
return typeof
|
|
3335
|
+
return x.reduce(function(b, y) {
|
|
3336
|
+
return typeof y == "string" ? b.push(C(y, null)) : y.data && b.push(C(y.data, y.mode)), b;
|
|
3320
3337
|
}, []);
|
|
3321
|
-
}, e.fromString = function(x,
|
|
3322
|
-
const
|
|
3338
|
+
}, e.fromString = function(x, b) {
|
|
3339
|
+
const y = h(x, l.isKanjiModeEnabled()), A = m(y), _ = v(A, b), E = a.find_path(_.map, "start", "end"), $ = [];
|
|
3323
3340
|
for (let U = 1; U < E.length - 1; U++)
|
|
3324
3341
|
$.push(_.table[E[U]].node);
|
|
3325
3342
|
return e.fromArray(u($));
|
|
@@ -3329,9 +3346,9 @@ var Zr = Me.exports;
|
|
|
3329
3346
|
);
|
|
3330
3347
|
};
|
|
3331
3348
|
})(De);
|
|
3332
|
-
const Ct = M, Tt = Pt,
|
|
3333
|
-
function
|
|
3334
|
-
const r = e.size, i =
|
|
3349
|
+
const Ct = M, Tt = Pt, ti = $r, ei = Rr, ri = Se, ii = Pe, Ft = ke, Ot = kt, ni = Br, xt = _e, si = Ie, oi = q, $t = De;
|
|
3350
|
+
function ai(e, t) {
|
|
3351
|
+
const r = e.size, i = ii.getPositions(t);
|
|
3335
3352
|
for (let n = 0; n < i.length; n++) {
|
|
3336
3353
|
const s = i[n][0], o = i[n][1];
|
|
3337
3354
|
for (let l = -1; l <= 7; l++)
|
|
@@ -3340,15 +3357,15 @@ function oi(e, t) {
|
|
|
3340
3357
|
o + a <= -1 || r <= o + a || (l >= 0 && l <= 6 && (a === 0 || a === 6) || a >= 0 && a <= 6 && (l === 0 || l === 6) || l >= 2 && l <= 4 && a >= 2 && a <= 4 ? e.set(s + l, o + a, !0, !0) : e.set(s + l, o + a, !1, !0));
|
|
3341
3358
|
}
|
|
3342
3359
|
}
|
|
3343
|
-
function
|
|
3360
|
+
function li(e) {
|
|
3344
3361
|
const t = e.size;
|
|
3345
3362
|
for (let r = 8; r < t - 8; r++) {
|
|
3346
3363
|
const i = r % 2 === 0;
|
|
3347
3364
|
e.set(r, 6, i, !0), e.set(6, r, i, !0);
|
|
3348
3365
|
}
|
|
3349
3366
|
}
|
|
3350
|
-
function
|
|
3351
|
-
const r =
|
|
3367
|
+
function ci(e, t) {
|
|
3368
|
+
const r = ri.getPositions(t);
|
|
3352
3369
|
for (let i = 0; i < r.length; i++) {
|
|
3353
3370
|
const n = r[i][0], s = r[i][1];
|
|
3354
3371
|
for (let o = -2; o <= 2; o++)
|
|
@@ -3356,20 +3373,20 @@ function li(e, t) {
|
|
|
3356
3373
|
o === -2 || o === 2 || l === -2 || l === 2 || o === 0 && l === 0 ? e.set(n + o, s + l, !0, !0) : e.set(n + o, s + l, !1, !0);
|
|
3357
3374
|
}
|
|
3358
3375
|
}
|
|
3359
|
-
function
|
|
3376
|
+
function di(e, t) {
|
|
3360
3377
|
const r = e.size, i = xt.getEncodedBits(t);
|
|
3361
3378
|
let n, s, o;
|
|
3362
3379
|
for (let l = 0; l < 18; l++)
|
|
3363
3380
|
n = Math.floor(l / 3), s = l % 3 + r - 8 - 3, o = (i >> l & 1) === 1, e.set(n, s, o, !0), e.set(s, n, o, !0);
|
|
3364
3381
|
}
|
|
3365
3382
|
function Rt(e, t, r) {
|
|
3366
|
-
const i = e.size, n =
|
|
3383
|
+
const i = e.size, n = si.getEncodedBits(t, r);
|
|
3367
3384
|
let s, o;
|
|
3368
3385
|
for (s = 0; s < 15; s++)
|
|
3369
3386
|
o = (n >> s & 1) === 1, s < 6 ? e.set(s, 8, o, !0) : s < 8 ? e.set(s + 1, 8, o, !0) : e.set(i - 15 + s, 8, o, !0), s < 8 ? e.set(8, i - s - 1, o, !0) : s < 9 ? e.set(8, 15 - s - 1 + 1, o, !0) : e.set(8, 15 - s - 1, o, !0);
|
|
3370
3387
|
e.set(i - 8, 8, 1, !0);
|
|
3371
3388
|
}
|
|
3372
|
-
function
|
|
3389
|
+
function ui(e, t) {
|
|
3373
3390
|
const r = e.size;
|
|
3374
3391
|
let i = -1, n = r - 1, s = 7, o = 0;
|
|
3375
3392
|
for (let l = r - 1; l > 0; l -= 2)
|
|
@@ -3385,10 +3402,10 @@ function di(e, t) {
|
|
|
3385
3402
|
}
|
|
3386
3403
|
}
|
|
3387
3404
|
}
|
|
3388
|
-
function
|
|
3389
|
-
const i = new
|
|
3405
|
+
function hi(e, t, r) {
|
|
3406
|
+
const i = new ti();
|
|
3390
3407
|
r.forEach(function(a) {
|
|
3391
|
-
i.put(a.mode.bit, 4), i.put(a.getLength(),
|
|
3408
|
+
i.put(a.mode.bit, 4), i.put(a.getLength(), oi.getCharCountIndicator(a.mode, e)), a.write(i);
|
|
3392
3409
|
});
|
|
3393
3410
|
const n = Ct.getSymbolTotalCodewords(e), s = Ot.getTotalCodewordsCount(e, t), o = (n - s) * 8;
|
|
3394
3411
|
for (i.getLengthInBits() + 4 <= o && i.put(0, 4); i.getLengthInBits() % 8 !== 0; )
|
|
@@ -3396,10 +3413,10 @@ function ui(e, t, r) {
|
|
|
3396
3413
|
const l = (o - i.getLengthInBits()) / 8;
|
|
3397
3414
|
for (let a = 0; a < l; a++)
|
|
3398
3415
|
i.put(a % 2 ? 17 : 236, 8);
|
|
3399
|
-
return
|
|
3416
|
+
return pi(i, e, t);
|
|
3400
3417
|
}
|
|
3401
|
-
function
|
|
3402
|
-
const i = Ct.getSymbolTotalCodewords(t), n = Ot.getTotalCodewordsCount(t, r), s = i - n, o = Ot.getBlocksCount(t, r), l = i % o, a = o - l, c = Math.floor(i / o), d = Math.floor(s / o), h = d + 1, p = c - d, u = new
|
|
3418
|
+
function pi(e, t, r) {
|
|
3419
|
+
const i = Ct.getSymbolTotalCodewords(t), n = Ot.getTotalCodewordsCount(t, r), s = i - n, o = Ot.getBlocksCount(t, r), l = i % o, a = o - l, c = Math.floor(i / o), d = Math.floor(s / o), h = d + 1, p = c - d, u = new ni(p);
|
|
3403
3420
|
let m = 0;
|
|
3404
3421
|
const v = new Array(o), C = new Array(o);
|
|
3405
3422
|
let w = 0;
|
|
@@ -3408,17 +3425,17 @@ function hi(e, t, r) {
|
|
|
3408
3425
|
const $ = E < a ? d : h;
|
|
3409
3426
|
v[E] = x.slice(m, m + $), C[E] = u.encode(v[E]), m += $, w = Math.max(w, $);
|
|
3410
3427
|
}
|
|
3411
|
-
const
|
|
3412
|
-
let
|
|
3413
|
-
for (
|
|
3428
|
+
const b = new Uint8Array(i);
|
|
3429
|
+
let y = 0, A, _;
|
|
3430
|
+
for (A = 0; A < w; A++)
|
|
3414
3431
|
for (_ = 0; _ < o; _++)
|
|
3415
|
-
|
|
3416
|
-
for (
|
|
3432
|
+
A < v[_].length && (b[y++] = v[_][A]);
|
|
3433
|
+
for (A = 0; A < p; A++)
|
|
3417
3434
|
for (_ = 0; _ < o; _++)
|
|
3418
|
-
y
|
|
3419
|
-
return
|
|
3435
|
+
b[y++] = C[_][A];
|
|
3436
|
+
return b;
|
|
3420
3437
|
}
|
|
3421
|
-
function
|
|
3438
|
+
function mi(e, t, r, i) {
|
|
3422
3439
|
let n;
|
|
3423
3440
|
if (Array.isArray(e))
|
|
3424
3441
|
n = $t.fromArray(e);
|
|
@@ -3443,8 +3460,8 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
3443
3460
|
Minimum version required to store current data is: ` + s + `.
|
|
3444
3461
|
`
|
|
3445
3462
|
);
|
|
3446
|
-
const o =
|
|
3447
|
-
return
|
|
3463
|
+
const o = hi(t, r, n), l = Ct.getSymbolSize(t), a = new ei(l);
|
|
3464
|
+
return ai(a, t), li(a), ci(a, t), Rt(a, r, 0), t >= 7 && di(a, t), ui(a, o), isNaN(i) && (i = Ft.getBestMask(
|
|
3448
3465
|
a,
|
|
3449
3466
|
Rt.bind(null, a, r)
|
|
3450
3467
|
)), Ft.applyMask(i, a), Rt(a, r, i), {
|
|
@@ -3459,7 +3476,7 @@ we.create = function(t, r) {
|
|
|
3459
3476
|
if (typeof t > "u" || t === "")
|
|
3460
3477
|
throw new Error("No input text");
|
|
3461
3478
|
let i = Tt.M, n, s;
|
|
3462
|
-
return typeof r < "u" && (i = Tt.from(r.errorCorrectionLevel, Tt.M), n = xt.from(r.version), s = Ft.from(r.maskPattern), r.toSJISFunc && Ct.setToSJISFunction(r.toSJISFunc)),
|
|
3479
|
+
return typeof r < "u" && (i = Tt.from(r.errorCorrectionLevel, Tt.M), n = xt.from(r.version), s = Ft.from(r.maskPattern), r.toSJISFunc && Ct.setToSJISFunction(r.toSJISFunc)), mi(t, n, i, s);
|
|
3463
3480
|
};
|
|
3464
3481
|
var Te = {}, Qt = {};
|
|
3465
3482
|
(function(e) {
|
|
@@ -3538,7 +3555,7 @@ var Te = {}, Qt = {};
|
|
|
3538
3555
|
};
|
|
3539
3556
|
})(Te);
|
|
3540
3557
|
var $e = {};
|
|
3541
|
-
const
|
|
3558
|
+
const fi = Qt;
|
|
3542
3559
|
function de(e, t) {
|
|
3543
3560
|
const r = e.a / 255, i = t + '="' + e.hex + '"';
|
|
3544
3561
|
return r < 1 ? i + " " + t + '-opacity="' + r.toFixed(2).slice(1) + '"' : i;
|
|
@@ -3547,7 +3564,7 @@ function Lt(e, t, r) {
|
|
|
3547
3564
|
let i = e + t;
|
|
3548
3565
|
return typeof r < "u" && (i += " " + r), i;
|
|
3549
3566
|
}
|
|
3550
|
-
function
|
|
3567
|
+
function gi(e, t, r) {
|
|
3551
3568
|
let i = "", n = 0, s = !1, o = 0;
|
|
3552
3569
|
for (let l = 0; l < e.length; l++) {
|
|
3553
3570
|
const a = Math.floor(l % t), c = Math.floor(l / t);
|
|
@@ -3556,14 +3573,14 @@ function fi(e, t, r) {
|
|
|
3556
3573
|
return i;
|
|
3557
3574
|
}
|
|
3558
3575
|
$e.render = function(t, r, i) {
|
|
3559
|
-
const n =
|
|
3576
|
+
const n = fi.getOptions(r), s = t.modules.size, o = t.modules.data, l = s + n.margin * 2, a = n.color.light.a ? "<path " + de(n.color.light, "fill") + ' d="M0 0h' + l + "v" + l + 'H0z"/>' : "", c = "<path " + de(n.color.dark, "stroke") + ' d="' + gi(o, s, n.margin) + '"/>', d = 'viewBox="0 0 ' + l + " " + l + '"', p = '<svg xmlns="http://www.w3.org/2000/svg" ' + (n.width ? 'width="' + n.width + '" height="' + n.width + '" ' : "") + d + ' shape-rendering="crispEdges">' + a + c + `</svg>
|
|
3560
3577
|
`;
|
|
3561
3578
|
return typeof i == "function" && i(null, p), p;
|
|
3562
3579
|
};
|
|
3563
|
-
const
|
|
3580
|
+
const yi = Mr, zt = we, Re = Te, bi = $e;
|
|
3564
3581
|
function Wt(e, t, r, i, n) {
|
|
3565
3582
|
const s = [].slice.call(arguments, 1), o = s.length, l = typeof s[o - 1] == "function";
|
|
3566
|
-
if (!l && !
|
|
3583
|
+
if (!l && !yi())
|
|
3567
3584
|
throw new Error("Callback required as last argument");
|
|
3568
3585
|
if (l) {
|
|
3569
3586
|
if (o < 2)
|
|
@@ -3592,12 +3609,12 @@ pt.create = zt.create;
|
|
|
3592
3609
|
pt.toCanvas = Wt.bind(null, Re.render);
|
|
3593
3610
|
pt.toDataURL = Wt.bind(null, Re.renderToDataURL);
|
|
3594
3611
|
pt.toString = Wt.bind(null, function(e, t, r) {
|
|
3595
|
-
return
|
|
3612
|
+
return bi.render(e, r);
|
|
3596
3613
|
});
|
|
3597
|
-
var
|
|
3598
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
3614
|
+
var vi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, P = (e, t, r, i) => {
|
|
3615
|
+
for (var n = i > 1 ? void 0 : i ? wi(t, r) : t, s = e.length - 1, o; s >= 0; s--)
|
|
3599
3616
|
(o = e[s]) && (n = (i ? o(t, r, n) : o(n)) || n);
|
|
3600
|
-
return i && n &&
|
|
3617
|
+
return i && n && vi(t, r, n), n;
|
|
3601
3618
|
};
|
|
3602
3619
|
let S = class extends ot {
|
|
3603
3620
|
constructor() {
|
|
@@ -3708,7 +3725,7 @@ let S = class extends ot {
|
|
|
3708
3725
|
* causing permanent skeleton state.
|
|
3709
3726
|
*/
|
|
3710
3727
|
updated(e) {
|
|
3711
|
-
super.updated(e), e.has("appearance") && this.applyAppearance(), !this.isInitialized && this.hasAllRequiredProps() &&
|
|
3728
|
+
super.updated(e), e.has("appearance") && this.applyAppearance(), !this.isInitialized && this.hasAllRequiredProps() && this.initializeSDK();
|
|
3712
3729
|
}
|
|
3713
3730
|
disconnectedCallback() {
|
|
3714
3731
|
var e;
|
|
@@ -3820,6 +3837,10 @@ let S = class extends ot {
|
|
|
3820
3837
|
id: t.id,
|
|
3821
3838
|
enabled: !1,
|
|
3822
3839
|
disabledReason: "GCash is only available for PHP currency"
|
|
3840
|
+
} : t.id === f.KONBINI && this.getTransactionData().currency !== "JPY" ? {
|
|
3841
|
+
id: t.id,
|
|
3842
|
+
enabled: !1,
|
|
3843
|
+
disabledReason: "Konbini is only available for JPY currency"
|
|
3823
3844
|
} : {
|
|
3824
3845
|
id: t.id,
|
|
3825
3846
|
enabled: !0
|
|
@@ -3953,16 +3974,14 @@ let S = class extends ot {
|
|
|
3953
3974
|
), this.sdk.on(
|
|
3954
3975
|
"dana_redirect",
|
|
3955
3976
|
(t) => {
|
|
3956
|
-
console.log("[WebComponent] dana_redirect event received:", t.payload);
|
|
3957
3977
|
const { redirectUrl: r } = t.payload;
|
|
3958
|
-
r && (
|
|
3978
|
+
r && (window.location.href = r);
|
|
3959
3979
|
}
|
|
3960
3980
|
), this.sdk.on(
|
|
3961
3981
|
"tng_redirect",
|
|
3962
3982
|
(t) => {
|
|
3963
|
-
console.log("[WebComponent] tng_redirect event received:", t.payload);
|
|
3964
3983
|
const { redirectUrl: r } = t.payload;
|
|
3965
|
-
r && (
|
|
3984
|
+
r && (window.location.href = r);
|
|
3966
3985
|
}
|
|
3967
3986
|
), this.sdk.on(
|
|
3968
3987
|
"alipaycn_redirect",
|
|
@@ -3982,6 +4001,12 @@ let S = class extends ot {
|
|
|
3982
4001
|
const { redirectUrl: r } = t.payload;
|
|
3983
4002
|
r && (window.location.href = r);
|
|
3984
4003
|
}
|
|
4004
|
+
), this.sdk.on(
|
|
4005
|
+
"konbini_redirect",
|
|
4006
|
+
(t) => {
|
|
4007
|
+
const { redirectUrl: r } = t.payload;
|
|
4008
|
+
r && (window.location.href = r);
|
|
4009
|
+
}
|
|
3985
4010
|
), this.sdk.initialize({
|
|
3986
4011
|
amount: this.amount,
|
|
3987
4012
|
currency: this.currency,
|
|
@@ -4159,6 +4184,14 @@ let S = class extends ot {
|
|
|
4159
4184
|
phoneNumber: this.phoneNumber
|
|
4160
4185
|
}));
|
|
4161
4186
|
}
|
|
4187
|
+
handleKonbiniPayment() {
|
|
4188
|
+
!this.sdk || this.currentState.status !== "ready" || (this.paymentLocked = !0, this.sdk.submitPayment(f.KONBINI, {
|
|
4189
|
+
firstName: this.firstName,
|
|
4190
|
+
lastName: this.lastName,
|
|
4191
|
+
email: this.email,
|
|
4192
|
+
phoneNumber: this.phoneNumber
|
|
4193
|
+
}));
|
|
4194
|
+
}
|
|
4162
4195
|
// --- Render Methods ---
|
|
4163
4196
|
/**
|
|
4164
4197
|
* Get the formatted pay amount for buttons (net amount including fees)
|
|
@@ -4196,7 +4229,7 @@ let S = class extends ot {
|
|
|
4196
4229
|
};
|
|
4197
4230
|
}
|
|
4198
4231
|
renderTransactionDetailsSkeleton() {
|
|
4199
|
-
return
|
|
4232
|
+
return g`
|
|
4200
4233
|
<div class="skeleton-transaction">
|
|
4201
4234
|
<div class="skeleton skeleton-title"></div>
|
|
4202
4235
|
<div class="skeleton-row">
|
|
@@ -4220,7 +4253,7 @@ let S = class extends ot {
|
|
|
4220
4253
|
`;
|
|
4221
4254
|
}
|
|
4222
4255
|
renderPaymentMethodsSkeleton() {
|
|
4223
|
-
return
|
|
4256
|
+
return g`
|
|
4224
4257
|
<div>
|
|
4225
4258
|
<div class="skeleton-method">
|
|
4226
4259
|
<div class="skeleton skeleton-radio"></div>
|
|
@@ -4240,7 +4273,7 @@ let S = class extends ot {
|
|
|
4240
4273
|
this.width ? `--one-payment-width: ${this.width}` : "",
|
|
4241
4274
|
this.maxWidth ? `--one-payment-max-width: ${this.maxWidth}` : ""
|
|
4242
4275
|
].filter(Boolean).join("; ");
|
|
4243
|
-
return
|
|
4276
|
+
return g`
|
|
4244
4277
|
<div class="payment-element" style="${e}">
|
|
4245
4278
|
${this.renderTransactionDetailsSkeleton()}
|
|
4246
4279
|
<div class="header">Select a payment method</div>
|
|
@@ -4250,7 +4283,7 @@ let S = class extends ot {
|
|
|
4250
4283
|
}
|
|
4251
4284
|
renderTransactionDetails() {
|
|
4252
4285
|
const e = this.getTransactionData(), t = (r) => r.toFixed(2);
|
|
4253
|
-
return
|
|
4286
|
+
return g`
|
|
4254
4287
|
<div class="transaction-details">
|
|
4255
4288
|
<h2 class="transaction-title">Transaction details</h2>
|
|
4256
4289
|
|
|
@@ -4285,7 +4318,7 @@ let S = class extends ot {
|
|
|
4285
4318
|
margin-top: ${this.feesExpanded ? "0.625rem" : "0"};
|
|
4286
4319
|
`}
|
|
4287
4320
|
>
|
|
4288
|
-
${e.feeBreakdown ?
|
|
4321
|
+
${e.feeBreakdown ? g`
|
|
4289
4322
|
<div class="fee-breakdown-inner">
|
|
4290
4323
|
<div class="breakdown-row">
|
|
4291
4324
|
<span class="breakdown-label">Transaction fee:</span>
|
|
@@ -4316,7 +4349,7 @@ let S = class extends ot {
|
|
|
4316
4349
|
renderCardForm() {
|
|
4317
4350
|
setTimeout(() => this.setupCleave(), 0);
|
|
4318
4351
|
const e = this.cardBrand === "amex" ? 4 : 3, t = this.cardBrand === "amex" ? "1234" : "123";
|
|
4319
|
-
return
|
|
4352
|
+
return g`
|
|
4320
4353
|
<div class="card-form">
|
|
4321
4354
|
<h4 class="form-title">Card Information</h4>
|
|
4322
4355
|
<div class="form-fields">
|
|
@@ -4331,7 +4364,7 @@ let S = class extends ot {
|
|
|
4331
4364
|
.value=${this.cardFormData.cardNumber}
|
|
4332
4365
|
@input=${(r) => this.handleInputChange("cardNumber", r.target.value)}
|
|
4333
4366
|
/>
|
|
4334
|
-
${this.formErrors.cardNumber ?
|
|
4367
|
+
${this.formErrors.cardNumber ? g`<div class="error-message">${this.formErrors.cardNumber}</div>` : ""}
|
|
4335
4368
|
</div>
|
|
4336
4369
|
|
|
4337
4370
|
<!-- Single Expiry Field -->
|
|
@@ -4350,7 +4383,7 @@ let S = class extends ot {
|
|
|
4350
4383
|
}, 0);
|
|
4351
4384
|
}}
|
|
4352
4385
|
/>
|
|
4353
|
-
${this.formErrors.expiry ?
|
|
4386
|
+
${this.formErrors.expiry ? g`<div class="error-message">${this.formErrors.expiry}</div>` : ""}
|
|
4354
4387
|
</div>
|
|
4355
4388
|
|
|
4356
4389
|
<!-- CVV -->
|
|
@@ -4367,7 +4400,7 @@ let S = class extends ot {
|
|
|
4367
4400
|
r.target.value = i, this.handleInputChange("cvv", i);
|
|
4368
4401
|
}}
|
|
4369
4402
|
/>
|
|
4370
|
-
${this.formErrors.cvv ?
|
|
4403
|
+
${this.formErrors.cvv ? g`<div class="error-message">${this.formErrors.cvv}</div>` : ""}
|
|
4371
4404
|
</div>
|
|
4372
4405
|
|
|
4373
4406
|
<!-- Cardholder Name -->
|
|
@@ -4383,7 +4416,7 @@ let S = class extends ot {
|
|
|
4383
4416
|
r.target.value = i, this.handleInputChange("cardholderName", i);
|
|
4384
4417
|
}}
|
|
4385
4418
|
/>
|
|
4386
|
-
${this.formErrors.cardholderName ?
|
|
4419
|
+
${this.formErrors.cardholderName ? g`<div class="error-message">${this.formErrors.cardholderName}</div>` : ""}
|
|
4387
4420
|
</div>
|
|
4388
4421
|
</div>
|
|
4389
4422
|
|
|
@@ -4400,7 +4433,7 @@ let S = class extends ot {
|
|
|
4400
4433
|
`;
|
|
4401
4434
|
}
|
|
4402
4435
|
renderPayNowContent() {
|
|
4403
|
-
return this.showQRModal && this.qrCodeDataUrl ?
|
|
4436
|
+
return this.showQRModal && this.qrCodeDataUrl ? g`
|
|
4404
4437
|
<div class="paynow-container">
|
|
4405
4438
|
<!-- Render generated QR code image -->
|
|
4406
4439
|
<div class="qr-code-wrapper">
|
|
@@ -4417,7 +4450,7 @@ let S = class extends ot {
|
|
|
4417
4450
|
${this.qrPollingInProgress ? "Verifying..." : "I Have Scanned the QR Code"}
|
|
4418
4451
|
</button>
|
|
4419
4452
|
</div>
|
|
4420
|
-
` :
|
|
4453
|
+
` : g`
|
|
4421
4454
|
<div class="paynow-container">
|
|
4422
4455
|
<div class="paynow-instructions">
|
|
4423
4456
|
<h3 class="instructions-title">How to Pay by QR:</h3>
|
|
@@ -4448,7 +4481,7 @@ let S = class extends ot {
|
|
|
4448
4481
|
`;
|
|
4449
4482
|
}
|
|
4450
4483
|
renderPromptPayContent() {
|
|
4451
|
-
return
|
|
4484
|
+
return g`
|
|
4452
4485
|
<div class="paynow-container">
|
|
4453
4486
|
<div class="paynow-instructions">
|
|
4454
4487
|
<h3 class="instructions-title">How to Pay with PromptPay:</h3>
|
|
@@ -4484,7 +4517,7 @@ let S = class extends ot {
|
|
|
4484
4517
|
`;
|
|
4485
4518
|
}
|
|
4486
4519
|
renderDuitNowContent() {
|
|
4487
|
-
return
|
|
4520
|
+
return g`
|
|
4488
4521
|
<div class="paynow-container">
|
|
4489
4522
|
<div class="paynow-instructions">
|
|
4490
4523
|
<h3 class="instructions-title">How to Pay with DuitNow:</h3>
|
|
@@ -4520,7 +4553,7 @@ let S = class extends ot {
|
|
|
4520
4553
|
`;
|
|
4521
4554
|
}
|
|
4522
4555
|
renderGoPayContent() {
|
|
4523
|
-
return
|
|
4556
|
+
return g`
|
|
4524
4557
|
<div class="paynow-container">
|
|
4525
4558
|
<div class="paynow-instructions">
|
|
4526
4559
|
<h3 class="instructions-title">How to Pay with GoPay:</h3>
|
|
@@ -4556,7 +4589,7 @@ let S = class extends ot {
|
|
|
4556
4589
|
`;
|
|
4557
4590
|
}
|
|
4558
4591
|
renderBoostContent() {
|
|
4559
|
-
return
|
|
4592
|
+
return g`
|
|
4560
4593
|
<div class="paynow-container">
|
|
4561
4594
|
<div class="paynow-instructions">
|
|
4562
4595
|
<h3 class="instructions-title">How to Pay with Boost:</h3>
|
|
@@ -4592,7 +4625,7 @@ let S = class extends ot {
|
|
|
4592
4625
|
`;
|
|
4593
4626
|
}
|
|
4594
4627
|
renderShopeePayContent() {
|
|
4595
|
-
return
|
|
4628
|
+
return g`
|
|
4596
4629
|
<div class="paynow-container">
|
|
4597
4630
|
<div class="paynow-instructions">
|
|
4598
4631
|
<h3 class="instructions-title">How to Pay with ShopeePay:</h3>
|
|
@@ -4628,7 +4661,7 @@ let S = class extends ot {
|
|
|
4628
4661
|
`;
|
|
4629
4662
|
}
|
|
4630
4663
|
renderAtomContent() {
|
|
4631
|
-
return
|
|
4664
|
+
return g`
|
|
4632
4665
|
<div class="paynow-container">
|
|
4633
4666
|
<div class="paynow-instructions">
|
|
4634
4667
|
<h3 class="instructions-title">How to Pay with Atome:</h3>
|
|
@@ -4664,7 +4697,7 @@ let S = class extends ot {
|
|
|
4664
4697
|
`;
|
|
4665
4698
|
}
|
|
4666
4699
|
renderDanaContent() {
|
|
4667
|
-
return
|
|
4700
|
+
return g`
|
|
4668
4701
|
<div class="paynow-container">
|
|
4669
4702
|
<div class="paynow-instructions">
|
|
4670
4703
|
<h3 class="instructions-title">How to Pay with Dana:</h3>
|
|
@@ -4700,7 +4733,7 @@ let S = class extends ot {
|
|
|
4700
4733
|
`;
|
|
4701
4734
|
}
|
|
4702
4735
|
renderTngContent() {
|
|
4703
|
-
return
|
|
4736
|
+
return g`
|
|
4704
4737
|
<div class="paynow-container">
|
|
4705
4738
|
<div class="paynow-instructions">
|
|
4706
4739
|
<h3 class="instructions-title">How to Pay with Touch 'n Go:</h3>
|
|
@@ -4736,7 +4769,7 @@ let S = class extends ot {
|
|
|
4736
4769
|
`;
|
|
4737
4770
|
}
|
|
4738
4771
|
renderAlipayCNContent() {
|
|
4739
|
-
return
|
|
4772
|
+
return g`
|
|
4740
4773
|
<div class="paynow-container">
|
|
4741
4774
|
<div class="paynow-instructions">
|
|
4742
4775
|
<h3 class="instructions-title">How to Pay with Alipay:</h3>
|
|
@@ -4772,7 +4805,7 @@ let S = class extends ot {
|
|
|
4772
4805
|
`;
|
|
4773
4806
|
}
|
|
4774
4807
|
renderAlipayHKContent() {
|
|
4775
|
-
return
|
|
4808
|
+
return g`
|
|
4776
4809
|
<div class="paynow-container">
|
|
4777
4810
|
<div class="paynow-instructions">
|
|
4778
4811
|
<h3 class="instructions-title">How to Pay with AlipayHK:</h3>
|
|
@@ -4808,7 +4841,7 @@ let S = class extends ot {
|
|
|
4808
4841
|
`;
|
|
4809
4842
|
}
|
|
4810
4843
|
renderGCashContent() {
|
|
4811
|
-
return
|
|
4844
|
+
return g`
|
|
4812
4845
|
<div class="paynow-container">
|
|
4813
4846
|
<div class="paynow-instructions">
|
|
4814
4847
|
<h3 class="instructions-title">How to Pay with GCash:</h3>
|
|
@@ -4843,8 +4876,44 @@ let S = class extends ot {
|
|
|
4843
4876
|
</div>
|
|
4844
4877
|
`;
|
|
4845
4878
|
}
|
|
4879
|
+
renderKonbiniContent() {
|
|
4880
|
+
return g`
|
|
4881
|
+
<div class="paynow-container">
|
|
4882
|
+
<div class="paynow-instructions">
|
|
4883
|
+
<h3 class="instructions-title">How to Pay with Konbini:</h3>
|
|
4884
|
+
|
|
4885
|
+
<div class="instruction-steps">
|
|
4886
|
+
<div class="instruction-step">
|
|
4887
|
+
<div class="step-number">1</div>
|
|
4888
|
+
<p class="step-text">Click <strong>"Pay"</strong> to get your payment code.</p>
|
|
4889
|
+
</div>
|
|
4890
|
+
|
|
4891
|
+
<div class="instruction-step">
|
|
4892
|
+
<div class="step-number">2</div>
|
|
4893
|
+
<p class="step-text">Visit any convenience store and show the code.</p>
|
|
4894
|
+
</div>
|
|
4895
|
+
|
|
4896
|
+
<div class="instruction-step">
|
|
4897
|
+
<div class="step-number">3</div>
|
|
4898
|
+
<p class="step-text">Complete the payment at the register.</p>
|
|
4899
|
+
</div>
|
|
4900
|
+
</div>
|
|
4901
|
+
|
|
4902
|
+
<div class="submit-section">
|
|
4903
|
+
<button
|
|
4904
|
+
class="pay-button ${this.currentState.status === "processing" || this.currentState.status === "requires_action" ? "loading" : ""}"
|
|
4905
|
+
@click=${this.handleKonbiniPayment}
|
|
4906
|
+
?disabled=${this.currentState.status === "processing" || this.currentState.status === "requires_action"}
|
|
4907
|
+
>
|
|
4908
|
+
${this.currentState.status === "processing" || this.currentState.status === "requires_action" ? "Redirecting..." : `Pay ${this.getPayButtonAmount()}`}
|
|
4909
|
+
</button>
|
|
4910
|
+
</div>
|
|
4911
|
+
</div>
|
|
4912
|
+
</div>
|
|
4913
|
+
`;
|
|
4914
|
+
}
|
|
4846
4915
|
render3DSModal() {
|
|
4847
|
-
return !this.show3DSModal || !this.nextActionUrl ? null :
|
|
4916
|
+
return !this.show3DSModal || !this.nextActionUrl ? null : g`
|
|
4848
4917
|
<div class="modal-overlay">
|
|
4849
4918
|
<div class="modal-content iframe-modal">
|
|
4850
4919
|
<iframe
|
|
@@ -4860,7 +4929,7 @@ let S = class extends ot {
|
|
|
4860
4929
|
renderStatusBlock() {
|
|
4861
4930
|
if (this.currentState.status === "succeeded") {
|
|
4862
4931
|
const e = this.getTransactionData(), t = e.netAmount.toFixed(2);
|
|
4863
|
-
return
|
|
4932
|
+
return g`
|
|
4864
4933
|
<div class="result-card success">
|
|
4865
4934
|
<div class="result-icon-wrapper">
|
|
4866
4935
|
<div class="result-icon">✓</div>
|
|
@@ -4875,7 +4944,7 @@ let S = class extends ot {
|
|
|
4875
4944
|
}
|
|
4876
4945
|
if (this.currentState.status === "failed") {
|
|
4877
4946
|
const e = this.currentState.error ? this.currentState.error.message : "An error occurred while processing your payment";
|
|
4878
|
-
return
|
|
4947
|
+
return g`
|
|
4879
4948
|
<div class="result-card error">
|
|
4880
4949
|
<div class="result-icon-wrapper">
|
|
4881
4950
|
<div class="result-icon">✕</div>
|
|
@@ -4929,10 +4998,12 @@ let S = class extends ot {
|
|
|
4929
4998
|
return "AlipayHK";
|
|
4930
4999
|
case f.GCASH:
|
|
4931
5000
|
return "GCash";
|
|
5001
|
+
case f.KONBINI:
|
|
5002
|
+
return "Konbini";
|
|
4932
5003
|
default:
|
|
4933
5004
|
return o;
|
|
4934
5005
|
}
|
|
4935
|
-
}, n = (o) => o === f.CARD ?
|
|
5006
|
+
}, n = (o) => o === f.CARD ? g`
|
|
4936
5007
|
<div class="method-icon-right">
|
|
4937
5008
|
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
4938
5009
|
<path
|
|
@@ -4945,70 +5016,74 @@ let S = class extends ot {
|
|
|
4945
5016
|
/>
|
|
4946
5017
|
</svg>
|
|
4947
5018
|
</div>
|
|
4948
|
-
` : o === f.PAYNOW ?
|
|
5019
|
+
` : o === f.PAYNOW ? g`
|
|
4949
5020
|
<div class="method-icon-right">
|
|
4950
5021
|
<img src="${dr}" alt="PayNow" style="width: 45px; height: auto;" />
|
|
4951
5022
|
</div>
|
|
4952
|
-
` : o === f.PROMPTPAY ?
|
|
5023
|
+
` : o === f.PROMPTPAY ? g`
|
|
4953
5024
|
<div class="method-icon-right">
|
|
4954
5025
|
<img src="${ur}" alt="PromptPay" style="width: 45px; height: auto;" />
|
|
4955
5026
|
</div>
|
|
4956
|
-
` : o === f.DUITNOW ?
|
|
5027
|
+
` : o === f.DUITNOW ? g`
|
|
4957
5028
|
<div class="method-icon-right">
|
|
4958
5029
|
<img src="${hr}" alt="DuitNow" style="width: 45px; height: auto;" />
|
|
4959
5030
|
</div>
|
|
4960
|
-
` : o === f.GOPAY ?
|
|
5031
|
+
` : o === f.GOPAY ? g`
|
|
4961
5032
|
<div class="method-icon-right">
|
|
4962
5033
|
<img src="${pr}" alt="GoPay" style="width: 45px; height: auto;" />
|
|
4963
5034
|
</div>
|
|
4964
|
-
` : o === f.BOOST ?
|
|
5035
|
+
` : o === f.BOOST ? g`
|
|
4965
5036
|
<div class="method-icon-right">
|
|
4966
5037
|
<img src="${mr}" alt="Boost" style="width: 45px; height: auto;" />
|
|
4967
5038
|
</div>
|
|
4968
|
-
` : o === f.SHOPEEPAY ?
|
|
5039
|
+
` : o === f.SHOPEEPAY ? g`
|
|
4969
5040
|
<div class="method-icon-right">
|
|
4970
5041
|
<img src="${fr}" alt="ShopeePay" style="width: 45px; height: auto;" />
|
|
4971
5042
|
</div>
|
|
4972
|
-
` : o === f.ATOM ?
|
|
5043
|
+
` : o === f.ATOM ? g`
|
|
4973
5044
|
<div class="method-icon-right">
|
|
4974
5045
|
<img src="${gr}" alt="Atome" style="width: 45px; height: auto;" />
|
|
4975
5046
|
</div>
|
|
4976
|
-
` : o === f.DANA ?
|
|
5047
|
+
` : o === f.DANA ? g`
|
|
4977
5048
|
<div class="method-icon-right">
|
|
4978
5049
|
<img src="${yr}" alt="Dana" style="width: 45px; height: auto;" />
|
|
4979
5050
|
</div>
|
|
4980
|
-
` : o === f.TNG ?
|
|
5051
|
+
` : o === f.TNG ? g`
|
|
4981
5052
|
<div class="method-icon-right">
|
|
4982
5053
|
<img src="${br}" alt="Touch 'n Go" style="width: 45px; height: auto;" />
|
|
4983
5054
|
</div>
|
|
4984
|
-
` : o === f.ALIPAYCN ?
|
|
5055
|
+
` : o === f.ALIPAYCN ? g`
|
|
4985
5056
|
<div class="method-icon-right">
|
|
4986
5057
|
<img src="${vr}" alt="Alipay" style="width: 45px; height: auto;" />
|
|
4987
5058
|
</div>
|
|
4988
|
-
` : o === f.ALIPAYHK ?
|
|
5059
|
+
` : o === f.ALIPAYHK ? g`
|
|
4989
5060
|
<div class="method-icon-right">
|
|
4990
5061
|
<img src="${wr}" alt="AlipayHK" style="width: 45px; height: auto;" />
|
|
4991
5062
|
</div>
|
|
4992
|
-
` : o === f.GCASH ?
|
|
5063
|
+
` : o === f.GCASH ? g`
|
|
4993
5064
|
<div class="method-icon-right">
|
|
4994
5065
|
<img src="${xr}" alt="GCash" style="width: 45px; height: auto;" />
|
|
4995
5066
|
</div>
|
|
5067
|
+
` : o === f.KONBINI ? g`
|
|
5068
|
+
<div class="method-icon-right">
|
|
5069
|
+
<img src="${Sr}" alt="Konbini" style="width: 45px; height: auto;" />
|
|
5070
|
+
</div>
|
|
4996
5071
|
` : null, s = [
|
|
4997
5072
|
this.width ? `--one-payment-width: ${this.width}` : "",
|
|
4998
5073
|
this.maxWidth ? `--one-payment-max-width: ${this.maxWidth}` : ""
|
|
4999
5074
|
].filter(Boolean).join("; ");
|
|
5000
|
-
return
|
|
5075
|
+
return g`
|
|
5001
5076
|
<div class="payment-element" style="${s}">
|
|
5002
5077
|
${this.renderTransactionDetails()}
|
|
5003
|
-
${t ?
|
|
5078
|
+
${t ? g`
|
|
5004
5079
|
<div class="header">Select a payment method</div>
|
|
5005
5080
|
<div class="payment-methods-list">
|
|
5006
5081
|
${r.map((o) => {
|
|
5007
5082
|
const l = this.selectedMethod === o.id, a = !o.enabled || this.paymentLocked && !l;
|
|
5008
|
-
return
|
|
5083
|
+
return g`
|
|
5009
5084
|
<div
|
|
5010
5085
|
class="payment-method-item"
|
|
5011
|
-
${o.disabledReason ?
|
|
5086
|
+
${o.disabledReason ? g`data-tooltip="${o.disabledReason}"` : ""}
|
|
5012
5087
|
>
|
|
5013
5088
|
<div
|
|
5014
5089
|
class="method-header ${l ? "selected" : ""} ${a ? "disabled" : ""}"
|
|
@@ -5027,8 +5102,8 @@ let S = class extends ot {
|
|
|
5027
5102
|
<span class="method-name">${i(o.id)}</span>
|
|
5028
5103
|
${n(o.id)}
|
|
5029
5104
|
</div>
|
|
5030
|
-
${l ?
|
|
5031
|
-
${o.id === f.CARD ? this.renderCardForm() : o.id === f.PAYNOW ? this.renderPayNowContent() : o.id === f.PROMPTPAY ? this.renderPromptPayContent() : o.id === f.DUITNOW ? this.renderDuitNowContent() : o.id === f.GOPAY ? this.renderGoPayContent() : o.id === f.BOOST ? this.renderBoostContent() : o.id === f.SHOPEEPAY ? this.renderShopeePayContent() : o.id === f.ATOM ? this.renderAtomContent() : o.id === f.DANA ? this.renderDanaContent() : o.id === f.TNG ? this.renderTngContent() : o.id === f.ALIPAYCN ? this.renderAlipayCNContent() : o.id === f.ALIPAYHK ? this.renderAlipayHKContent() : o.id === f.GCASH ? this.renderGCashContent() : null}
|
|
5105
|
+
${l ? g`<div class="method-content">
|
|
5106
|
+
${o.id === f.CARD ? this.renderCardForm() : o.id === f.PAYNOW ? this.renderPayNowContent() : o.id === f.PROMPTPAY ? this.renderPromptPayContent() : o.id === f.DUITNOW ? this.renderDuitNowContent() : o.id === f.GOPAY ? this.renderGoPayContent() : o.id === f.BOOST ? this.renderBoostContent() : o.id === f.SHOPEEPAY ? this.renderShopeePayContent() : o.id === f.ATOM ? this.renderAtomContent() : o.id === f.DANA ? this.renderDanaContent() : o.id === f.TNG ? this.renderTngContent() : o.id === f.ALIPAYCN ? this.renderAlipayCNContent() : o.id === f.ALIPAYHK ? this.renderAlipayHKContent() : o.id === f.GCASH ? this.renderGCashContent() : o.id === f.KONBINI ? this.renderKonbiniContent() : null}
|
|
5032
5107
|
</div>` : ""}
|
|
5033
5108
|
</div>
|
|
5034
5109
|
`;
|
|
@@ -6455,19 +6530,19 @@ P([
|
|
|
6455
6530
|
S = P([
|
|
6456
6531
|
rr("one-payment")
|
|
6457
6532
|
], S);
|
|
6458
|
-
const
|
|
6533
|
+
const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6459
6534
|
__proto__: null,
|
|
6460
6535
|
get OnePayment() {
|
|
6461
6536
|
return S;
|
|
6462
6537
|
}
|
|
6463
6538
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6464
|
-
function
|
|
6465
|
-
customElements.get("one-payment") || Promise.resolve().then(() =>
|
|
6539
|
+
function ki() {
|
|
6540
|
+
customElements.get("one-payment") || Promise.resolve().then(() => xi).then(({ OnePayment: e }) => {
|
|
6466
6541
|
customElements.define("one-payment", e);
|
|
6467
6542
|
});
|
|
6468
6543
|
}
|
|
6469
6544
|
export {
|
|
6470
6545
|
S as OnePayment,
|
|
6471
6546
|
S as OnePaymentElement,
|
|
6472
|
-
|
|
6547
|
+
ki as defineCustomElements
|
|
6473
6548
|
};
|