@cling-se/widget 0.17.2 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/AddClientCallout-Bod9Eqx4.js +101 -0
- package/dist/AnswerModal-a2cyKFbt.js +3371 -0
- package/dist/AttachmentItem-DBUqckCS.js +171 -0
- package/dist/BaseUpload-DrWzuvbS.js +6503 -0
- package/dist/BlockMedia-DuE_K9hR.js +103 -0
- package/dist/CCallout-CM1VsH30.js +104 -0
- package/dist/{CCurrencyDropdown-CKRgncWy.js → CCurrencyDropdown-C_lAaq4P.js} +91 -53
- package/dist/CDropdownItem-DMUAJ90n.js +749 -0
- package/dist/CFormField.vue_vue_type_script_setup_true_lang-BqAyWe3T.js +292 -0
- package/dist/{CPhoneFormat-Bd-HZuYo.js → CPhoneFormat-Dnn_cKk7.js} +13 -21
- package/dist/CPhoneInput-DuGkDiv-.js +207 -0
- package/dist/CPriceInput-B7DYzKcF.js +142 -0
- package/dist/CSelect-BZZDr27O.js +98 -0
- package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-D2jDhnYI.js +51 -0
- package/dist/ClientAutocomplete-DuaJ5zDf.js +532 -0
- package/dist/ClientModal-CaMSjLkD.js +1188 -0
- package/dist/ColorPicker-BISZPQ6j.js +1408 -0
- package/dist/CompanyModal-ClTcmU4Y.js +250 -0
- package/dist/ContentWrapper-Bj7jbWU0.js +265 -0
- package/dist/CoverBlockSettings-AXyiLxrF.js +861 -0
- package/dist/DocAnswer-Bu09V33D.js +33 -0
- package/dist/DocDetails-B6-2LKsO.js +452 -0
- package/dist/DocForm-CFN8LWSd.js +6772 -0
- package/dist/DocFormSend-D1CUhy4n.js +171 -0
- package/dist/DocLinks-CuliFqtN.js +36 -0
- package/dist/DocModalBase-BxKsnwN-.js +29 -0
- package/dist/DocPrint-B_HJ_RET.js +399 -0
- package/dist/DocReceipt-D-A1TaTI.js +341 -0
- package/dist/DocSendReminder-BKTJonzh.js +181 -0
- package/dist/{DocTextEditor-DFid7uKr.js → DocTextEditor-CEPcJT2o.js} +7907 -5579
- package/dist/DocTimeline-CF9S4YDZ.js +537 -0
- package/dist/DocumentClient-7mbq2QA4.js +90 -0
- package/dist/DocumentLayout-DkFlHgW6.js +1434 -0
- package/dist/DocumentLogotype-BTYMdpNi.js +162 -0
- package/dist/DocumentVoided-CWr5WMUv.js +33 -0
- package/dist/EmbedInput-SevVEpwc.js +156 -0
- package/dist/EmbedSettings-YMbUmp1O.js +103 -0
- package/dist/ErrorCallout-CQo2iF9c.js +34 -0
- package/dist/FilePreviewModal-C0xBeoAz.js +202 -0
- package/dist/Flag-BObij6SN.js +41 -0
- package/dist/HeaderSettings-C77pR78n.js +720 -0
- package/dist/ImageSelectModal-DKdU-0uq.js +119 -0
- package/dist/ImageUploadWrapper-BGkS5Cll.js +1585 -0
- package/dist/Index-B3y-jq9s.js +1098 -0
- package/dist/Index-B41pUREi.js +47 -0
- package/dist/Index-BEyeS1OG.js +52 -0
- package/dist/Index-BG5j8ZFP.js +93 -0
- package/dist/Index-BOT65yQR.js +68 -0
- package/dist/Index-BQNl-cXP.js +28 -0
- package/dist/Index-BY6xsS7C.js +38 -0
- package/dist/Index-Bh0Xv5ry.js +163 -0
- package/dist/Index-Bn4FSQcx.js +228 -0
- package/dist/Index-BrRIAede.js +87 -0
- package/dist/Index-C-6um0kX.js +76 -0
- package/dist/{Index-EO0rsTmx.js → Index-C-gHa5xk.js} +319 -214
- package/dist/Index-C0wcjKCH.js +629 -0
- package/dist/Index-C6BbUFYw.js +160 -0
- package/dist/Index-C8xwJ0m1.js +200 -0
- package/dist/Index-CKgFEJF4.js +140 -0
- package/dist/{Index-CbYLDVU5.js → Index-CQwmu4f1.js} +47 -60
- package/dist/Index-CXchTpBa.js +74 -0
- package/dist/{Index-BzcZCdHj.js → Index-CYoRt8PA.js} +9 -17
- package/dist/Index-CZZNQ4q5.js +39 -0
- package/dist/Index-CkaAs5ms.js +136 -0
- package/dist/Index-CtpXaBz8.js +363 -0
- package/dist/Index-CxDsSGtZ.js +126 -0
- package/dist/Index-DFkTBm02.js +102 -0
- package/dist/Index-DP3ll8F-.js +70 -0
- package/dist/{Index-BdJbs8bM.js → Index-DPDzMKQa.js} +10 -18
- package/dist/Index-DvxSig3z.js +25 -0
- package/dist/Index-Dzrn3Y6p.js +16 -0
- package/dist/{Index-BWnh94_i.js → Index-LQb0omFE.js} +10 -18
- package/dist/Index-Mt4mSaNT.js +4 -0
- package/dist/Index-_xN_cczo.js +3477 -0
- package/dist/Index-gAz45qgR.js +21 -0
- package/dist/Index-xXLFalgR.js +49 -0
- package/dist/Index-zyZRPz3H.js +28 -0
- package/dist/Index.vue_vue_type_script_lang-Ddo1wo-D.js +671 -0
- package/dist/InputToggleRow-CokEYwm2.js +99 -0
- package/dist/ManualPopover-Dukly7GP.js +65 -0
- package/dist/MediaWrapper-B8msCrQm.js +18 -0
- package/dist/{NotBindingText-D8Blua5a.js → NotBindingText-DcQd8Eej.js} +13 -17
- package/dist/PackageGroup-clUIUoik.js +1060 -0
- package/dist/PdfTerms-DpzMVRfN.js +34 -0
- package/dist/PdfViewer-CSf4Rtbj.js +392 -0
- package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6KSjjMA.js +17 -0
- package/dist/PriceHeader-Dyweu8aH.js +488 -0
- package/dist/{SearchApi-Bg9FwkW0.js → SearchApi-Y1fDQn0u.js} +37 -49
- package/dist/SendForm-B9l24WwR.js +6689 -0
- package/dist/Setup-DyzbPFM4.js +47 -0
- package/dist/{SmartList-DofjZjfy.js → SmartList-CWGKoAJh.js} +16 -24
- package/dist/Sortable.vue_vue_type_script_setup_true_lang-C2Gwp6Q-.js +1349 -0
- package/dist/{TermsSettings-B4glHd0I.js → TermsSettings-BeQH307A.js} +169 -56
- package/dist/ThemeColorRow-DFIsPy55.js +105 -0
- package/dist/ToggleBinding-DlH4y1IM.js +44 -0
- package/dist/UploadModal-BZ0mPBBB.js +134 -0
- package/dist/VideoPlayerInput-DBxcTUb7.js +134 -0
- package/dist/VideoPlayerSettings-Dg1OxjOa.js +78 -0
- package/dist/VideoSelectModal-BhbanMix.js +217 -0
- package/dist/{anime.es-BrPTThYb.js → anime.es-4wvNItHq.js} +205 -201
- package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
- package/dist/{dom-Ds4ypDrd.js → dom-CkTGWrfu.js} +3 -6
- package/dist/{focusDrawerMixin-DVCJIsb_.js → focusDrawerMixin-BVbTYOGr.js} +1 -1
- package/dist/{formDrawerState-BYsq1pB0.js → formDrawerState-CogZ-GVm.js} +2 -2
- package/dist/helpers-B4GUxtdD.js +46 -0
- package/dist/index-BZDey7B-.js +268 -0
- package/dist/index-Bd8_ZHHq.js +188 -0
- package/dist/index-BvyoYp1e.js +508 -0
- package/dist/index-CJZoubA3.js +3525 -0
- package/dist/index-D7yQWP4d.js +125 -0
- package/dist/index-D8hGHka6.js +513 -0
- package/dist/index-Dxy4tf7x.js +149 -0
- package/dist/index.es.js +2 -5
- package/dist/index.umd.js +303 -1486
- package/dist/main-Bn5XkQPb.js +57570 -0
- package/dist/mapFormMixin-C7FJLnbO.js +1528 -0
- package/dist/omit-DrWpFvRJ.js +56 -0
- package/dist/{publicSenderState-C4cIGu3m.js → publicSenderState-tdtCFPMx.js} +4 -4
- package/dist/splitpanes-BApidgjj.js +342 -0
- package/dist/template-CHdf2K2I.js +1572 -0
- package/dist/tippy.esm-Co6FYzEM.js +1994 -0
- package/dist/useTermsModal-VDnO1Lro.js +87 -0
- package/dist/{utils-CMs9ODO8.js → utils-DZkn0Q9c.js} +8 -11
- package/dist/validation-CqBkar3f.js +40 -0
- package/dist/widget.css +1 -0
- package/package.json +20 -25
- package/dist/AddClientCallout-TF4dWJwb.js +0 -48
- package/dist/AnswerModal-CLHDa2TD.js +0 -3879
- package/dist/AttachmentItem-ICP5nbhT.js +0 -85
- package/dist/BaseDatePicker-wwmiz_b5.js +0 -3187
- package/dist/BaseUpload-CDZOjohX.js +0 -1977
- package/dist/BlockMedia-D1JAYF9F.js +0 -76
- package/dist/CCallout-dAjcZXrm.js +0 -58
- package/dist/CDropdownItem-CkSNbSdj.js +0 -640
- package/dist/CFormField-Dw6UM1u6.js +0 -240
- package/dist/CPhoneInput-Dd6cJ4jg.js +0 -138
- package/dist/CPriceInput-CjV95s8E.js +0 -116
- package/dist/CSelect-izVnsQME.js +0 -91
- package/dist/CSkeleton-C0TjtLtY.js +0 -55
- package/dist/ClientAutocomplete-Cfu3abEx.js +0 -438
- package/dist/ClientModal-DjSoPQ9x.js +0 -666
- package/dist/ColorPicker-DZP6FIdn.js +0 -2879
- package/dist/CompanyModal-BYQWdbhG.js +0 -147
- package/dist/ContentWrapper-Bci9pSEp.js +0 -190
- package/dist/CoverBlockSettings-wD55bj3k.js +0 -659
- package/dist/DocAnswer-B5q-ntKP.js +0 -36
- package/dist/DocDetails-BQuaNZ4b.js +0 -263
- package/dist/DocForm-QzZ5wqsS.js +0 -5017
- package/dist/DocFormSend-CORtQPhb.js +0 -146
- package/dist/DocLinks-DZPzODUe.js +0 -38
- package/dist/DocModalBase-TTALjv6K.js +0 -28
- package/dist/DocPrint-BB-KT9ut.js +0 -240
- package/dist/DocReceipt-CGks1GLS.js +0 -217
- package/dist/DocSendReminder-BBQXJbsV.js +0 -140
- package/dist/DocTimeline-4jnYDmBI.js +0 -485
- package/dist/DocumentClient-BAAX7Dxk.js +0 -136
- package/dist/DocumentLayout-C4edCFmr.js +0 -4880
- package/dist/DocumentLogotype-i7YSQKcH.js +0 -92
- package/dist/DocumentVoided-BvZoMFB_.js +0 -25
- package/dist/EmbedInput-Bij7ER30.js +0 -117
- package/dist/EmbedSettings-D0oyq4-9.js +0 -74
- package/dist/ErrorCallout-CsW3WTZp.js +0 -27
- package/dist/FilePreviewModal-Doaawg0l.js +0 -81
- package/dist/Flag-C4Mf2xUU.js +0 -46
- package/dist/HeaderSettings-DwZ54IsK.js +0 -440
- package/dist/ImageSelectModal-ClFJ5uXM.js +0 -86
- package/dist/ImageUploadWrapper-DtEp_Pg3.js +0 -1604
- package/dist/Index-2MwnGZ_4.js +0 -25
- package/dist/Index-3CwdeytO.js +0 -107
- package/dist/Index-B-bSVOoh.js +0 -73
- package/dist/Index-BDyMp1ib.js +0 -643
- package/dist/Index-BMgtwHVA.js +0 -24
- package/dist/Index-BTD3hWbY.js +0 -54
- package/dist/Index-BUbd06rz.js +0 -144
- package/dist/Index-Bv2XrpgK.js +0 -25
- package/dist/Index-C00Ay-7P.js +0 -62
- package/dist/Index-CHL_6WQH.js +0 -66
- package/dist/Index-CLyNrkJA.js +0 -28
- package/dist/Index-CV57PvUE.js +0 -26
- package/dist/Index-Crj4apcP.js +0 -146
- package/dist/Index-CryBgLTa.js +0 -294
- package/dist/Index-Cv33nreP.js +0 -33
- package/dist/Index-D0ErQJ2M.js +0 -2445
- package/dist/Index-D8ZnVbsP.js +0 -32
- package/dist/Index-DPNIJewY.js +0 -56
- package/dist/Index-DVXhB0Ja.js +0 -58
- package/dist/Index-DWhQwxeB.js +0 -94
- package/dist/Index-DX7tomhl.js +0 -230
- package/dist/Index-D_AdmLWe.js +0 -41
- package/dist/Index-DgTQzlfK.js +0 -754
- package/dist/Index-DhapmO-4.js +0 -55
- package/dist/Index-DjC8joRt.js +0 -150
- package/dist/Index-Dv4l4LKF.js +0 -154
- package/dist/Index-TTFKPIIC.js +0 -84
- package/dist/Index-cT8oYfLR.js +0 -41
- package/dist/Index-igPwrQMu.js +0 -77
- package/dist/InputToggleRow-BgOubdXs.js +0 -57
- package/dist/ManualPopover-8suun-i9.js +0 -60
- package/dist/MediaWrapper-BadblLbS.js +0 -23
- package/dist/PackageGroup-BxmqH6qI.js +0 -704
- package/dist/PdfTerms-C6MRk0Ix.js +0 -31
- package/dist/PdfViewer-DUoiQx_1.js +0 -383
- package/dist/PlainHtml-DZ9V0Yuf.js +0 -27
- package/dist/PriceHeader-C3_CoKrL.js +0 -338
- package/dist/SendForm-D-OvqCee.js +0 -1023
- package/dist/Setup-CwK4er2y.js +0 -50
- package/dist/ThemeColorRow-BplIaxA2.js +0 -69
- package/dist/ToggleBinding-6ntt38Ye.js +0 -42
- package/dist/UploadModal-B6jQzsYA.js +0 -95
- package/dist/VideoPlayerInput-ryP77WC0.js +0 -97
- package/dist/VideoPlayerSettings-DJh0JNRI.js +0 -61
- package/dist/VideoSelectModal-8udQ394X.js +0 -104
- package/dist/answerDocumentMixin-CF4J_vsp.js +0 -51
- package/dist/debounce-CgyZi04Q.js +0 -84
- package/dist/formValidationMixin-Dq7aZhBk.js +0 -49
- package/dist/index-2Q8Ejpof.js +0 -167
- package/dist/index-B5-izJkt.js +0 -102
- package/dist/index-BQb6k0M8.js +0 -351
- package/dist/index-CR-KQfRE.js +0 -81
- package/dist/index-CogHiXWx.js +0 -2700
- package/dist/index-lZ1sSNWc.js +0 -492
- package/dist/main-BpqUyMpC.js +0 -57349
- package/dist/mapFormMixin-rxtAFyFK.js +0 -3028
- package/dist/omit-C7FeydiO.js +0 -31
- package/dist/simplebar.min-Dm388s-3.js +0 -71
- package/dist/splitpanes-BHUVsCZF.js +0 -382
- package/dist/style.css +0 -4
- package/dist/throttle-CfcsX8nA.js +0 -18
- package/dist/tippy.esm-C9mV-Rzr.js +0 -1805
- package/dist/vuedraggable.umd-CChGnToh.js +0 -3161
- package/dist/vuex.esm-DKGl8mcw.js +0 -467
|
@@ -0,0 +1,3371 @@
|
|
|
1
|
+
import { m as Z } from "./mapFormMixin-C7FJLnbO.js";
|
|
2
|
+
import { h as Re, ah as $t, d3 as Fe, az as Wt, y as Lt, cQ as $e, T as Se, _ as tt, d4 as Ne, d5 as Le, o as D, b as R, s as y, d as B, f as L, F as lt, c as Q, w as N, v as I, B as K, ai as Ut, e as $, n as Ht, E as Ue, G as qe, d6 as Oe, a as ze, g as ct, q as Yt, ax as Gt, ap as je, ca as Ve } from "./main-Bn5XkQPb.js";
|
|
3
|
+
import { a as z } from "./anime.es-4wvNItHq.js";
|
|
4
|
+
import { _ as We } from "./CFormField.vue_vue_type_script_setup_true_lang-BqAyWe3T.js";
|
|
5
|
+
var G = {}, ut, Kt;
|
|
6
|
+
function He() {
|
|
7
|
+
return Kt || (Kt = 1, ut = function() {
|
|
8
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
9
|
+
}), ut;
|
|
10
|
+
}
|
|
11
|
+
var dt = {}, V = {}, Jt;
|
|
12
|
+
function W() {
|
|
13
|
+
if (Jt) return V;
|
|
14
|
+
Jt = 1;
|
|
15
|
+
let e;
|
|
16
|
+
const t = [
|
|
17
|
+
0,
|
|
18
|
+
// Not used
|
|
19
|
+
26,
|
|
20
|
+
44,
|
|
21
|
+
70,
|
|
22
|
+
100,
|
|
23
|
+
134,
|
|
24
|
+
172,
|
|
25
|
+
196,
|
|
26
|
+
242,
|
|
27
|
+
292,
|
|
28
|
+
346,
|
|
29
|
+
404,
|
|
30
|
+
466,
|
|
31
|
+
532,
|
|
32
|
+
581,
|
|
33
|
+
655,
|
|
34
|
+
733,
|
|
35
|
+
815,
|
|
36
|
+
901,
|
|
37
|
+
991,
|
|
38
|
+
1085,
|
|
39
|
+
1156,
|
|
40
|
+
1258,
|
|
41
|
+
1364,
|
|
42
|
+
1474,
|
|
43
|
+
1588,
|
|
44
|
+
1706,
|
|
45
|
+
1828,
|
|
46
|
+
1921,
|
|
47
|
+
2051,
|
|
48
|
+
2185,
|
|
49
|
+
2323,
|
|
50
|
+
2465,
|
|
51
|
+
2611,
|
|
52
|
+
2761,
|
|
53
|
+
2876,
|
|
54
|
+
3034,
|
|
55
|
+
3196,
|
|
56
|
+
3362,
|
|
57
|
+
3532,
|
|
58
|
+
3706
|
|
59
|
+
];
|
|
60
|
+
return V.getSymbolSize = function(i) {
|
|
61
|
+
if (!i) throw new Error('"version" cannot be null or undefined');
|
|
62
|
+
if (i < 1 || i > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
63
|
+
return i * 4 + 17;
|
|
64
|
+
}, V.getSymbolTotalCodewords = function(i) {
|
|
65
|
+
return t[i];
|
|
66
|
+
}, V.getBCHDigit = function(o) {
|
|
67
|
+
let i = 0;
|
|
68
|
+
for (; o !== 0; )
|
|
69
|
+
i++, o >>>= 1;
|
|
70
|
+
return i;
|
|
71
|
+
}, V.setToSJISFunction = function(i) {
|
|
72
|
+
if (typeof i != "function")
|
|
73
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
74
|
+
e = i;
|
|
75
|
+
}, V.isKanjiModeEnabled = function() {
|
|
76
|
+
return typeof e < "u";
|
|
77
|
+
}, V.toSJIS = function(i) {
|
|
78
|
+
return e(i);
|
|
79
|
+
}, V;
|
|
80
|
+
}
|
|
81
|
+
var ht = {}, Xt;
|
|
82
|
+
function qt() {
|
|
83
|
+
return Xt || (Xt = 1, function(e) {
|
|
84
|
+
e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
|
|
85
|
+
function t(o) {
|
|
86
|
+
if (typeof o != "string")
|
|
87
|
+
throw new Error("Param is not a string");
|
|
88
|
+
switch (o.toLowerCase()) {
|
|
89
|
+
case "l":
|
|
90
|
+
case "low":
|
|
91
|
+
return e.L;
|
|
92
|
+
case "m":
|
|
93
|
+
case "medium":
|
|
94
|
+
return e.M;
|
|
95
|
+
case "q":
|
|
96
|
+
case "quartile":
|
|
97
|
+
return e.Q;
|
|
98
|
+
case "h":
|
|
99
|
+
case "high":
|
|
100
|
+
return e.H;
|
|
101
|
+
default:
|
|
102
|
+
throw new Error("Unknown EC Level: " + o);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
e.isValid = function(i) {
|
|
106
|
+
return i && typeof i.bit < "u" && i.bit >= 0 && i.bit < 4;
|
|
107
|
+
}, e.from = function(i, n) {
|
|
108
|
+
if (e.isValid(i))
|
|
109
|
+
return i;
|
|
110
|
+
try {
|
|
111
|
+
return t(i);
|
|
112
|
+
} catch {
|
|
113
|
+
return n;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}(ht)), ht;
|
|
117
|
+
}
|
|
118
|
+
var ft, Qt;
|
|
119
|
+
function Ye() {
|
|
120
|
+
if (Qt) return ft;
|
|
121
|
+
Qt = 1;
|
|
122
|
+
function e() {
|
|
123
|
+
this.buffer = [], this.length = 0;
|
|
124
|
+
}
|
|
125
|
+
return e.prototype = {
|
|
126
|
+
get: function(t) {
|
|
127
|
+
const o = Math.floor(t / 8);
|
|
128
|
+
return (this.buffer[o] >>> 7 - t % 8 & 1) === 1;
|
|
129
|
+
},
|
|
130
|
+
put: function(t, o) {
|
|
131
|
+
for (let i = 0; i < o; i++)
|
|
132
|
+
this.putBit((t >>> o - i - 1 & 1) === 1);
|
|
133
|
+
},
|
|
134
|
+
getLengthInBits: function() {
|
|
135
|
+
return this.length;
|
|
136
|
+
},
|
|
137
|
+
putBit: function(t) {
|
|
138
|
+
const o = Math.floor(this.length / 8);
|
|
139
|
+
this.buffer.length <= o && this.buffer.push(0), t && (this.buffer[o] |= 128 >>> this.length % 8), this.length++;
|
|
140
|
+
}
|
|
141
|
+
}, ft = e, ft;
|
|
142
|
+
}
|
|
143
|
+
var gt, Zt;
|
|
144
|
+
function Ge() {
|
|
145
|
+
if (Zt) return gt;
|
|
146
|
+
Zt = 1;
|
|
147
|
+
function e(t) {
|
|
148
|
+
if (!t || t < 1)
|
|
149
|
+
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
150
|
+
this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
|
|
151
|
+
}
|
|
152
|
+
return e.prototype.set = function(t, o, i, n) {
|
|
153
|
+
const s = t * this.size + o;
|
|
154
|
+
this.data[s] = i, n && (this.reservedBit[s] = !0);
|
|
155
|
+
}, e.prototype.get = function(t, o) {
|
|
156
|
+
return this.data[t * this.size + o];
|
|
157
|
+
}, e.prototype.xor = function(t, o, i) {
|
|
158
|
+
this.data[t * this.size + o] ^= i;
|
|
159
|
+
}, e.prototype.isReserved = function(t, o) {
|
|
160
|
+
return this.reservedBit[t * this.size + o];
|
|
161
|
+
}, gt = e, gt;
|
|
162
|
+
}
|
|
163
|
+
var mt = {}, te;
|
|
164
|
+
function Ke() {
|
|
165
|
+
return te || (te = 1, function(e) {
|
|
166
|
+
const t = W().getSymbolSize;
|
|
167
|
+
e.getRowColCoords = function(i) {
|
|
168
|
+
if (i === 1) return [];
|
|
169
|
+
const n = Math.floor(i / 7) + 2, s = t(i), r = s === 145 ? 26 : Math.ceil((s - 13) / (2 * n - 2)) * 2, a = [s - 7];
|
|
170
|
+
for (let l = 1; l < n - 1; l++)
|
|
171
|
+
a[l] = a[l - 1] - r;
|
|
172
|
+
return a.push(6), a.reverse();
|
|
173
|
+
}, e.getPositions = function(i) {
|
|
174
|
+
const n = [], s = e.getRowColCoords(i), r = s.length;
|
|
175
|
+
for (let a = 0; a < r; a++)
|
|
176
|
+
for (let l = 0; l < r; l++)
|
|
177
|
+
a === 0 && l === 0 || // top-left
|
|
178
|
+
a === 0 && l === r - 1 || // bottom-left
|
|
179
|
+
a === r - 1 && l === 0 || n.push([s[a], s[l]]);
|
|
180
|
+
return n;
|
|
181
|
+
};
|
|
182
|
+
}(mt)), mt;
|
|
183
|
+
}
|
|
184
|
+
var pt = {}, ee;
|
|
185
|
+
function Je() {
|
|
186
|
+
if (ee) return pt;
|
|
187
|
+
ee = 1;
|
|
188
|
+
const e = W().getSymbolSize, t = 7;
|
|
189
|
+
return pt.getPositions = function(i) {
|
|
190
|
+
const n = e(i);
|
|
191
|
+
return [
|
|
192
|
+
// top-left
|
|
193
|
+
[0, 0],
|
|
194
|
+
// top-right
|
|
195
|
+
[n - t, 0],
|
|
196
|
+
// bottom-left
|
|
197
|
+
[0, n - t]
|
|
198
|
+
];
|
|
199
|
+
}, pt;
|
|
200
|
+
}
|
|
201
|
+
var wt = {}, ne;
|
|
202
|
+
function Xe() {
|
|
203
|
+
return ne || (ne = 1, function(e) {
|
|
204
|
+
e.Patterns = {
|
|
205
|
+
PATTERN000: 0,
|
|
206
|
+
PATTERN001: 1,
|
|
207
|
+
PATTERN010: 2,
|
|
208
|
+
PATTERN011: 3,
|
|
209
|
+
PATTERN100: 4,
|
|
210
|
+
PATTERN101: 5,
|
|
211
|
+
PATTERN110: 6,
|
|
212
|
+
PATTERN111: 7
|
|
213
|
+
};
|
|
214
|
+
const t = {
|
|
215
|
+
N1: 3,
|
|
216
|
+
N2: 3,
|
|
217
|
+
N3: 40,
|
|
218
|
+
N4: 10
|
|
219
|
+
};
|
|
220
|
+
e.isValid = function(n) {
|
|
221
|
+
return n != null && n !== "" && !isNaN(n) && n >= 0 && n <= 7;
|
|
222
|
+
}, e.from = function(n) {
|
|
223
|
+
return e.isValid(n) ? parseInt(n, 10) : void 0;
|
|
224
|
+
}, e.getPenaltyN1 = function(n) {
|
|
225
|
+
const s = n.size;
|
|
226
|
+
let r = 0, a = 0, l = 0, u = null, c = null;
|
|
227
|
+
for (let h = 0; h < s; h++) {
|
|
228
|
+
a = l = 0, u = c = null;
|
|
229
|
+
for (let f = 0; f < s; f++) {
|
|
230
|
+
let d = n.get(h, f);
|
|
231
|
+
d === u ? a++ : (a >= 5 && (r += t.N1 + (a - 5)), u = d, a = 1), d = n.get(f, h), d === c ? l++ : (l >= 5 && (r += t.N1 + (l - 5)), c = d, l = 1);
|
|
232
|
+
}
|
|
233
|
+
a >= 5 && (r += t.N1 + (a - 5)), l >= 5 && (r += t.N1 + (l - 5));
|
|
234
|
+
}
|
|
235
|
+
return r;
|
|
236
|
+
}, e.getPenaltyN2 = function(n) {
|
|
237
|
+
const s = n.size;
|
|
238
|
+
let r = 0;
|
|
239
|
+
for (let a = 0; a < s - 1; a++)
|
|
240
|
+
for (let l = 0; l < s - 1; l++) {
|
|
241
|
+
const u = n.get(a, l) + n.get(a, l + 1) + n.get(a + 1, l) + n.get(a + 1, l + 1);
|
|
242
|
+
(u === 4 || u === 0) && r++;
|
|
243
|
+
}
|
|
244
|
+
return r * t.N2;
|
|
245
|
+
}, e.getPenaltyN3 = function(n) {
|
|
246
|
+
const s = n.size;
|
|
247
|
+
let r = 0, a = 0, l = 0;
|
|
248
|
+
for (let u = 0; u < s; u++) {
|
|
249
|
+
a = l = 0;
|
|
250
|
+
for (let c = 0; c < s; c++)
|
|
251
|
+
a = a << 1 & 2047 | n.get(u, c), c >= 10 && (a === 1488 || a === 93) && r++, l = l << 1 & 2047 | n.get(c, u), c >= 10 && (l === 1488 || l === 93) && r++;
|
|
252
|
+
}
|
|
253
|
+
return r * t.N3;
|
|
254
|
+
}, e.getPenaltyN4 = function(n) {
|
|
255
|
+
let s = 0;
|
|
256
|
+
const r = n.data.length;
|
|
257
|
+
for (let l = 0; l < r; l++) s += n.data[l];
|
|
258
|
+
return Math.abs(Math.ceil(s * 100 / r / 5) - 10) * t.N4;
|
|
259
|
+
};
|
|
260
|
+
function o(i, n, s) {
|
|
261
|
+
switch (i) {
|
|
262
|
+
case e.Patterns.PATTERN000:
|
|
263
|
+
return (n + s) % 2 === 0;
|
|
264
|
+
case e.Patterns.PATTERN001:
|
|
265
|
+
return n % 2 === 0;
|
|
266
|
+
case e.Patterns.PATTERN010:
|
|
267
|
+
return s % 3 === 0;
|
|
268
|
+
case e.Patterns.PATTERN011:
|
|
269
|
+
return (n + s) % 3 === 0;
|
|
270
|
+
case e.Patterns.PATTERN100:
|
|
271
|
+
return (Math.floor(n / 2) + Math.floor(s / 3)) % 2 === 0;
|
|
272
|
+
case e.Patterns.PATTERN101:
|
|
273
|
+
return n * s % 2 + n * s % 3 === 0;
|
|
274
|
+
case e.Patterns.PATTERN110:
|
|
275
|
+
return (n * s % 2 + n * s % 3) % 2 === 0;
|
|
276
|
+
case e.Patterns.PATTERN111:
|
|
277
|
+
return (n * s % 3 + (n + s) % 2) % 2 === 0;
|
|
278
|
+
default:
|
|
279
|
+
throw new Error("bad maskPattern:" + i);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
e.applyMask = function(n, s) {
|
|
283
|
+
const r = s.size;
|
|
284
|
+
for (let a = 0; a < r; a++)
|
|
285
|
+
for (let l = 0; l < r; l++)
|
|
286
|
+
s.isReserved(l, a) || s.xor(l, a, o(n, l, a));
|
|
287
|
+
}, e.getBestMask = function(n, s) {
|
|
288
|
+
const r = Object.keys(e.Patterns).length;
|
|
289
|
+
let a = 0, l = 1 / 0;
|
|
290
|
+
for (let u = 0; u < r; u++) {
|
|
291
|
+
s(u), e.applyMask(u, n);
|
|
292
|
+
const c = e.getPenaltyN1(n) + e.getPenaltyN2(n) + e.getPenaltyN3(n) + e.getPenaltyN4(n);
|
|
293
|
+
e.applyMask(u, n), c < l && (l = c, a = u);
|
|
294
|
+
}
|
|
295
|
+
return a;
|
|
296
|
+
};
|
|
297
|
+
}(wt)), wt;
|
|
298
|
+
}
|
|
299
|
+
var nt = {}, ie;
|
|
300
|
+
function ke() {
|
|
301
|
+
if (ie) return nt;
|
|
302
|
+
ie = 1;
|
|
303
|
+
const e = qt(), t = [
|
|
304
|
+
// L M Q H
|
|
305
|
+
1,
|
|
306
|
+
1,
|
|
307
|
+
1,
|
|
308
|
+
1,
|
|
309
|
+
1,
|
|
310
|
+
1,
|
|
311
|
+
1,
|
|
312
|
+
1,
|
|
313
|
+
1,
|
|
314
|
+
1,
|
|
315
|
+
2,
|
|
316
|
+
2,
|
|
317
|
+
1,
|
|
318
|
+
2,
|
|
319
|
+
2,
|
|
320
|
+
4,
|
|
321
|
+
1,
|
|
322
|
+
2,
|
|
323
|
+
4,
|
|
324
|
+
4,
|
|
325
|
+
2,
|
|
326
|
+
4,
|
|
327
|
+
4,
|
|
328
|
+
4,
|
|
329
|
+
2,
|
|
330
|
+
4,
|
|
331
|
+
6,
|
|
332
|
+
5,
|
|
333
|
+
2,
|
|
334
|
+
4,
|
|
335
|
+
6,
|
|
336
|
+
6,
|
|
337
|
+
2,
|
|
338
|
+
5,
|
|
339
|
+
8,
|
|
340
|
+
8,
|
|
341
|
+
4,
|
|
342
|
+
5,
|
|
343
|
+
8,
|
|
344
|
+
8,
|
|
345
|
+
4,
|
|
346
|
+
5,
|
|
347
|
+
8,
|
|
348
|
+
11,
|
|
349
|
+
4,
|
|
350
|
+
8,
|
|
351
|
+
10,
|
|
352
|
+
11,
|
|
353
|
+
4,
|
|
354
|
+
9,
|
|
355
|
+
12,
|
|
356
|
+
16,
|
|
357
|
+
4,
|
|
358
|
+
9,
|
|
359
|
+
16,
|
|
360
|
+
16,
|
|
361
|
+
6,
|
|
362
|
+
10,
|
|
363
|
+
12,
|
|
364
|
+
18,
|
|
365
|
+
6,
|
|
366
|
+
10,
|
|
367
|
+
17,
|
|
368
|
+
16,
|
|
369
|
+
6,
|
|
370
|
+
11,
|
|
371
|
+
16,
|
|
372
|
+
19,
|
|
373
|
+
6,
|
|
374
|
+
13,
|
|
375
|
+
18,
|
|
376
|
+
21,
|
|
377
|
+
7,
|
|
378
|
+
14,
|
|
379
|
+
21,
|
|
380
|
+
25,
|
|
381
|
+
8,
|
|
382
|
+
16,
|
|
383
|
+
20,
|
|
384
|
+
25,
|
|
385
|
+
8,
|
|
386
|
+
17,
|
|
387
|
+
23,
|
|
388
|
+
25,
|
|
389
|
+
9,
|
|
390
|
+
17,
|
|
391
|
+
23,
|
|
392
|
+
34,
|
|
393
|
+
9,
|
|
394
|
+
18,
|
|
395
|
+
25,
|
|
396
|
+
30,
|
|
397
|
+
10,
|
|
398
|
+
20,
|
|
399
|
+
27,
|
|
400
|
+
32,
|
|
401
|
+
12,
|
|
402
|
+
21,
|
|
403
|
+
29,
|
|
404
|
+
35,
|
|
405
|
+
12,
|
|
406
|
+
23,
|
|
407
|
+
34,
|
|
408
|
+
37,
|
|
409
|
+
12,
|
|
410
|
+
25,
|
|
411
|
+
34,
|
|
412
|
+
40,
|
|
413
|
+
13,
|
|
414
|
+
26,
|
|
415
|
+
35,
|
|
416
|
+
42,
|
|
417
|
+
14,
|
|
418
|
+
28,
|
|
419
|
+
38,
|
|
420
|
+
45,
|
|
421
|
+
15,
|
|
422
|
+
29,
|
|
423
|
+
40,
|
|
424
|
+
48,
|
|
425
|
+
16,
|
|
426
|
+
31,
|
|
427
|
+
43,
|
|
428
|
+
51,
|
|
429
|
+
17,
|
|
430
|
+
33,
|
|
431
|
+
45,
|
|
432
|
+
54,
|
|
433
|
+
18,
|
|
434
|
+
35,
|
|
435
|
+
48,
|
|
436
|
+
57,
|
|
437
|
+
19,
|
|
438
|
+
37,
|
|
439
|
+
51,
|
|
440
|
+
60,
|
|
441
|
+
19,
|
|
442
|
+
38,
|
|
443
|
+
53,
|
|
444
|
+
63,
|
|
445
|
+
20,
|
|
446
|
+
40,
|
|
447
|
+
56,
|
|
448
|
+
66,
|
|
449
|
+
21,
|
|
450
|
+
43,
|
|
451
|
+
59,
|
|
452
|
+
70,
|
|
453
|
+
22,
|
|
454
|
+
45,
|
|
455
|
+
62,
|
|
456
|
+
74,
|
|
457
|
+
24,
|
|
458
|
+
47,
|
|
459
|
+
65,
|
|
460
|
+
77,
|
|
461
|
+
25,
|
|
462
|
+
49,
|
|
463
|
+
68,
|
|
464
|
+
81
|
|
465
|
+
], o = [
|
|
466
|
+
// L M Q H
|
|
467
|
+
7,
|
|
468
|
+
10,
|
|
469
|
+
13,
|
|
470
|
+
17,
|
|
471
|
+
10,
|
|
472
|
+
16,
|
|
473
|
+
22,
|
|
474
|
+
28,
|
|
475
|
+
15,
|
|
476
|
+
26,
|
|
477
|
+
36,
|
|
478
|
+
44,
|
|
479
|
+
20,
|
|
480
|
+
36,
|
|
481
|
+
52,
|
|
482
|
+
64,
|
|
483
|
+
26,
|
|
484
|
+
48,
|
|
485
|
+
72,
|
|
486
|
+
88,
|
|
487
|
+
36,
|
|
488
|
+
64,
|
|
489
|
+
96,
|
|
490
|
+
112,
|
|
491
|
+
40,
|
|
492
|
+
72,
|
|
493
|
+
108,
|
|
494
|
+
130,
|
|
495
|
+
48,
|
|
496
|
+
88,
|
|
497
|
+
132,
|
|
498
|
+
156,
|
|
499
|
+
60,
|
|
500
|
+
110,
|
|
501
|
+
160,
|
|
502
|
+
192,
|
|
503
|
+
72,
|
|
504
|
+
130,
|
|
505
|
+
192,
|
|
506
|
+
224,
|
|
507
|
+
80,
|
|
508
|
+
150,
|
|
509
|
+
224,
|
|
510
|
+
264,
|
|
511
|
+
96,
|
|
512
|
+
176,
|
|
513
|
+
260,
|
|
514
|
+
308,
|
|
515
|
+
104,
|
|
516
|
+
198,
|
|
517
|
+
288,
|
|
518
|
+
352,
|
|
519
|
+
120,
|
|
520
|
+
216,
|
|
521
|
+
320,
|
|
522
|
+
384,
|
|
523
|
+
132,
|
|
524
|
+
240,
|
|
525
|
+
360,
|
|
526
|
+
432,
|
|
527
|
+
144,
|
|
528
|
+
280,
|
|
529
|
+
408,
|
|
530
|
+
480,
|
|
531
|
+
168,
|
|
532
|
+
308,
|
|
533
|
+
448,
|
|
534
|
+
532,
|
|
535
|
+
180,
|
|
536
|
+
338,
|
|
537
|
+
504,
|
|
538
|
+
588,
|
|
539
|
+
196,
|
|
540
|
+
364,
|
|
541
|
+
546,
|
|
542
|
+
650,
|
|
543
|
+
224,
|
|
544
|
+
416,
|
|
545
|
+
600,
|
|
546
|
+
700,
|
|
547
|
+
224,
|
|
548
|
+
442,
|
|
549
|
+
644,
|
|
550
|
+
750,
|
|
551
|
+
252,
|
|
552
|
+
476,
|
|
553
|
+
690,
|
|
554
|
+
816,
|
|
555
|
+
270,
|
|
556
|
+
504,
|
|
557
|
+
750,
|
|
558
|
+
900,
|
|
559
|
+
300,
|
|
560
|
+
560,
|
|
561
|
+
810,
|
|
562
|
+
960,
|
|
563
|
+
312,
|
|
564
|
+
588,
|
|
565
|
+
870,
|
|
566
|
+
1050,
|
|
567
|
+
336,
|
|
568
|
+
644,
|
|
569
|
+
952,
|
|
570
|
+
1110,
|
|
571
|
+
360,
|
|
572
|
+
700,
|
|
573
|
+
1020,
|
|
574
|
+
1200,
|
|
575
|
+
390,
|
|
576
|
+
728,
|
|
577
|
+
1050,
|
|
578
|
+
1260,
|
|
579
|
+
420,
|
|
580
|
+
784,
|
|
581
|
+
1140,
|
|
582
|
+
1350,
|
|
583
|
+
450,
|
|
584
|
+
812,
|
|
585
|
+
1200,
|
|
586
|
+
1440,
|
|
587
|
+
480,
|
|
588
|
+
868,
|
|
589
|
+
1290,
|
|
590
|
+
1530,
|
|
591
|
+
510,
|
|
592
|
+
924,
|
|
593
|
+
1350,
|
|
594
|
+
1620,
|
|
595
|
+
540,
|
|
596
|
+
980,
|
|
597
|
+
1440,
|
|
598
|
+
1710,
|
|
599
|
+
570,
|
|
600
|
+
1036,
|
|
601
|
+
1530,
|
|
602
|
+
1800,
|
|
603
|
+
570,
|
|
604
|
+
1064,
|
|
605
|
+
1590,
|
|
606
|
+
1890,
|
|
607
|
+
600,
|
|
608
|
+
1120,
|
|
609
|
+
1680,
|
|
610
|
+
1980,
|
|
611
|
+
630,
|
|
612
|
+
1204,
|
|
613
|
+
1770,
|
|
614
|
+
2100,
|
|
615
|
+
660,
|
|
616
|
+
1260,
|
|
617
|
+
1860,
|
|
618
|
+
2220,
|
|
619
|
+
720,
|
|
620
|
+
1316,
|
|
621
|
+
1950,
|
|
622
|
+
2310,
|
|
623
|
+
750,
|
|
624
|
+
1372,
|
|
625
|
+
2040,
|
|
626
|
+
2430
|
|
627
|
+
];
|
|
628
|
+
return nt.getBlocksCount = function(n, s) {
|
|
629
|
+
switch (s) {
|
|
630
|
+
case e.L:
|
|
631
|
+
return t[(n - 1) * 4 + 0];
|
|
632
|
+
case e.M:
|
|
633
|
+
return t[(n - 1) * 4 + 1];
|
|
634
|
+
case e.Q:
|
|
635
|
+
return t[(n - 1) * 4 + 2];
|
|
636
|
+
case e.H:
|
|
637
|
+
return t[(n - 1) * 4 + 3];
|
|
638
|
+
default:
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
}, nt.getTotalCodewordsCount = function(n, s) {
|
|
642
|
+
switch (s) {
|
|
643
|
+
case e.L:
|
|
644
|
+
return o[(n - 1) * 4 + 0];
|
|
645
|
+
case e.M:
|
|
646
|
+
return o[(n - 1) * 4 + 1];
|
|
647
|
+
case e.Q:
|
|
648
|
+
return o[(n - 1) * 4 + 2];
|
|
649
|
+
case e.H:
|
|
650
|
+
return o[(n - 1) * 4 + 3];
|
|
651
|
+
default:
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
}, nt;
|
|
655
|
+
}
|
|
656
|
+
var yt = {}, X = {}, se;
|
|
657
|
+
function Qe() {
|
|
658
|
+
if (se) return X;
|
|
659
|
+
se = 1;
|
|
660
|
+
const e = new Uint8Array(512), t = new Uint8Array(256);
|
|
661
|
+
return function() {
|
|
662
|
+
let i = 1;
|
|
663
|
+
for (let n = 0; n < 255; n++)
|
|
664
|
+
e[n] = i, t[i] = n, i <<= 1, i & 256 && (i ^= 285);
|
|
665
|
+
for (let n = 255; n < 512; n++)
|
|
666
|
+
e[n] = e[n - 255];
|
|
667
|
+
}(), X.log = function(i) {
|
|
668
|
+
if (i < 1) throw new Error("log(" + i + ")");
|
|
669
|
+
return t[i];
|
|
670
|
+
}, X.exp = function(i) {
|
|
671
|
+
return e[i];
|
|
672
|
+
}, X.mul = function(i, n) {
|
|
673
|
+
return i === 0 || n === 0 ? 0 : e[t[i] + t[n]];
|
|
674
|
+
}, X;
|
|
675
|
+
}
|
|
676
|
+
var oe;
|
|
677
|
+
function Ze() {
|
|
678
|
+
return oe || (oe = 1, function(e) {
|
|
679
|
+
const t = Qe();
|
|
680
|
+
e.mul = function(i, n) {
|
|
681
|
+
const s = new Uint8Array(i.length + n.length - 1);
|
|
682
|
+
for (let r = 0; r < i.length; r++)
|
|
683
|
+
for (let a = 0; a < n.length; a++)
|
|
684
|
+
s[r + a] ^= t.mul(i[r], n[a]);
|
|
685
|
+
return s;
|
|
686
|
+
}, e.mod = function(i, n) {
|
|
687
|
+
let s = new Uint8Array(i);
|
|
688
|
+
for (; s.length - n.length >= 0; ) {
|
|
689
|
+
const r = s[0];
|
|
690
|
+
for (let l = 0; l < n.length; l++)
|
|
691
|
+
s[l] ^= t.mul(n[l], r);
|
|
692
|
+
let a = 0;
|
|
693
|
+
for (; a < s.length && s[a] === 0; ) a++;
|
|
694
|
+
s = s.slice(a);
|
|
695
|
+
}
|
|
696
|
+
return s;
|
|
697
|
+
}, e.generateECPolynomial = function(i) {
|
|
698
|
+
let n = new Uint8Array([1]);
|
|
699
|
+
for (let s = 0; s < i; s++)
|
|
700
|
+
n = e.mul(n, new Uint8Array([1, t.exp(s)]));
|
|
701
|
+
return n;
|
|
702
|
+
};
|
|
703
|
+
}(yt)), yt;
|
|
704
|
+
}
|
|
705
|
+
var vt, re;
|
|
706
|
+
function tn() {
|
|
707
|
+
if (re) return vt;
|
|
708
|
+
re = 1;
|
|
709
|
+
const e = Ze();
|
|
710
|
+
function t(o) {
|
|
711
|
+
this.genPoly = void 0, this.degree = o, this.degree && this.initialize(this.degree);
|
|
712
|
+
}
|
|
713
|
+
return t.prototype.initialize = function(i) {
|
|
714
|
+
this.degree = i, this.genPoly = e.generateECPolynomial(this.degree);
|
|
715
|
+
}, t.prototype.encode = function(i) {
|
|
716
|
+
if (!this.genPoly)
|
|
717
|
+
throw new Error("Encoder not initialized");
|
|
718
|
+
const n = new Uint8Array(i.length + this.degree);
|
|
719
|
+
n.set(i);
|
|
720
|
+
const s = e.mod(n, this.genPoly), r = this.degree - s.length;
|
|
721
|
+
if (r > 0) {
|
|
722
|
+
const a = new Uint8Array(this.degree);
|
|
723
|
+
return a.set(s, r), a;
|
|
724
|
+
}
|
|
725
|
+
return s;
|
|
726
|
+
}, vt = t, vt;
|
|
727
|
+
}
|
|
728
|
+
var _t = {}, Ct = {}, xt = {}, ae;
|
|
729
|
+
function Te() {
|
|
730
|
+
return ae || (ae = 1, xt.isValid = function(t) {
|
|
731
|
+
return !isNaN(t) && t >= 1 && t <= 40;
|
|
732
|
+
}), xt;
|
|
733
|
+
}
|
|
734
|
+
var U = {}, le;
|
|
735
|
+
function Me() {
|
|
736
|
+
if (le) return U;
|
|
737
|
+
le = 1;
|
|
738
|
+
const e = "[0-9]+", t = "[A-Z $%*+\\-./:]+";
|
|
739
|
+
let o = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
740
|
+
o = o.replace(/u/g, "\\u");
|
|
741
|
+
const i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + o + `)(?:.|[\r
|
|
742
|
+
]))+`;
|
|
743
|
+
U.KANJI = new RegExp(o, "g"), U.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), U.BYTE = new RegExp(i, "g"), U.NUMERIC = new RegExp(e, "g"), U.ALPHANUMERIC = new RegExp(t, "g");
|
|
744
|
+
const n = new RegExp("^" + o + "$"), s = new RegExp("^" + e + "$"), r = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
745
|
+
return U.testKanji = function(l) {
|
|
746
|
+
return n.test(l);
|
|
747
|
+
}, U.testNumeric = function(l) {
|
|
748
|
+
return s.test(l);
|
|
749
|
+
}, U.testAlphanumeric = function(l) {
|
|
750
|
+
return r.test(l);
|
|
751
|
+
}, U;
|
|
752
|
+
}
|
|
753
|
+
var ce;
|
|
754
|
+
function H() {
|
|
755
|
+
return ce || (ce = 1, function(e) {
|
|
756
|
+
const t = Te(), o = Me();
|
|
757
|
+
e.NUMERIC = {
|
|
758
|
+
id: "Numeric",
|
|
759
|
+
bit: 1,
|
|
760
|
+
ccBits: [10, 12, 14]
|
|
761
|
+
}, e.ALPHANUMERIC = {
|
|
762
|
+
id: "Alphanumeric",
|
|
763
|
+
bit: 2,
|
|
764
|
+
ccBits: [9, 11, 13]
|
|
765
|
+
}, e.BYTE = {
|
|
766
|
+
id: "Byte",
|
|
767
|
+
bit: 4,
|
|
768
|
+
ccBits: [8, 16, 16]
|
|
769
|
+
}, e.KANJI = {
|
|
770
|
+
id: "Kanji",
|
|
771
|
+
bit: 8,
|
|
772
|
+
ccBits: [8, 10, 12]
|
|
773
|
+
}, e.MIXED = {
|
|
774
|
+
bit: -1
|
|
775
|
+
}, e.getCharCountIndicator = function(s, r) {
|
|
776
|
+
if (!s.ccBits) throw new Error("Invalid mode: " + s);
|
|
777
|
+
if (!t.isValid(r))
|
|
778
|
+
throw new Error("Invalid version: " + r);
|
|
779
|
+
return r >= 1 && r < 10 ? s.ccBits[0] : r < 27 ? s.ccBits[1] : s.ccBits[2];
|
|
780
|
+
}, e.getBestModeForData = function(s) {
|
|
781
|
+
return o.testNumeric(s) ? e.NUMERIC : o.testAlphanumeric(s) ? e.ALPHANUMERIC : o.testKanji(s) ? e.KANJI : e.BYTE;
|
|
782
|
+
}, e.toString = function(s) {
|
|
783
|
+
if (s && s.id) return s.id;
|
|
784
|
+
throw new Error("Invalid mode");
|
|
785
|
+
}, e.isValid = function(s) {
|
|
786
|
+
return s && s.bit && s.ccBits;
|
|
787
|
+
};
|
|
788
|
+
function i(n) {
|
|
789
|
+
if (typeof n != "string")
|
|
790
|
+
throw new Error("Param is not a string");
|
|
791
|
+
switch (n.toLowerCase()) {
|
|
792
|
+
case "numeric":
|
|
793
|
+
return e.NUMERIC;
|
|
794
|
+
case "alphanumeric":
|
|
795
|
+
return e.ALPHANUMERIC;
|
|
796
|
+
case "kanji":
|
|
797
|
+
return e.KANJI;
|
|
798
|
+
case "byte":
|
|
799
|
+
return e.BYTE;
|
|
800
|
+
default:
|
|
801
|
+
throw new Error("Unknown mode: " + n);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
e.from = function(s, r) {
|
|
805
|
+
if (e.isValid(s))
|
|
806
|
+
return s;
|
|
807
|
+
try {
|
|
808
|
+
return i(s);
|
|
809
|
+
} catch {
|
|
810
|
+
return r;
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
}(Ct)), Ct;
|
|
814
|
+
}
|
|
815
|
+
var ue;
|
|
816
|
+
function en() {
|
|
817
|
+
return ue || (ue = 1, function(e) {
|
|
818
|
+
const t = W(), o = ke(), i = qt(), n = H(), s = Te(), r = 7973, a = t.getBCHDigit(r);
|
|
819
|
+
function l(f, d, p) {
|
|
820
|
+
for (let g = 1; g <= 40; g++)
|
|
821
|
+
if (d <= e.getCapacity(g, p, f))
|
|
822
|
+
return g;
|
|
823
|
+
}
|
|
824
|
+
function u(f, d) {
|
|
825
|
+
return n.getCharCountIndicator(f, d) + 4;
|
|
826
|
+
}
|
|
827
|
+
function c(f, d) {
|
|
828
|
+
let p = 0;
|
|
829
|
+
return f.forEach(function(g) {
|
|
830
|
+
const A = u(g.mode, d);
|
|
831
|
+
p += A + g.getBitsLength();
|
|
832
|
+
}), p;
|
|
833
|
+
}
|
|
834
|
+
function h(f, d) {
|
|
835
|
+
for (let p = 1; p <= 40; p++)
|
|
836
|
+
if (c(f, p) <= e.getCapacity(p, d, n.MIXED))
|
|
837
|
+
return p;
|
|
838
|
+
}
|
|
839
|
+
e.from = function(d, p) {
|
|
840
|
+
return s.isValid(d) ? parseInt(d, 10) : p;
|
|
841
|
+
}, e.getCapacity = function(d, p, g) {
|
|
842
|
+
if (!s.isValid(d))
|
|
843
|
+
throw new Error("Invalid QR Code version");
|
|
844
|
+
typeof g > "u" && (g = n.BYTE);
|
|
845
|
+
const A = t.getSymbolTotalCodewords(d), x = o.getTotalCodewordsCount(d, p), T = (A - x) * 8;
|
|
846
|
+
if (g === n.MIXED) return T;
|
|
847
|
+
const E = T - u(g, d);
|
|
848
|
+
switch (g) {
|
|
849
|
+
case n.NUMERIC:
|
|
850
|
+
return Math.floor(E / 10 * 3);
|
|
851
|
+
case n.ALPHANUMERIC:
|
|
852
|
+
return Math.floor(E / 11 * 2);
|
|
853
|
+
case n.KANJI:
|
|
854
|
+
return Math.floor(E / 13);
|
|
855
|
+
case n.BYTE:
|
|
856
|
+
default:
|
|
857
|
+
return Math.floor(E / 8);
|
|
858
|
+
}
|
|
859
|
+
}, e.getBestVersionForData = function(d, p) {
|
|
860
|
+
let g;
|
|
861
|
+
const A = i.from(p, i.M);
|
|
862
|
+
if (Array.isArray(d)) {
|
|
863
|
+
if (d.length > 1)
|
|
864
|
+
return h(d, A);
|
|
865
|
+
if (d.length === 0)
|
|
866
|
+
return 1;
|
|
867
|
+
g = d[0];
|
|
868
|
+
} else
|
|
869
|
+
g = d;
|
|
870
|
+
return l(g.mode, g.getLength(), A);
|
|
871
|
+
}, e.getEncodedBits = function(d) {
|
|
872
|
+
if (!s.isValid(d) || d < 7)
|
|
873
|
+
throw new Error("Invalid QR Code version");
|
|
874
|
+
let p = d << 12;
|
|
875
|
+
for (; t.getBCHDigit(p) - a >= 0; )
|
|
876
|
+
p ^= r << t.getBCHDigit(p) - a;
|
|
877
|
+
return d << 12 | p;
|
|
878
|
+
};
|
|
879
|
+
}(_t)), _t;
|
|
880
|
+
}
|
|
881
|
+
var bt = {}, de;
|
|
882
|
+
function nn() {
|
|
883
|
+
if (de) return bt;
|
|
884
|
+
de = 1;
|
|
885
|
+
const e = W(), t = 1335, o = 21522, i = e.getBCHDigit(t);
|
|
886
|
+
return bt.getEncodedBits = function(s, r) {
|
|
887
|
+
const a = s.bit << 3 | r;
|
|
888
|
+
let l = a << 10;
|
|
889
|
+
for (; e.getBCHDigit(l) - i >= 0; )
|
|
890
|
+
l ^= t << e.getBCHDigit(l) - i;
|
|
891
|
+
return (a << 10 | l) ^ o;
|
|
892
|
+
}, bt;
|
|
893
|
+
}
|
|
894
|
+
var Pt = {}, Et, he;
|
|
895
|
+
function sn() {
|
|
896
|
+
if (he) return Et;
|
|
897
|
+
he = 1;
|
|
898
|
+
const e = H();
|
|
899
|
+
function t(o) {
|
|
900
|
+
this.mode = e.NUMERIC, this.data = o.toString();
|
|
901
|
+
}
|
|
902
|
+
return t.getBitsLength = function(i) {
|
|
903
|
+
return 10 * Math.floor(i / 3) + (i % 3 ? i % 3 * 3 + 1 : 0);
|
|
904
|
+
}, t.prototype.getLength = function() {
|
|
905
|
+
return this.data.length;
|
|
906
|
+
}, t.prototype.getBitsLength = function() {
|
|
907
|
+
return t.getBitsLength(this.data.length);
|
|
908
|
+
}, t.prototype.write = function(i) {
|
|
909
|
+
let n, s, r;
|
|
910
|
+
for (n = 0; n + 3 <= this.data.length; n += 3)
|
|
911
|
+
s = this.data.substr(n, 3), r = parseInt(s, 10), i.put(r, 10);
|
|
912
|
+
const a = this.data.length - n;
|
|
913
|
+
a > 0 && (s = this.data.substr(n), r = parseInt(s, 10), i.put(r, a * 3 + 1));
|
|
914
|
+
}, Et = t, Et;
|
|
915
|
+
}
|
|
916
|
+
var St, fe;
|
|
917
|
+
function on() {
|
|
918
|
+
if (fe) return St;
|
|
919
|
+
fe = 1;
|
|
920
|
+
const e = H(), t = [
|
|
921
|
+
"0",
|
|
922
|
+
"1",
|
|
923
|
+
"2",
|
|
924
|
+
"3",
|
|
925
|
+
"4",
|
|
926
|
+
"5",
|
|
927
|
+
"6",
|
|
928
|
+
"7",
|
|
929
|
+
"8",
|
|
930
|
+
"9",
|
|
931
|
+
"A",
|
|
932
|
+
"B",
|
|
933
|
+
"C",
|
|
934
|
+
"D",
|
|
935
|
+
"E",
|
|
936
|
+
"F",
|
|
937
|
+
"G",
|
|
938
|
+
"H",
|
|
939
|
+
"I",
|
|
940
|
+
"J",
|
|
941
|
+
"K",
|
|
942
|
+
"L",
|
|
943
|
+
"M",
|
|
944
|
+
"N",
|
|
945
|
+
"O",
|
|
946
|
+
"P",
|
|
947
|
+
"Q",
|
|
948
|
+
"R",
|
|
949
|
+
"S",
|
|
950
|
+
"T",
|
|
951
|
+
"U",
|
|
952
|
+
"V",
|
|
953
|
+
"W",
|
|
954
|
+
"X",
|
|
955
|
+
"Y",
|
|
956
|
+
"Z",
|
|
957
|
+
" ",
|
|
958
|
+
"$",
|
|
959
|
+
"%",
|
|
960
|
+
"*",
|
|
961
|
+
"+",
|
|
962
|
+
"-",
|
|
963
|
+
".",
|
|
964
|
+
"/",
|
|
965
|
+
":"
|
|
966
|
+
];
|
|
967
|
+
function o(i) {
|
|
968
|
+
this.mode = e.ALPHANUMERIC, this.data = i;
|
|
969
|
+
}
|
|
970
|
+
return o.getBitsLength = function(n) {
|
|
971
|
+
return 11 * Math.floor(n / 2) + 6 * (n % 2);
|
|
972
|
+
}, o.prototype.getLength = function() {
|
|
973
|
+
return this.data.length;
|
|
974
|
+
}, o.prototype.getBitsLength = function() {
|
|
975
|
+
return o.getBitsLength(this.data.length);
|
|
976
|
+
}, o.prototype.write = function(n) {
|
|
977
|
+
let s;
|
|
978
|
+
for (s = 0; s + 2 <= this.data.length; s += 2) {
|
|
979
|
+
let r = t.indexOf(this.data[s]) * 45;
|
|
980
|
+
r += t.indexOf(this.data[s + 1]), n.put(r, 11);
|
|
981
|
+
}
|
|
982
|
+
this.data.length % 2 && n.put(t.indexOf(this.data[s]), 6);
|
|
983
|
+
}, St = o, St;
|
|
984
|
+
}
|
|
985
|
+
var kt, ge;
|
|
986
|
+
function rn() {
|
|
987
|
+
return ge || (ge = 1, kt = function(t) {
|
|
988
|
+
for (var o = [], i = t.length, n = 0; n < i; n++) {
|
|
989
|
+
var s = t.charCodeAt(n);
|
|
990
|
+
if (s >= 55296 && s <= 56319 && i > n + 1) {
|
|
991
|
+
var r = t.charCodeAt(n + 1);
|
|
992
|
+
r >= 56320 && r <= 57343 && (s = (s - 55296) * 1024 + r - 56320 + 65536, n += 1);
|
|
993
|
+
}
|
|
994
|
+
if (s < 128) {
|
|
995
|
+
o.push(s);
|
|
996
|
+
continue;
|
|
997
|
+
}
|
|
998
|
+
if (s < 2048) {
|
|
999
|
+
o.push(s >> 6 | 192), o.push(s & 63 | 128);
|
|
1000
|
+
continue;
|
|
1001
|
+
}
|
|
1002
|
+
if (s < 55296 || s >= 57344 && s < 65536) {
|
|
1003
|
+
o.push(s >> 12 | 224), o.push(s >> 6 & 63 | 128), o.push(s & 63 | 128);
|
|
1004
|
+
continue;
|
|
1005
|
+
}
|
|
1006
|
+
if (s >= 65536 && s <= 1114111) {
|
|
1007
|
+
o.push(s >> 18 | 240), o.push(s >> 12 & 63 | 128), o.push(s >> 6 & 63 | 128), o.push(s & 63 | 128);
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
o.push(239, 191, 189);
|
|
1011
|
+
}
|
|
1012
|
+
return new Uint8Array(o).buffer;
|
|
1013
|
+
}), kt;
|
|
1014
|
+
}
|
|
1015
|
+
var Tt, me;
|
|
1016
|
+
function an() {
|
|
1017
|
+
if (me) return Tt;
|
|
1018
|
+
me = 1;
|
|
1019
|
+
const e = rn(), t = H();
|
|
1020
|
+
function o(i) {
|
|
1021
|
+
this.mode = t.BYTE, typeof i == "string" && (i = e(i)), this.data = new Uint8Array(i);
|
|
1022
|
+
}
|
|
1023
|
+
return o.getBitsLength = function(n) {
|
|
1024
|
+
return n * 8;
|
|
1025
|
+
}, o.prototype.getLength = function() {
|
|
1026
|
+
return this.data.length;
|
|
1027
|
+
}, o.prototype.getBitsLength = function() {
|
|
1028
|
+
return o.getBitsLength(this.data.length);
|
|
1029
|
+
}, o.prototype.write = function(i) {
|
|
1030
|
+
for (let n = 0, s = this.data.length; n < s; n++)
|
|
1031
|
+
i.put(this.data[n], 8);
|
|
1032
|
+
}, Tt = o, Tt;
|
|
1033
|
+
}
|
|
1034
|
+
var Mt, pe;
|
|
1035
|
+
function ln() {
|
|
1036
|
+
if (pe) return Mt;
|
|
1037
|
+
pe = 1;
|
|
1038
|
+
const e = H(), t = W();
|
|
1039
|
+
function o(i) {
|
|
1040
|
+
this.mode = e.KANJI, this.data = i;
|
|
1041
|
+
}
|
|
1042
|
+
return o.getBitsLength = function(n) {
|
|
1043
|
+
return n * 13;
|
|
1044
|
+
}, o.prototype.getLength = function() {
|
|
1045
|
+
return this.data.length;
|
|
1046
|
+
}, o.prototype.getBitsLength = function() {
|
|
1047
|
+
return o.getBitsLength(this.data.length);
|
|
1048
|
+
}, o.prototype.write = function(i) {
|
|
1049
|
+
let n;
|
|
1050
|
+
for (n = 0; n < this.data.length; n++) {
|
|
1051
|
+
let s = t.toSJIS(this.data[n]);
|
|
1052
|
+
if (s >= 33088 && s <= 40956)
|
|
1053
|
+
s -= 33088;
|
|
1054
|
+
else if (s >= 57408 && s <= 60351)
|
|
1055
|
+
s -= 49472;
|
|
1056
|
+
else
|
|
1057
|
+
throw new Error(
|
|
1058
|
+
"Invalid SJIS character: " + this.data[n] + `
|
|
1059
|
+
Make sure your charset is UTF-8`
|
|
1060
|
+
);
|
|
1061
|
+
s = (s >>> 8 & 255) * 192 + (s & 255), i.put(s, 13);
|
|
1062
|
+
}
|
|
1063
|
+
}, Mt = o, Mt;
|
|
1064
|
+
}
|
|
1065
|
+
var It = { exports: {} }, we;
|
|
1066
|
+
function cn() {
|
|
1067
|
+
return we || (we = 1, function(e) {
|
|
1068
|
+
var t = {
|
|
1069
|
+
single_source_shortest_paths: function(o, i, n) {
|
|
1070
|
+
var s = {}, r = {};
|
|
1071
|
+
r[i] = 0;
|
|
1072
|
+
var a = t.PriorityQueue.make();
|
|
1073
|
+
a.push(i, 0);
|
|
1074
|
+
for (var l, u, c, h, f, d, p, g, A; !a.empty(); ) {
|
|
1075
|
+
l = a.pop(), u = l.value, h = l.cost, f = o[u] || {};
|
|
1076
|
+
for (c in f)
|
|
1077
|
+
f.hasOwnProperty(c) && (d = f[c], p = h + d, g = r[c], A = typeof r[c] > "u", (A || g > p) && (r[c] = p, a.push(c, p), s[c] = u));
|
|
1078
|
+
}
|
|
1079
|
+
if (typeof n < "u" && typeof r[n] > "u") {
|
|
1080
|
+
var x = ["Could not find a path from ", i, " to ", n, "."].join("");
|
|
1081
|
+
throw new Error(x);
|
|
1082
|
+
}
|
|
1083
|
+
return s;
|
|
1084
|
+
},
|
|
1085
|
+
extract_shortest_path_from_predecessor_list: function(o, i) {
|
|
1086
|
+
for (var n = [], s = i; s; )
|
|
1087
|
+
n.push(s), o[s], s = o[s];
|
|
1088
|
+
return n.reverse(), n;
|
|
1089
|
+
},
|
|
1090
|
+
find_path: function(o, i, n) {
|
|
1091
|
+
var s = t.single_source_shortest_paths(o, i, n);
|
|
1092
|
+
return t.extract_shortest_path_from_predecessor_list(
|
|
1093
|
+
s,
|
|
1094
|
+
n
|
|
1095
|
+
);
|
|
1096
|
+
},
|
|
1097
|
+
/**
|
|
1098
|
+
* A very naive priority queue implementation.
|
|
1099
|
+
*/
|
|
1100
|
+
PriorityQueue: {
|
|
1101
|
+
make: function(o) {
|
|
1102
|
+
var i = t.PriorityQueue, n = {}, s;
|
|
1103
|
+
o = o || {};
|
|
1104
|
+
for (s in i)
|
|
1105
|
+
i.hasOwnProperty(s) && (n[s] = i[s]);
|
|
1106
|
+
return n.queue = [], n.sorter = o.sorter || i.default_sorter, n;
|
|
1107
|
+
},
|
|
1108
|
+
default_sorter: function(o, i) {
|
|
1109
|
+
return o.cost - i.cost;
|
|
1110
|
+
},
|
|
1111
|
+
/**
|
|
1112
|
+
* Add a new item to the queue and ensure the highest priority element
|
|
1113
|
+
* is at the front of the queue.
|
|
1114
|
+
*/
|
|
1115
|
+
push: function(o, i) {
|
|
1116
|
+
var n = { value: o, cost: i };
|
|
1117
|
+
this.queue.push(n), this.queue.sort(this.sorter);
|
|
1118
|
+
},
|
|
1119
|
+
/**
|
|
1120
|
+
* Return the highest priority element in the queue.
|
|
1121
|
+
*/
|
|
1122
|
+
pop: function() {
|
|
1123
|
+
return this.queue.shift();
|
|
1124
|
+
},
|
|
1125
|
+
empty: function() {
|
|
1126
|
+
return this.queue.length === 0;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
e.exports = t;
|
|
1131
|
+
}(It)), It.exports;
|
|
1132
|
+
}
|
|
1133
|
+
var ye;
|
|
1134
|
+
function un() {
|
|
1135
|
+
return ye || (ye = 1, function(e) {
|
|
1136
|
+
const t = H(), o = sn(), i = on(), n = an(), s = ln(), r = Me(), a = W(), l = cn();
|
|
1137
|
+
function u(x) {
|
|
1138
|
+
return unescape(encodeURIComponent(x)).length;
|
|
1139
|
+
}
|
|
1140
|
+
function c(x, T, E) {
|
|
1141
|
+
const S = [];
|
|
1142
|
+
let F;
|
|
1143
|
+
for (; (F = x.exec(E)) !== null; )
|
|
1144
|
+
S.push({
|
|
1145
|
+
data: F[0],
|
|
1146
|
+
index: F.index,
|
|
1147
|
+
mode: T,
|
|
1148
|
+
length: F[0].length
|
|
1149
|
+
});
|
|
1150
|
+
return S;
|
|
1151
|
+
}
|
|
1152
|
+
function h(x) {
|
|
1153
|
+
const T = c(r.NUMERIC, t.NUMERIC, x), E = c(r.ALPHANUMERIC, t.ALPHANUMERIC, x);
|
|
1154
|
+
let S, F;
|
|
1155
|
+
return a.isKanjiModeEnabled() ? (S = c(r.BYTE, t.BYTE, x), F = c(r.KANJI, t.KANJI, x)) : (S = c(r.BYTE_KANJI, t.BYTE, x), F = []), T.concat(E, S, F).sort(function(b, C) {
|
|
1156
|
+
return b.index - C.index;
|
|
1157
|
+
}).map(function(b) {
|
|
1158
|
+
return {
|
|
1159
|
+
data: b.data,
|
|
1160
|
+
mode: b.mode,
|
|
1161
|
+
length: b.length
|
|
1162
|
+
};
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
function f(x, T) {
|
|
1166
|
+
switch (T) {
|
|
1167
|
+
case t.NUMERIC:
|
|
1168
|
+
return o.getBitsLength(x);
|
|
1169
|
+
case t.ALPHANUMERIC:
|
|
1170
|
+
return i.getBitsLength(x);
|
|
1171
|
+
case t.KANJI:
|
|
1172
|
+
return s.getBitsLength(x);
|
|
1173
|
+
case t.BYTE:
|
|
1174
|
+
return n.getBitsLength(x);
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
function d(x) {
|
|
1178
|
+
return x.reduce(function(T, E) {
|
|
1179
|
+
const S = T.length - 1 >= 0 ? T[T.length - 1] : null;
|
|
1180
|
+
return S && S.mode === E.mode ? (T[T.length - 1].data += E.data, T) : (T.push(E), T);
|
|
1181
|
+
}, []);
|
|
1182
|
+
}
|
|
1183
|
+
function p(x) {
|
|
1184
|
+
const T = [];
|
|
1185
|
+
for (let E = 0; E < x.length; E++) {
|
|
1186
|
+
const S = x[E];
|
|
1187
|
+
switch (S.mode) {
|
|
1188
|
+
case t.NUMERIC:
|
|
1189
|
+
T.push([
|
|
1190
|
+
S,
|
|
1191
|
+
{ data: S.data, mode: t.ALPHANUMERIC, length: S.length },
|
|
1192
|
+
{ data: S.data, mode: t.BYTE, length: S.length }
|
|
1193
|
+
]);
|
|
1194
|
+
break;
|
|
1195
|
+
case t.ALPHANUMERIC:
|
|
1196
|
+
T.push([
|
|
1197
|
+
S,
|
|
1198
|
+
{ data: S.data, mode: t.BYTE, length: S.length }
|
|
1199
|
+
]);
|
|
1200
|
+
break;
|
|
1201
|
+
case t.KANJI:
|
|
1202
|
+
T.push([
|
|
1203
|
+
S,
|
|
1204
|
+
{ data: S.data, mode: t.BYTE, length: u(S.data) }
|
|
1205
|
+
]);
|
|
1206
|
+
break;
|
|
1207
|
+
case t.BYTE:
|
|
1208
|
+
T.push([
|
|
1209
|
+
{ data: S.data, mode: t.BYTE, length: u(S.data) }
|
|
1210
|
+
]);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
return T;
|
|
1214
|
+
}
|
|
1215
|
+
function g(x, T) {
|
|
1216
|
+
const E = {}, S = { start: {} };
|
|
1217
|
+
let F = ["start"];
|
|
1218
|
+
for (let w = 0; w < x.length; w++) {
|
|
1219
|
+
const b = x[w], C = [];
|
|
1220
|
+
for (let m = 0; m < b.length; m++) {
|
|
1221
|
+
const k = b[m], v = "" + w + m;
|
|
1222
|
+
C.push(v), E[v] = { node: k, lastCount: 0 }, S[v] = {};
|
|
1223
|
+
for (let P = 0; P < F.length; P++) {
|
|
1224
|
+
const _ = F[P];
|
|
1225
|
+
E[_] && E[_].node.mode === k.mode ? (S[_][v] = f(E[_].lastCount + k.length, k.mode) - f(E[_].lastCount, k.mode), E[_].lastCount += k.length) : (E[_] && (E[_].lastCount = k.length), S[_][v] = f(k.length, k.mode) + 4 + t.getCharCountIndicator(k.mode, T));
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
F = C;
|
|
1229
|
+
}
|
|
1230
|
+
for (let w = 0; w < F.length; w++)
|
|
1231
|
+
S[F[w]].end = 0;
|
|
1232
|
+
return { map: S, table: E };
|
|
1233
|
+
}
|
|
1234
|
+
function A(x, T) {
|
|
1235
|
+
let E;
|
|
1236
|
+
const S = t.getBestModeForData(x);
|
|
1237
|
+
if (E = t.from(T, S), E !== t.BYTE && E.bit < S.bit)
|
|
1238
|
+
throw new Error('"' + x + '" cannot be encoded with mode ' + t.toString(E) + `.
|
|
1239
|
+
Suggested mode is: ` + t.toString(S));
|
|
1240
|
+
switch (E === t.KANJI && !a.isKanjiModeEnabled() && (E = t.BYTE), E) {
|
|
1241
|
+
case t.NUMERIC:
|
|
1242
|
+
return new o(x);
|
|
1243
|
+
case t.ALPHANUMERIC:
|
|
1244
|
+
return new i(x);
|
|
1245
|
+
case t.KANJI:
|
|
1246
|
+
return new s(x);
|
|
1247
|
+
case t.BYTE:
|
|
1248
|
+
return new n(x);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
e.fromArray = function(T) {
|
|
1252
|
+
return T.reduce(function(E, S) {
|
|
1253
|
+
return typeof S == "string" ? E.push(A(S, null)) : S.data && E.push(A(S.data, S.mode)), E;
|
|
1254
|
+
}, []);
|
|
1255
|
+
}, e.fromString = function(T, E) {
|
|
1256
|
+
const S = h(T, a.isKanjiModeEnabled()), F = p(S), w = g(F, E), b = l.find_path(w.map, "start", "end"), C = [];
|
|
1257
|
+
for (let m = 1; m < b.length - 1; m++)
|
|
1258
|
+
C.push(w.table[b[m]].node);
|
|
1259
|
+
return e.fromArray(d(C));
|
|
1260
|
+
}, e.rawSplit = function(T) {
|
|
1261
|
+
return e.fromArray(
|
|
1262
|
+
h(T, a.isKanjiModeEnabled())
|
|
1263
|
+
);
|
|
1264
|
+
};
|
|
1265
|
+
}(Pt)), Pt;
|
|
1266
|
+
}
|
|
1267
|
+
var ve;
|
|
1268
|
+
function dn() {
|
|
1269
|
+
if (ve) return dt;
|
|
1270
|
+
ve = 1;
|
|
1271
|
+
const e = W(), t = qt(), o = Ye(), i = Ge(), n = Ke(), s = Je(), r = Xe(), a = ke(), l = tn(), u = en(), c = nn(), h = H(), f = un();
|
|
1272
|
+
function d(w, b) {
|
|
1273
|
+
const C = w.size, m = s.getPositions(b);
|
|
1274
|
+
for (let k = 0; k < m.length; k++) {
|
|
1275
|
+
const v = m[k][0], P = m[k][1];
|
|
1276
|
+
for (let _ = -1; _ <= 7; _++)
|
|
1277
|
+
if (!(v + _ <= -1 || C <= v + _))
|
|
1278
|
+
for (let M = -1; M <= 7; M++)
|
|
1279
|
+
P + M <= -1 || C <= P + M || (_ >= 0 && _ <= 6 && (M === 0 || M === 6) || M >= 0 && M <= 6 && (_ === 0 || _ === 6) || _ >= 2 && _ <= 4 && M >= 2 && M <= 4 ? w.set(v + _, P + M, !0, !0) : w.set(v + _, P + M, !1, !0));
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
function p(w) {
|
|
1283
|
+
const b = w.size;
|
|
1284
|
+
for (let C = 8; C < b - 8; C++) {
|
|
1285
|
+
const m = C % 2 === 0;
|
|
1286
|
+
w.set(C, 6, m, !0), w.set(6, C, m, !0);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
function g(w, b) {
|
|
1290
|
+
const C = n.getPositions(b);
|
|
1291
|
+
for (let m = 0; m < C.length; m++) {
|
|
1292
|
+
const k = C[m][0], v = C[m][1];
|
|
1293
|
+
for (let P = -2; P <= 2; P++)
|
|
1294
|
+
for (let _ = -2; _ <= 2; _++)
|
|
1295
|
+
P === -2 || P === 2 || _ === -2 || _ === 2 || P === 0 && _ === 0 ? w.set(k + P, v + _, !0, !0) : w.set(k + P, v + _, !1, !0);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
function A(w, b) {
|
|
1299
|
+
const C = w.size, m = u.getEncodedBits(b);
|
|
1300
|
+
let k, v, P;
|
|
1301
|
+
for (let _ = 0; _ < 18; _++)
|
|
1302
|
+
k = Math.floor(_ / 3), v = _ % 3 + C - 8 - 3, P = (m >> _ & 1) === 1, w.set(k, v, P, !0), w.set(v, k, P, !0);
|
|
1303
|
+
}
|
|
1304
|
+
function x(w, b, C) {
|
|
1305
|
+
const m = w.size, k = c.getEncodedBits(b, C);
|
|
1306
|
+
let v, P;
|
|
1307
|
+
for (v = 0; v < 15; v++)
|
|
1308
|
+
P = (k >> v & 1) === 1, v < 6 ? w.set(v, 8, P, !0) : v < 8 ? w.set(v + 1, 8, P, !0) : w.set(m - 15 + v, 8, P, !0), v < 8 ? w.set(8, m - v - 1, P, !0) : v < 9 ? w.set(8, 15 - v - 1 + 1, P, !0) : w.set(8, 15 - v - 1, P, !0);
|
|
1309
|
+
w.set(m - 8, 8, 1, !0);
|
|
1310
|
+
}
|
|
1311
|
+
function T(w, b) {
|
|
1312
|
+
const C = w.size;
|
|
1313
|
+
let m = -1, k = C - 1, v = 7, P = 0;
|
|
1314
|
+
for (let _ = C - 1; _ > 0; _ -= 2)
|
|
1315
|
+
for (_ === 6 && _--; ; ) {
|
|
1316
|
+
for (let M = 0; M < 2; M++)
|
|
1317
|
+
if (!w.isReserved(k, _ - M)) {
|
|
1318
|
+
let j = !1;
|
|
1319
|
+
P < b.length && (j = (b[P] >>> v & 1) === 1), w.set(k, _ - M, j), v--, v === -1 && (P++, v = 7);
|
|
1320
|
+
}
|
|
1321
|
+
if (k += m, k < 0 || C <= k) {
|
|
1322
|
+
k -= m, m = -m;
|
|
1323
|
+
break;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
function E(w, b, C) {
|
|
1328
|
+
const m = new o();
|
|
1329
|
+
C.forEach(function(M) {
|
|
1330
|
+
m.put(M.mode.bit, 4), m.put(M.getLength(), h.getCharCountIndicator(M.mode, w)), M.write(m);
|
|
1331
|
+
});
|
|
1332
|
+
const k = e.getSymbolTotalCodewords(w), v = a.getTotalCodewordsCount(w, b), P = (k - v) * 8;
|
|
1333
|
+
for (m.getLengthInBits() + 4 <= P && m.put(0, 4); m.getLengthInBits() % 8 !== 0; )
|
|
1334
|
+
m.putBit(0);
|
|
1335
|
+
const _ = (P - m.getLengthInBits()) / 8;
|
|
1336
|
+
for (let M = 0; M < _; M++)
|
|
1337
|
+
m.put(M % 2 ? 17 : 236, 8);
|
|
1338
|
+
return S(m, w, b);
|
|
1339
|
+
}
|
|
1340
|
+
function S(w, b, C) {
|
|
1341
|
+
const m = e.getSymbolTotalCodewords(b), k = a.getTotalCodewordsCount(b, C), v = m - k, P = a.getBlocksCount(b, C), _ = m % P, M = P - _, j = Math.floor(m / P), J = Math.floor(v / P), Ae = J + 1, zt = j - J, Be = new l(zt);
|
|
1342
|
+
let st = 0;
|
|
1343
|
+
const et = new Array(P), jt = new Array(P);
|
|
1344
|
+
let ot = 0;
|
|
1345
|
+
const De = new Uint8Array(w.buffer);
|
|
1346
|
+
for (let Y = 0; Y < P; Y++) {
|
|
1347
|
+
const at = Y < M ? J : Ae;
|
|
1348
|
+
et[Y] = De.slice(st, st + at), jt[Y] = Be.encode(et[Y]), st += at, ot = Math.max(ot, at);
|
|
1349
|
+
}
|
|
1350
|
+
const rt = new Uint8Array(m);
|
|
1351
|
+
let Vt = 0, q, O;
|
|
1352
|
+
for (q = 0; q < ot; q++)
|
|
1353
|
+
for (O = 0; O < P; O++)
|
|
1354
|
+
q < et[O].length && (rt[Vt++] = et[O][q]);
|
|
1355
|
+
for (q = 0; q < zt; q++)
|
|
1356
|
+
for (O = 0; O < P; O++)
|
|
1357
|
+
rt[Vt++] = jt[O][q];
|
|
1358
|
+
return rt;
|
|
1359
|
+
}
|
|
1360
|
+
function F(w, b, C, m) {
|
|
1361
|
+
let k;
|
|
1362
|
+
if (Array.isArray(w))
|
|
1363
|
+
k = f.fromArray(w);
|
|
1364
|
+
else if (typeof w == "string") {
|
|
1365
|
+
let j = b;
|
|
1366
|
+
if (!j) {
|
|
1367
|
+
const J = f.rawSplit(w);
|
|
1368
|
+
j = u.getBestVersionForData(J, C);
|
|
1369
|
+
}
|
|
1370
|
+
k = f.fromString(w, j || 40);
|
|
1371
|
+
} else
|
|
1372
|
+
throw new Error("Invalid data");
|
|
1373
|
+
const v = u.getBestVersionForData(k, C);
|
|
1374
|
+
if (!v)
|
|
1375
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
1376
|
+
if (!b)
|
|
1377
|
+
b = v;
|
|
1378
|
+
else if (b < v)
|
|
1379
|
+
throw new Error(
|
|
1380
|
+
`
|
|
1381
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
1382
|
+
Minimum version required to store current data is: ` + v + `.
|
|
1383
|
+
`
|
|
1384
|
+
);
|
|
1385
|
+
const P = E(b, C, k), _ = e.getSymbolSize(b), M = new i(_);
|
|
1386
|
+
return d(M, b), p(M), g(M, b), x(M, C, 0), b >= 7 && A(M, b), T(M, P), isNaN(m) && (m = r.getBestMask(
|
|
1387
|
+
M,
|
|
1388
|
+
x.bind(null, M, C)
|
|
1389
|
+
)), r.applyMask(m, M), x(M, C, m), {
|
|
1390
|
+
modules: M,
|
|
1391
|
+
version: b,
|
|
1392
|
+
errorCorrectionLevel: C,
|
|
1393
|
+
maskPattern: m,
|
|
1394
|
+
segments: k
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
return dt.create = function(b, C) {
|
|
1398
|
+
if (typeof b > "u" || b === "")
|
|
1399
|
+
throw new Error("No input text");
|
|
1400
|
+
let m = t.M, k, v;
|
|
1401
|
+
return typeof C < "u" && (m = t.from(C.errorCorrectionLevel, t.M), k = u.from(C.version), v = r.from(C.maskPattern), C.toSJISFunc && e.setToSJISFunction(C.toSJISFunc)), F(b, k, m, v);
|
|
1402
|
+
}, dt;
|
|
1403
|
+
}
|
|
1404
|
+
var At = {}, Bt = {}, _e;
|
|
1405
|
+
function Ie() {
|
|
1406
|
+
return _e || (_e = 1, function(e) {
|
|
1407
|
+
function t(o) {
|
|
1408
|
+
if (typeof o == "number" && (o = o.toString()), typeof o != "string")
|
|
1409
|
+
throw new Error("Color should be defined as hex string");
|
|
1410
|
+
let i = o.slice().replace("#", "").split("");
|
|
1411
|
+
if (i.length < 3 || i.length === 5 || i.length > 8)
|
|
1412
|
+
throw new Error("Invalid hex color: " + o);
|
|
1413
|
+
(i.length === 3 || i.length === 4) && (i = Array.prototype.concat.apply([], i.map(function(s) {
|
|
1414
|
+
return [s, s];
|
|
1415
|
+
}))), i.length === 6 && i.push("F", "F");
|
|
1416
|
+
const n = parseInt(i.join(""), 16);
|
|
1417
|
+
return {
|
|
1418
|
+
r: n >> 24 & 255,
|
|
1419
|
+
g: n >> 16 & 255,
|
|
1420
|
+
b: n >> 8 & 255,
|
|
1421
|
+
a: n & 255,
|
|
1422
|
+
hex: "#" + i.slice(0, 6).join("")
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
e.getOptions = function(i) {
|
|
1426
|
+
i || (i = {}), i.color || (i.color = {});
|
|
1427
|
+
const n = typeof i.margin > "u" || i.margin === null || i.margin < 0 ? 4 : i.margin, s = i.width && i.width >= 21 ? i.width : void 0, r = i.scale || 4;
|
|
1428
|
+
return {
|
|
1429
|
+
width: s,
|
|
1430
|
+
scale: s ? 4 : r,
|
|
1431
|
+
margin: n,
|
|
1432
|
+
color: {
|
|
1433
|
+
dark: t(i.color.dark || "#000000ff"),
|
|
1434
|
+
light: t(i.color.light || "#ffffffff")
|
|
1435
|
+
},
|
|
1436
|
+
type: i.type,
|
|
1437
|
+
rendererOpts: i.rendererOpts || {}
|
|
1438
|
+
};
|
|
1439
|
+
}, e.getScale = function(i, n) {
|
|
1440
|
+
return n.width && n.width >= i + n.margin * 2 ? n.width / (i + n.margin * 2) : n.scale;
|
|
1441
|
+
}, e.getImageWidth = function(i, n) {
|
|
1442
|
+
const s = e.getScale(i, n);
|
|
1443
|
+
return Math.floor((i + n.margin * 2) * s);
|
|
1444
|
+
}, e.qrToImageData = function(i, n, s) {
|
|
1445
|
+
const r = n.modules.size, a = n.modules.data, l = e.getScale(r, s), u = Math.floor((r + s.margin * 2) * l), c = s.margin * l, h = [s.color.light, s.color.dark];
|
|
1446
|
+
for (let f = 0; f < u; f++)
|
|
1447
|
+
for (let d = 0; d < u; d++) {
|
|
1448
|
+
let p = (f * u + d) * 4, g = s.color.light;
|
|
1449
|
+
if (f >= c && d >= c && f < u - c && d < u - c) {
|
|
1450
|
+
const A = Math.floor((f - c) / l), x = Math.floor((d - c) / l);
|
|
1451
|
+
g = h[a[A * r + x] ? 1 : 0];
|
|
1452
|
+
}
|
|
1453
|
+
i[p++] = g.r, i[p++] = g.g, i[p++] = g.b, i[p] = g.a;
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
}(Bt)), Bt;
|
|
1457
|
+
}
|
|
1458
|
+
var Ce;
|
|
1459
|
+
function hn() {
|
|
1460
|
+
return Ce || (Ce = 1, function(e) {
|
|
1461
|
+
const t = Ie();
|
|
1462
|
+
function o(n, s, r) {
|
|
1463
|
+
n.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height = r, s.width = r, s.style.height = r + "px", s.style.width = r + "px";
|
|
1464
|
+
}
|
|
1465
|
+
function i() {
|
|
1466
|
+
try {
|
|
1467
|
+
return document.createElement("canvas");
|
|
1468
|
+
} catch {
|
|
1469
|
+
throw new Error("You need to specify a canvas element");
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
e.render = function(s, r, a) {
|
|
1473
|
+
let l = a, u = r;
|
|
1474
|
+
typeof l > "u" && (!r || !r.getContext) && (l = r, r = void 0), r || (u = i()), l = t.getOptions(l);
|
|
1475
|
+
const c = t.getImageWidth(s.modules.size, l), h = u.getContext("2d"), f = h.createImageData(c, c);
|
|
1476
|
+
return t.qrToImageData(f.data, s, l), o(h, u, c), h.putImageData(f, 0, 0), u;
|
|
1477
|
+
}, e.renderToDataURL = function(s, r, a) {
|
|
1478
|
+
let l = a;
|
|
1479
|
+
typeof l > "u" && (!r || !r.getContext) && (l = r, r = void 0), l || (l = {});
|
|
1480
|
+
const u = e.render(s, r, l), c = l.type || "image/png", h = l.rendererOpts || {};
|
|
1481
|
+
return u.toDataURL(c, h.quality);
|
|
1482
|
+
};
|
|
1483
|
+
}(At)), At;
|
|
1484
|
+
}
|
|
1485
|
+
var Dt = {}, xe;
|
|
1486
|
+
function fn() {
|
|
1487
|
+
if (xe) return Dt;
|
|
1488
|
+
xe = 1;
|
|
1489
|
+
const e = Ie();
|
|
1490
|
+
function t(n, s) {
|
|
1491
|
+
const r = n.a / 255, a = s + '="' + n.hex + '"';
|
|
1492
|
+
return r < 1 ? a + " " + s + '-opacity="' + r.toFixed(2).slice(1) + '"' : a;
|
|
1493
|
+
}
|
|
1494
|
+
function o(n, s, r) {
|
|
1495
|
+
let a = n + s;
|
|
1496
|
+
return typeof r < "u" && (a += " " + r), a;
|
|
1497
|
+
}
|
|
1498
|
+
function i(n, s, r) {
|
|
1499
|
+
let a = "", l = 0, u = !1, c = 0;
|
|
1500
|
+
for (let h = 0; h < n.length; h++) {
|
|
1501
|
+
const f = Math.floor(h % s), d = Math.floor(h / s);
|
|
1502
|
+
!f && !u && (u = !0), n[h] ? (c++, h > 0 && f > 0 && n[h - 1] || (a += u ? o("M", f + r, 0.5 + d + r) : o("m", l, 0), l = 0, u = !1), f + 1 < s && n[h + 1] || (a += o("h", c), c = 0)) : l++;
|
|
1503
|
+
}
|
|
1504
|
+
return a;
|
|
1505
|
+
}
|
|
1506
|
+
return Dt.render = function(s, r, a) {
|
|
1507
|
+
const l = e.getOptions(r), u = s.modules.size, c = s.modules.data, h = u + l.margin * 2, f = l.color.light.a ? "<path " + t(l.color.light, "fill") + ' d="M0 0h' + h + "v" + h + 'H0z"/>' : "", d = "<path " + t(l.color.dark, "stroke") + ' d="' + i(c, u, l.margin) + '"/>', p = 'viewBox="0 0 ' + h + " " + h + '"', A = '<svg xmlns="http://www.w3.org/2000/svg" ' + (l.width ? 'width="' + l.width + '" height="' + l.width + '" ' : "") + p + ' shape-rendering="crispEdges">' + f + d + `</svg>
|
|
1508
|
+
`;
|
|
1509
|
+
return typeof a == "function" && a(null, A), A;
|
|
1510
|
+
}, Dt;
|
|
1511
|
+
}
|
|
1512
|
+
var be;
|
|
1513
|
+
function gn() {
|
|
1514
|
+
if (be) return G;
|
|
1515
|
+
be = 1;
|
|
1516
|
+
const e = He(), t = dn(), o = hn(), i = fn();
|
|
1517
|
+
function n(s, r, a, l, u) {
|
|
1518
|
+
const c = [].slice.call(arguments, 1), h = c.length, f = typeof c[h - 1] == "function";
|
|
1519
|
+
if (!f && !e())
|
|
1520
|
+
throw new Error("Callback required as last argument");
|
|
1521
|
+
if (f) {
|
|
1522
|
+
if (h < 2)
|
|
1523
|
+
throw new Error("Too few arguments provided");
|
|
1524
|
+
h === 2 ? (u = a, a = r, r = l = void 0) : h === 3 && (r.getContext && typeof u > "u" ? (u = l, l = void 0) : (u = l, l = a, a = r, r = void 0));
|
|
1525
|
+
} else {
|
|
1526
|
+
if (h < 1)
|
|
1527
|
+
throw new Error("Too few arguments provided");
|
|
1528
|
+
return h === 1 ? (a = r, r = l = void 0) : h === 2 && !r.getContext && (l = a, a = r, r = void 0), new Promise(function(d, p) {
|
|
1529
|
+
try {
|
|
1530
|
+
const g = t.create(a, l);
|
|
1531
|
+
d(s(g, r, l));
|
|
1532
|
+
} catch (g) {
|
|
1533
|
+
p(g);
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
try {
|
|
1538
|
+
const d = t.create(a, l);
|
|
1539
|
+
u(null, s(d, r, l));
|
|
1540
|
+
} catch (d) {
|
|
1541
|
+
u(d);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
return G.create = t.create, G.toCanvas = n.bind(null, o.render), G.toDataURL = n.bind(null, o.renderToDataURL), G.toString = n.bind(null, function(s, r, a) {
|
|
1545
|
+
return i.render(s, a);
|
|
1546
|
+
}), G;
|
|
1547
|
+
}
|
|
1548
|
+
var Rt = gn();
|
|
1549
|
+
/*! vue-qrcode v2.0.0 | (c) 2018-present Chen Fengyuan | MIT */
|
|
1550
|
+
const Pe = "ready";
|
|
1551
|
+
var mn = Re({
|
|
1552
|
+
name: "VueQrcode",
|
|
1553
|
+
props: {
|
|
1554
|
+
/**
|
|
1555
|
+
* The value of the QR code.
|
|
1556
|
+
*/
|
|
1557
|
+
value: {
|
|
1558
|
+
type: String,
|
|
1559
|
+
default: void 0
|
|
1560
|
+
},
|
|
1561
|
+
/**
|
|
1562
|
+
* The options for the QR code generator.
|
|
1563
|
+
* {@link https://github.com/soldair/node-qrcode#qr-code-options}
|
|
1564
|
+
*/
|
|
1565
|
+
options: {
|
|
1566
|
+
type: Object,
|
|
1567
|
+
default: void 0
|
|
1568
|
+
},
|
|
1569
|
+
/**
|
|
1570
|
+
* The tag name of the component's root element.
|
|
1571
|
+
*/
|
|
1572
|
+
tag: {
|
|
1573
|
+
type: String,
|
|
1574
|
+
default: "canvas"
|
|
1575
|
+
}
|
|
1576
|
+
},
|
|
1577
|
+
emits: [Pe],
|
|
1578
|
+
watch: {
|
|
1579
|
+
$props: {
|
|
1580
|
+
deep: !0,
|
|
1581
|
+
immediate: !0,
|
|
1582
|
+
/**
|
|
1583
|
+
* Update the QR code when props changed.
|
|
1584
|
+
*/
|
|
1585
|
+
handler() {
|
|
1586
|
+
this.$el && this.generate();
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
mounted() {
|
|
1591
|
+
this.generate();
|
|
1592
|
+
},
|
|
1593
|
+
methods: {
|
|
1594
|
+
/**
|
|
1595
|
+
* Generate QR code.
|
|
1596
|
+
*/
|
|
1597
|
+
generate() {
|
|
1598
|
+
const e = this.options || {}, t = String(this.value), o = () => {
|
|
1599
|
+
this.$emit(Pe, this.$el);
|
|
1600
|
+
};
|
|
1601
|
+
switch (this.tag) {
|
|
1602
|
+
case "canvas":
|
|
1603
|
+
Rt.toCanvas(this.$el, t, e, (i) => {
|
|
1604
|
+
if (i)
|
|
1605
|
+
throw i;
|
|
1606
|
+
o();
|
|
1607
|
+
});
|
|
1608
|
+
break;
|
|
1609
|
+
case "img":
|
|
1610
|
+
Rt.toDataURL(t, e, (i, n) => {
|
|
1611
|
+
if (i)
|
|
1612
|
+
throw i;
|
|
1613
|
+
this.$el.src = n, this.$el.onload = o;
|
|
1614
|
+
});
|
|
1615
|
+
break;
|
|
1616
|
+
case "svg":
|
|
1617
|
+
Rt.toString(t, e, (i, n) => {
|
|
1618
|
+
if (i)
|
|
1619
|
+
throw i;
|
|
1620
|
+
const s = document.createElement("div");
|
|
1621
|
+
s.innerHTML = n;
|
|
1622
|
+
const r = s.querySelector("svg");
|
|
1623
|
+
if (r) {
|
|
1624
|
+
const { attributes: a, childNodes: l } = r;
|
|
1625
|
+
Object.keys(a).forEach((u) => {
|
|
1626
|
+
const c = a[Number(u)];
|
|
1627
|
+
this.$el.setAttribute(c.name, c.value);
|
|
1628
|
+
}), Object.keys(l).forEach((u) => {
|
|
1629
|
+
const c = l[Number(u)];
|
|
1630
|
+
this.$el.appendChild(c.cloneNode(!0));
|
|
1631
|
+
}), o();
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
break;
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
render() {
|
|
1639
|
+
return $t(this.tag, this.$slots.default);
|
|
1640
|
+
}
|
|
1641
|
+
});
|
|
1642
|
+
class pn {
|
|
1643
|
+
constructor() {
|
|
1644
|
+
this._activePolls = {}, this._pollingInterval = 1e3;
|
|
1645
|
+
}
|
|
1646
|
+
_startPolling(t) {
|
|
1647
|
+
const { handler: o, interval: i } = this._activePolls[t], n = async () => {
|
|
1648
|
+
var s;
|
|
1649
|
+
await o(), (s = this._activePolls[t]) != null && s.pollActive && setTimeout(n, i || this._pollingInterval);
|
|
1650
|
+
};
|
|
1651
|
+
n();
|
|
1652
|
+
}
|
|
1653
|
+
/**
|
|
1654
|
+
* Add a new poll to the active polls list.
|
|
1655
|
+
* @param {string} options.id - Unique identifier for the poll.
|
|
1656
|
+
* @param {function} options.handler - Function to be executed when the poll is activated.
|
|
1657
|
+
* @param {number} options.interval - Time interval in milliseconds at which the poll should run.
|
|
1658
|
+
* @param {number} [options.removeAfterMs=0] - Optional. Time in milliseconds after which the poll should be automatically removed.
|
|
1659
|
+
* @param {boolean} [options.startImmediately=true] - Optional. If true, the poll will start immediately after being added.
|
|
1660
|
+
* @param {*} [options.data] - Optional. Additional data associated with the poll.
|
|
1661
|
+
* @returns {function} - A function that can be used to manually remove the poll from the active polls list.
|
|
1662
|
+
*/
|
|
1663
|
+
addPoll({
|
|
1664
|
+
id: t,
|
|
1665
|
+
handler: o,
|
|
1666
|
+
interval: i,
|
|
1667
|
+
removeAfterMs: n = 0,
|
|
1668
|
+
startImmediately: s = !0,
|
|
1669
|
+
data: r
|
|
1670
|
+
}) {
|
|
1671
|
+
if (!t || typeof o != "function")
|
|
1672
|
+
throw new Error("Invalid poll definition");
|
|
1673
|
+
if (this._activePolls[t])
|
|
1674
|
+
throw new Error("Poll with the same ID already exists");
|
|
1675
|
+
return this._activePolls[t] = { handler: o, interval: i, pollActive: !1, data: r }, s && setTimeout(() => {
|
|
1676
|
+
this.activatePoll(t);
|
|
1677
|
+
}, 0), n && setTimeout(() => {
|
|
1678
|
+
this._activePolls[t] && this.removePoll(t);
|
|
1679
|
+
}, n), () => this.removePoll(t);
|
|
1680
|
+
}
|
|
1681
|
+
activatePoll(t) {
|
|
1682
|
+
if (!this._activePolls[t])
|
|
1683
|
+
throw new Error("Poll not found");
|
|
1684
|
+
this._activePolls[t].pollActive || (this._activePolls[t].pollActive = !0, this._startPolling(t));
|
|
1685
|
+
}
|
|
1686
|
+
deactivatePoll(t) {
|
|
1687
|
+
if (!this._activePolls[t]) {
|
|
1688
|
+
console.warn("[deactivatePoll] Poll not found");
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
this._activePolls[t].pollActive = !1;
|
|
1692
|
+
}
|
|
1693
|
+
removePoll(t) {
|
|
1694
|
+
if (!this._activePolls[t]) {
|
|
1695
|
+
console.warn("[removePoll] Poll not found");
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
delete this._activePolls[t];
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
let Ft = null;
|
|
1702
|
+
function Ee() {
|
|
1703
|
+
return Ft || (Ft = new pn()), Ft;
|
|
1704
|
+
}
|
|
1705
|
+
function wn(e) {
|
|
1706
|
+
window.history.replaceState(window.history.state, "", window.location.href);
|
|
1707
|
+
let t = "";
|
|
1708
|
+
const o = (navigator == null ? void 0 : navigator.userAgent) || "";
|
|
1709
|
+
return o.match("CriOS") ? t = "googlechromes://" : o.match("FxiOS") ? t = "firefox://" : o.match("EdgiOS") ? t = "microsoft-edge-https://" : o.match("GSA") && (t = "googleapp://open-url?url="), t + encodeURIComponent(`${window.location.href}#${e}`);
|
|
1710
|
+
}
|
|
1711
|
+
const yn = {
|
|
1712
|
+
name: "BankIdAnswer",
|
|
1713
|
+
components: {
|
|
1714
|
+
QrCode: mn
|
|
1715
|
+
},
|
|
1716
|
+
emits: ["loading", "error", "complete"],
|
|
1717
|
+
mixins: [Z([])],
|
|
1718
|
+
props: {
|
|
1719
|
+
onCompleteFunc: {
|
|
1720
|
+
type: Function,
|
|
1721
|
+
default: null
|
|
1722
|
+
}
|
|
1723
|
+
},
|
|
1724
|
+
data() {
|
|
1725
|
+
return {
|
|
1726
|
+
signAnswerId: null,
|
|
1727
|
+
view: "form",
|
|
1728
|
+
errorMessage: "",
|
|
1729
|
+
isLoading: !1,
|
|
1730
|
+
qrCode: null,
|
|
1731
|
+
autoStartToken: null,
|
|
1732
|
+
isMobile: !1
|
|
1733
|
+
};
|
|
1734
|
+
},
|
|
1735
|
+
computed: {
|
|
1736
|
+
viewText() {
|
|
1737
|
+
const e = (t) => this._document.$t(`answerModal.bankId.component.viewText.${t}`);
|
|
1738
|
+
return {
|
|
1739
|
+
new: {
|
|
1740
|
+
title: e("new.title"),
|
|
1741
|
+
text: e("new.text"),
|
|
1742
|
+
spinnerText: e("new.spinnerText")
|
|
1743
|
+
},
|
|
1744
|
+
waiting: {
|
|
1745
|
+
title: e("waiting.title"),
|
|
1746
|
+
text: e("waiting.text"),
|
|
1747
|
+
spinnerText: e("waiting.spinnerText")
|
|
1748
|
+
},
|
|
1749
|
+
started: {
|
|
1750
|
+
title: e("waiting.title"),
|
|
1751
|
+
text: e("waiting.text"),
|
|
1752
|
+
spinnerText: e("waiting.spinnerText")
|
|
1753
|
+
},
|
|
1754
|
+
signing: {
|
|
1755
|
+
title: e("signing.title"),
|
|
1756
|
+
text: e("signing.text"),
|
|
1757
|
+
spinnerText: e("signing.spinnerText")
|
|
1758
|
+
},
|
|
1759
|
+
error: {
|
|
1760
|
+
title: e("error.title"),
|
|
1761
|
+
text: e("error.text")
|
|
1762
|
+
},
|
|
1763
|
+
canceled: {
|
|
1764
|
+
title: e("canceled.title"),
|
|
1765
|
+
text: e("canceled.text")
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
},
|
|
1770
|
+
watch: {
|
|
1771
|
+
isLoading(e) {
|
|
1772
|
+
this.$emit("loading", e);
|
|
1773
|
+
}
|
|
1774
|
+
},
|
|
1775
|
+
created() {
|
|
1776
|
+
this.isMobile = Fe(), this.tryResumeSigningSession();
|
|
1777
|
+
},
|
|
1778
|
+
methods: {
|
|
1779
|
+
tryResumeSigningSession() {
|
|
1780
|
+
var o, i;
|
|
1781
|
+
const e = Ee(), t = Object.keys(e._activePolls).find(
|
|
1782
|
+
(n) => n.includes("bankId-")
|
|
1783
|
+
);
|
|
1784
|
+
try {
|
|
1785
|
+
if (t) {
|
|
1786
|
+
const { signAnswerId: n, autoStartToken: s, qrCode: r } = ((o = e._activePolls[t]) == null ? void 0 : o.data) || {};
|
|
1787
|
+
this.signAnswerId = n, this.autoStartToken = s, this.qrCode = r, e.removePoll(t), (i = window.location) != null && i.hash && window.history.replaceState(
|
|
1788
|
+
window.history.state,
|
|
1789
|
+
"",
|
|
1790
|
+
window.location.pathname
|
|
1791
|
+
// clears search + hash
|
|
1792
|
+
), this.isLoading = !0, this.startPolling();
|
|
1793
|
+
}
|
|
1794
|
+
} catch {
|
|
1795
|
+
const s = this._document.$t(
|
|
1796
|
+
"answerModal.bankId.component.viewText.error.text"
|
|
1797
|
+
);
|
|
1798
|
+
Wt("error", s);
|
|
1799
|
+
}
|
|
1800
|
+
},
|
|
1801
|
+
async submit({ answer: e }) {
|
|
1802
|
+
try {
|
|
1803
|
+
this.isLoading = !0;
|
|
1804
|
+
const { id: t, autoStartToken: o, qrCodeData: i } = await e({
|
|
1805
|
+
body: { isAccepted: !0 }
|
|
1806
|
+
});
|
|
1807
|
+
o && (this.autoStartToken = o), i && (this.qrCode = i), this.signAnswerId = t, this.startPolling(), this.isMobile && this.triggerAutoStart();
|
|
1808
|
+
return;
|
|
1809
|
+
} catch (t) {
|
|
1810
|
+
this.onError(t);
|
|
1811
|
+
}
|
|
1812
|
+
},
|
|
1813
|
+
async startPolling() {
|
|
1814
|
+
if (!this.signAnswerId) throw Error("Missing signAnswerId");
|
|
1815
|
+
const e = Ee(), t = `bankId-${this.signAnswerId}`, o = async () => {
|
|
1816
|
+
if (!this.signAnswerId) throw Error("Missing signAnswerId");
|
|
1817
|
+
const i = () => {
|
|
1818
|
+
this.clearSignState(), e.removePoll(t);
|
|
1819
|
+
};
|
|
1820
|
+
try {
|
|
1821
|
+
const { data: n } = await Ne.get(this.signAnswerId);
|
|
1822
|
+
n.qrCodeData && (this.qrCode = n.qrCodeData), ["completed", "canceled"].includes(n.status) && i(), n.status === "completed" ? this.onComplete() : n.status === "canceled" ? this.onCanceled() : this.view = n.status;
|
|
1823
|
+
} catch (n) {
|
|
1824
|
+
this.onError(n), i();
|
|
1825
|
+
}
|
|
1826
|
+
};
|
|
1827
|
+
try {
|
|
1828
|
+
e.addPoll({
|
|
1829
|
+
id: t,
|
|
1830
|
+
handler: o,
|
|
1831
|
+
interval: 1e3,
|
|
1832
|
+
data: {
|
|
1833
|
+
signAnswerId: this.signAnswerId,
|
|
1834
|
+
autoStartToken: this.autoStartToken,
|
|
1835
|
+
qrCode: this.qrCode
|
|
1836
|
+
}
|
|
1837
|
+
});
|
|
1838
|
+
} catch {
|
|
1839
|
+
this.clearSignState();
|
|
1840
|
+
const n = this._document.$t(
|
|
1841
|
+
"answerModal.bankId.component.viewText.error.text"
|
|
1842
|
+
);
|
|
1843
|
+
Wt("error", n);
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
clearSignState() {
|
|
1847
|
+
this.autoStartToken = null, this.qrCode = null, this.isLoading = !1;
|
|
1848
|
+
},
|
|
1849
|
+
onComplete() {
|
|
1850
|
+
typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
1851
|
+
},
|
|
1852
|
+
onCanceled() {
|
|
1853
|
+
this.view = "canceled", this.errorMessage = this._document.$t(
|
|
1854
|
+
"answerModal.bankId.component.signingInterrupted"
|
|
1855
|
+
);
|
|
1856
|
+
},
|
|
1857
|
+
onError(e) {
|
|
1858
|
+
var o, i;
|
|
1859
|
+
if (e.httpStatusCode === 409) throw e;
|
|
1860
|
+
this.$emit("error"), this.view = "error";
|
|
1861
|
+
const t = (i = (o = e.response) == null ? void 0 : o.data) == null ? void 0 : i.errorCode;
|
|
1862
|
+
switch (t) {
|
|
1863
|
+
case 9001:
|
|
1864
|
+
// Signing already in progress
|
|
1865
|
+
case 9002:
|
|
1866
|
+
// Signing expired, show user the message
|
|
1867
|
+
case 9003:
|
|
1868
|
+
// Signing cancelled by user
|
|
1869
|
+
case 9004:
|
|
1870
|
+
// Signing cancelled
|
|
1871
|
+
case 9005:
|
|
1872
|
+
// User certificate error
|
|
1873
|
+
case 9006:
|
|
1874
|
+
// Signing start fail
|
|
1875
|
+
case 9007:
|
|
1876
|
+
$e.warn(e);
|
|
1877
|
+
break;
|
|
1878
|
+
case 9009:
|
|
1879
|
+
this.$emit("complete");
|
|
1880
|
+
break;
|
|
1881
|
+
default:
|
|
1882
|
+
Lt(e, { showMessage: !1 });
|
|
1883
|
+
}
|
|
1884
|
+
this.errorMessage = this.$i18n.te(`errors:${t}`) && this._document.$t(`answerModal.bankId.component.errors.${t}`) || this._document.$t("answerModal.bankId.component.defaultError");
|
|
1885
|
+
},
|
|
1886
|
+
triggerAutoStart() {
|
|
1887
|
+
if (!this.autoStartToken) return;
|
|
1888
|
+
let e = "bankid://", t = "null";
|
|
1889
|
+
if (this.isMobile) {
|
|
1890
|
+
const i = Le(), n = (navigator == null ? void 0 : navigator.userAgent) || (navigator == null ? void 0 : navigator.vendor) || (window == null ? void 0 : window.opera), s = i === "iOS" && (/Version\/[\d.]+.*Safari/.test(n) || /GSA/.test(n)), r = i === "Android" && /Version\/[\d.]+.*Chrome/.test(n);
|
|
1891
|
+
(s || r) && (e = "https://app.bankid.com"), i === "iOS" && Se.value !== "widget" && (t = wn(this.signAnswerId));
|
|
1892
|
+
}
|
|
1893
|
+
const o = `${e}/?autostarttoken=${this.autoStartToken}&redirect=${t}`;
|
|
1894
|
+
this.isMobile ? document.location = o : this.$refs.autoStartFrame.src = o;
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
}, vn = { class: "-my-4 flex flex-col items-center" }, _n = {
|
|
1898
|
+
ref: "autoStartFrame",
|
|
1899
|
+
height: "0",
|
|
1900
|
+
width: "0",
|
|
1901
|
+
class: "hidden"
|
|
1902
|
+
}, Cn = {
|
|
1903
|
+
key: 0,
|
|
1904
|
+
class: "flex h-[250px] w-[250px] items-center justify-center rounded-xl bg-gray-100"
|
|
1905
|
+
}, xn = ["textContent"], bn = { key: 2 }, Pn = {
|
|
1906
|
+
class: "flex flex-col items-center justify-center",
|
|
1907
|
+
style: { "background-color": "#183e4f", padding: `calc(2.5 * var(--rem)) calc(3 * var(--rem))
|
|
1908
|
+
calc(2 * var(--rem))` }
|
|
1909
|
+
}, En = ["textContent"], Sn = {
|
|
1910
|
+
class: "flex w-full flex-col items-center justify-center text-center",
|
|
1911
|
+
style: { padding: `calc(3 * var(--rem)) calc(2 * var(--rem))
|
|
1912
|
+
calc(2 * var(--rem))` }
|
|
1913
|
+
}, kn = ["textContent"], Tn = ["textContent"];
|
|
1914
|
+
function Mn(e, t, o, i, n, s) {
|
|
1915
|
+
const r = $("CIcon"), a = $("QrCode"), l = $("CButton"), u = $("Animation");
|
|
1916
|
+
return D(), R("div", vn, [
|
|
1917
|
+
y("iframe", _n, null, 512),
|
|
1918
|
+
["form", "signing", "error", "canceled"].includes(n.view) ? (D(), R("div", Cn, [
|
|
1919
|
+
B(r, {
|
|
1920
|
+
type: "bankId",
|
|
1921
|
+
size: "50",
|
|
1922
|
+
class: "text-gray-500"
|
|
1923
|
+
})
|
|
1924
|
+
])) : L("", !0),
|
|
1925
|
+
["new", "waiting", "started"].includes(n.view) ? (D(), R(lt, { key: 1 }, [
|
|
1926
|
+
n.qrCode ? (D(), Q(a, {
|
|
1927
|
+
key: 0,
|
|
1928
|
+
value: n.qrCode,
|
|
1929
|
+
options: {
|
|
1930
|
+
width: 250,
|
|
1931
|
+
errorCorrectionLevel: "L",
|
|
1932
|
+
color: { dark: "#000000" }
|
|
1933
|
+
}
|
|
1934
|
+
}, null, 8, ["value"])) : L("", !0)
|
|
1935
|
+
], 64)) : L("", !0),
|
|
1936
|
+
B(u, { class: "w-full" }, {
|
|
1937
|
+
default: N(() => {
|
|
1938
|
+
var c;
|
|
1939
|
+
return [
|
|
1940
|
+
y("div", {
|
|
1941
|
+
key: "a",
|
|
1942
|
+
class: "min-h-[20px] pt-4 text-sm text-gray-500",
|
|
1943
|
+
textContent: I((c = s.viewText[n.view]) == null ? void 0 : c.spinnerText)
|
|
1944
|
+
}, null, 8, xn),
|
|
1945
|
+
!n.isMobile && ["new", "waiting", "started"].includes(n.view) ? (D(), Q(l, {
|
|
1946
|
+
key: "b",
|
|
1947
|
+
type: "none",
|
|
1948
|
+
pattern: "secondary",
|
|
1949
|
+
size: "small",
|
|
1950
|
+
class: "mt-4",
|
|
1951
|
+
onClick: s.triggerAutoStart
|
|
1952
|
+
}, {
|
|
1953
|
+
default: N(() => [
|
|
1954
|
+
K(I(e._document.$t("answerModal.bankId.component.startOnThisDevice")), 1)
|
|
1955
|
+
]),
|
|
1956
|
+
_: 1
|
|
1957
|
+
}, 8, ["onClick"])) : L("", !0)
|
|
1958
|
+
];
|
|
1959
|
+
}),
|
|
1960
|
+
_: 1
|
|
1961
|
+
}),
|
|
1962
|
+
["form", "new", "waiting", "started"].includes(n.view) ? L("", !0) : (D(), R("div", bn, [
|
|
1963
|
+
B(Ut, { name: "pop-in" }, {
|
|
1964
|
+
default: N(() => [
|
|
1965
|
+
["signing", "error", "canceled"].includes(n.view) ? (D(), R("div", {
|
|
1966
|
+
key: 0,
|
|
1967
|
+
class: "bankid-popup",
|
|
1968
|
+
onClick: t[1] || (t[1] = () => {
|
|
1969
|
+
n.view = "form", n.isLoading = !1;
|
|
1970
|
+
})
|
|
1971
|
+
}, [
|
|
1972
|
+
y("div", Pn, [
|
|
1973
|
+
B(r, {
|
|
1974
|
+
type: "bankId",
|
|
1975
|
+
size: "34",
|
|
1976
|
+
class: "text-white"
|
|
1977
|
+
}),
|
|
1978
|
+
y("div", {
|
|
1979
|
+
class: "pt-4 text-sm font-medium text-white opacity-75",
|
|
1980
|
+
textContent: I(s.viewText[n.view].text)
|
|
1981
|
+
}, null, 8, En)
|
|
1982
|
+
]),
|
|
1983
|
+
y("div", Sn, [
|
|
1984
|
+
n.view === "signing" ? (D(), R(lt, { key: 0 }, [
|
|
1985
|
+
t[2] || (t[2] = y("div", { class: "spinner" }, null, -1)),
|
|
1986
|
+
y("div", {
|
|
1987
|
+
class: "pt-8 text-gray-500",
|
|
1988
|
+
textContent: I(s.viewText[n.view].spinnerText)
|
|
1989
|
+
}, null, 8, kn)
|
|
1990
|
+
], 64)) : ["error", "canceled"].includes(n.view) ? (D(), R(lt, { key: 1 }, [
|
|
1991
|
+
B(r, {
|
|
1992
|
+
type: "error",
|
|
1993
|
+
size: "22",
|
|
1994
|
+
class: "mb-2.5 text-gray-400"
|
|
1995
|
+
}),
|
|
1996
|
+
y("div", {
|
|
1997
|
+
style: { "font-size": "14px" },
|
|
1998
|
+
textContent: I(n.errorMessage)
|
|
1999
|
+
}, null, 8, Tn),
|
|
2000
|
+
B(l, {
|
|
2001
|
+
loading: n.isLoading,
|
|
2002
|
+
type: "none",
|
|
2003
|
+
pattern: "secondary",
|
|
2004
|
+
size: "small",
|
|
2005
|
+
style: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" },
|
|
2006
|
+
onClick: t[0] || (t[0] = (c) => n.view = "form")
|
|
2007
|
+
}, {
|
|
2008
|
+
default: N(() => [
|
|
2009
|
+
K(I(e._document.$t("tryAgain")), 1)
|
|
2010
|
+
]),
|
|
2011
|
+
_: 1
|
|
2012
|
+
}, 8, ["loading"])
|
|
2013
|
+
], 64)) : L("", !0)
|
|
2014
|
+
])
|
|
2015
|
+
])) : L("", !0)
|
|
2016
|
+
]),
|
|
2017
|
+
_: 1
|
|
2018
|
+
})
|
|
2019
|
+
]))
|
|
2020
|
+
]);
|
|
2021
|
+
}
|
|
2022
|
+
const In = /* @__PURE__ */ tt(yn, [["render", Mn], ["__scopeId", "data-v-4273b03f"]]), An = {
|
|
2023
|
+
name: "DenyAnswer",
|
|
2024
|
+
mixins: [Z([])],
|
|
2025
|
+
props: {
|
|
2026
|
+
onCompleteFunc: {
|
|
2027
|
+
type: Function,
|
|
2028
|
+
default: null
|
|
2029
|
+
}
|
|
2030
|
+
},
|
|
2031
|
+
data() {
|
|
2032
|
+
return {
|
|
2033
|
+
rejectReason: ""
|
|
2034
|
+
};
|
|
2035
|
+
},
|
|
2036
|
+
methods: {
|
|
2037
|
+
async submit({ update: e, answer: t }) {
|
|
2038
|
+
const o = [];
|
|
2039
|
+
this.rejectReason && o.push({
|
|
2040
|
+
key: "unclear-other",
|
|
2041
|
+
category: "misc",
|
|
2042
|
+
description: this.rejectReason,
|
|
2043
|
+
sentAt: this._document.lastSentAt
|
|
2044
|
+
}), await e({ body: { "data.rejectReasons": o } }), await t({ body: { isAccepted: !1 } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
}, Bn = { class: "text-left" };
|
|
2048
|
+
function Dn(e, t, o, i, n, s) {
|
|
2049
|
+
const r = $("CInput");
|
|
2050
|
+
return D(), R("div", Bn, [
|
|
2051
|
+
y("label", null, I(e._document.$t("answerModal.decline.component.label")), 1),
|
|
2052
|
+
B(r, {
|
|
2053
|
+
modelValue: n.rejectReason,
|
|
2054
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => n.rejectReason = a),
|
|
2055
|
+
type: "textarea",
|
|
2056
|
+
filled: "",
|
|
2057
|
+
"custom-class": "decline-input",
|
|
2058
|
+
style: { "margin-bottom": "calc(1.5 * var(--rem))" }
|
|
2059
|
+
}, null, 8, ["modelValue"])
|
|
2060
|
+
]);
|
|
2061
|
+
}
|
|
2062
|
+
const Rn = /* @__PURE__ */ tt(An, [["render", Dn]]);
|
|
2063
|
+
/*!
|
|
2064
|
+
* Signature Pad v4.0.10 | https://github.com/szimek/signature_pad
|
|
2065
|
+
* (c) 2022 Szymon Nowak | Released under the MIT license
|
|
2066
|
+
*/
|
|
2067
|
+
class it {
|
|
2068
|
+
constructor(t, o, i, n) {
|
|
2069
|
+
if (isNaN(t) || isNaN(o))
|
|
2070
|
+
throw new Error(`Point is invalid: (${t}, ${o})`);
|
|
2071
|
+
this.x = +t, this.y = +o, this.pressure = i || 0, this.time = n || Date.now();
|
|
2072
|
+
}
|
|
2073
|
+
distanceTo(t) {
|
|
2074
|
+
return Math.sqrt(Math.pow(this.x - t.x, 2) + Math.pow(this.y - t.y, 2));
|
|
2075
|
+
}
|
|
2076
|
+
equals(t) {
|
|
2077
|
+
return this.x === t.x && this.y === t.y && this.pressure === t.pressure && this.time === t.time;
|
|
2078
|
+
}
|
|
2079
|
+
velocityFrom(t) {
|
|
2080
|
+
return this.time !== t.time ? this.distanceTo(t) / (this.time - t.time) : 0;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
class Ot {
|
|
2084
|
+
constructor(t, o, i, n, s, r) {
|
|
2085
|
+
this.startPoint = t, this.control2 = o, this.control1 = i, this.endPoint = n, this.startWidth = s, this.endWidth = r;
|
|
2086
|
+
}
|
|
2087
|
+
static fromPoints(t, o) {
|
|
2088
|
+
const i = this.calculateControlPoints(t[0], t[1], t[2]).c2, n = this.calculateControlPoints(t[1], t[2], t[3]).c1;
|
|
2089
|
+
return new Ot(t[1], i, n, t[2], o.start, o.end);
|
|
2090
|
+
}
|
|
2091
|
+
static calculateControlPoints(t, o, i) {
|
|
2092
|
+
const n = t.x - o.x, s = t.y - o.y, r = o.x - i.x, a = o.y - i.y, l = { x: (t.x + o.x) / 2, y: (t.y + o.y) / 2 }, u = { x: (o.x + i.x) / 2, y: (o.y + i.y) / 2 }, c = Math.sqrt(n * n + s * s), h = Math.sqrt(r * r + a * a), f = l.x - u.x, d = l.y - u.y, p = h / (c + h), g = { x: u.x + f * p, y: u.y + d * p }, A = o.x - g.x, x = o.y - g.y;
|
|
2093
|
+
return {
|
|
2094
|
+
c1: new it(l.x + A, l.y + x),
|
|
2095
|
+
c2: new it(u.x + A, u.y + x)
|
|
2096
|
+
};
|
|
2097
|
+
}
|
|
2098
|
+
length() {
|
|
2099
|
+
let o = 0, i, n;
|
|
2100
|
+
for (let s = 0; s <= 10; s += 1) {
|
|
2101
|
+
const r = s / 10, a = this.point(r, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), l = this.point(r, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
2102
|
+
if (s > 0) {
|
|
2103
|
+
const u = a - i, c = l - n;
|
|
2104
|
+
o += Math.sqrt(u * u + c * c);
|
|
2105
|
+
}
|
|
2106
|
+
i = a, n = l;
|
|
2107
|
+
}
|
|
2108
|
+
return o;
|
|
2109
|
+
}
|
|
2110
|
+
point(t, o, i, n, s) {
|
|
2111
|
+
return o * (1 - t) * (1 - t) * (1 - t) + 3 * i * (1 - t) * (1 - t) * t + 3 * n * (1 - t) * t * t + s * t * t * t;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
class Fn {
|
|
2115
|
+
constructor() {
|
|
2116
|
+
try {
|
|
2117
|
+
this._et = new EventTarget();
|
|
2118
|
+
} catch {
|
|
2119
|
+
this._et = document;
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
addEventListener(t, o, i) {
|
|
2123
|
+
this._et.addEventListener(t, o, i);
|
|
2124
|
+
}
|
|
2125
|
+
dispatchEvent(t) {
|
|
2126
|
+
return this._et.dispatchEvent(t);
|
|
2127
|
+
}
|
|
2128
|
+
removeEventListener(t, o, i) {
|
|
2129
|
+
this._et.removeEventListener(t, o, i);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
function $n(e, t = 250) {
|
|
2133
|
+
let o = 0, i = null, n, s, r;
|
|
2134
|
+
const a = () => {
|
|
2135
|
+
o = Date.now(), i = null, n = e.apply(s, r), i || (s = null, r = []);
|
|
2136
|
+
};
|
|
2137
|
+
return function(...u) {
|
|
2138
|
+
const c = Date.now(), h = t - (c - o);
|
|
2139
|
+
return s = this, r = u, h <= 0 || h > t ? (i && (clearTimeout(i), i = null), o = c, n = e.apply(s, r), i || (s = null, r = [])) : i || (i = window.setTimeout(a, h)), n;
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
let Nn = class Nt extends Fn {
|
|
2143
|
+
constructor(t, o = {}) {
|
|
2144
|
+
super(), this.canvas = t, this._handleMouseDown = (i) => {
|
|
2145
|
+
i.buttons === 1 && (this._drawningStroke = !0, this._strokeBegin(i));
|
|
2146
|
+
}, this._handleMouseMove = (i) => {
|
|
2147
|
+
this._drawningStroke && this._strokeMoveUpdate(i);
|
|
2148
|
+
}, this._handleMouseUp = (i) => {
|
|
2149
|
+
i.buttons === 1 && this._drawningStroke && (this._drawningStroke = !1, this._strokeEnd(i));
|
|
2150
|
+
}, this._handleTouchStart = (i) => {
|
|
2151
|
+
if (i.cancelable && i.preventDefault(), i.targetTouches.length === 1) {
|
|
2152
|
+
const n = i.changedTouches[0];
|
|
2153
|
+
this._strokeBegin(n);
|
|
2154
|
+
}
|
|
2155
|
+
}, this._handleTouchMove = (i) => {
|
|
2156
|
+
i.cancelable && i.preventDefault();
|
|
2157
|
+
const n = i.targetTouches[0];
|
|
2158
|
+
this._strokeMoveUpdate(n);
|
|
2159
|
+
}, this._handleTouchEnd = (i) => {
|
|
2160
|
+
if (i.target === this.canvas) {
|
|
2161
|
+
i.cancelable && i.preventDefault();
|
|
2162
|
+
const s = i.changedTouches[0];
|
|
2163
|
+
this._strokeEnd(s);
|
|
2164
|
+
}
|
|
2165
|
+
}, this._handlePointerStart = (i) => {
|
|
2166
|
+
this._drawningStroke = !0, i.preventDefault(), this._strokeBegin(i);
|
|
2167
|
+
}, this._handlePointerMove = (i) => {
|
|
2168
|
+
this._drawningStroke && (i.preventDefault(), this._strokeMoveUpdate(i));
|
|
2169
|
+
}, this._handlePointerEnd = (i) => {
|
|
2170
|
+
this._drawningStroke && (i.preventDefault(), this._drawningStroke = !1, this._strokeEnd(i));
|
|
2171
|
+
}, this.velocityFilterWeight = o.velocityFilterWeight || 0.7, this.minWidth = o.minWidth || 0.5, this.maxWidth = o.maxWidth || 2.5, this.throttle = "throttle" in o ? o.throttle : 16, this.minDistance = "minDistance" in o ? o.minDistance : 5, this.dotSize = o.dotSize || 0, this.penColor = o.penColor || "black", this.backgroundColor = o.backgroundColor || "rgba(0,0,0,0)", this._strokeMoveUpdate = this.throttle ? $n(Nt.prototype._strokeUpdate, this.throttle) : Nt.prototype._strokeUpdate, this._ctx = t.getContext("2d"), this.clear(), this.on();
|
|
2172
|
+
}
|
|
2173
|
+
clear() {
|
|
2174
|
+
const { _ctx: t, canvas: o } = this;
|
|
2175
|
+
t.fillStyle = this.backgroundColor, t.clearRect(0, 0, o.width, o.height), t.fillRect(0, 0, o.width, o.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0;
|
|
2176
|
+
}
|
|
2177
|
+
fromDataURL(t, o = {}) {
|
|
2178
|
+
return new Promise((i, n) => {
|
|
2179
|
+
const s = new Image(), r = o.ratio || window.devicePixelRatio || 1, a = o.width || this.canvas.width / r, l = o.height || this.canvas.height / r, u = o.xOffset || 0, c = o.yOffset || 0;
|
|
2180
|
+
this._reset(this._getPointGroupOptions()), s.onload = () => {
|
|
2181
|
+
this._ctx.drawImage(s, u, c, a, l), i();
|
|
2182
|
+
}, s.onerror = (h) => {
|
|
2183
|
+
n(h);
|
|
2184
|
+
}, s.crossOrigin = "anonymous", s.src = t, this._isEmpty = !1;
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
toDataURL(t = "image/png", o) {
|
|
2188
|
+
switch (t) {
|
|
2189
|
+
case "image/svg+xml":
|
|
2190
|
+
return this._toSVG();
|
|
2191
|
+
default:
|
|
2192
|
+
return this.canvas.toDataURL(t, o);
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
on() {
|
|
2196
|
+
this.canvas.style.touchAction = "none", this.canvas.style.msTouchAction = "none", this.canvas.style.userSelect = "none";
|
|
2197
|
+
const t = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
|
|
2198
|
+
window.PointerEvent && !t ? this._handlePointerEvents() : (this._handleMouseEvents(), "ontouchstart" in window && this._handleTouchEvents());
|
|
2199
|
+
}
|
|
2200
|
+
off() {
|
|
2201
|
+
this.canvas.style.touchAction = "auto", this.canvas.style.msTouchAction = "auto", this.canvas.style.userSelect = "auto", this.canvas.removeEventListener("pointerdown", this._handlePointerStart), this.canvas.removeEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.removeEventListener("pointerup", this._handlePointerEnd), this.canvas.removeEventListener("mousedown", this._handleMouseDown), this.canvas.removeEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.removeEventListener("mouseup", this._handleMouseUp), this.canvas.removeEventListener("touchstart", this._handleTouchStart), this.canvas.removeEventListener("touchmove", this._handleTouchMove), this.canvas.removeEventListener("touchend", this._handleTouchEnd);
|
|
2202
|
+
}
|
|
2203
|
+
isEmpty() {
|
|
2204
|
+
return this._isEmpty;
|
|
2205
|
+
}
|
|
2206
|
+
fromData(t, { clear: o = !0 } = {}) {
|
|
2207
|
+
o && this.clear(), this._fromData(t, this._drawCurve.bind(this), this._drawDot.bind(this)), this._data = this._data.concat(t);
|
|
2208
|
+
}
|
|
2209
|
+
toData() {
|
|
2210
|
+
return this._data;
|
|
2211
|
+
}
|
|
2212
|
+
_getPointGroupOptions(t) {
|
|
2213
|
+
return {
|
|
2214
|
+
penColor: t && "penColor" in t ? t.penColor : this.penColor,
|
|
2215
|
+
dotSize: t && "dotSize" in t ? t.dotSize : this.dotSize,
|
|
2216
|
+
minWidth: t && "minWidth" in t ? t.minWidth : this.minWidth,
|
|
2217
|
+
maxWidth: t && "maxWidth" in t ? t.maxWidth : this.maxWidth,
|
|
2218
|
+
velocityFilterWeight: t && "velocityFilterWeight" in t ? t.velocityFilterWeight : this.velocityFilterWeight
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
_strokeBegin(t) {
|
|
2222
|
+
this.dispatchEvent(new CustomEvent("beginStroke", { detail: t }));
|
|
2223
|
+
const o = this._getPointGroupOptions(), i = Object.assign(Object.assign({}, o), { points: [] });
|
|
2224
|
+
this._data.push(i), this._reset(o), this._strokeUpdate(t);
|
|
2225
|
+
}
|
|
2226
|
+
_strokeUpdate(t) {
|
|
2227
|
+
if (this._data.length === 0) {
|
|
2228
|
+
this._strokeBegin(t);
|
|
2229
|
+
return;
|
|
2230
|
+
}
|
|
2231
|
+
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: t }));
|
|
2232
|
+
const o = t.clientX, i = t.clientY, n = t.pressure !== void 0 ? t.pressure : t.force !== void 0 ? t.force : 0, s = this._createPoint(o, i, n), r = this._data[this._data.length - 1], a = r.points, l = a.length > 0 && a[a.length - 1], u = l ? s.distanceTo(l) <= this.minDistance : !1, c = this._getPointGroupOptions(r);
|
|
2233
|
+
if (!l || !(l && u)) {
|
|
2234
|
+
const h = this._addPoint(s, c);
|
|
2235
|
+
l ? h && this._drawCurve(h, c) : this._drawDot(s, c), a.push({
|
|
2236
|
+
time: s.time,
|
|
2237
|
+
x: s.x,
|
|
2238
|
+
y: s.y,
|
|
2239
|
+
pressure: s.pressure
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
2242
|
+
this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: t }));
|
|
2243
|
+
}
|
|
2244
|
+
_strokeEnd(t) {
|
|
2245
|
+
this._strokeUpdate(t), this.dispatchEvent(new CustomEvent("endStroke", { detail: t }));
|
|
2246
|
+
}
|
|
2247
|
+
_handlePointerEvents() {
|
|
2248
|
+
this._drawningStroke = !1, this.canvas.addEventListener("pointerdown", this._handlePointerStart), this.canvas.addEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.addEventListener("pointerup", this._handlePointerEnd);
|
|
2249
|
+
}
|
|
2250
|
+
_handleMouseEvents() {
|
|
2251
|
+
this._drawningStroke = !1, this.canvas.addEventListener("mousedown", this._handleMouseDown), this.canvas.addEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.addEventListener("mouseup", this._handleMouseUp);
|
|
2252
|
+
}
|
|
2253
|
+
_handleTouchEvents() {
|
|
2254
|
+
this.canvas.addEventListener("touchstart", this._handleTouchStart), this.canvas.addEventListener("touchmove", this._handleTouchMove), this.canvas.addEventListener("touchend", this._handleTouchEnd);
|
|
2255
|
+
}
|
|
2256
|
+
_reset(t) {
|
|
2257
|
+
this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (t.minWidth + t.maxWidth) / 2, this._ctx.fillStyle = t.penColor;
|
|
2258
|
+
}
|
|
2259
|
+
_createPoint(t, o, i) {
|
|
2260
|
+
const n = this.canvas.getBoundingClientRect();
|
|
2261
|
+
return new it(t - n.left, o - n.top, i, (/* @__PURE__ */ new Date()).getTime());
|
|
2262
|
+
}
|
|
2263
|
+
_addPoint(t, o) {
|
|
2264
|
+
const { _lastPoints: i } = this;
|
|
2265
|
+
if (i.push(t), i.length > 2) {
|
|
2266
|
+
i.length === 3 && i.unshift(i[0]);
|
|
2267
|
+
const n = this._calculateCurveWidths(i[1], i[2], o), s = Ot.fromPoints(i, n);
|
|
2268
|
+
return i.shift(), s;
|
|
2269
|
+
}
|
|
2270
|
+
return null;
|
|
2271
|
+
}
|
|
2272
|
+
_calculateCurveWidths(t, o, i) {
|
|
2273
|
+
const n = i.velocityFilterWeight * o.velocityFrom(t) + (1 - i.velocityFilterWeight) * this._lastVelocity, s = this._strokeWidth(n, i), r = {
|
|
2274
|
+
end: s,
|
|
2275
|
+
start: this._lastWidth
|
|
2276
|
+
};
|
|
2277
|
+
return this._lastVelocity = n, this._lastWidth = s, r;
|
|
2278
|
+
}
|
|
2279
|
+
_strokeWidth(t, o) {
|
|
2280
|
+
return Math.max(o.maxWidth / (t + 1), o.minWidth);
|
|
2281
|
+
}
|
|
2282
|
+
_drawCurveSegment(t, o, i) {
|
|
2283
|
+
const n = this._ctx;
|
|
2284
|
+
n.moveTo(t, o), n.arc(t, o, i, 0, 2 * Math.PI, !1), this._isEmpty = !1;
|
|
2285
|
+
}
|
|
2286
|
+
_drawCurve(t, o) {
|
|
2287
|
+
const i = this._ctx, n = t.endWidth - t.startWidth, s = Math.ceil(t.length()) * 2;
|
|
2288
|
+
i.beginPath(), i.fillStyle = o.penColor;
|
|
2289
|
+
for (let r = 0; r < s; r += 1) {
|
|
2290
|
+
const a = r / s, l = a * a, u = l * a, c = 1 - a, h = c * c, f = h * c;
|
|
2291
|
+
let d = f * t.startPoint.x;
|
|
2292
|
+
d += 3 * h * a * t.control1.x, d += 3 * c * l * t.control2.x, d += u * t.endPoint.x;
|
|
2293
|
+
let p = f * t.startPoint.y;
|
|
2294
|
+
p += 3 * h * a * t.control1.y, p += 3 * c * l * t.control2.y, p += u * t.endPoint.y;
|
|
2295
|
+
const g = Math.min(t.startWidth + u * n, o.maxWidth);
|
|
2296
|
+
this._drawCurveSegment(d, p, g);
|
|
2297
|
+
}
|
|
2298
|
+
i.closePath(), i.fill();
|
|
2299
|
+
}
|
|
2300
|
+
_drawDot(t, o) {
|
|
2301
|
+
const i = this._ctx, n = o.dotSize > 0 ? o.dotSize : (o.minWidth + o.maxWidth) / 2;
|
|
2302
|
+
i.beginPath(), this._drawCurveSegment(t.x, t.y, n), i.closePath(), i.fillStyle = o.penColor, i.fill();
|
|
2303
|
+
}
|
|
2304
|
+
_fromData(t, o, i) {
|
|
2305
|
+
for (const n of t) {
|
|
2306
|
+
const { points: s } = n, r = this._getPointGroupOptions(n);
|
|
2307
|
+
if (s.length > 1)
|
|
2308
|
+
for (let a = 0; a < s.length; a += 1) {
|
|
2309
|
+
const l = s[a], u = new it(l.x, l.y, l.pressure, l.time);
|
|
2310
|
+
a === 0 && this._reset(r);
|
|
2311
|
+
const c = this._addPoint(u, r);
|
|
2312
|
+
c && o(c, r);
|
|
2313
|
+
}
|
|
2314
|
+
else
|
|
2315
|
+
this._reset(r), i(s[0], r);
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
_toSVG() {
|
|
2319
|
+
const t = this._data, o = Math.max(window.devicePixelRatio || 1, 1), i = 0, n = 0, s = this.canvas.width / o, r = this.canvas.height / o, a = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2320
|
+
a.setAttribute("width", this.canvas.width.toString()), a.setAttribute("height", this.canvas.height.toString()), this._fromData(t, (d, { penColor: p }) => {
|
|
2321
|
+
const g = document.createElement("path");
|
|
2322
|
+
if (!isNaN(d.control1.x) && !isNaN(d.control1.y) && !isNaN(d.control2.x) && !isNaN(d.control2.y)) {
|
|
2323
|
+
const A = `M ${d.startPoint.x.toFixed(3)},${d.startPoint.y.toFixed(3)} C ${d.control1.x.toFixed(3)},${d.control1.y.toFixed(3)} ${d.control2.x.toFixed(3)},${d.control2.y.toFixed(3)} ${d.endPoint.x.toFixed(3)},${d.endPoint.y.toFixed(3)}`;
|
|
2324
|
+
g.setAttribute("d", A), g.setAttribute("stroke-width", (d.endWidth * 2.25).toFixed(3)), g.setAttribute("stroke", p), g.setAttribute("fill", "none"), g.setAttribute("stroke-linecap", "round"), a.appendChild(g);
|
|
2325
|
+
}
|
|
2326
|
+
}, (d, { penColor: p, dotSize: g, minWidth: A, maxWidth: x }) => {
|
|
2327
|
+
const T = document.createElement("circle"), E = g > 0 ? g : (A + x) / 2;
|
|
2328
|
+
T.setAttribute("r", E.toString()), T.setAttribute("cx", d.x.toString()), T.setAttribute("cy", d.y.toString()), T.setAttribute("fill", p), a.appendChild(T);
|
|
2329
|
+
});
|
|
2330
|
+
const l = "data:image/svg+xml;base64,", u = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${i} ${n} ${s} ${r}" width="${s}" height="${r}">`;
|
|
2331
|
+
let c = a.innerHTML;
|
|
2332
|
+
if (c === void 0) {
|
|
2333
|
+
const d = document.createElement("dummy"), p = a.childNodes;
|
|
2334
|
+
d.innerHTML = "";
|
|
2335
|
+
for (let g = 0; g < p.length; g += 1)
|
|
2336
|
+
d.appendChild(p[g].cloneNode(!0));
|
|
2337
|
+
c = d.innerHTML;
|
|
2338
|
+
}
|
|
2339
|
+
const f = u + c + "</svg>";
|
|
2340
|
+
return l + btoa(f);
|
|
2341
|
+
}
|
|
2342
|
+
};
|
|
2343
|
+
class Ln extends Nn {
|
|
2344
|
+
fromText(t, o = {}) {
|
|
2345
|
+
if (this.clear(), !t) return;
|
|
2346
|
+
const { font: i, x: n = 10, y: s = 50 } = o;
|
|
2347
|
+
let { maxWidth: r } = o;
|
|
2348
|
+
if (!r) {
|
|
2349
|
+
const { clientWidth: a = 300 } = this.canvas;
|
|
2350
|
+
r = Math.floor(a - 2 * n);
|
|
2351
|
+
}
|
|
2352
|
+
this._ctx.font = i, this._ctx.fillText(t, n, s, r), this._isEmpty = !1;
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
const Un = {
|
|
2356
|
+
name: "SignaturePad",
|
|
2357
|
+
props: {
|
|
2358
|
+
type: {
|
|
2359
|
+
type: String,
|
|
2360
|
+
default: "text",
|
|
2361
|
+
validator: (e) => ["text", "draw"].includes(e)
|
|
2362
|
+
},
|
|
2363
|
+
text: {
|
|
2364
|
+
type: String,
|
|
2365
|
+
default: ""
|
|
2366
|
+
},
|
|
2367
|
+
width: {
|
|
2368
|
+
type: String,
|
|
2369
|
+
default: "100%"
|
|
2370
|
+
},
|
|
2371
|
+
height: {
|
|
2372
|
+
type: String,
|
|
2373
|
+
default: "100%"
|
|
2374
|
+
},
|
|
2375
|
+
customStyle: {
|
|
2376
|
+
type: Object,
|
|
2377
|
+
default: () => ({})
|
|
2378
|
+
},
|
|
2379
|
+
options: {
|
|
2380
|
+
type: Object,
|
|
2381
|
+
default: () => ({})
|
|
2382
|
+
},
|
|
2383
|
+
/**
|
|
2384
|
+
* Obj on format like {
|
|
2385
|
+
beginStroke: () => {},
|
|
2386
|
+
endStroke: () => {},
|
|
2387
|
+
},
|
|
2388
|
+
*/
|
|
2389
|
+
signEvents: {
|
|
2390
|
+
type: Object,
|
|
2391
|
+
default: () => ({})
|
|
2392
|
+
},
|
|
2393
|
+
images: {
|
|
2394
|
+
type: Array,
|
|
2395
|
+
default: () => []
|
|
2396
|
+
}
|
|
2397
|
+
},
|
|
2398
|
+
data() {
|
|
2399
|
+
return {
|
|
2400
|
+
signaturePad: {},
|
|
2401
|
+
onResizeHandler: null,
|
|
2402
|
+
signatureData: "",
|
|
2403
|
+
defaultOptions: {
|
|
2404
|
+
dotSize: 1.5,
|
|
2405
|
+
minWidth: 0.5,
|
|
2406
|
+
maxWidth: 2.5,
|
|
2407
|
+
throttle: 16,
|
|
2408
|
+
minDistance: 3,
|
|
2409
|
+
backgroundColor: "rgba(0,0,0,0)",
|
|
2410
|
+
penColor: "black",
|
|
2411
|
+
velocityFilterWeight: 0.5
|
|
2412
|
+
},
|
|
2413
|
+
validTypes: ["image/png", "image/jpeg", "image/svg+xml"]
|
|
2414
|
+
};
|
|
2415
|
+
},
|
|
2416
|
+
watch: {
|
|
2417
|
+
type() {
|
|
2418
|
+
this.initType();
|
|
2419
|
+
},
|
|
2420
|
+
text(e) {
|
|
2421
|
+
this.drawText(e);
|
|
2422
|
+
}
|
|
2423
|
+
},
|
|
2424
|
+
mounted() {
|
|
2425
|
+
const { options: e, defaultOptions: t } = this, o = this.$refs.signaturePadCanvas;
|
|
2426
|
+
this.signaturePad = new Ln(o, {
|
|
2427
|
+
...t,
|
|
2428
|
+
...e
|
|
2429
|
+
}), this.onResizeHandler = this.resizeCanvas.bind(this), window.addEventListener("resize", this.onResizeHandler, !1), Object.keys(this.signEvents).forEach((i) => {
|
|
2430
|
+
this.signaturePad.addEventListener(i, () => {
|
|
2431
|
+
this.signEvents[i]();
|
|
2432
|
+
});
|
|
2433
|
+
}), this.initType(), this.resizeCanvas();
|
|
2434
|
+
},
|
|
2435
|
+
beforeUnmount() {
|
|
2436
|
+
this.onResizeHandler && window.removeEventListener("resize", this.onResizeHandler, !1);
|
|
2437
|
+
},
|
|
2438
|
+
methods: {
|
|
2439
|
+
initType() {
|
|
2440
|
+
this.type === "draw" ? this.openSignaturePad() : this.lockSignaturePad();
|
|
2441
|
+
},
|
|
2442
|
+
resizeCanvas() {
|
|
2443
|
+
const e = this.$refs.signaturePadCanvas, t = Math.max(window.devicePixelRatio || 1, 1);
|
|
2444
|
+
if (e.width = e.offsetWidth * t, e.height = e.offsetHeight * t, e.getContext("2d").scale(t, t), this.signaturePad.clear(), this.signatureData = "", this.type === "draw") {
|
|
2445
|
+
const o = this.signaturePad.toData();
|
|
2446
|
+
o != null && o.length && this.signaturePad.fromData(o);
|
|
2447
|
+
} else this.type === "text" && this.drawText(this.text);
|
|
2448
|
+
},
|
|
2449
|
+
saveSignature(e = {}) {
|
|
2450
|
+
const { type: t = "image/png", trim: o = !0, encoderOptions: i } = e || {}, n = { isEmpty: !1, data: void 0 };
|
|
2451
|
+
if (!this.validTypes.includes(t)) {
|
|
2452
|
+
const s = this.validTypes.join(", ");
|
|
2453
|
+
throw new Error(
|
|
2454
|
+
`The Image type is incorrect! We only support ${s} types.`
|
|
2455
|
+
);
|
|
2456
|
+
}
|
|
2457
|
+
if (this.signaturePad.isEmpty()) return { ...n, isEmpty: !0 };
|
|
2458
|
+
if (o) {
|
|
2459
|
+
const s = this.$refs.signaturePadCanvas, r = s ? this.trimCanvas(s) : null;
|
|
2460
|
+
this.signatureData = r ? r.toDataURL(t, i) : "";
|
|
2461
|
+
} else
|
|
2462
|
+
this.signatureData = this.signaturePad.toDataURL(t, i);
|
|
2463
|
+
return {
|
|
2464
|
+
...n,
|
|
2465
|
+
data: this.signatureData
|
|
2466
|
+
};
|
|
2467
|
+
},
|
|
2468
|
+
undoSignature() {
|
|
2469
|
+
const { signaturePad: e } = this, t = e.toData();
|
|
2470
|
+
t && e.fromData(t.slice(0, -1));
|
|
2471
|
+
},
|
|
2472
|
+
drawText(e) {
|
|
2473
|
+
this.signaturePad.fromText(e, {
|
|
2474
|
+
font: '40px "Nothing You Could Do"',
|
|
2475
|
+
x: 10,
|
|
2476
|
+
y: 100
|
|
2477
|
+
});
|
|
2478
|
+
},
|
|
2479
|
+
// Extend of module methods
|
|
2480
|
+
fromText(...e) {
|
|
2481
|
+
return this.signaturePad.fromText(...e);
|
|
2482
|
+
},
|
|
2483
|
+
fromDataURL(...e) {
|
|
2484
|
+
return this.signaturePad.fromDataURL(...e);
|
|
2485
|
+
},
|
|
2486
|
+
fromData(...e) {
|
|
2487
|
+
return this.signaturePad.fromData(...e);
|
|
2488
|
+
},
|
|
2489
|
+
toData(...e) {
|
|
2490
|
+
return this.signaturePad.toData(...e);
|
|
2491
|
+
},
|
|
2492
|
+
lockSignaturePad() {
|
|
2493
|
+
return this.signaturePad.off();
|
|
2494
|
+
},
|
|
2495
|
+
openSignaturePad() {
|
|
2496
|
+
return this.signaturePad.on();
|
|
2497
|
+
},
|
|
2498
|
+
isEmpty() {
|
|
2499
|
+
return this.signaturePad.isEmpty();
|
|
2500
|
+
},
|
|
2501
|
+
clearSignature() {
|
|
2502
|
+
return this.signaturePad.clear();
|
|
2503
|
+
},
|
|
2504
|
+
trimCanvas(e) {
|
|
2505
|
+
const t = document.createElement("canvas"), o = t.getContext("2d");
|
|
2506
|
+
t.width = e.width, t.height = e.height, o.drawImage(e, 0, 0);
|
|
2507
|
+
let i = t.width, n = t.height;
|
|
2508
|
+
const s = { x: [], y: [] }, r = o.getImageData(
|
|
2509
|
+
0,
|
|
2510
|
+
0,
|
|
2511
|
+
t.width,
|
|
2512
|
+
t.height
|
|
2513
|
+
);
|
|
2514
|
+
let a = 0;
|
|
2515
|
+
for (let c = 0; c < n; c++)
|
|
2516
|
+
for (let h = 0; h < i; h++)
|
|
2517
|
+
a = (c * i + h) * 4, r.data[a + 3] > 0 && (s.x.push(h), s.y.push(c));
|
|
2518
|
+
s.x.sort((c, h) => c - h), s.y.sort((c, h) => c - h);
|
|
2519
|
+
const l = s.x.length - 1;
|
|
2520
|
+
i = s.x[l] - s.x[0], n = s.y[l] - s.y[0];
|
|
2521
|
+
const u = o.getImageData(s.x[0], s.y[0], i, n);
|
|
2522
|
+
return t.height = n, o.putImageData(u, 0, 0), t;
|
|
2523
|
+
}
|
|
2524
|
+
},
|
|
2525
|
+
render() {
|
|
2526
|
+
const { width: e, height: t, customStyle: o } = this;
|
|
2527
|
+
return $t(
|
|
2528
|
+
"div",
|
|
2529
|
+
{
|
|
2530
|
+
style: {
|
|
2531
|
+
width: e,
|
|
2532
|
+
height: t,
|
|
2533
|
+
...o
|
|
2534
|
+
}
|
|
2535
|
+
},
|
|
2536
|
+
[
|
|
2537
|
+
$t("canvas", {
|
|
2538
|
+
style: {
|
|
2539
|
+
width: "100%",
|
|
2540
|
+
height: "100%"
|
|
2541
|
+
},
|
|
2542
|
+
ref: "signaturePadCanvas"
|
|
2543
|
+
})
|
|
2544
|
+
]
|
|
2545
|
+
);
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
function qn({ rel: e, href: t, crossorigin: o = !1 }) {
|
|
2549
|
+
const i = document.createElement("link");
|
|
2550
|
+
i.rel = e, i.href = t, i.crossorigin = o, document.head.appendChild(i);
|
|
2551
|
+
}
|
|
2552
|
+
const On = [
|
|
2553
|
+
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
|
|
2554
|
+
{ rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: !0 },
|
|
2555
|
+
{
|
|
2556
|
+
rel: "stylesheet",
|
|
2557
|
+
href: "https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do&display=swap"
|
|
2558
|
+
}
|
|
2559
|
+
], zn = {
|
|
2560
|
+
name: "SignatureAnswer",
|
|
2561
|
+
components: {
|
|
2562
|
+
CField: We,
|
|
2563
|
+
SignaturePad: Un
|
|
2564
|
+
},
|
|
2565
|
+
emits: ["invalid"],
|
|
2566
|
+
mixins: [Z([])],
|
|
2567
|
+
props: {
|
|
2568
|
+
onCompleteFunc: {
|
|
2569
|
+
type: Function,
|
|
2570
|
+
default: null
|
|
2571
|
+
}
|
|
2572
|
+
},
|
|
2573
|
+
data() {
|
|
2574
|
+
return {
|
|
2575
|
+
mode: "text",
|
|
2576
|
+
text: "",
|
|
2577
|
+
isEmpty: !0,
|
|
2578
|
+
penColor: "hsl(220, 100%, 50%)"
|
|
2579
|
+
};
|
|
2580
|
+
},
|
|
2581
|
+
watch: {
|
|
2582
|
+
mode(e) {
|
|
2583
|
+
this.reset(), this.$refs.signaturePad && e === "text" && this.focusName();
|
|
2584
|
+
},
|
|
2585
|
+
text() {
|
|
2586
|
+
this.$refs.signaturePad && this.$nextTick(() => {
|
|
2587
|
+
this.isEmpty = this.$refs.signaturePad.isEmpty();
|
|
2588
|
+
});
|
|
2589
|
+
},
|
|
2590
|
+
isEmpty: {
|
|
2591
|
+
immediate: !0,
|
|
2592
|
+
handler(e) {
|
|
2593
|
+
this.$emit("invalid", e);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
},
|
|
2597
|
+
created() {
|
|
2598
|
+
On.forEach(qn);
|
|
2599
|
+
},
|
|
2600
|
+
mounted() {
|
|
2601
|
+
this.focusName();
|
|
2602
|
+
},
|
|
2603
|
+
methods: {
|
|
2604
|
+
reset() {
|
|
2605
|
+
this.$refs.signaturePad && (this.$refs.signaturePad.clearSignature(), this.text && (this.text = ""), this.isEmpty = this.$refs.signaturePad.isEmpty());
|
|
2606
|
+
},
|
|
2607
|
+
undo() {
|
|
2608
|
+
this.$refs.signaturePad && (this.mode === "text" && this.text ? this.text = this.text.slice(0, this.text.length - 1) : this.$refs.signaturePad.undoSignature(), this.isEmpty = this.$refs.signaturePad.isEmpty());
|
|
2609
|
+
},
|
|
2610
|
+
getSignatureData() {
|
|
2611
|
+
let e = { type: "image/png", trim: !0 };
|
|
2612
|
+
this.mode === "draw" && (e = { type: "image/svg+xml", trim: !1 });
|
|
2613
|
+
const { isEmpty: t, data: o } = this.$refs.signaturePad ? this.$refs.signaturePad.saveSignature(e) : {};
|
|
2614
|
+
if (t || !o) throw Error("Missing signatureData");
|
|
2615
|
+
return o;
|
|
2616
|
+
},
|
|
2617
|
+
async submit({ answer: e }) {
|
|
2618
|
+
const t = this.getSignatureData();
|
|
2619
|
+
await e({ body: { isAccepted: !0, signatureDataURL: t } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
2620
|
+
},
|
|
2621
|
+
focusName() {
|
|
2622
|
+
this.$nextTick(
|
|
2623
|
+
() => this.$refs.nameInput ? this.$refs.nameInput.focus() : null
|
|
2624
|
+
);
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
}, jn = { style: { "text-align": "left" } }, Vn = {
|
|
2628
|
+
class: "flex w-full items-center justify-between",
|
|
2629
|
+
style: { "font-size": "16px", "padding-bottom": "1em", "font-weight": "500", color: "hsl(0, 0%, 11%)" }
|
|
2630
|
+
}, Wn = { class: "sign-toggle" }, Hn = {
|
|
2631
|
+
class: "wrapper",
|
|
2632
|
+
style: { "padding-bottom": "5px" }
|
|
2633
|
+
}, Yn = { style: { position: "absolute", left: "1em", top: "0.75em", "font-size": "12px", color: "hsl(0, 0%, 50%)" } }, Gn = { class: "flex w-full justify-end" }, Kn = {
|
|
2634
|
+
class: "text-center",
|
|
2635
|
+
style: { "font-size": "12px", color: "hsl(0, 0%, 45%)", "padding-top": "10px" }
|
|
2636
|
+
};
|
|
2637
|
+
function Jn(e, t, o, i, n, s) {
|
|
2638
|
+
const r = $("CInput"), a = $("CField"), l = $("SignaturePad"), u = $("CButton");
|
|
2639
|
+
return D(), R("div", jn, [
|
|
2640
|
+
y("div", Vn, [
|
|
2641
|
+
y("div", null, I(e._document.$t("answerModal.signature.component.subTitle")), 1),
|
|
2642
|
+
y("div", Wn, [
|
|
2643
|
+
y("div", {
|
|
2644
|
+
class: Ht([{ active: n.mode === "text" }, "sign-toggle-button"]),
|
|
2645
|
+
onClick: t[0] || (t[0] = (c) => n.mode = "text")
|
|
2646
|
+
}, I(e._document.$t("answerModal.signature.component.text.tab")), 3),
|
|
2647
|
+
y("div", {
|
|
2648
|
+
class: Ht([{ active: n.mode === "draw" }, "sign-toggle-button"]),
|
|
2649
|
+
onClick: t[1] || (t[1] = (c) => n.mode = "draw")
|
|
2650
|
+
}, I(e._document.$t("answerModal.signature.component.draw.tab")), 3)
|
|
2651
|
+
])
|
|
2652
|
+
]),
|
|
2653
|
+
n.mode === "text" ? (D(), Q(a, {
|
|
2654
|
+
key: 0,
|
|
2655
|
+
label: e._document.$t("answerModal.signature.component.text.nameLabel")
|
|
2656
|
+
}, {
|
|
2657
|
+
default: N(() => [
|
|
2658
|
+
B(r, {
|
|
2659
|
+
ref: "nameInput",
|
|
2660
|
+
modelValue: n.text,
|
|
2661
|
+
"onUpdate:modelValue": t[2] || (t[2] = (c) => n.text = c),
|
|
2662
|
+
placeholder: e._document.$t("answerModal.signature.component.text.namePlaceholder")
|
|
2663
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
2664
|
+
]),
|
|
2665
|
+
_: 1
|
|
2666
|
+
}, 8, ["label"])) : L("", !0),
|
|
2667
|
+
y("div", Hn, [
|
|
2668
|
+
t[3] || (t[3] = y("div", { class: "background-image" }, [
|
|
2669
|
+
y("svg", {
|
|
2670
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2671
|
+
width: "100%",
|
|
2672
|
+
height: "100%"
|
|
2673
|
+
}, [
|
|
2674
|
+
y("line", {
|
|
2675
|
+
x1: "0",
|
|
2676
|
+
y1: "75%",
|
|
2677
|
+
x2: "100%",
|
|
2678
|
+
y2: "75%",
|
|
2679
|
+
stroke: "hsl(0,0%, 70%)",
|
|
2680
|
+
"stroke-width": "1",
|
|
2681
|
+
"stroke-linecap": "round",
|
|
2682
|
+
"stroke-dasharray": "3",
|
|
2683
|
+
"shape-rendering": "crispEdges",
|
|
2684
|
+
"pointer-events": "none"
|
|
2685
|
+
})
|
|
2686
|
+
])
|
|
2687
|
+
], -1)),
|
|
2688
|
+
y("div", Yn, I(e._document.$t(`answerModal.signature.component.${n.mode}.canvasLabel`)), 1),
|
|
2689
|
+
t[4] || (t[4] = y("span", { style: { "font-family": "'Nothing You Could Do', cursive" } }, null, -1)),
|
|
2690
|
+
B(l, {
|
|
2691
|
+
ref: "signaturePad",
|
|
2692
|
+
type: n.mode,
|
|
2693
|
+
text: n.text,
|
|
2694
|
+
options: {
|
|
2695
|
+
penColor: n.penColor
|
|
2696
|
+
},
|
|
2697
|
+
"sign-events": {
|
|
2698
|
+
endStroke: () => {
|
|
2699
|
+
n.isEmpty = e.$refs.signaturePad ? e.$refs.signaturePad.isEmpty() : !0;
|
|
2700
|
+
}
|
|
2701
|
+
},
|
|
2702
|
+
class: "signature-pad"
|
|
2703
|
+
}, null, 8, ["type", "text", "options", "sign-events"])
|
|
2704
|
+
]),
|
|
2705
|
+
Ue(y("div", Gn, [
|
|
2706
|
+
B(u, {
|
|
2707
|
+
disabled: n.isEmpty,
|
|
2708
|
+
type: "text",
|
|
2709
|
+
size: "small",
|
|
2710
|
+
pattern: "tertiary",
|
|
2711
|
+
circle: "",
|
|
2712
|
+
icon: "trash",
|
|
2713
|
+
onClick: s.reset
|
|
2714
|
+
}, null, 8, ["disabled", "onClick"]),
|
|
2715
|
+
B(u, {
|
|
2716
|
+
disabled: n.isEmpty,
|
|
2717
|
+
type: "text",
|
|
2718
|
+
size: "small",
|
|
2719
|
+
pattern: "tertiary",
|
|
2720
|
+
circle: "",
|
|
2721
|
+
icon: "rotate-left",
|
|
2722
|
+
onClick: s.undo
|
|
2723
|
+
}, null, 8, ["disabled", "onClick"])
|
|
2724
|
+
], 512), [
|
|
2725
|
+
[qe, n.mode === "draw"]
|
|
2726
|
+
]),
|
|
2727
|
+
y("div", Kn, I(e._document.$t("answerModal.signature.component.terms")), 1)
|
|
2728
|
+
]);
|
|
2729
|
+
}
|
|
2730
|
+
const Xn = /* @__PURE__ */ tt(zn, [["render", Jn], ["__scopeId", "data-v-6857111d"]]), Qn = () => {
|
|
2731
|
+
const e = window.location.host.split(".");
|
|
2732
|
+
return e && e[0];
|
|
2733
|
+
}, Zn = Qn() === "fortnox", ti = [
|
|
2734
|
+
"enjoyedExperience",
|
|
2735
|
+
// boolean value
|
|
2736
|
+
"whatToImprove"
|
|
2737
|
+
// string value
|
|
2738
|
+
], ei = {
|
|
2739
|
+
emits: ["page", "close"],
|
|
2740
|
+
mixins: [Z([])],
|
|
2741
|
+
props: {
|
|
2742
|
+
publicId: {
|
|
2743
|
+
type: String,
|
|
2744
|
+
default: ""
|
|
2745
|
+
}
|
|
2746
|
+
},
|
|
2747
|
+
data() {
|
|
2748
|
+
return {
|
|
2749
|
+
page: "start",
|
|
2750
|
+
whatToImprove: ""
|
|
2751
|
+
};
|
|
2752
|
+
},
|
|
2753
|
+
computed: {
|
|
2754
|
+
showPostFeedbackActions() {
|
|
2755
|
+
return Se.value !== "widget" && !Zn;
|
|
2756
|
+
}
|
|
2757
|
+
},
|
|
2758
|
+
created() {
|
|
2759
|
+
this.$nextTick(() => {
|
|
2760
|
+
this.startAnimation();
|
|
2761
|
+
});
|
|
2762
|
+
},
|
|
2763
|
+
methods: {
|
|
2764
|
+
async submitFeedback({ type: e, data: t }) {
|
|
2765
|
+
if (!this.publicId) throw Error("Missing param publicId");
|
|
2766
|
+
if (!e) throw Error("Missing param type");
|
|
2767
|
+
if (!ti.includes(e)) throw Error("Invalid feedback type");
|
|
2768
|
+
if (!t) throw Error("Missing param data");
|
|
2769
|
+
let o = "positive";
|
|
2770
|
+
if (e === "whatToImprove" && !t.value) {
|
|
2771
|
+
this.goTo("negative.success");
|
|
2772
|
+
return;
|
|
2773
|
+
}
|
|
2774
|
+
try {
|
|
2775
|
+
Oe.feedback(this.publicId, { type: e, data: t }), e === "enjoyedExperience" && !t.value && (o = "negative"), e === "whatToImprove" && (o = "negative.success");
|
|
2776
|
+
} catch (i) {
|
|
2777
|
+
Lt(i, { showMessage: !1 });
|
|
2778
|
+
} finally {
|
|
2779
|
+
this.goTo(o);
|
|
2780
|
+
}
|
|
2781
|
+
},
|
|
2782
|
+
async goTo(e) {
|
|
2783
|
+
if (e === "positive" && !this.showPostFeedbackActions && setTimeout(() => {
|
|
2784
|
+
this.close();
|
|
2785
|
+
}, 2e3), this.$emit("page", e), e === "positive" || e === "negative") {
|
|
2786
|
+
this.$refs.start.style.opacity = 0, this.page = "intermediate", setTimeout(() => {
|
|
2787
|
+
this.page = e;
|
|
2788
|
+
}, 2e3);
|
|
2789
|
+
return;
|
|
2790
|
+
}
|
|
2791
|
+
this.page = e;
|
|
2792
|
+
},
|
|
2793
|
+
startAnimation() {
|
|
2794
|
+
const e = this.$refs.feedbackBg;
|
|
2795
|
+
e.gradOneXPos = 0, e.gradOneYPos = 0, e.gradTwoXPos = 80, e.gradTwoYPos = 20, e.gradThreeXPos = 20, e.gradThreeYPos = 80, e.gradFourXPos = 80, e.gradFourYPos = 80, z({
|
|
2796
|
+
targets: e,
|
|
2797
|
+
duration: 12e3,
|
|
2798
|
+
direction: "alternate",
|
|
2799
|
+
easing: "linear",
|
|
2800
|
+
loop: !0,
|
|
2801
|
+
gradOneXPos: [10, 5, 0, -10],
|
|
2802
|
+
gradOneYPos: [10, 20, 25, 30],
|
|
2803
|
+
gradTwoXPos: [25, 20, 15, 10, 25],
|
|
2804
|
+
gradTwoYPos: [65, 55, 40, 65, 80],
|
|
2805
|
+
gradThreeXPos: [25, 20, 10, 15, 25],
|
|
2806
|
+
gradThreeYPos: [65, 50, 45, 60, 80],
|
|
2807
|
+
gradFourXPos: [85, 80, 75, 70, 95],
|
|
2808
|
+
gradFourYPos: [90, 100, 120, 100, 85],
|
|
2809
|
+
update() {
|
|
2810
|
+
e.style.setProperty(
|
|
2811
|
+
"--gradOneXPos",
|
|
2812
|
+
`${e.gradOneXPos}%`
|
|
2813
|
+
), e.style.setProperty(
|
|
2814
|
+
"--gradOneYPos",
|
|
2815
|
+
`${e.gradOneYPos}%`
|
|
2816
|
+
), e.style.setProperty(
|
|
2817
|
+
"--gradTwoXPos",
|
|
2818
|
+
`${e.gradTwoXPos}%`
|
|
2819
|
+
), e.style.setProperty(
|
|
2820
|
+
"--gradTwoYPos",
|
|
2821
|
+
`${e.gradTwoYPos}%`
|
|
2822
|
+
), e.style.setProperty(
|
|
2823
|
+
"--gradThreeXPos",
|
|
2824
|
+
`${e.gradThreeXPos}%`
|
|
2825
|
+
), e.style.setProperty(
|
|
2826
|
+
"--gradThreeYPos",
|
|
2827
|
+
`${e.gradThreeYPos}%`
|
|
2828
|
+
), e.style.setProperty(
|
|
2829
|
+
"--gradFourXPos",
|
|
2830
|
+
`${e.gradFourXPos}%`
|
|
2831
|
+
), e.style.setProperty(
|
|
2832
|
+
"--gradFourYPos",
|
|
2833
|
+
`${e.gradFourYPos}%`
|
|
2834
|
+
);
|
|
2835
|
+
}
|
|
2836
|
+
});
|
|
2837
|
+
},
|
|
2838
|
+
// animations
|
|
2839
|
+
leave(e, t) {
|
|
2840
|
+
z({
|
|
2841
|
+
targets: e,
|
|
2842
|
+
// height: 0,
|
|
2843
|
+
// opacity: [1, 0],
|
|
2844
|
+
opacity: 0,
|
|
2845
|
+
duration: 500,
|
|
2846
|
+
easing: "easeInOutCubic",
|
|
2847
|
+
complete: t
|
|
2848
|
+
});
|
|
2849
|
+
},
|
|
2850
|
+
enter(e, t) {
|
|
2851
|
+
z({
|
|
2852
|
+
targets: e,
|
|
2853
|
+
delay: this.page === "intermediate" ? 250 : 0,
|
|
2854
|
+
duration: 500,
|
|
2855
|
+
opacity: [0, 1],
|
|
2856
|
+
easing: "easeInOutCubic",
|
|
2857
|
+
complete: t
|
|
2858
|
+
});
|
|
2859
|
+
},
|
|
2860
|
+
close() {
|
|
2861
|
+
this.$emit("close");
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
}, ni = { class: "f-feedback" }, ii = {
|
|
2865
|
+
ref: "feedbackBg",
|
|
2866
|
+
class: "f-bg"
|
|
2867
|
+
}, si = { class: "f-container" }, oi = {
|
|
2868
|
+
ref: "start",
|
|
2869
|
+
key: "start",
|
|
2870
|
+
class: "flex w-full flex-col items-center justify-center",
|
|
2871
|
+
style: { transition: "opacity 250ms" }
|
|
2872
|
+
}, ri = ["textContent"], ai = {
|
|
2873
|
+
key: "intermediate",
|
|
2874
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
2875
|
+
}, li = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, ci = ["textContent"], ui = {
|
|
2876
|
+
key: "positive",
|
|
2877
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
2878
|
+
}, di = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, hi = ["textContent"], fi = ["textContent"], gi = {
|
|
2879
|
+
key: "negative",
|
|
2880
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
2881
|
+
}, mi = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, pi = ["textContent"], wi = ["textContent"], yi = {
|
|
2882
|
+
key: "success",
|
|
2883
|
+
style: { height: "100%", display: "flex", "flex-direction": "column" }
|
|
2884
|
+
}, vi = { style: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, _i = ["textContent"], Ci = ["textContent"];
|
|
2885
|
+
function xi(e, t, o, i, n, s) {
|
|
2886
|
+
const r = $("CButton"), a = $("CInput");
|
|
2887
|
+
return D(), R("div", ni, [
|
|
2888
|
+
y("div", ii, null, 512),
|
|
2889
|
+
y("div", si, [
|
|
2890
|
+
B(Ut, {
|
|
2891
|
+
css: !1,
|
|
2892
|
+
mode: "out-in",
|
|
2893
|
+
onEnter: s.enter,
|
|
2894
|
+
onLeave: s.leave
|
|
2895
|
+
}, {
|
|
2896
|
+
default: N(() => [
|
|
2897
|
+
n.page === "start" ? (D(), R("div", oi, [
|
|
2898
|
+
y("div", {
|
|
2899
|
+
style: { "padding-bottom": "calc(1.5 * var(--rem))", "font-size": "14px", "font-weight": "500" },
|
|
2900
|
+
textContent: I(e._document.$t("answerFeedback.start.title"))
|
|
2901
|
+
}, null, 8, ri),
|
|
2902
|
+
y("div", null, [
|
|
2903
|
+
B(r, {
|
|
2904
|
+
"icon-left": "thumbsdown",
|
|
2905
|
+
size: "small",
|
|
2906
|
+
pattern: "secondary",
|
|
2907
|
+
class: "feedback-btn",
|
|
2908
|
+
onClick: t[0] || (t[0] = (l) => s.submitFeedback({
|
|
2909
|
+
type: "enjoyedExperience",
|
|
2910
|
+
data: { value: !1 }
|
|
2911
|
+
}))
|
|
2912
|
+
}, {
|
|
2913
|
+
default: N(() => [
|
|
2914
|
+
K(I(e._document.$t("answerFeedback.start.no")), 1)
|
|
2915
|
+
]),
|
|
2916
|
+
_: 1
|
|
2917
|
+
}),
|
|
2918
|
+
B(r, {
|
|
2919
|
+
"icon-left": "thumbsup",
|
|
2920
|
+
size: "small",
|
|
2921
|
+
pattern: "secondary",
|
|
2922
|
+
class: "feedback-btn",
|
|
2923
|
+
style: { "margin-left": "calc(0.75 * var(--rem))" },
|
|
2924
|
+
onClick: t[1] || (t[1] = (l) => s.submitFeedback({
|
|
2925
|
+
type: "enjoyedExperience",
|
|
2926
|
+
data: { value: !0 }
|
|
2927
|
+
}))
|
|
2928
|
+
}, {
|
|
2929
|
+
default: N(() => [
|
|
2930
|
+
K(I(e._document.$t("answerFeedback.start.yes")), 1)
|
|
2931
|
+
]),
|
|
2932
|
+
_: 1
|
|
2933
|
+
})
|
|
2934
|
+
])
|
|
2935
|
+
], 512)) : n.page === "intermediate" ? (D(), R("div", ai, [
|
|
2936
|
+
y("div", li, [
|
|
2937
|
+
y("div", {
|
|
2938
|
+
class: "f-title",
|
|
2939
|
+
textContent: I(e._document.$t("answerFeedback.intermediate.title"))
|
|
2940
|
+
}, null, 8, ci)
|
|
2941
|
+
])
|
|
2942
|
+
])) : n.page === "positive" ? (D(), R("div", ui, [
|
|
2943
|
+
y("div", di, [
|
|
2944
|
+
y("div", {
|
|
2945
|
+
class: "f-title",
|
|
2946
|
+
textContent: I(e._document.$t("answerFeedback.yes.title"))
|
|
2947
|
+
}, null, 8, hi),
|
|
2948
|
+
y("div", {
|
|
2949
|
+
textContent: I(e._document.$t("answerFeedback.yes.text"))
|
|
2950
|
+
}, null, 8, fi)
|
|
2951
|
+
]),
|
|
2952
|
+
B(r, {
|
|
2953
|
+
class: "a-btn",
|
|
2954
|
+
type: "secondary",
|
|
2955
|
+
wide: "",
|
|
2956
|
+
tag: "a",
|
|
2957
|
+
href: "/register?utm_source=document&utm_medium=feedback-modal&utm_campaign=signup&utm_content=positive-exp",
|
|
2958
|
+
target: "_blank",
|
|
2959
|
+
style: { "margin-bottom": "0.5em" },
|
|
2960
|
+
textContent: I(e._document.$t("answerFeedback.yes.action"))
|
|
2961
|
+
}, null, 8, ["textContent"]),
|
|
2962
|
+
B(r, {
|
|
2963
|
+
class: "a-btn",
|
|
2964
|
+
wide: "",
|
|
2965
|
+
tag: "a",
|
|
2966
|
+
href: `https://${e.$t(
|
|
2967
|
+
"_common:brand.domain"
|
|
2968
|
+
)}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=positive-exp`,
|
|
2969
|
+
target: "_blank",
|
|
2970
|
+
textContent: I(e._document.$t("answerFeedback.yes.secondary"))
|
|
2971
|
+
}, null, 8, ["href", "textContent"])
|
|
2972
|
+
])) : n.page === "negative" ? (D(), R("div", gi, [
|
|
2973
|
+
y("div", mi, [
|
|
2974
|
+
y("div", {
|
|
2975
|
+
class: "f-title",
|
|
2976
|
+
textContent: I(e._document.$t("answerFeedback.no.start.title"))
|
|
2977
|
+
}, null, 8, pi),
|
|
2978
|
+
y("div", {
|
|
2979
|
+
textContent: I(e._document.$t("answerFeedback.no.start.text"))
|
|
2980
|
+
}, null, 8, wi),
|
|
2981
|
+
B(a, {
|
|
2982
|
+
modelValue: n.whatToImprove,
|
|
2983
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => n.whatToImprove = l),
|
|
2984
|
+
placeholder: e._document.$t("answerFeedback.no.start.placeholder"),
|
|
2985
|
+
type: "textarea",
|
|
2986
|
+
class: "input-style",
|
|
2987
|
+
style: { margin: "2em 0" }
|
|
2988
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
2989
|
+
]),
|
|
2990
|
+
B(r, {
|
|
2991
|
+
wide: "",
|
|
2992
|
+
class: "a-btn",
|
|
2993
|
+
onClick: t[3] || (t[3] = (l) => s.submitFeedback({
|
|
2994
|
+
type: "whatToImprove",
|
|
2995
|
+
data: { value: n.whatToImprove }
|
|
2996
|
+
})),
|
|
2997
|
+
textContent: I(e._document.$t("answerFeedback.no.start.action"))
|
|
2998
|
+
}, null, 8, ["textContent"])
|
|
2999
|
+
])) : n.page === "negative.success" ? (D(), R("div", yi, [
|
|
3000
|
+
y("div", vi, [
|
|
3001
|
+
y("div", {
|
|
3002
|
+
class: "f-title",
|
|
3003
|
+
textContent: I(e._document.$t("answerFeedback.no.success.title"))
|
|
3004
|
+
}, null, 8, _i),
|
|
3005
|
+
y("div", {
|
|
3006
|
+
textContent: I(e._document.$t("answerFeedback.no.success.text"))
|
|
3007
|
+
}, null, 8, Ci)
|
|
3008
|
+
]),
|
|
3009
|
+
B(r, {
|
|
3010
|
+
class: "a-btn",
|
|
3011
|
+
tag: "a",
|
|
3012
|
+
href: `https://${e.$t(
|
|
3013
|
+
"_common:brand.domain"
|
|
3014
|
+
)}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=negative-exp`,
|
|
3015
|
+
target: "_blank",
|
|
3016
|
+
wide: "",
|
|
3017
|
+
type: "secondary",
|
|
3018
|
+
style: { "margin-bottom": "0.5em" },
|
|
3019
|
+
textContent: I(e._document.$t("answerFeedback.no.success.action"))
|
|
3020
|
+
}, null, 8, ["href", "textContent"]),
|
|
3021
|
+
B(r, {
|
|
3022
|
+
class: "a-btn",
|
|
3023
|
+
wide: "",
|
|
3024
|
+
onClick: s.close,
|
|
3025
|
+
textContent: I(e._document.$t("answerFeedback.no.success.secondary"))
|
|
3026
|
+
}, null, 8, ["onClick", "textContent"])
|
|
3027
|
+
])) : L("", !0)
|
|
3028
|
+
]),
|
|
3029
|
+
_: 1
|
|
3030
|
+
}, 8, ["onEnter", "onLeave"])
|
|
3031
|
+
])
|
|
3032
|
+
]);
|
|
3033
|
+
}
|
|
3034
|
+
const bi = /* @__PURE__ */ tt(ei, [["render", xi], ["__scopeId", "data-v-ed8d6ec3"]]), Pi = {
|
|
3035
|
+
components: {
|
|
3036
|
+
Feedback: bi,
|
|
3037
|
+
Signature: Xn,
|
|
3038
|
+
BankId: In,
|
|
3039
|
+
Deny: Rn
|
|
3040
|
+
},
|
|
3041
|
+
mixins: [Z([])],
|
|
3042
|
+
i18nOptions: {
|
|
3043
|
+
namespaces: "temporary",
|
|
3044
|
+
messages: {
|
|
3045
|
+
en: {
|
|
3046
|
+
previewMode: "Preview answer mode"
|
|
3047
|
+
},
|
|
3048
|
+
sv: {
|
|
3049
|
+
previewMode: "Demo - Förhandsgranska"
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
},
|
|
3053
|
+
emits: ["cancel", "close"],
|
|
3054
|
+
props: {
|
|
3055
|
+
mode: { type: String, default: "accept" },
|
|
3056
|
+
// 'accept', 'decline'
|
|
3057
|
+
isSender: { type: Boolean, default: !1 },
|
|
3058
|
+
senderActions: { type: Object, default: () => ({}) },
|
|
3059
|
+
calcHeight: { type: Boolean, default: !1 }
|
|
3060
|
+
},
|
|
3061
|
+
data() {
|
|
3062
|
+
return {
|
|
3063
|
+
page: "start",
|
|
3064
|
+
// start | intermediate | success | versionError
|
|
3065
|
+
isFeedbackInitiated: !1,
|
|
3066
|
+
isPosting: !1,
|
|
3067
|
+
actionInvalid: !1
|
|
3068
|
+
};
|
|
3069
|
+
},
|
|
3070
|
+
computed: {
|
|
3071
|
+
answerComponentName() {
|
|
3072
|
+
return this.mode === "decline" ? "Deny" : this.answerMethod === "bankId" ? "BankId" : "Signature";
|
|
3073
|
+
},
|
|
3074
|
+
answerType() {
|
|
3075
|
+
return this.mode === "decline" ? "decline" : this.answerMethod === "bankId" ? "bankId" : "signature";
|
|
3076
|
+
},
|
|
3077
|
+
signee() {
|
|
3078
|
+
return this.isSender ? this._document.senderClient : this._document.viewer;
|
|
3079
|
+
},
|
|
3080
|
+
answerMethod() {
|
|
3081
|
+
var e;
|
|
3082
|
+
return (e = this.signee.answerMethod) == null ? void 0 : e.accept;
|
|
3083
|
+
},
|
|
3084
|
+
successStrings() {
|
|
3085
|
+
const e = this.signee.email ? this._document.$t(`answerModal.${this.answerType}.success.text`, {
|
|
3086
|
+
email: this.signee.email
|
|
3087
|
+
}) : this._document.$t(
|
|
3088
|
+
`answerModal.${this.answerType}.success.textFallback`
|
|
3089
|
+
), t = this.signee.email ? this._document.$t("answerModal.successTextSingle", {
|
|
3090
|
+
email: this.signee.email
|
|
3091
|
+
}) : this._document.$t("answerModal.successTextFallbackSingle"), o = this._document.remainingSignatures === 0 ? t : e;
|
|
3092
|
+
return {
|
|
3093
|
+
title: this._document.$t(
|
|
3094
|
+
`answerModal.${this.answerType}.success.title`
|
|
3095
|
+
),
|
|
3096
|
+
text: o
|
|
3097
|
+
};
|
|
3098
|
+
}
|
|
3099
|
+
},
|
|
3100
|
+
created() {
|
|
3101
|
+
this.calcHeight && this.$nextTick(() => this.setFixedHeight());
|
|
3102
|
+
},
|
|
3103
|
+
methods: {
|
|
3104
|
+
...ze({
|
|
3105
|
+
answerCurrentDoc: ct.ANSWER_CURRENT_PUBLIC_DOCUMENT,
|
|
3106
|
+
putCurrentDoc: ct.PUT_CURRENT_PUBLIC_DOCUMENT,
|
|
3107
|
+
reloadCurrentDocument: ct.RELOAD_CURRENT_DOCUMENT
|
|
3108
|
+
}),
|
|
3109
|
+
async onSubmit() {
|
|
3110
|
+
this.setFixedHeight(), await this.submit();
|
|
3111
|
+
},
|
|
3112
|
+
async submit() {
|
|
3113
|
+
if (!this.isPosting) {
|
|
3114
|
+
this.isPosting = !0;
|
|
3115
|
+
try {
|
|
3116
|
+
const { submit: e } = this.$refs.answerComponent;
|
|
3117
|
+
if (typeof e != "function")
|
|
3118
|
+
throw Error("Missing answer type submit method");
|
|
3119
|
+
await e({
|
|
3120
|
+
update: (t) => this.putCurrentDoc({ includeChanges: !0, ...t }),
|
|
3121
|
+
answer: this.answerCurrentDoc,
|
|
3122
|
+
...this.isSender ? this.senderActions : null
|
|
3123
|
+
});
|
|
3124
|
+
} catch (e) {
|
|
3125
|
+
this.isPosting = !1, e.httpStatusCode === 409 ? this.page = "versionError" : Lt(e);
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
},
|
|
3129
|
+
onComplete() {
|
|
3130
|
+
return (async () => {
|
|
3131
|
+
var o;
|
|
3132
|
+
if (this.isSender && this.senderActions.send) {
|
|
3133
|
+
this.$emit("close"), await this.senderActions.send();
|
|
3134
|
+
return;
|
|
3135
|
+
}
|
|
3136
|
+
const t = this.mode === "accept";
|
|
3137
|
+
this.mode === "accept" && this.answerMethod === "bankId" ? setTimeout(
|
|
3138
|
+
() => this.reloadCurrentDocument().then(
|
|
3139
|
+
() => {
|
|
3140
|
+
var i;
|
|
3141
|
+
return Yt.trigger("document:answer", {
|
|
3142
|
+
id: (i = this._document) == null ? void 0 : i.id,
|
|
3143
|
+
didAccept: t
|
|
3144
|
+
});
|
|
3145
|
+
}
|
|
3146
|
+
),
|
|
3147
|
+
1e3
|
|
3148
|
+
) : Yt.trigger("document:answer", {
|
|
3149
|
+
id: (o = this._document) == null ? void 0 : o.id,
|
|
3150
|
+
didAccept: t
|
|
3151
|
+
}), await Gt(800), this.page = "intermediate", await Gt(2e3), this.page = "success", this.isPosting = !1;
|
|
3152
|
+
})();
|
|
3153
|
+
},
|
|
3154
|
+
reload() {
|
|
3155
|
+
window.location.reload();
|
|
3156
|
+
},
|
|
3157
|
+
setFixedHeight() {
|
|
3158
|
+
this.$el.style.minHeight = `${this.$el.offsetHeight}px`;
|
|
3159
|
+
},
|
|
3160
|
+
minimizeHeight(e, t) {
|
|
3161
|
+
z({
|
|
3162
|
+
targets: e,
|
|
3163
|
+
height: 0,
|
|
3164
|
+
flexGrow: [1, 0],
|
|
3165
|
+
opacity: [1, 0],
|
|
3166
|
+
duration: 900,
|
|
3167
|
+
easing: "easeOutQuint",
|
|
3168
|
+
complete: t
|
|
3169
|
+
}), z({
|
|
3170
|
+
targets: this.$refs.feedback.$el,
|
|
3171
|
+
height: 0,
|
|
3172
|
+
flexGrow: 1,
|
|
3173
|
+
duration: 900,
|
|
3174
|
+
easing: "easeOutQuint"
|
|
3175
|
+
});
|
|
3176
|
+
},
|
|
3177
|
+
enterAnim(e, t) {
|
|
3178
|
+
z({
|
|
3179
|
+
targets: e.querySelectorAll(".stagger-anim"),
|
|
3180
|
+
opacity: [0, 1],
|
|
3181
|
+
delay: z.stagger(180, { start: 800 }),
|
|
3182
|
+
duration: 340,
|
|
3183
|
+
easing: "linear",
|
|
3184
|
+
complete: t
|
|
3185
|
+
});
|
|
3186
|
+
},
|
|
3187
|
+
leaveAnim(e, t) {
|
|
3188
|
+
e.style.position = "absolute", z({
|
|
3189
|
+
targets: e.querySelectorAll(".stagger-anim"),
|
|
3190
|
+
opacity: 0,
|
|
3191
|
+
delay: z.stagger(200),
|
|
3192
|
+
duration: 200,
|
|
3193
|
+
easing: "linear",
|
|
3194
|
+
complete: t
|
|
3195
|
+
});
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
}, Ei = {
|
|
3199
|
+
key: "start",
|
|
3200
|
+
class: "root-padding flex-grow"
|
|
3201
|
+
}, Si = {
|
|
3202
|
+
class: "stagger-anim",
|
|
3203
|
+
style: { "padding-bottom": "40px" }
|
|
3204
|
+
}, ki = ["textContent"], Ti = ["textContent"], Mi = {
|
|
3205
|
+
class: "stagger-anim",
|
|
3206
|
+
style: { "padding-top": "3em" }
|
|
3207
|
+
}, Ii = {
|
|
3208
|
+
key: "intermediate",
|
|
3209
|
+
class: "flex w-full flex-grow flex-col items-center justify-center text-center",
|
|
3210
|
+
style: { height: "100%" }
|
|
3211
|
+
}, Ai = ["textContent"], Bi = {
|
|
3212
|
+
key: "success",
|
|
3213
|
+
class: "flex w-full flex-grow flex-col",
|
|
3214
|
+
style: { height: "100%" }
|
|
3215
|
+
}, Di = {
|
|
3216
|
+
key: 0,
|
|
3217
|
+
class: "flex w-full flex-grow flex-col items-center justify-center",
|
|
3218
|
+
style: { overflow: "hidden" }
|
|
3219
|
+
}, Ri = {
|
|
3220
|
+
style: { height: "100%" },
|
|
3221
|
+
class: "root-padding flex w-full flex-col items-center justify-center"
|
|
3222
|
+
}, Fi = {
|
|
3223
|
+
class: "a-title stagger-anim",
|
|
3224
|
+
style: { padding: "calc(2.5 * var(--rem)) 0 calc(2 * var(--rem))" }
|
|
3225
|
+
}, $i = ["textContent"], Ni = ["textContent"], Li = {
|
|
3226
|
+
key: "versionError",
|
|
3227
|
+
class: "root-padding flex flex-grow flex-col items-center justify-center text-center"
|
|
3228
|
+
}, Ui = { class: "stagger-anim" }, qi = {
|
|
3229
|
+
class: "flex items-center justify-center",
|
|
3230
|
+
style: { padding: "20px 0" }
|
|
3231
|
+
}, Oi = {
|
|
3232
|
+
class: "flex items-center justify-center",
|
|
3233
|
+
style: { width: "52px", height: "52px", "border-radius": "50%" }
|
|
3234
|
+
}, zi = ["textContent"], ji = ["textContent"], Vi = {
|
|
3235
|
+
class: "stagger-anim",
|
|
3236
|
+
style: { "padding-top": "3em" }
|
|
3237
|
+
};
|
|
3238
|
+
function Wi(e, t, o, i, n, s) {
|
|
3239
|
+
const r = $("CButton"), a = $("Feedback"), l = $("CIcon");
|
|
3240
|
+
return D(), Q(Ve, {
|
|
3241
|
+
class: "a-root font-inter",
|
|
3242
|
+
tag: "div",
|
|
3243
|
+
css: !1,
|
|
3244
|
+
mode: "out-in",
|
|
3245
|
+
onEnter: s.enterAnim,
|
|
3246
|
+
onLeave: s.leaveAnim
|
|
3247
|
+
}, {
|
|
3248
|
+
default: N(() => {
|
|
3249
|
+
var u;
|
|
3250
|
+
return [
|
|
3251
|
+
B(r, {
|
|
3252
|
+
key: "btn",
|
|
3253
|
+
icon: "x",
|
|
3254
|
+
circle: "",
|
|
3255
|
+
class: "text-[hsl(0, 0%, 45%)] absolute right-5 top-5 z-[9]",
|
|
3256
|
+
onClick: t[0] || (t[0] = () => {
|
|
3257
|
+
e.$emit("cancel"), e.$emit("close");
|
|
3258
|
+
})
|
|
3259
|
+
}),
|
|
3260
|
+
n.page === "start" ? (D(), R("div", Ei, [
|
|
3261
|
+
y("div", Si, [
|
|
3262
|
+
y("div", {
|
|
3263
|
+
class: "a-title",
|
|
3264
|
+
textContent: I(e._document.$t(`answerModal.${s.answerType}.start.title`))
|
|
3265
|
+
}, null, 8, ki),
|
|
3266
|
+
y("div", {
|
|
3267
|
+
style: { color: "hsl(0, 0%, 40%)" },
|
|
3268
|
+
textContent: I(e._document.$t(`answerModal.${s.answerType}.start.text`))
|
|
3269
|
+
}, null, 8, Ti)
|
|
3270
|
+
]),
|
|
3271
|
+
(D(), Q(je(s.answerComponentName), {
|
|
3272
|
+
ref: "answerComponent",
|
|
3273
|
+
_document: e._document,
|
|
3274
|
+
signee: s.signee,
|
|
3275
|
+
"on-complete-func": s.onComplete,
|
|
3276
|
+
class: "stagger-anim",
|
|
3277
|
+
onInvalid: t[1] || (t[1] = (c) => n.actionInvalid = c),
|
|
3278
|
+
onLoading: t[2] || (t[2] = (c) => n.isPosting = c)
|
|
3279
|
+
}, null, 40, ["_document", "signee", "on-complete-func"])),
|
|
3280
|
+
y("div", Mi, [
|
|
3281
|
+
B(r, {
|
|
3282
|
+
loading: n.isPosting,
|
|
3283
|
+
disabled: n.actionInvalid,
|
|
3284
|
+
type: o.mode === "decline" ? "text" : "secondary",
|
|
3285
|
+
class: "a-btn",
|
|
3286
|
+
icon: s.answerType === "bankId" ? "bankId" : "",
|
|
3287
|
+
onClick: s.onSubmit
|
|
3288
|
+
}, {
|
|
3289
|
+
default: N(() => [
|
|
3290
|
+
K(I(e._document.$t(`answerModal.${s.answerType}.start.action`)), 1)
|
|
3291
|
+
]),
|
|
3292
|
+
_: 1
|
|
3293
|
+
}, 8, ["loading", "disabled", "type", "icon", "onClick"])
|
|
3294
|
+
])
|
|
3295
|
+
])) : n.page === "intermediate" ? (D(), R("div", Ii, [
|
|
3296
|
+
y("div", {
|
|
3297
|
+
class: "a-title stagger-anim",
|
|
3298
|
+
textContent: I(e._document.$t("answerModal.answerSuccess"))
|
|
3299
|
+
}, null, 8, Ai)
|
|
3300
|
+
])) : n.page === "success" ? (D(), R("div", Bi, [
|
|
3301
|
+
B(Ut, {
|
|
3302
|
+
css: !1,
|
|
3303
|
+
onLeave: s.minimizeHeight
|
|
3304
|
+
}, {
|
|
3305
|
+
default: N(() => [
|
|
3306
|
+
n.isFeedbackInitiated ? L("", !0) : (D(), R("div", Di, [
|
|
3307
|
+
y("div", Ri, [
|
|
3308
|
+
y("div", Fi, [
|
|
3309
|
+
y("div", {
|
|
3310
|
+
textContent: I(s.successStrings.title)
|
|
3311
|
+
}, null, 8, $i)
|
|
3312
|
+
]),
|
|
3313
|
+
y("div", {
|
|
3314
|
+
class: "stagger-anim",
|
|
3315
|
+
textContent: I(s.successStrings.text)
|
|
3316
|
+
}, null, 8, Ni)
|
|
3317
|
+
])
|
|
3318
|
+
]))
|
|
3319
|
+
]),
|
|
3320
|
+
_: 1
|
|
3321
|
+
}, 8, ["onLeave"]),
|
|
3322
|
+
B(a, {
|
|
3323
|
+
ref: "feedback",
|
|
3324
|
+
"public-id": (u = e._document.viewer) == null ? void 0 : u.publicDocumentId,
|
|
3325
|
+
_document: e._document,
|
|
3326
|
+
style: { flex: "0 0", overflow: "hidden", "min-height": "200px" },
|
|
3327
|
+
class: "stagger-anim",
|
|
3328
|
+
onPage: t[3] || (t[3] = () => n.isFeedbackInitiated = !0),
|
|
3329
|
+
onClose: t[4] || (t[4] = (c) => e.$emit("close"))
|
|
3330
|
+
}, null, 8, ["public-id", "_document"])
|
|
3331
|
+
])) : n.page === "versionError" ? (D(), R("div", Li, [
|
|
3332
|
+
y("div", Ui, [
|
|
3333
|
+
y("div", qi, [
|
|
3334
|
+
y("div", Oi, [
|
|
3335
|
+
B(l, {
|
|
3336
|
+
size: 30,
|
|
3337
|
+
type: "error"
|
|
3338
|
+
})
|
|
3339
|
+
])
|
|
3340
|
+
]),
|
|
3341
|
+
y("div", {
|
|
3342
|
+
class: "a-title",
|
|
3343
|
+
textContent: I(e._document.$t(`answerModal.versionError.${o.mode}.title`))
|
|
3344
|
+
}, null, 8, zi),
|
|
3345
|
+
y("div", {
|
|
3346
|
+
textContent: I(e._document.$t("answerModal.versionError.text"))
|
|
3347
|
+
}, null, 8, ji)
|
|
3348
|
+
]),
|
|
3349
|
+
y("div", Vi, [
|
|
3350
|
+
B(r, {
|
|
3351
|
+
loading: n.isPosting,
|
|
3352
|
+
type: "none",
|
|
3353
|
+
class: "a-btn",
|
|
3354
|
+
onClick: s.reload
|
|
3355
|
+
}, {
|
|
3356
|
+
default: N(() => [
|
|
3357
|
+
K(I(e._document.$t("answerModal.versionError.btn")), 1)
|
|
3358
|
+
]),
|
|
3359
|
+
_: 1
|
|
3360
|
+
}, 8, ["loading", "onClick"])
|
|
3361
|
+
])
|
|
3362
|
+
])) : L("", !0)
|
|
3363
|
+
];
|
|
3364
|
+
}),
|
|
3365
|
+
_: 1
|
|
3366
|
+
}, 8, ["onEnter", "onLeave"]);
|
|
3367
|
+
}
|
|
3368
|
+
const Ji = /* @__PURE__ */ tt(Pi, [["render", Wi], ["__scopeId", "data-v-dcf19c7f"]]);
|
|
3369
|
+
export {
|
|
3370
|
+
Ji as default
|
|
3371
|
+
};
|