@cling-se/widget 0.12.4 → 0.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddClientCallout-96e94ad9.js → AddClientCallout-9ecb1f65.js} +5 -5
- package/dist/{AnswerModal-6990ea17.js → AnswerModal-740a32d9.js} +1264 -1153
- package/dist/{AttachmentItem-0d327381.js → AttachmentItem-b5feec24.js} +3 -3
- package/dist/{BaseDatePicker-e2e1ea6e.js → BaseDatePicker-4de97237.js} +2 -2
- package/dist/{BaseInput-d9c734b0.js → BaseInput-0fd105dc.js} +1 -1
- package/dist/{BaseUpload-9efbce6d.js → BaseUpload-7da3dfa3.js} +2 -2
- package/dist/{BlockMedia-70d92534.js → BlockMedia-8538a7e4.js} +1 -1
- package/dist/{CCallout-419f1eac.js → CCallout-cb6ed00c.js} +2 -2
- package/dist/{CDropdownItem-60893039.js → CDropdownItem-3e55db42.js} +1 -1
- package/dist/{CField-2e027461.js → CField-83895bd6.js} +1 -1
- package/dist/{CPhoneFormat-b0670312.js → CPhoneFormat-89bc45bf.js} +1 -1
- package/dist/{CSlider.vue_vue_type_style_index_0_lang-852dfd0e.js → CSlider.vue_vue_type_style_index_0_lang-8ad297eb.js} +1 -1
- package/dist/{ClientAutocomplete-44998c42.js → ClientAutocomplete-660860d5.js} +2 -2
- package/dist/{ClientModal-d4ebef77.js → ClientModal-33675a8c.js} +5 -5
- package/dist/{ColorPicker-cd9e1cc0.js → ColorPicker-882e51a3.js} +1 -1
- package/dist/{CompanyModal-36820c26.js → CompanyModal-cb5a2df0.js} +3 -3
- package/dist/{ContentWrapper-520e4761.js → ContentWrapper-8f9a3424.js} +14 -14
- package/dist/{CoverBlockSettings-0251d18f.js → CoverBlockSettings-e97bd444.js} +7 -7
- package/dist/{DocAnswer-dad0bf7f.js → DocAnswer-6cccdd47.js} +4 -4
- package/dist/{DocDetails-31009b60.js → DocDetails-c957efaf.js} +17 -17
- package/dist/{DocForm-3e6d9d83.js → DocForm-821529a9.js} +43 -40
- package/dist/{DocFormSend-3b8e9604.js → DocFormSend-c7d8316a.js} +17 -17
- package/dist/{DocLinks-1467ba01.js → DocLinks-5d90c8da.js} +2 -2
- package/dist/{DocModalBase-c596787a.js → DocModalBase-f94bd68c.js} +1 -1
- package/dist/{DocPrint-3970f8e8.js → DocPrint-8eb06698.js} +5 -5
- package/dist/{DocReceipt-dd5c7d5b.js → DocReceipt-8c8a7913.js} +8 -8
- package/dist/{DocSendReminder-a3909a71.js → DocSendReminder-bfcbe73c.js} +1 -1
- package/dist/{DocTextEditor-f0223af8.js → DocTextEditor-b691f5d0.js} +293 -292
- package/dist/{DocTimeline-9b29e5f6.js → DocTimeline-6905dfa2.js} +1 -1
- package/dist/{DocumentClient-f77bc578.js → DocumentClient-84874729.js} +7 -7
- package/dist/{DocumentLayout-9cc2a08e.js → DocumentLayout-0280007c.js} +4 -4
- package/dist/{DocumentLogotype-20216f74.js → DocumentLogotype-af5615e2.js} +3 -3
- package/dist/{DocumentVoided-1198114e.js → DocumentVoided-1608d7d8.js} +1 -1
- package/dist/{EmbedInput-df3aa286.js → EmbedInput-b557906f.js} +2 -2
- package/dist/{EmbedSettings-b71e059b.js → EmbedSettings-6879968d.js} +3 -3
- package/dist/{ErrorCallout-a39eba4d.js → ErrorCallout-29ec868f.js} +1 -1
- package/dist/{FilePreviewModal-b5edeee0.js → FilePreviewModal-2c83e9ce.js} +5 -5
- package/dist/{Flag-c7a354cd.js → Flag-a72eedd7.js} +1 -1
- package/dist/{HeaderSettings-db6e32c8.js → HeaderSettings-f896361e.js} +16 -16
- package/dist/{ImageSelectModal-856e363b.js → ImageSelectModal-87115a0d.js} +8 -8
- package/dist/{ImageUploadWrapper-24dadc15.js → ImageUploadWrapper-b848e2c0.js} +2 -2
- package/dist/{Index-607f6640.js → Index-06d09242.js} +6 -6
- package/dist/{Index-8ac2ed05.js → Index-0e1ec3a9.js} +4 -4
- package/dist/{Index-75368b48.js → Index-143885f0.js} +2 -2
- package/dist/{Index-cada810e.js → Index-17532b7c.js} +7 -7
- package/dist/{Index-99ac0ac2.js → Index-1d872d01.js} +4 -4
- package/dist/{Index-73cee68c.js → Index-233d78f7.js} +2 -2
- package/dist/{Index-6d22d9d1.js → Index-317a278d.js} +2 -2
- package/dist/{Index-f05fe2a1.js → Index-392a72f0.js} +4 -4
- package/dist/{Index-12ea21c5.js → Index-41d36214.js} +1 -1
- package/dist/{Index-a5a82682.js → Index-45532a12.js} +9 -9
- package/dist/{Index-139b1013.js → Index-4e8673d8.js} +2 -2
- package/dist/{Index-34978d11.js → Index-57b1bd74.js} +2 -2
- package/dist/{Index-0099e82e.js → Index-5a98a216.js} +1 -1
- package/dist/{Index-9891ee1a.js → Index-5d96ebf8.js} +6 -6
- package/dist/{Index-3378fcf6.js → Index-5fb570f5.js} +4 -4
- package/dist/{Index-007a1233.js → Index-66422854.js} +5 -5
- package/dist/{Index-4f9afe72.js → Index-6a2c6bb4.js} +6 -6
- package/dist/{Index-40083942.js → Index-6cc9b40a.js} +14 -14
- package/dist/{Index-f06fcb76.js → Index-8378b41b.js} +5 -5
- package/dist/{Index-4f25825f.js → Index-896744ca.js} +10 -10
- package/dist/{Index-b5480383.js → Index-9bfd19ae.js} +24 -22
- package/dist/{Index-014d0ac2.js → Index-a6170166.js} +14 -14
- package/dist/{Index-3889e134.js → Index-a84493fa.js} +4 -4
- package/dist/{Index-d689466d.js → Index-ac5ed93b.js} +2 -2
- package/dist/{Index-ef955a66.js → Index-adc4d454.js} +3 -3
- package/dist/{Index-dd5f8fc7.js → Index-b14355c6.js} +15 -13
- package/dist/{Index-5355b449.js → Index-b855bb6b.js} +7 -7
- package/dist/{Index-4e675d8a.js → Index-cc275f1a.js} +4 -4
- package/dist/{Index-7b2e5ac5.js → Index-d1422cac.js} +13 -13
- package/dist/{Index-c551781f.js → Index-d4831043.js} +6 -6
- package/dist/{Index-1bf76a16.js → Index-dd7c60a3.js} +4 -4
- package/dist/{Index-dcbfb822.js → Index-e2275b80.js} +2 -2
- package/dist/{Index-bc5f3ca9.js → Index-e5bca4ba.js} +2 -2
- package/dist/{Index-54a78fad.js → Index-fb873cb0.js} +4 -4
- package/dist/{InputToggleRow-a9229972.js → InputToggleRow-57168fd7.js} +1 -1
- package/dist/{IsPremiumPreStep-4e9e2883.js → IsPremiumPreStep-c47b64ba.js} +2 -2
- package/dist/{ManualPopover-720770bb.js → ManualPopover-f0d020f7.js} +1 -1
- package/dist/{MediaWrapper-90c72ae5.js → MediaWrapper-f88b5042.js} +3 -3
- package/dist/{NotBindingText-832d5350.js → NotBindingText-5443e8ae.js} +2 -2
- package/dist/{PackageGroup-22cbb76c.js → PackageGroup-b04e1dd2.js} +12 -12
- package/dist/{PdfTerms-ce2d5d5e.js → PdfTerms-1b2ccc92.js} +5 -5
- package/dist/{PdfViewer-ebff4b6c.js → PdfViewer-70a62650.js} +2 -2
- package/dist/{PlainHtml-faae67a3.js → PlainHtml-69debaed.js} +1 -1
- package/dist/{PriceHeader-67ac2108.js → PriceHeader-57e8c8b2.js} +13 -13
- package/dist/{SearchApi-d90fd0d2.js → SearchApi-89a10999.js} +2 -2
- package/dist/{Setup-88387515.js → Setup-e49038b9.js} +1 -1
- package/dist/{TermsSettings-82f18edc.js → TermsSettings-9230124b.js} +7 -7
- package/dist/{ThemeColorRow-ca0c7f34.js → ThemeColorRow-7fa03127.js} +3 -3
- package/dist/{ToggleBinding-87b13b54.js → ToggleBinding-eccf31b0.js} +3 -3
- package/dist/{UploadModal-9c6b64dc.js → UploadModal-7ec92085.js} +3 -3
- package/dist/{VideoPlayerInput-87ae1e67.js → VideoPlayerInput-79ecaa25.js} +3 -3
- package/dist/{VideoPlayerSettings-ab7c9dd9.js → VideoPlayerSettings-832db291.js} +4 -4
- package/dist/{VideoSelectModal-b9c128a2.js → VideoSelectModal-71610c73.js} +8 -8
- package/dist/{answerDocumentMixin-1a04710f.js → answerDocumentMixin-9ef76853.js} +3 -3
- package/dist/{debounce-5f4cc346.js → debounce-8671f8dc.js} +1 -1
- package/dist/{focusDrawerMixin-fcfab690.js → focusDrawerMixin-e1e74aa5.js} +1 -1
- package/dist/{formComponentsInstall-f2198c99.js → formComponentsInstall-7929495e.js} +12 -12
- package/dist/{formDrawerState-6ff961ac.js → formDrawerState-132b3356.js} +1 -1
- package/dist/{formValidationMixin-5882b9a7.js → formValidationMixin-7e63bf02.js} +1 -1
- package/dist/{index-09727136.js → index-689abdc4.js} +1 -1
- package/dist/{index-383fefaf.js → index-c32415d8.js} +1 -1
- package/dist/{index-069b282b.js → index-c932bbd7.js} +3 -3
- package/dist/{index-525e4866.js → index-d581dd3e.js} +5 -5
- package/dist/{index-7fa7534f.js → index-e08e9511.js} +9 -9
- package/dist/{index-9d8996e9.js → index-ecae741c.js} +1 -1
- package/dist/index.es.js +3 -3
- package/dist/index.umd.js +147 -147
- package/dist/{main-0ba93efc.js → main-3e2eb1ab.js} +5990 -5815
- package/dist/{mapFormMixin-46fe94a8.js → mapFormMixin-7434613a.js} +1 -1
- package/dist/{publicSenderState-644bb177.js → publicSenderState-d2935885.js} +1 -1
- package/dist/style.css +2 -2
- package/dist/{throttle-61f5ee70.js → throttle-67fcd09d.js} +2 -2
- package/dist/{tinycolor-4773d945.js → tinycolor-efcd3ffc.js} +1 -2
- package/dist/{tippy.esm-b5320973.js → tippy.esm-2fc4283d.js} +5 -5
- package/dist/{utils-8d533496.js → utils-0765b02b.js} +1 -1
- package/dist/{vuedraggable.umd-37bf712b.js → vuedraggable.umd-6b43b866.js} +1 -1
- package/package.json +7 -7
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { a as nt } from "./anime.es-e284c852.js";
|
|
2
|
-
import { aq as
|
|
3
|
-
import { a as
|
|
4
|
-
import { m as ft } from "./mapFormMixin-
|
|
5
|
-
import { C as
|
|
2
|
+
import { aq as It, h as Ct, n as ot, ar as Mt, L as Tt, as as Rt, at as $t, au as Dt, g as wt, e as At, J as Bt } from "./main-3e2eb1ab.js";
|
|
3
|
+
import { a as Ut } from "./vuex.esm-4a0fff7c.js";
|
|
4
|
+
import { m as ft } from "./mapFormMixin-7434613a.js";
|
|
5
|
+
import { C as Lt } from "./CField-83895bd6.js";
|
|
6
6
|
import "./CField.vue_vue_type_style_index_0_lang-4ed993c7.js";
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
},
|
|
11
|
-
const
|
|
7
|
+
const Nt = () => {
|
|
8
|
+
const v = window.location.host.split(".");
|
|
9
|
+
return v && v[0];
|
|
10
|
+
}, Ot = Nt() === "fortnox";
|
|
11
|
+
const zt = [
|
|
12
12
|
"enjoyedExperience",
|
|
13
13
|
// boolean value
|
|
14
14
|
"whatToImprove"
|
|
15
15
|
// string value
|
|
16
|
-
],
|
|
16
|
+
], Yt = {
|
|
17
17
|
props: {
|
|
18
18
|
publicId: {
|
|
19
19
|
type: String,
|
|
@@ -33,37 +33,37 @@ const Lt = [
|
|
|
33
33
|
};
|
|
34
34
|
},
|
|
35
35
|
methods: {
|
|
36
|
-
async submitFeedback({ type:
|
|
36
|
+
async submitFeedback({ type: v, data: r }) {
|
|
37
37
|
if (!this.publicId)
|
|
38
38
|
throw Error("Missing param publicId");
|
|
39
|
-
if (!
|
|
39
|
+
if (!v)
|
|
40
40
|
throw Error("Missing param type");
|
|
41
|
-
if (!
|
|
41
|
+
if (!zt.includes(v))
|
|
42
42
|
throw Error("Invalid feedback type");
|
|
43
43
|
if (!r)
|
|
44
44
|
throw Error("Missing param data");
|
|
45
45
|
let n = "positive";
|
|
46
46
|
try {
|
|
47
|
-
|
|
47
|
+
It.feedback(this.publicId, { type: v, data: r }), v === "enjoyedExperience" && !r.value && (n = "negative"), v === "whatToImprove" && (n = "negative.success"), Ot && n !== "negative" && (n = "custom");
|
|
48
48
|
} catch (g) {
|
|
49
|
-
|
|
49
|
+
Ct(g, { showMessage: !1 });
|
|
50
50
|
} finally {
|
|
51
51
|
this.goTo(n);
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
async goTo(
|
|
55
|
-
if (this.$emit("page",
|
|
54
|
+
async goTo(v) {
|
|
55
|
+
if (this.$emit("page", v), v === "positive" || v === "negative") {
|
|
56
56
|
this.$refs.start.style.opacity = 0, this.page = "intermediate", setTimeout(() => {
|
|
57
|
-
this.page =
|
|
57
|
+
this.page = v;
|
|
58
58
|
}, 2e3);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
this.page =
|
|
61
|
+
this.page = v;
|
|
62
62
|
},
|
|
63
63
|
startAnimation() {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
targets:
|
|
64
|
+
const v = this.$refs.feedbackBg;
|
|
65
|
+
v.gradOneXPos = 0, v.gradOneYPos = 0, v.gradTwoXPos = 80, v.gradTwoYPos = 20, v.gradThreeXPos = 20, v.gradThreeYPos = 80, v.gradFourXPos = 80, v.gradFourYPos = 80, nt({
|
|
66
|
+
targets: v,
|
|
67
67
|
duration: 12e3,
|
|
68
68
|
direction: "alternate",
|
|
69
69
|
easing: "linear",
|
|
@@ -77,38 +77,38 @@ const Lt = [
|
|
|
77
77
|
gradFourXPos: [85, 80, 75, 70, 95],
|
|
78
78
|
gradFourYPos: [90, 100, 120, 100, 85],
|
|
79
79
|
update() {
|
|
80
|
-
|
|
80
|
+
v.style.setProperty(
|
|
81
81
|
"--gradOneXPos",
|
|
82
|
-
`${
|
|
83
|
-
),
|
|
82
|
+
`${v.gradOneXPos}%`
|
|
83
|
+
), v.style.setProperty(
|
|
84
84
|
"--gradOneYPos",
|
|
85
|
-
`${
|
|
86
|
-
),
|
|
85
|
+
`${v.gradOneYPos}%`
|
|
86
|
+
), v.style.setProperty(
|
|
87
87
|
"--gradTwoXPos",
|
|
88
|
-
`${
|
|
89
|
-
),
|
|
88
|
+
`${v.gradTwoXPos}%`
|
|
89
|
+
), v.style.setProperty(
|
|
90
90
|
"--gradTwoYPos",
|
|
91
|
-
`${
|
|
92
|
-
),
|
|
91
|
+
`${v.gradTwoYPos}%`
|
|
92
|
+
), v.style.setProperty(
|
|
93
93
|
"--gradThreeXPos",
|
|
94
|
-
`${
|
|
95
|
-
),
|
|
94
|
+
`${v.gradThreeXPos}%`
|
|
95
|
+
), v.style.setProperty(
|
|
96
96
|
"--gradThreeYPos",
|
|
97
|
-
`${
|
|
98
|
-
),
|
|
97
|
+
`${v.gradThreeYPos}%`
|
|
98
|
+
), v.style.setProperty(
|
|
99
99
|
"--gradFourXPos",
|
|
100
|
-
`${
|
|
101
|
-
),
|
|
100
|
+
`${v.gradFourXPos}%`
|
|
101
|
+
), v.style.setProperty(
|
|
102
102
|
"--gradFourYPos",
|
|
103
|
-
`${
|
|
103
|
+
`${v.gradFourYPos}%`
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
},
|
|
108
108
|
// animations
|
|
109
|
-
leave(
|
|
109
|
+
leave(v, r) {
|
|
110
110
|
nt({
|
|
111
|
-
targets:
|
|
111
|
+
targets: v,
|
|
112
112
|
// height: 0,
|
|
113
113
|
// opacity: [1, 0],
|
|
114
114
|
opacity: 0,
|
|
@@ -117,9 +117,9 @@ const Lt = [
|
|
|
117
117
|
complete: r
|
|
118
118
|
});
|
|
119
119
|
},
|
|
120
|
-
enter(
|
|
120
|
+
enter(v, r) {
|
|
121
121
|
nt({
|
|
122
|
-
targets:
|
|
122
|
+
targets: v,
|
|
123
123
|
delay: this.page === "intermediate" ? 250 : 0,
|
|
124
124
|
duration: 500,
|
|
125
125
|
opacity: [0, 1],
|
|
@@ -129,7 +129,7 @@ const Lt = [
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
var
|
|
132
|
+
var Wt = function() {
|
|
133
133
|
var r = this, n = r._self._c;
|
|
134
134
|
return n("div", { staticClass: "f-feedback" }, [n("div", { ref: "feedbackBg", staticClass: "f-bg" }), n("div", { staticClass: "f-container" }, [n("transition", { attrs: { css: !1, mode: "out-in" }, on: { enter: r.enter, leave: r.leave } }, [r.page === "start" ? n("div", { key: "start", ref: "start", staticClass: "flex w-full flex-col items-center justify-center", staticStyle: { transition: "opacity 250ms" } }, [n("div", { staticStyle: { "padding-bottom": "calc(1.5 * var(--rem))", "font-size": "14px", "font-weight": "500" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.start.title")) } }), n("div", [n("CButton", { staticClass: "feedback-btn", attrs: { "icon-left": "thumbsdown", size: "small", pattern: "secondary" }, on: { click: function(g) {
|
|
135
135
|
return r.submitFeedback({
|
|
@@ -157,26 +157,26 @@ var Ot = function() {
|
|
|
157
157
|
} } })], 1) : r.page === "custom" ? n("div", { key: "success", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.text")) } })]), n("CButton", { staticClass: "a-btn", attrs: { type: "secondary", wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.action")) }, on: { click: function(g) {
|
|
158
158
|
return r.$emit("close");
|
|
159
159
|
} } })], 1) : r._e()])], 1)]);
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
}, Ht = [], jt = /* @__PURE__ */ ot(
|
|
161
|
+
Yt,
|
|
162
|
+
Wt,
|
|
163
|
+
Ht,
|
|
164
164
|
!1,
|
|
165
165
|
null,
|
|
166
166
|
"67b518b8",
|
|
167
167
|
null,
|
|
168
168
|
null
|
|
169
169
|
);
|
|
170
|
-
const
|
|
170
|
+
const Gt = jt.exports;
|
|
171
171
|
/*!
|
|
172
172
|
* Signature Pad v4.0.10 | https://github.com/szimek/signature_pad
|
|
173
173
|
* (c) 2022 Szymon Nowak | Released under the MIT license
|
|
174
174
|
*/
|
|
175
175
|
class pt {
|
|
176
|
-
constructor(r, n, g,
|
|
176
|
+
constructor(r, n, g, u) {
|
|
177
177
|
if (isNaN(r) || isNaN(n))
|
|
178
178
|
throw new Error(`Point is invalid: (${r}, ${n})`);
|
|
179
|
-
this.x = +r, this.y = +n, this.pressure = g || 0, this.time =
|
|
179
|
+
this.x = +r, this.y = +n, this.pressure = g || 0, this.time = u || Date.now();
|
|
180
180
|
}
|
|
181
181
|
distanceTo(r) {
|
|
182
182
|
return Math.sqrt(Math.pow(this.x - r.x, 2) + Math.pow(this.y - r.y, 2));
|
|
@@ -188,38 +188,38 @@ class pt {
|
|
|
188
188
|
return this.time !== r.time ? this.distanceTo(r) / (this.time - r.time) : 0;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
class
|
|
192
|
-
constructor(r, n, g,
|
|
193
|
-
this.startPoint = r, this.control2 = n, this.control1 = g, this.endPoint =
|
|
191
|
+
class bt {
|
|
192
|
+
constructor(r, n, g, u, h, d) {
|
|
193
|
+
this.startPoint = r, this.control2 = n, this.control1 = g, this.endPoint = u, this.startWidth = h, this.endWidth = d;
|
|
194
194
|
}
|
|
195
195
|
static fromPoints(r, n) {
|
|
196
|
-
const g = this.calculateControlPoints(r[0], r[1], r[2]).c2,
|
|
197
|
-
return new
|
|
196
|
+
const g = this.calculateControlPoints(r[0], r[1], r[2]).c2, u = this.calculateControlPoints(r[1], r[2], r[3]).c1;
|
|
197
|
+
return new bt(r[1], g, u, r[2], n.start, n.end);
|
|
198
198
|
}
|
|
199
199
|
static calculateControlPoints(r, n, g) {
|
|
200
|
-
const
|
|
200
|
+
const u = r.x - n.x, h = r.y - n.y, d = n.x - g.x, c = n.y - g.y, i = { x: (r.x + n.x) / 2, y: (r.y + n.y) / 2 }, s = { x: (n.x + g.x) / 2, y: (n.y + g.y) / 2 }, f = Math.sqrt(u * u + h * h), a = Math.sqrt(d * d + c * c), w = i.x - s.x, x = i.y - s.y, b = a / (f + a), A = { x: s.x + w * b, y: s.y + x * b }, F = n.x - A.x, M = n.y - A.y;
|
|
201
201
|
return {
|
|
202
202
|
c1: new pt(i.x + F, i.y + M),
|
|
203
203
|
c2: new pt(s.x + F, s.y + M)
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
length() {
|
|
207
|
-
let n = 0, g,
|
|
208
|
-
for (let
|
|
209
|
-
const d =
|
|
210
|
-
if (
|
|
211
|
-
const s = c - g,
|
|
212
|
-
n += Math.sqrt(s * s +
|
|
213
|
-
}
|
|
214
|
-
g = c,
|
|
207
|
+
let n = 0, g, u;
|
|
208
|
+
for (let h = 0; h <= 10; h += 1) {
|
|
209
|
+
const d = h / 10, c = this.point(d, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), i = this.point(d, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
|
|
210
|
+
if (h > 0) {
|
|
211
|
+
const s = c - g, f = i - u;
|
|
212
|
+
n += Math.sqrt(s * s + f * f);
|
|
213
|
+
}
|
|
214
|
+
g = c, u = i;
|
|
215
215
|
}
|
|
216
216
|
return n;
|
|
217
217
|
}
|
|
218
|
-
point(r, n, g,
|
|
219
|
-
return n * (1 - r) * (1 - r) * (1 - r) + 3 * g * (1 - r) * (1 - r) * r + 3 *
|
|
218
|
+
point(r, n, g, u, h) {
|
|
219
|
+
return n * (1 - r) * (1 - r) * (1 - r) + 3 * g * (1 - r) * (1 - r) * r + 3 * u * (1 - r) * r * r + h * r * r * r;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
class
|
|
222
|
+
class Kt {
|
|
223
223
|
constructor() {
|
|
224
224
|
try {
|
|
225
225
|
this._et = new EventTarget();
|
|
@@ -237,17 +237,17 @@ class Ht {
|
|
|
237
237
|
this._et.removeEventListener(r, n, g);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
let n = 0, g = null,
|
|
240
|
+
function Vt(v, r = 250) {
|
|
241
|
+
let n = 0, g = null, u, h, d;
|
|
242
242
|
const c = () => {
|
|
243
|
-
n = Date.now(), g = null,
|
|
243
|
+
n = Date.now(), g = null, u = v.apply(h, d), g || (h = null, d = []);
|
|
244
244
|
};
|
|
245
245
|
return function(...s) {
|
|
246
|
-
const
|
|
247
|
-
return
|
|
246
|
+
const f = Date.now(), a = r - (f - n);
|
|
247
|
+
return h = this, d = s, a <= 0 || a > r ? (g && (clearTimeout(g), g = null), n = f, u = v.apply(h, d), g || (h = null, d = [])) : g || (g = window.setTimeout(c, a)), u;
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
let
|
|
250
|
+
let Jt = class Et extends Kt {
|
|
251
251
|
constructor(r, n = {}) {
|
|
252
252
|
super(), this.canvas = r, this._handleMouseDown = (g) => {
|
|
253
253
|
g.buttons === 1 && (this._drawningStroke = !0, this._strokeBegin(g));
|
|
@@ -257,18 +257,18 @@ let Gt = class _t extends Ht {
|
|
|
257
257
|
g.buttons === 1 && this._drawningStroke && (this._drawningStroke = !1, this._strokeEnd(g));
|
|
258
258
|
}, this._handleTouchStart = (g) => {
|
|
259
259
|
if (g.cancelable && g.preventDefault(), g.targetTouches.length === 1) {
|
|
260
|
-
const
|
|
261
|
-
this._strokeBegin(
|
|
260
|
+
const u = g.changedTouches[0];
|
|
261
|
+
this._strokeBegin(u);
|
|
262
262
|
}
|
|
263
263
|
}, this._handleTouchMove = (g) => {
|
|
264
264
|
g.cancelable && g.preventDefault();
|
|
265
|
-
const
|
|
266
|
-
this._strokeMoveUpdate(
|
|
265
|
+
const u = g.targetTouches[0];
|
|
266
|
+
this._strokeMoveUpdate(u);
|
|
267
267
|
}, this._handleTouchEnd = (g) => {
|
|
268
268
|
if (g.target === this.canvas) {
|
|
269
269
|
g.cancelable && g.preventDefault();
|
|
270
|
-
const
|
|
271
|
-
this._strokeEnd(
|
|
270
|
+
const h = g.changedTouches[0];
|
|
271
|
+
this._strokeEnd(h);
|
|
272
272
|
}
|
|
273
273
|
}, this._handlePointerStart = (g) => {
|
|
274
274
|
this._drawningStroke = !0, g.preventDefault(), this._strokeBegin(g);
|
|
@@ -276,20 +276,20 @@ let Gt = class _t extends Ht {
|
|
|
276
276
|
this._drawningStroke && (g.preventDefault(), this._strokeMoveUpdate(g));
|
|
277
277
|
}, this._handlePointerEnd = (g) => {
|
|
278
278
|
this._drawningStroke && (g.preventDefault(), this._drawningStroke = !1, this._strokeEnd(g));
|
|
279
|
-
}, this.velocityFilterWeight = n.velocityFilterWeight || 0.7, this.minWidth = n.minWidth || 0.5, this.maxWidth = n.maxWidth || 2.5, this.throttle = "throttle" in n ? n.throttle : 16, this.minDistance = "minDistance" in n ? n.minDistance : 5, this.dotSize = n.dotSize || 0, this.penColor = n.penColor || "black", this.backgroundColor = n.backgroundColor || "rgba(0,0,0,0)", this._strokeMoveUpdate = this.throttle ?
|
|
279
|
+
}, this.velocityFilterWeight = n.velocityFilterWeight || 0.7, this.minWidth = n.minWidth || 0.5, this.maxWidth = n.maxWidth || 2.5, this.throttle = "throttle" in n ? n.throttle : 16, this.minDistance = "minDistance" in n ? n.minDistance : 5, this.dotSize = n.dotSize || 0, this.penColor = n.penColor || "black", this.backgroundColor = n.backgroundColor || "rgba(0,0,0,0)", this._strokeMoveUpdate = this.throttle ? Vt(Et.prototype._strokeUpdate, this.throttle) : Et.prototype._strokeUpdate, this._ctx = r.getContext("2d"), this.clear(), this.on();
|
|
280
280
|
}
|
|
281
281
|
clear() {
|
|
282
282
|
const { _ctx: r, canvas: n } = this;
|
|
283
283
|
r.fillStyle = this.backgroundColor, r.clearRect(0, 0, n.width, n.height), r.fillRect(0, 0, n.width, n.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0;
|
|
284
284
|
}
|
|
285
285
|
fromDataURL(r, n = {}) {
|
|
286
|
-
return new Promise((g,
|
|
287
|
-
const
|
|
288
|
-
this._reset(this._getPointGroupOptions()),
|
|
289
|
-
this._ctx.drawImage(
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
},
|
|
286
|
+
return new Promise((g, u) => {
|
|
287
|
+
const h = new Image(), d = n.ratio || window.devicePixelRatio || 1, c = n.width || this.canvas.width / d, i = n.height || this.canvas.height / d, s = n.xOffset || 0, f = n.yOffset || 0;
|
|
288
|
+
this._reset(this._getPointGroupOptions()), h.onload = () => {
|
|
289
|
+
this._ctx.drawImage(h, s, f, c, i), g();
|
|
290
|
+
}, h.onerror = (a) => {
|
|
291
|
+
u(a);
|
|
292
|
+
}, h.crossOrigin = "anonymous", h.src = r, this._isEmpty = !1;
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
295
|
toDataURL(r = "image/png", n) {
|
|
@@ -337,14 +337,14 @@ let Gt = class _t extends Ht {
|
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
339
|
this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: r }));
|
|
340
|
-
const n = r.clientX, g = r.clientY,
|
|
340
|
+
const n = r.clientX, g = r.clientY, u = r.pressure !== void 0 ? r.pressure : r.force !== void 0 ? r.force : 0, h = this._createPoint(n, g, u), d = this._data[this._data.length - 1], c = d.points, i = c.length > 0 && c[c.length - 1], s = i ? h.distanceTo(i) <= this.minDistance : !1, f = this._getPointGroupOptions(d);
|
|
341
341
|
if (!i || !(i && s)) {
|
|
342
|
-
const a = this._addPoint(
|
|
343
|
-
i ? a && this._drawCurve(a,
|
|
344
|
-
time:
|
|
345
|
-
x:
|
|
346
|
-
y:
|
|
347
|
-
pressure:
|
|
342
|
+
const a = this._addPoint(h, f);
|
|
343
|
+
i ? a && this._drawCurve(a, f) : this._drawDot(h, f), c.push({
|
|
344
|
+
time: h.time,
|
|
345
|
+
x: h.x,
|
|
346
|
+
y: h.y,
|
|
347
|
+
pressure: h.pressure
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: r }));
|
|
@@ -365,108 +365,108 @@ let Gt = class _t extends Ht {
|
|
|
365
365
|
this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (r.minWidth + r.maxWidth) / 2, this._ctx.fillStyle = r.penColor;
|
|
366
366
|
}
|
|
367
367
|
_createPoint(r, n, g) {
|
|
368
|
-
const
|
|
369
|
-
return new pt(r -
|
|
368
|
+
const u = this.canvas.getBoundingClientRect();
|
|
369
|
+
return new pt(r - u.left, n - u.top, g, (/* @__PURE__ */ new Date()).getTime());
|
|
370
370
|
}
|
|
371
371
|
_addPoint(r, n) {
|
|
372
372
|
const { _lastPoints: g } = this;
|
|
373
373
|
if (g.push(r), g.length > 2) {
|
|
374
374
|
g.length === 3 && g.unshift(g[0]);
|
|
375
|
-
const
|
|
376
|
-
return g.shift(),
|
|
375
|
+
const u = this._calculateCurveWidths(g[1], g[2], n), h = bt.fromPoints(g, u);
|
|
376
|
+
return g.shift(), h;
|
|
377
377
|
}
|
|
378
378
|
return null;
|
|
379
379
|
}
|
|
380
380
|
_calculateCurveWidths(r, n, g) {
|
|
381
|
-
const
|
|
382
|
-
end:
|
|
381
|
+
const u = g.velocityFilterWeight * n.velocityFrom(r) + (1 - g.velocityFilterWeight) * this._lastVelocity, h = this._strokeWidth(u, g), d = {
|
|
382
|
+
end: h,
|
|
383
383
|
start: this._lastWidth
|
|
384
384
|
};
|
|
385
|
-
return this._lastVelocity =
|
|
385
|
+
return this._lastVelocity = u, this._lastWidth = h, d;
|
|
386
386
|
}
|
|
387
387
|
_strokeWidth(r, n) {
|
|
388
388
|
return Math.max(n.maxWidth / (r + 1), n.minWidth);
|
|
389
389
|
}
|
|
390
390
|
_drawCurveSegment(r, n, g) {
|
|
391
|
-
const
|
|
392
|
-
|
|
391
|
+
const u = this._ctx;
|
|
392
|
+
u.moveTo(r, n), u.arc(r, n, g, 0, 2 * Math.PI, !1), this._isEmpty = !1;
|
|
393
393
|
}
|
|
394
394
|
_drawCurve(r, n) {
|
|
395
|
-
const g = this._ctx,
|
|
395
|
+
const g = this._ctx, u = r.endWidth - r.startWidth, h = Math.ceil(r.length()) * 2;
|
|
396
396
|
g.beginPath(), g.fillStyle = n.penColor;
|
|
397
|
-
for (let d = 0; d <
|
|
398
|
-
const c = d /
|
|
397
|
+
for (let d = 0; d < h; d += 1) {
|
|
398
|
+
const c = d / h, i = c * c, s = i * c, f = 1 - c, a = f * f, w = a * f;
|
|
399
399
|
let x = w * r.startPoint.x;
|
|
400
|
-
x += 3 * a * c * r.control1.x, x += 3 *
|
|
400
|
+
x += 3 * a * c * r.control1.x, x += 3 * f * i * r.control2.x, x += s * r.endPoint.x;
|
|
401
401
|
let b = w * r.startPoint.y;
|
|
402
|
-
b += 3 * a * c * r.control1.y, b += 3 *
|
|
403
|
-
const
|
|
404
|
-
this._drawCurveSegment(x, b,
|
|
402
|
+
b += 3 * a * c * r.control1.y, b += 3 * f * i * r.control2.y, b += s * r.endPoint.y;
|
|
403
|
+
const A = Math.min(r.startWidth + s * u, n.maxWidth);
|
|
404
|
+
this._drawCurveSegment(x, b, A);
|
|
405
405
|
}
|
|
406
406
|
g.closePath(), g.fill();
|
|
407
407
|
}
|
|
408
408
|
_drawDot(r, n) {
|
|
409
|
-
const g = this._ctx,
|
|
410
|
-
g.beginPath(), this._drawCurveSegment(r.x, r.y,
|
|
409
|
+
const g = this._ctx, u = n.dotSize > 0 ? n.dotSize : (n.minWidth + n.maxWidth) / 2;
|
|
410
|
+
g.beginPath(), this._drawCurveSegment(r.x, r.y, u), g.closePath(), g.fillStyle = n.penColor, g.fill();
|
|
411
411
|
}
|
|
412
412
|
_fromData(r, n, g) {
|
|
413
|
-
for (const
|
|
414
|
-
const { points:
|
|
415
|
-
if (
|
|
416
|
-
for (let c = 0; c <
|
|
417
|
-
const i =
|
|
413
|
+
for (const u of r) {
|
|
414
|
+
const { points: h } = u, d = this._getPointGroupOptions(u);
|
|
415
|
+
if (h.length > 1)
|
|
416
|
+
for (let c = 0; c < h.length; c += 1) {
|
|
417
|
+
const i = h[c], s = new pt(i.x, i.y, i.pressure, i.time);
|
|
418
418
|
c === 0 && this._reset(d);
|
|
419
|
-
const
|
|
420
|
-
|
|
419
|
+
const f = this._addPoint(s, d);
|
|
420
|
+
f && n(f, d);
|
|
421
421
|
}
|
|
422
422
|
else
|
|
423
|
-
this._reset(d), g(
|
|
423
|
+
this._reset(d), g(h[0], d);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
_toSVG() {
|
|
427
|
-
const r = this._data, n = Math.max(window.devicePixelRatio || 1, 1), g = 0,
|
|
427
|
+
const r = this._data, n = Math.max(window.devicePixelRatio || 1, 1), g = 0, u = 0, h = this.canvas.width / n, d = this.canvas.height / n, c = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
428
428
|
c.setAttribute("width", this.canvas.width.toString()), c.setAttribute("height", this.canvas.height.toString()), this._fromData(r, (x, { penColor: b }) => {
|
|
429
|
-
const
|
|
429
|
+
const A = document.createElement("path");
|
|
430
430
|
if (!isNaN(x.control1.x) && !isNaN(x.control1.y) && !isNaN(x.control2.x) && !isNaN(x.control2.y)) {
|
|
431
431
|
const F = `M ${x.startPoint.x.toFixed(3)},${x.startPoint.y.toFixed(3)} C ${x.control1.x.toFixed(3)},${x.control1.y.toFixed(3)} ${x.control2.x.toFixed(3)},${x.control2.y.toFixed(3)} ${x.endPoint.x.toFixed(3)},${x.endPoint.y.toFixed(3)}`;
|
|
432
|
-
|
|
432
|
+
A.setAttribute("d", F), A.setAttribute("stroke-width", (x.endWidth * 2.25).toFixed(3)), A.setAttribute("stroke", b), A.setAttribute("fill", "none"), A.setAttribute("stroke-linecap", "round"), c.appendChild(A);
|
|
433
433
|
}
|
|
434
|
-
}, (x, { penColor: b, dotSize:
|
|
435
|
-
const C = document.createElement("circle"),
|
|
436
|
-
C.setAttribute("r",
|
|
434
|
+
}, (x, { penColor: b, dotSize: A, minWidth: F, maxWidth: M }) => {
|
|
435
|
+
const C = document.createElement("circle"), B = A > 0 ? A : (F + M) / 2;
|
|
436
|
+
C.setAttribute("r", B.toString()), C.setAttribute("cx", x.x.toString()), C.setAttribute("cy", x.y.toString()), C.setAttribute("fill", b), c.appendChild(C);
|
|
437
437
|
});
|
|
438
|
-
const i = "data:image/svg+xml;base64,", s = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${g} ${
|
|
439
|
-
let
|
|
440
|
-
if (
|
|
438
|
+
const i = "data:image/svg+xml;base64,", s = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${g} ${u} ${h} ${d}" width="${h}" height="${d}">`;
|
|
439
|
+
let f = c.innerHTML;
|
|
440
|
+
if (f === void 0) {
|
|
441
441
|
const x = document.createElement("dummy"), b = c.childNodes;
|
|
442
442
|
x.innerHTML = "";
|
|
443
|
-
for (let
|
|
444
|
-
x.appendChild(b[
|
|
445
|
-
|
|
443
|
+
for (let A = 0; A < b.length; A += 1)
|
|
444
|
+
x.appendChild(b[A].cloneNode(!0));
|
|
445
|
+
f = x.innerHTML;
|
|
446
446
|
}
|
|
447
|
-
const a = "</svg>", w = s +
|
|
447
|
+
const a = "</svg>", w = s + f + a;
|
|
448
448
|
return i + btoa(w);
|
|
449
449
|
}
|
|
450
|
-
},
|
|
450
|
+
}, Xt = class extends Jt {
|
|
451
451
|
fromText(r, n = {}) {
|
|
452
452
|
if (this.clear(), !r)
|
|
453
453
|
return;
|
|
454
|
-
const { font: g, x:
|
|
454
|
+
const { font: g, x: u = 10, y: h = 50 } = n;
|
|
455
455
|
let { maxWidth: d } = n;
|
|
456
456
|
if (!d) {
|
|
457
457
|
const { clientWidth: c = 300 } = this.canvas;
|
|
458
|
-
d = Math.floor(c - 2 *
|
|
458
|
+
d = Math.floor(c - 2 * u);
|
|
459
459
|
}
|
|
460
|
-
this._ctx.font = g, this._ctx.fillText(r,
|
|
460
|
+
this._ctx.font = g, this._ctx.fillText(r, u, h, d), this._isEmpty = !1;
|
|
461
461
|
}
|
|
462
462
|
};
|
|
463
|
-
const
|
|
463
|
+
const Qt = {
|
|
464
464
|
name: "SignaturePad",
|
|
465
465
|
props: {
|
|
466
466
|
type: {
|
|
467
467
|
type: String,
|
|
468
468
|
default: "text",
|
|
469
|
-
validator: (
|
|
469
|
+
validator: (v) => ["text", "draw"].includes(v)
|
|
470
470
|
},
|
|
471
471
|
text: {
|
|
472
472
|
type: String,
|
|
@@ -525,15 +525,15 @@ const Jt = {
|
|
|
525
525
|
type() {
|
|
526
526
|
this.initType();
|
|
527
527
|
},
|
|
528
|
-
text(
|
|
529
|
-
this.drawText(
|
|
528
|
+
text(v) {
|
|
529
|
+
this.drawText(v);
|
|
530
530
|
}
|
|
531
531
|
},
|
|
532
532
|
mounted() {
|
|
533
|
-
const { options:
|
|
534
|
-
this.signaturePad = new
|
|
533
|
+
const { options: v, defaultOptions: r } = this, n = this.$refs.signaturePadCanvas;
|
|
534
|
+
this.signaturePad = new Xt(n, {
|
|
535
535
|
...r,
|
|
536
|
-
...
|
|
536
|
+
...v
|
|
537
537
|
}), this.onResizeHandler = this.resizeCanvas.bind(this), window.addEventListener("resize", this.onResizeHandler, !1), Object.keys(this.signEvents).forEach((g) => {
|
|
538
538
|
this.signaturePad.addEventListener(g, () => {
|
|
539
539
|
this.signEvents[g]();
|
|
@@ -548,56 +548,56 @@ const Jt = {
|
|
|
548
548
|
this.type === "draw" ? this.openSignaturePad() : this.lockSignaturePad();
|
|
549
549
|
},
|
|
550
550
|
resizeCanvas() {
|
|
551
|
-
const
|
|
552
|
-
if (
|
|
551
|
+
const v = this.$refs.signaturePadCanvas, r = Math.max(window.devicePixelRatio || 1, 1);
|
|
552
|
+
if (v.width = v.offsetWidth * r, v.height = v.offsetHeight * r, v.getContext("2d").scale(r, r), this.signaturePad.clear(), this.signatureData = "", this.type === "draw") {
|
|
553
553
|
const n = this.signaturePad.toData();
|
|
554
554
|
n != null && n.length && this.signaturePad.fromData(n);
|
|
555
555
|
} else
|
|
556
556
|
this.type === "text" && this.drawText(this.text);
|
|
557
557
|
},
|
|
558
|
-
saveSignature(
|
|
559
|
-
const { type: r = "image/png", trim: n = !0, encoderOptions: g } =
|
|
558
|
+
saveSignature(v = {}) {
|
|
559
|
+
const { type: r = "image/png", trim: n = !0, encoderOptions: g } = v || {}, u = { isEmpty: !1, data: void 0 };
|
|
560
560
|
if (!this.validTypes.includes(r)) {
|
|
561
|
-
const
|
|
561
|
+
const h = this.validTypes.join(", ");
|
|
562
562
|
throw new Error(
|
|
563
|
-
`The Image type is incorrect! We only support ${
|
|
563
|
+
`The Image type is incorrect! We only support ${h} types.`
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
566
|
if (this.signaturePad.isEmpty())
|
|
567
|
-
return { ...
|
|
567
|
+
return { ...u, isEmpty: !0 };
|
|
568
568
|
if (n) {
|
|
569
|
-
const
|
|
569
|
+
const h = this.$refs.signaturePadCanvas, d = h ? this.trimCanvas(h) : null;
|
|
570
570
|
this.signatureData = d ? d.toDataURL(r, g) : "";
|
|
571
571
|
} else
|
|
572
572
|
this.signatureData = this.signaturePad.toDataURL(r, g);
|
|
573
573
|
return {
|
|
574
|
-
...
|
|
574
|
+
...u,
|
|
575
575
|
data: this.signatureData
|
|
576
576
|
};
|
|
577
577
|
},
|
|
578
578
|
undoSignature() {
|
|
579
|
-
const { signaturePad:
|
|
580
|
-
r &&
|
|
579
|
+
const { signaturePad: v } = this, r = v.toData();
|
|
580
|
+
r && v.fromData(r.slice(0, -1));
|
|
581
581
|
},
|
|
582
|
-
drawText(
|
|
583
|
-
this.signaturePad.fromText(
|
|
582
|
+
drawText(v) {
|
|
583
|
+
this.signaturePad.fromText(v, {
|
|
584
584
|
font: '40px "Nothing You Could Do"',
|
|
585
585
|
x: 10,
|
|
586
586
|
y: 100
|
|
587
587
|
});
|
|
588
588
|
},
|
|
589
589
|
// Extend of module methods
|
|
590
|
-
fromText(...
|
|
591
|
-
return this.signaturePad.fromText(...
|
|
590
|
+
fromText(...v) {
|
|
591
|
+
return this.signaturePad.fromText(...v);
|
|
592
592
|
},
|
|
593
|
-
fromDataURL(...
|
|
594
|
-
return this.signaturePad.fromDataURL(...
|
|
593
|
+
fromDataURL(...v) {
|
|
594
|
+
return this.signaturePad.fromDataURL(...v);
|
|
595
595
|
},
|
|
596
|
-
fromData(...
|
|
597
|
-
return this.signaturePad.fromData(...
|
|
596
|
+
fromData(...v) {
|
|
597
|
+
return this.signaturePad.fromData(...v);
|
|
598
598
|
},
|
|
599
|
-
toData(...
|
|
600
|
-
return this.signaturePad.toData(...
|
|
599
|
+
toData(...v) {
|
|
600
|
+
return this.signaturePad.toData(...v);
|
|
601
601
|
},
|
|
602
602
|
lockSignaturePad() {
|
|
603
603
|
return this.signaturePad.off();
|
|
@@ -611,30 +611,30 @@ const Jt = {
|
|
|
611
611
|
clearSignature() {
|
|
612
612
|
return this.signaturePad.clear();
|
|
613
613
|
},
|
|
614
|
-
trimCanvas(
|
|
614
|
+
trimCanvas(v) {
|
|
615
615
|
const r = document.createElement("canvas"), n = r.getContext("2d");
|
|
616
|
-
r.width =
|
|
617
|
-
let g = r.width,
|
|
618
|
-
const
|
|
616
|
+
r.width = v.width, r.height = v.height, n.drawImage(v, 0, 0);
|
|
617
|
+
let g = r.width, u = r.height;
|
|
618
|
+
const h = { x: [], y: [] }, d = n.getImageData(
|
|
619
619
|
0,
|
|
620
620
|
0,
|
|
621
621
|
r.width,
|
|
622
622
|
r.height
|
|
623
623
|
);
|
|
624
624
|
let c = 0;
|
|
625
|
-
for (let
|
|
625
|
+
for (let f = 0; f < u; f++)
|
|
626
626
|
for (let a = 0; a < g; a++)
|
|
627
|
-
c = (
|
|
628
|
-
|
|
629
|
-
const i =
|
|
630
|
-
g =
|
|
631
|
-
const s = n.getImageData(
|
|
632
|
-
return r.height =
|
|
627
|
+
c = (f * g + a) * 4, d.data[c + 3] > 0 && (h.x.push(a), h.y.push(f));
|
|
628
|
+
h.x.sort((f, a) => f - a), h.y.sort((f, a) => f - a);
|
|
629
|
+
const i = h.x.length - 1;
|
|
630
|
+
g = h.x[i] - h.x[0], u = h.y[i] - h.y[0];
|
|
631
|
+
const s = n.getImageData(h.x[0], h.y[0], g, u);
|
|
632
|
+
return r.height = u, n.putImageData(s, 0, 0), r;
|
|
633
633
|
}
|
|
634
634
|
},
|
|
635
|
-
render(
|
|
635
|
+
render(v) {
|
|
636
636
|
const { width: r, height: n, customStyle: g } = this;
|
|
637
|
-
return
|
|
637
|
+
return v(
|
|
638
638
|
"div",
|
|
639
639
|
{
|
|
640
640
|
style: {
|
|
@@ -644,7 +644,7 @@ const Jt = {
|
|
|
644
644
|
}
|
|
645
645
|
},
|
|
646
646
|
[
|
|
647
|
-
|
|
647
|
+
v("canvas", {
|
|
648
648
|
style: {
|
|
649
649
|
width: "100%",
|
|
650
650
|
height: "100%"
|
|
@@ -654,34 +654,40 @@ const Jt = {
|
|
|
654
654
|
]
|
|
655
655
|
);
|
|
656
656
|
}
|
|
657
|
-
},
|
|
658
|
-
var
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
657
|
+
}, qt = null, Zt = null;
|
|
658
|
+
var te = /* @__PURE__ */ ot(
|
|
659
|
+
Qt,
|
|
660
|
+
qt,
|
|
661
|
+
Zt,
|
|
662
662
|
!1,
|
|
663
663
|
null,
|
|
664
664
|
null,
|
|
665
665
|
null,
|
|
666
666
|
null
|
|
667
667
|
);
|
|
668
|
-
const
|
|
669
|
-
function
|
|
668
|
+
const ee = te.exports;
|
|
669
|
+
function re({ rel: v, href: r, crossorigin: n = !1 }) {
|
|
670
670
|
const g = document.createElement("link");
|
|
671
|
-
g.rel =
|
|
671
|
+
g.rel = v, g.href = r, g.crossorigin = n, document.head.appendChild(g);
|
|
672
672
|
}
|
|
673
|
-
const
|
|
673
|
+
const ne = [
|
|
674
674
|
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
|
|
675
675
|
{ rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: !0 },
|
|
676
676
|
{
|
|
677
677
|
rel: "stylesheet",
|
|
678
678
|
href: "https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do&display=swap"
|
|
679
679
|
}
|
|
680
|
-
],
|
|
680
|
+
], ie = {
|
|
681
681
|
name: "SignatureAnswer",
|
|
682
682
|
components: {
|
|
683
|
-
CField:
|
|
684
|
-
SignaturePad:
|
|
683
|
+
CField: Lt,
|
|
684
|
+
SignaturePad: ee
|
|
685
|
+
},
|
|
686
|
+
props: {
|
|
687
|
+
onCompleteFunc: {
|
|
688
|
+
type: Function,
|
|
689
|
+
default: null
|
|
690
|
+
}
|
|
685
691
|
},
|
|
686
692
|
mixins: [ft([])],
|
|
687
693
|
data() {
|
|
@@ -693,8 +699,8 @@ const te = [
|
|
|
693
699
|
};
|
|
694
700
|
},
|
|
695
701
|
watch: {
|
|
696
|
-
mode(
|
|
697
|
-
this.reset(), this.$refs.signaturePad &&
|
|
702
|
+
mode(v) {
|
|
703
|
+
this.reset(), this.$refs.signaturePad && v === "text" && this.focusName();
|
|
698
704
|
},
|
|
699
705
|
text() {
|
|
700
706
|
this.$refs.signaturePad && this.$nextTick(() => {
|
|
@@ -703,13 +709,13 @@ const te = [
|
|
|
703
709
|
},
|
|
704
710
|
isEmpty: {
|
|
705
711
|
immediate: !0,
|
|
706
|
-
handler(
|
|
707
|
-
this.$emit("invalid",
|
|
712
|
+
handler(v) {
|
|
713
|
+
this.$emit("invalid", v);
|
|
708
714
|
}
|
|
709
715
|
}
|
|
710
716
|
},
|
|
711
717
|
created() {
|
|
712
|
-
|
|
718
|
+
ne.forEach(re);
|
|
713
719
|
},
|
|
714
720
|
mounted() {
|
|
715
721
|
this.focusName();
|
|
@@ -722,16 +728,16 @@ const te = [
|
|
|
722
728
|
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());
|
|
723
729
|
},
|
|
724
730
|
getSignatureData() {
|
|
725
|
-
let
|
|
726
|
-
this.mode === "draw" && (
|
|
727
|
-
const { isEmpty: r, data: n } = this.$refs.signaturePad ? this.$refs.signaturePad.saveSignature(
|
|
731
|
+
let v = { type: "image/png", trim: !0 };
|
|
732
|
+
this.mode === "draw" && (v = { type: "image/svg+xml", trim: !1 });
|
|
733
|
+
const { isEmpty: r, data: n } = this.$refs.signaturePad ? this.$refs.signaturePad.saveSignature(v) : {};
|
|
728
734
|
if (r || !n)
|
|
729
735
|
throw Error("Missing signatureData");
|
|
730
736
|
return n;
|
|
731
737
|
},
|
|
732
|
-
async submit({ answer:
|
|
738
|
+
async submit({ answer: v }) {
|
|
733
739
|
const r = this.getSignatureData();
|
|
734
|
-
await
|
|
740
|
+
await v({ body: { isAccepted: !0, signatureDataURL: r } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
735
741
|
},
|
|
736
742
|
focusName() {
|
|
737
743
|
this.$nextTick(
|
|
@@ -740,7 +746,7 @@ const te = [
|
|
|
740
746
|
}
|
|
741
747
|
}
|
|
742
748
|
};
|
|
743
|
-
var
|
|
749
|
+
var ae = function() {
|
|
744
750
|
var r = this, n = r._self._c;
|
|
745
751
|
return n("div", { staticStyle: { "text-align": "left" } }, [n("div", { staticClass: "flex w-full items-center justify-between", staticStyle: { "font-size": "16px", "padding-bottom": "1em", "font-weight": "500", color: "hsl(0, 0%, 11%)" } }, [n("div", [r._v(r._s(r._document.$t("answerModal.signature.component.subTitle")))]), n("div", { staticClass: "sign-toggle" }, [n("div", { staticClass: "sign-toggle-button", class: { active: r.mode === "text" }, on: { click: function(g) {
|
|
746
752
|
r.mode = "text";
|
|
@@ -755,17 +761,17 @@ var re = function() {
|
|
|
755
761
|
r.isEmpty = r.$refs.signaturePad ? r.$refs.signaturePad.isEmpty() : !0;
|
|
756
762
|
}
|
|
757
763
|
} } })], 1), n("div", { directives: [{ name: "show", rawName: "v-show", value: r.mode === "draw", expression: "mode === 'draw'" }], staticClass: "flex w-full justify-end" }, [n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "trash" }, on: { click: r.reset } }), n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "rotate-left" }, on: { click: r.undo } })], 1), n("div", { staticClass: "text-center", staticStyle: { "font-size": "12px", color: "hsl(0, 0%, 45%)", "padding-top": "10px" } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.terms")) + " ")])], 1);
|
|
758
|
-
},
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
764
|
+
}, oe = [], se = /* @__PURE__ */ ot(
|
|
765
|
+
ie,
|
|
766
|
+
ae,
|
|
767
|
+
oe,
|
|
762
768
|
!1,
|
|
763
769
|
null,
|
|
764
|
-
"
|
|
770
|
+
"2545fee5",
|
|
765
771
|
null,
|
|
766
772
|
null
|
|
767
773
|
);
|
|
768
|
-
const
|
|
774
|
+
const ue = se.exports;
|
|
769
775
|
/*!
|
|
770
776
|
* vue-qrcode v1.0.2
|
|
771
777
|
* https://fengyuanchen.github.io/vue-qrcode
|
|
@@ -778,61 +784,61 @@ const ae = ie.exports;
|
|
|
778
784
|
function gt() {
|
|
779
785
|
throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");
|
|
780
786
|
}
|
|
781
|
-
function
|
|
782
|
-
return r = { exports: {} },
|
|
787
|
+
function le(v, r) {
|
|
788
|
+
return r = { exports: {} }, v(r, r.exports), r.exports;
|
|
783
789
|
}
|
|
784
|
-
var xt =
|
|
790
|
+
var xt = le(function(v, r) {
|
|
785
791
|
(function(n) {
|
|
786
|
-
|
|
792
|
+
v.exports = n();
|
|
787
793
|
})(function() {
|
|
788
794
|
return function() {
|
|
789
|
-
function n(g,
|
|
790
|
-
function d(s,
|
|
791
|
-
if (!
|
|
795
|
+
function n(g, u, h) {
|
|
796
|
+
function d(s, f) {
|
|
797
|
+
if (!u[s]) {
|
|
792
798
|
if (!g[s]) {
|
|
793
799
|
var a = typeof gt == "function" && gt;
|
|
794
|
-
if (!
|
|
800
|
+
if (!f && a)
|
|
795
801
|
return a(s, !0);
|
|
796
802
|
if (c)
|
|
797
803
|
return c(s, !0);
|
|
798
804
|
var w = new Error("Cannot find module '" + s + "'");
|
|
799
805
|
throw w.code = "MODULE_NOT_FOUND", w;
|
|
800
806
|
}
|
|
801
|
-
var x =
|
|
807
|
+
var x = u[s] = { exports: {} };
|
|
802
808
|
g[s][0].call(x.exports, function(b) {
|
|
803
|
-
var
|
|
804
|
-
return d(
|
|
805
|
-
}, x, x.exports, n, g,
|
|
809
|
+
var A = g[s][1][b];
|
|
810
|
+
return d(A || b);
|
|
811
|
+
}, x, x.exports, n, g, u, h);
|
|
806
812
|
}
|
|
807
|
-
return
|
|
813
|
+
return u[s].exports;
|
|
808
814
|
}
|
|
809
|
-
for (var c = typeof gt == "function" && gt, i = 0; i <
|
|
810
|
-
d(
|
|
815
|
+
for (var c = typeof gt == "function" && gt, i = 0; i < h.length; i++)
|
|
816
|
+
d(h[i]);
|
|
811
817
|
return d;
|
|
812
818
|
}
|
|
813
819
|
return n;
|
|
814
|
-
}()({ 1: [function(n, g,
|
|
820
|
+
}()({ 1: [function(n, g, u) {
|
|
815
821
|
g.exports = function() {
|
|
816
822
|
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
817
823
|
};
|
|
818
|
-
}, {}], 2: [function(n, g,
|
|
819
|
-
var
|
|
820
|
-
|
|
824
|
+
}, {}], 2: [function(n, g, u) {
|
|
825
|
+
var h = n("./utils").getSymbolSize;
|
|
826
|
+
u.getRowColCoords = function(c) {
|
|
821
827
|
if (c === 1)
|
|
822
828
|
return [];
|
|
823
|
-
for (var i = Math.floor(c / 7) + 2, s =
|
|
824
|
-
a[w] = a[w - 1] -
|
|
829
|
+
for (var i = Math.floor(c / 7) + 2, s = h(c), f = s === 145 ? 26 : Math.ceil((s - 13) / (2 * i - 2)) * 2, a = [s - 7], w = 1; w < i - 1; w++)
|
|
830
|
+
a[w] = a[w - 1] - f;
|
|
825
831
|
return a.push(6), a.reverse();
|
|
826
|
-
},
|
|
827
|
-
for (var i = [], s =
|
|
828
|
-
for (var w = 0; w <
|
|
832
|
+
}, u.getPositions = function(c) {
|
|
833
|
+
for (var i = [], s = u.getRowColCoords(c), f = s.length, a = 0; a < f; a++)
|
|
834
|
+
for (var w = 0; w < f; w++)
|
|
829
835
|
a === 0 && w === 0 || // top-left
|
|
830
|
-
a === 0 && w ===
|
|
831
|
-
a ===
|
|
836
|
+
a === 0 && w === f - 1 || // bottom-left
|
|
837
|
+
a === f - 1 && w === 0 || i.push([s[a], s[w]]);
|
|
832
838
|
return i;
|
|
833
839
|
};
|
|
834
|
-
}, { "./utils": 21 }], 3: [function(n, g,
|
|
835
|
-
var
|
|
840
|
+
}, { "./utils": 21 }], 3: [function(n, g, u) {
|
|
841
|
+
var h = n("./mode"), d = [
|
|
836
842
|
"0",
|
|
837
843
|
"1",
|
|
838
844
|
"2",
|
|
@@ -880,7 +886,7 @@ var xt = oe(function(m, r) {
|
|
|
880
886
|
":"
|
|
881
887
|
];
|
|
882
888
|
function c(i) {
|
|
883
|
-
this.mode =
|
|
889
|
+
this.mode = h.ALPHANUMERIC, this.data = i;
|
|
884
890
|
}
|
|
885
891
|
c.getBitsLength = function(s) {
|
|
886
892
|
return 11 * Math.floor(s / 2) + 6 * (s % 2);
|
|
@@ -889,18 +895,18 @@ var xt = oe(function(m, r) {
|
|
|
889
895
|
}, c.prototype.getBitsLength = function() {
|
|
890
896
|
return c.getBitsLength(this.data.length);
|
|
891
897
|
}, c.prototype.write = function(s) {
|
|
892
|
-
var
|
|
893
|
-
for (
|
|
894
|
-
var a = d.indexOf(this.data[
|
|
895
|
-
a += d.indexOf(this.data[
|
|
898
|
+
var f;
|
|
899
|
+
for (f = 0; f + 2 <= this.data.length; f += 2) {
|
|
900
|
+
var a = d.indexOf(this.data[f]) * 45;
|
|
901
|
+
a += d.indexOf(this.data[f + 1]), s.put(a, 11);
|
|
896
902
|
}
|
|
897
|
-
this.data.length % 2 && s.put(d.indexOf(this.data[
|
|
903
|
+
this.data.length % 2 && s.put(d.indexOf(this.data[f]), 6);
|
|
898
904
|
}, g.exports = c;
|
|
899
|
-
}, { "./mode": 14 }], 4: [function(n, g,
|
|
900
|
-
function
|
|
905
|
+
}, { "./mode": 14 }], 4: [function(n, g, u) {
|
|
906
|
+
function h() {
|
|
901
907
|
this.buffer = [], this.length = 0;
|
|
902
908
|
}
|
|
903
|
-
|
|
909
|
+
h.prototype = {
|
|
904
910
|
get: function(d) {
|
|
905
911
|
var c = Math.floor(d / 8);
|
|
906
912
|
return (this.buffer[c] >>> 7 - d % 8 & 1) === 1;
|
|
@@ -916,17 +922,17 @@ var xt = oe(function(m, r) {
|
|
|
916
922
|
var c = Math.floor(this.length / 8);
|
|
917
923
|
this.buffer.length <= c && this.buffer.push(0), d && (this.buffer[c] |= 128 >>> this.length % 8), this.length++;
|
|
918
924
|
}
|
|
919
|
-
}, g.exports =
|
|
920
|
-
}, {}], 5: [function(n, g,
|
|
921
|
-
var
|
|
925
|
+
}, g.exports = h;
|
|
926
|
+
}, {}], 5: [function(n, g, u) {
|
|
927
|
+
var h = n("../utils/buffer");
|
|
922
928
|
function d(c) {
|
|
923
929
|
if (!c || c < 1)
|
|
924
930
|
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
925
|
-
this.size = c, this.data =
|
|
931
|
+
this.size = c, this.data = h.alloc(c * c), this.reservedBit = h.alloc(c * c);
|
|
926
932
|
}
|
|
927
|
-
d.prototype.set = function(c, i, s,
|
|
933
|
+
d.prototype.set = function(c, i, s, f) {
|
|
928
934
|
var a = c * this.size + i;
|
|
929
|
-
this.data[a] = s,
|
|
935
|
+
this.data[a] = s, f && (this.reservedBit[a] = !0);
|
|
930
936
|
}, d.prototype.get = function(c, i) {
|
|
931
937
|
return this.data[c * this.size + i];
|
|
932
938
|
}, d.prototype.xor = function(c, i, s) {
|
|
@@ -934,10 +940,10 @@ var xt = oe(function(m, r) {
|
|
|
934
940
|
}, d.prototype.isReserved = function(c, i) {
|
|
935
941
|
return this.reservedBit[c * this.size + i];
|
|
936
942
|
}, g.exports = d;
|
|
937
|
-
}, { "../utils/buffer": 28 }], 6: [function(n, g,
|
|
938
|
-
var
|
|
943
|
+
}, { "../utils/buffer": 28 }], 6: [function(n, g, u) {
|
|
944
|
+
var h = n("../utils/buffer"), d = n("./mode");
|
|
939
945
|
function c(i) {
|
|
940
|
-
this.mode = d.BYTE, this.data =
|
|
946
|
+
this.mode = d.BYTE, this.data = h.from(i);
|
|
941
947
|
}
|
|
942
948
|
c.getBitsLength = function(s) {
|
|
943
949
|
return s * 8;
|
|
@@ -946,11 +952,11 @@ var xt = oe(function(m, r) {
|
|
|
946
952
|
}, c.prototype.getBitsLength = function() {
|
|
947
953
|
return c.getBitsLength(this.data.length);
|
|
948
954
|
}, c.prototype.write = function(i) {
|
|
949
|
-
for (var s = 0,
|
|
955
|
+
for (var s = 0, f = this.data.length; s < f; s++)
|
|
950
956
|
i.put(this.data[s], 8);
|
|
951
957
|
}, g.exports = c;
|
|
952
|
-
}, { "../utils/buffer": 28, "./mode": 14 }], 7: [function(n, g,
|
|
953
|
-
var
|
|
958
|
+
}, { "../utils/buffer": 28, "./mode": 14 }], 7: [function(n, g, u) {
|
|
959
|
+
var h = n("./error-correction-level"), d = [
|
|
954
960
|
// L M Q H
|
|
955
961
|
1,
|
|
956
962
|
1,
|
|
@@ -1275,71 +1281,71 @@ var xt = oe(function(m, r) {
|
|
|
1275
1281
|
2040,
|
|
1276
1282
|
2430
|
|
1277
1283
|
];
|
|
1278
|
-
|
|
1279
|
-
switch (
|
|
1280
|
-
case
|
|
1284
|
+
u.getBlocksCount = function(s, f) {
|
|
1285
|
+
switch (f) {
|
|
1286
|
+
case h.L:
|
|
1281
1287
|
return d[(s - 1) * 4 + 0];
|
|
1282
|
-
case
|
|
1288
|
+
case h.M:
|
|
1283
1289
|
return d[(s - 1) * 4 + 1];
|
|
1284
|
-
case
|
|
1290
|
+
case h.Q:
|
|
1285
1291
|
return d[(s - 1) * 4 + 2];
|
|
1286
|
-
case
|
|
1292
|
+
case h.H:
|
|
1287
1293
|
return d[(s - 1) * 4 + 3];
|
|
1288
1294
|
default:
|
|
1289
1295
|
return;
|
|
1290
1296
|
}
|
|
1291
|
-
},
|
|
1292
|
-
switch (
|
|
1293
|
-
case
|
|
1297
|
+
}, u.getTotalCodewordsCount = function(s, f) {
|
|
1298
|
+
switch (f) {
|
|
1299
|
+
case h.L:
|
|
1294
1300
|
return c[(s - 1) * 4 + 0];
|
|
1295
|
-
case
|
|
1301
|
+
case h.M:
|
|
1296
1302
|
return c[(s - 1) * 4 + 1];
|
|
1297
|
-
case
|
|
1303
|
+
case h.Q:
|
|
1298
1304
|
return c[(s - 1) * 4 + 2];
|
|
1299
|
-
case
|
|
1305
|
+
case h.H:
|
|
1300
1306
|
return c[(s - 1) * 4 + 3];
|
|
1301
1307
|
default:
|
|
1302
1308
|
return;
|
|
1303
1309
|
}
|
|
1304
1310
|
};
|
|
1305
|
-
}, { "./error-correction-level": 8 }], 8: [function(n, g,
|
|
1306
|
-
|
|
1307
|
-
function
|
|
1311
|
+
}, { "./error-correction-level": 8 }], 8: [function(n, g, u) {
|
|
1312
|
+
u.L = { bit: 1 }, u.M = { bit: 0 }, u.Q = { bit: 3 }, u.H = { bit: 2 };
|
|
1313
|
+
function h(d) {
|
|
1308
1314
|
if (typeof d != "string")
|
|
1309
1315
|
throw new Error("Param is not a string");
|
|
1310
1316
|
var c = d.toLowerCase();
|
|
1311
1317
|
switch (c) {
|
|
1312
1318
|
case "l":
|
|
1313
1319
|
case "low":
|
|
1314
|
-
return
|
|
1320
|
+
return u.L;
|
|
1315
1321
|
case "m":
|
|
1316
1322
|
case "medium":
|
|
1317
|
-
return
|
|
1323
|
+
return u.M;
|
|
1318
1324
|
case "q":
|
|
1319
1325
|
case "quartile":
|
|
1320
|
-
return
|
|
1326
|
+
return u.Q;
|
|
1321
1327
|
case "h":
|
|
1322
1328
|
case "high":
|
|
1323
|
-
return
|
|
1329
|
+
return u.H;
|
|
1324
1330
|
default:
|
|
1325
1331
|
throw new Error("Unknown EC Level: " + d);
|
|
1326
1332
|
}
|
|
1327
1333
|
}
|
|
1328
|
-
|
|
1334
|
+
u.isValid = function(c) {
|
|
1329
1335
|
return c && typeof c.bit < "u" && c.bit >= 0 && c.bit < 4;
|
|
1330
|
-
},
|
|
1331
|
-
if (
|
|
1336
|
+
}, u.from = function(c, i) {
|
|
1337
|
+
if (u.isValid(c))
|
|
1332
1338
|
return c;
|
|
1333
1339
|
try {
|
|
1334
|
-
return
|
|
1340
|
+
return h(c);
|
|
1335
1341
|
} catch {
|
|
1336
1342
|
return i;
|
|
1337
1343
|
}
|
|
1338
1344
|
};
|
|
1339
|
-
}, {}], 9: [function(n, g,
|
|
1340
|
-
var
|
|
1341
|
-
|
|
1342
|
-
var s =
|
|
1345
|
+
}, {}], 9: [function(n, g, u) {
|
|
1346
|
+
var h = n("./utils").getSymbolSize, d = 7;
|
|
1347
|
+
u.getPositions = function(i) {
|
|
1348
|
+
var s = h(i);
|
|
1343
1349
|
return [
|
|
1344
1350
|
// top-left
|
|
1345
1351
|
[0, 0],
|
|
@@ -1349,33 +1355,33 @@ var xt = oe(function(m, r) {
|
|
|
1349
1355
|
[0, s - d]
|
|
1350
1356
|
];
|
|
1351
1357
|
};
|
|
1352
|
-
}, { "./utils": 21 }], 10: [function(n, g,
|
|
1353
|
-
var
|
|
1354
|
-
|
|
1355
|
-
for (var w =
|
|
1356
|
-
x ^= d <<
|
|
1358
|
+
}, { "./utils": 21 }], 10: [function(n, g, u) {
|
|
1359
|
+
var h = n("./utils"), d = 1335, c = 21522, i = h.getBCHDigit(d);
|
|
1360
|
+
u.getEncodedBits = function(f, a) {
|
|
1361
|
+
for (var w = f.bit << 3 | a, x = w << 10; h.getBCHDigit(x) - i >= 0; )
|
|
1362
|
+
x ^= d << h.getBCHDigit(x) - i;
|
|
1357
1363
|
return (w << 10 | x) ^ c;
|
|
1358
1364
|
};
|
|
1359
|
-
}, { "./utils": 21 }], 11: [function(n, g,
|
|
1360
|
-
var
|
|
1365
|
+
}, { "./utils": 21 }], 11: [function(n, g, u) {
|
|
1366
|
+
var h = n("../utils/buffer"), d = h.alloc(512), c = h.alloc(256);
|
|
1361
1367
|
(function() {
|
|
1362
|
-
for (var s = 1,
|
|
1363
|
-
d[
|
|
1364
|
-
for (
|
|
1365
|
-
d[
|
|
1366
|
-
})(),
|
|
1368
|
+
for (var s = 1, f = 0; f < 255; f++)
|
|
1369
|
+
d[f] = s, c[s] = f, s <<= 1, s & 256 && (s ^= 285);
|
|
1370
|
+
for (f = 255; f < 512; f++)
|
|
1371
|
+
d[f] = d[f - 255];
|
|
1372
|
+
})(), u.log = function(s) {
|
|
1367
1373
|
if (s < 1)
|
|
1368
1374
|
throw new Error("log(" + s + ")");
|
|
1369
1375
|
return c[s];
|
|
1370
|
-
},
|
|
1376
|
+
}, u.exp = function(s) {
|
|
1371
1377
|
return d[s];
|
|
1372
|
-
},
|
|
1373
|
-
return s === 0 ||
|
|
1378
|
+
}, u.mul = function(s, f) {
|
|
1379
|
+
return s === 0 || f === 0 ? 0 : d[c[s] + c[f]];
|
|
1374
1380
|
};
|
|
1375
|
-
}, { "../utils/buffer": 28 }], 12: [function(n, g,
|
|
1376
|
-
var
|
|
1381
|
+
}, { "../utils/buffer": 28 }], 12: [function(n, g, u) {
|
|
1382
|
+
var h = n("./mode"), d = n("./utils");
|
|
1377
1383
|
function c(i) {
|
|
1378
|
-
this.mode =
|
|
1384
|
+
this.mode = h.KANJI, this.data = i;
|
|
1379
1385
|
}
|
|
1380
1386
|
c.getBitsLength = function(s) {
|
|
1381
1387
|
return s * 13;
|
|
@@ -1386,21 +1392,21 @@ var xt = oe(function(m, r) {
|
|
|
1386
1392
|
}, c.prototype.write = function(i) {
|
|
1387
1393
|
var s;
|
|
1388
1394
|
for (s = 0; s < this.data.length; s++) {
|
|
1389
|
-
var
|
|
1390
|
-
if (
|
|
1391
|
-
|
|
1392
|
-
else if (
|
|
1393
|
-
|
|
1395
|
+
var f = d.toSJIS(this.data[s]);
|
|
1396
|
+
if (f >= 33088 && f <= 40956)
|
|
1397
|
+
f -= 33088;
|
|
1398
|
+
else if (f >= 57408 && f <= 60351)
|
|
1399
|
+
f -= 49472;
|
|
1394
1400
|
else
|
|
1395
1401
|
throw new Error(
|
|
1396
1402
|
"Invalid SJIS character: " + this.data[s] + `
|
|
1397
1403
|
Make sure your charset is UTF-8`
|
|
1398
1404
|
);
|
|
1399
|
-
|
|
1405
|
+
f = (f >>> 8 & 255) * 192 + (f & 255), i.put(f, 13);
|
|
1400
1406
|
}
|
|
1401
1407
|
}, g.exports = c;
|
|
1402
|
-
}, { "./mode": 14, "./utils": 21 }], 13: [function(n, g,
|
|
1403
|
-
|
|
1408
|
+
}, { "./mode": 14, "./utils": 21 }], 13: [function(n, g, u) {
|
|
1409
|
+
u.Patterns = {
|
|
1404
1410
|
PATTERN000: 0,
|
|
1405
1411
|
PATTERN001: 1,
|
|
1406
1412
|
PATTERN010: 2,
|
|
@@ -1410,113 +1416,113 @@ Make sure your charset is UTF-8`
|
|
|
1410
1416
|
PATTERN110: 6,
|
|
1411
1417
|
PATTERN111: 7
|
|
1412
1418
|
};
|
|
1413
|
-
var
|
|
1419
|
+
var h = {
|
|
1414
1420
|
N1: 3,
|
|
1415
1421
|
N2: 3,
|
|
1416
1422
|
N3: 40,
|
|
1417
1423
|
N4: 10
|
|
1418
1424
|
};
|
|
1419
|
-
|
|
1425
|
+
u.isValid = function(i) {
|
|
1420
1426
|
return i != null && i !== "" && !isNaN(i) && i >= 0 && i <= 7;
|
|
1421
|
-
},
|
|
1422
|
-
return
|
|
1423
|
-
},
|
|
1424
|
-
for (var s = i.size,
|
|
1427
|
+
}, u.from = function(i) {
|
|
1428
|
+
return u.isValid(i) ? parseInt(i, 10) : void 0;
|
|
1429
|
+
}, u.getPenaltyN1 = function(i) {
|
|
1430
|
+
for (var s = i.size, f = 0, a = 0, w = 0, x = null, b = null, A = 0; A < s; A++) {
|
|
1425
1431
|
a = w = 0, x = b = null;
|
|
1426
1432
|
for (var F = 0; F < s; F++) {
|
|
1427
|
-
var M = i.get(
|
|
1428
|
-
M === x ? a++ : (a >= 5 && (
|
|
1433
|
+
var M = i.get(A, F);
|
|
1434
|
+
M === x ? a++ : (a >= 5 && (f += h.N1 + (a - 5)), x = M, a = 1), M = i.get(F, A), M === b ? w++ : (w >= 5 && (f += h.N1 + (w - 5)), b = M, w = 1);
|
|
1429
1435
|
}
|
|
1430
|
-
a >= 5 && (
|
|
1436
|
+
a >= 5 && (f += h.N1 + (a - 5)), w >= 5 && (f += h.N1 + (w - 5));
|
|
1431
1437
|
}
|
|
1432
|
-
return
|
|
1433
|
-
},
|
|
1434
|
-
for (var s = i.size,
|
|
1438
|
+
return f;
|
|
1439
|
+
}, u.getPenaltyN2 = function(i) {
|
|
1440
|
+
for (var s = i.size, f = 0, a = 0; a < s - 1; a++)
|
|
1435
1441
|
for (var w = 0; w < s - 1; w++) {
|
|
1436
1442
|
var x = i.get(a, w) + i.get(a, w + 1) + i.get(a + 1, w) + i.get(a + 1, w + 1);
|
|
1437
|
-
(x === 4 || x === 0) &&
|
|
1443
|
+
(x === 4 || x === 0) && f++;
|
|
1438
1444
|
}
|
|
1439
|
-
return
|
|
1440
|
-
},
|
|
1441
|
-
for (var s = i.size,
|
|
1445
|
+
return f * h.N2;
|
|
1446
|
+
}, u.getPenaltyN3 = function(i) {
|
|
1447
|
+
for (var s = i.size, f = 0, a = 0, w = 0, x = 0; x < s; x++) {
|
|
1442
1448
|
a = w = 0;
|
|
1443
1449
|
for (var b = 0; b < s; b++)
|
|
1444
|
-
a = a << 1 & 2047 | i.get(x, b), b >= 10 && (a === 1488 || a === 93) &&
|
|
1450
|
+
a = a << 1 & 2047 | i.get(x, b), b >= 10 && (a === 1488 || a === 93) && f++, w = w << 1 & 2047 | i.get(b, x), b >= 10 && (w === 1488 || w === 93) && f++;
|
|
1445
1451
|
}
|
|
1446
|
-
return
|
|
1447
|
-
},
|
|
1448
|
-
for (var s = 0,
|
|
1452
|
+
return f * h.N3;
|
|
1453
|
+
}, u.getPenaltyN4 = function(i) {
|
|
1454
|
+
for (var s = 0, f = i.data.length, a = 0; a < f; a++)
|
|
1449
1455
|
s += i.data[a];
|
|
1450
|
-
var w = Math.abs(Math.ceil(s * 100 /
|
|
1451
|
-
return w *
|
|
1456
|
+
var w = Math.abs(Math.ceil(s * 100 / f / 5) - 10);
|
|
1457
|
+
return w * h.N4;
|
|
1452
1458
|
};
|
|
1453
1459
|
function d(c, i, s) {
|
|
1454
1460
|
switch (c) {
|
|
1455
|
-
case
|
|
1461
|
+
case u.Patterns.PATTERN000:
|
|
1456
1462
|
return (i + s) % 2 === 0;
|
|
1457
|
-
case
|
|
1463
|
+
case u.Patterns.PATTERN001:
|
|
1458
1464
|
return i % 2 === 0;
|
|
1459
|
-
case
|
|
1465
|
+
case u.Patterns.PATTERN010:
|
|
1460
1466
|
return s % 3 === 0;
|
|
1461
|
-
case
|
|
1467
|
+
case u.Patterns.PATTERN011:
|
|
1462
1468
|
return (i + s) % 3 === 0;
|
|
1463
|
-
case
|
|
1469
|
+
case u.Patterns.PATTERN100:
|
|
1464
1470
|
return (Math.floor(i / 2) + Math.floor(s / 3)) % 2 === 0;
|
|
1465
|
-
case
|
|
1471
|
+
case u.Patterns.PATTERN101:
|
|
1466
1472
|
return i * s % 2 + i * s % 3 === 0;
|
|
1467
|
-
case
|
|
1473
|
+
case u.Patterns.PATTERN110:
|
|
1468
1474
|
return (i * s % 2 + i * s % 3) % 2 === 0;
|
|
1469
|
-
case
|
|
1475
|
+
case u.Patterns.PATTERN111:
|
|
1470
1476
|
return (i * s % 3 + (i + s) % 2) % 2 === 0;
|
|
1471
1477
|
default:
|
|
1472
1478
|
throw new Error("bad maskPattern:" + c);
|
|
1473
1479
|
}
|
|
1474
1480
|
}
|
|
1475
|
-
|
|
1476
|
-
for (var
|
|
1477
|
-
for (var w = 0; w <
|
|
1481
|
+
u.applyMask = function(i, s) {
|
|
1482
|
+
for (var f = s.size, a = 0; a < f; a++)
|
|
1483
|
+
for (var w = 0; w < f; w++)
|
|
1478
1484
|
s.isReserved(w, a) || s.xor(w, a, d(i, w, a));
|
|
1479
|
-
},
|
|
1480
|
-
for (var
|
|
1481
|
-
s(x),
|
|
1482
|
-
var b =
|
|
1483
|
-
|
|
1485
|
+
}, u.getBestMask = function(i, s) {
|
|
1486
|
+
for (var f = Object.keys(u.Patterns).length, a = 0, w = 1 / 0, x = 0; x < f; x++) {
|
|
1487
|
+
s(x), u.applyMask(x, i);
|
|
1488
|
+
var b = u.getPenaltyN1(i) + u.getPenaltyN2(i) + u.getPenaltyN3(i) + u.getPenaltyN4(i);
|
|
1489
|
+
u.applyMask(x, i), b < w && (w = b, a = x);
|
|
1484
1490
|
}
|
|
1485
1491
|
return a;
|
|
1486
1492
|
};
|
|
1487
|
-
}, {}], 14: [function(n, g,
|
|
1488
|
-
var
|
|
1489
|
-
|
|
1493
|
+
}, {}], 14: [function(n, g, u) {
|
|
1494
|
+
var h = n("./version-check"), d = n("./regex");
|
|
1495
|
+
u.NUMERIC = {
|
|
1490
1496
|
id: "Numeric",
|
|
1491
1497
|
bit: 1,
|
|
1492
1498
|
ccBits: [10, 12, 14]
|
|
1493
|
-
},
|
|
1499
|
+
}, u.ALPHANUMERIC = {
|
|
1494
1500
|
id: "Alphanumeric",
|
|
1495
1501
|
bit: 2,
|
|
1496
1502
|
ccBits: [9, 11, 13]
|
|
1497
|
-
},
|
|
1503
|
+
}, u.BYTE = {
|
|
1498
1504
|
id: "Byte",
|
|
1499
1505
|
bit: 4,
|
|
1500
1506
|
ccBits: [8, 16, 16]
|
|
1501
|
-
},
|
|
1507
|
+
}, u.KANJI = {
|
|
1502
1508
|
id: "Kanji",
|
|
1503
1509
|
bit: 8,
|
|
1504
1510
|
ccBits: [8, 10, 12]
|
|
1505
|
-
},
|
|
1511
|
+
}, u.MIXED = {
|
|
1506
1512
|
bit: -1
|
|
1507
|
-
},
|
|
1513
|
+
}, u.getCharCountIndicator = function(s, f) {
|
|
1508
1514
|
if (!s.ccBits)
|
|
1509
1515
|
throw new Error("Invalid mode: " + s);
|
|
1510
|
-
if (!
|
|
1511
|
-
throw new Error("Invalid version: " +
|
|
1512
|
-
return
|
|
1513
|
-
},
|
|
1514
|
-
return d.testNumeric(s) ?
|
|
1515
|
-
},
|
|
1516
|
+
if (!h.isValid(f))
|
|
1517
|
+
throw new Error("Invalid version: " + f);
|
|
1518
|
+
return f >= 1 && f < 10 ? s.ccBits[0] : f < 27 ? s.ccBits[1] : s.ccBits[2];
|
|
1519
|
+
}, u.getBestModeForData = function(s) {
|
|
1520
|
+
return d.testNumeric(s) ? u.NUMERIC : d.testAlphanumeric(s) ? u.ALPHANUMERIC : d.testKanji(s) ? u.KANJI : u.BYTE;
|
|
1521
|
+
}, u.toString = function(s) {
|
|
1516
1522
|
if (s && s.id)
|
|
1517
1523
|
return s.id;
|
|
1518
1524
|
throw new Error("Invalid mode");
|
|
1519
|
-
},
|
|
1525
|
+
}, u.isValid = function(s) {
|
|
1520
1526
|
return s && s.bit && s.ccBits;
|
|
1521
1527
|
};
|
|
1522
1528
|
function c(i) {
|
|
@@ -1525,30 +1531,30 @@ Make sure your charset is UTF-8`
|
|
|
1525
1531
|
var s = i.toLowerCase();
|
|
1526
1532
|
switch (s) {
|
|
1527
1533
|
case "numeric":
|
|
1528
|
-
return
|
|
1534
|
+
return u.NUMERIC;
|
|
1529
1535
|
case "alphanumeric":
|
|
1530
|
-
return
|
|
1536
|
+
return u.ALPHANUMERIC;
|
|
1531
1537
|
case "kanji":
|
|
1532
|
-
return
|
|
1538
|
+
return u.KANJI;
|
|
1533
1539
|
case "byte":
|
|
1534
|
-
return
|
|
1540
|
+
return u.BYTE;
|
|
1535
1541
|
default:
|
|
1536
1542
|
throw new Error("Unknown mode: " + i);
|
|
1537
1543
|
}
|
|
1538
1544
|
}
|
|
1539
|
-
|
|
1540
|
-
if (
|
|
1545
|
+
u.from = function(s, f) {
|
|
1546
|
+
if (u.isValid(s))
|
|
1541
1547
|
return s;
|
|
1542
1548
|
try {
|
|
1543
1549
|
return c(s);
|
|
1544
1550
|
} catch {
|
|
1545
|
-
return
|
|
1551
|
+
return f;
|
|
1546
1552
|
}
|
|
1547
1553
|
};
|
|
1548
|
-
}, { "./regex": 19, "./version-check": 22 }], 15: [function(n, g,
|
|
1549
|
-
var
|
|
1554
|
+
}, { "./regex": 19, "./version-check": 22 }], 15: [function(n, g, u) {
|
|
1555
|
+
var h = n("./mode");
|
|
1550
1556
|
function d(c) {
|
|
1551
|
-
this.mode =
|
|
1557
|
+
this.mode = h.NUMERIC, this.data = c.toString();
|
|
1552
1558
|
}
|
|
1553
1559
|
d.getBitsLength = function(i) {
|
|
1554
1560
|
return 10 * Math.floor(i / 3) + (i % 3 ? i % 3 * 3 + 1 : 0);
|
|
@@ -1557,35 +1563,35 @@ Make sure your charset is UTF-8`
|
|
|
1557
1563
|
}, d.prototype.getBitsLength = function() {
|
|
1558
1564
|
return d.getBitsLength(this.data.length);
|
|
1559
1565
|
}, d.prototype.write = function(i) {
|
|
1560
|
-
var s,
|
|
1566
|
+
var s, f, a;
|
|
1561
1567
|
for (s = 0; s + 3 <= this.data.length; s += 3)
|
|
1562
|
-
|
|
1568
|
+
f = this.data.substr(s, 3), a = parseInt(f, 10), i.put(a, 10);
|
|
1563
1569
|
var w = this.data.length - s;
|
|
1564
|
-
w > 0 && (
|
|
1570
|
+
w > 0 && (f = this.data.substr(s), a = parseInt(f, 10), i.put(a, w * 3 + 1));
|
|
1565
1571
|
}, g.exports = d;
|
|
1566
|
-
}, { "./mode": 14 }], 16: [function(n, g,
|
|
1567
|
-
var
|
|
1568
|
-
|
|
1569
|
-
for (var
|
|
1572
|
+
}, { "./mode": 14 }], 16: [function(n, g, u) {
|
|
1573
|
+
var h = n("../utils/buffer"), d = n("./galois-field");
|
|
1574
|
+
u.mul = function(i, s) {
|
|
1575
|
+
for (var f = h.alloc(i.length + s.length - 1), a = 0; a < i.length; a++)
|
|
1570
1576
|
for (var w = 0; w < s.length; w++)
|
|
1571
|
-
|
|
1572
|
-
return
|
|
1573
|
-
},
|
|
1574
|
-
for (var
|
|
1575
|
-
for (var a =
|
|
1576
|
-
|
|
1577
|
-
for (var x = 0; x <
|
|
1577
|
+
f[a + w] ^= d.mul(i[a], s[w]);
|
|
1578
|
+
return f;
|
|
1579
|
+
}, u.mod = function(i, s) {
|
|
1580
|
+
for (var f = h.from(i); f.length - s.length >= 0; ) {
|
|
1581
|
+
for (var a = f[0], w = 0; w < s.length; w++)
|
|
1582
|
+
f[w] ^= d.mul(s[w], a);
|
|
1583
|
+
for (var x = 0; x < f.length && f[x] === 0; )
|
|
1578
1584
|
x++;
|
|
1579
|
-
|
|
1585
|
+
f = f.slice(x);
|
|
1580
1586
|
}
|
|
1581
|
-
return
|
|
1582
|
-
},
|
|
1583
|
-
for (var s =
|
|
1584
|
-
s =
|
|
1587
|
+
return f;
|
|
1588
|
+
}, u.generateECPolynomial = function(i) {
|
|
1589
|
+
for (var s = h.from([1]), f = 0; f < i; f++)
|
|
1590
|
+
s = u.mul(s, [1, d.exp(f)]);
|
|
1585
1591
|
return s;
|
|
1586
1592
|
};
|
|
1587
|
-
}, { "../utils/buffer": 28, "./galois-field": 11 }], 17: [function(n, g,
|
|
1588
|
-
var
|
|
1593
|
+
}, { "../utils/buffer": 28, "./galois-field": 11 }], 17: [function(n, g, u) {
|
|
1594
|
+
var h = n("../utils/buffer"), d = n("./utils"), c = n("./error-correction-level"), i = n("./bit-buffer"), s = n("./bit-matrix"), f = n("./alignment-pattern"), a = n("./finder-pattern"), w = n("./mask-pattern"), x = n("./error-correction-code"), b = n("./reed-solomon-encoder"), A = n("./version"), F = n("./format-info"), M = n("./mode"), C = n("./segments"), B = n("isarray");
|
|
1589
1595
|
function I($, D) {
|
|
1590
1596
|
for (var U = $.size, R = a.getPositions(D), O = 0; O < R.length; O++)
|
|
1591
1597
|
for (var z = R[O][0], N = R[O][1], Y = -1; Y <= 7; Y++)
|
|
@@ -1600,13 +1606,13 @@ Make sure your charset is UTF-8`
|
|
|
1600
1606
|
}
|
|
1601
1607
|
}
|
|
1602
1608
|
function _($, D) {
|
|
1603
|
-
for (var U =
|
|
1609
|
+
for (var U = f.getPositions(D), R = 0; R < U.length; R++)
|
|
1604
1610
|
for (var O = U[R][0], z = U[R][1], N = -2; N <= 2; N++)
|
|
1605
1611
|
for (var Y = -2; Y <= 2; Y++)
|
|
1606
1612
|
N === -2 || N === 2 || Y === -2 || Y === 2 || N === 0 && Y === 0 ? $.set(O + N, z + Y, !0, !0) : $.set(O + N, z + Y, !1, !0);
|
|
1607
1613
|
}
|
|
1608
|
-
function
|
|
1609
|
-
for (var U = $.size, R =
|
|
1614
|
+
function m($, D) {
|
|
1615
|
+
for (var U = $.size, R = A.getEncodedBits(D), O, z, N, Y = 0; Y < 18; Y++)
|
|
1610
1616
|
O = Math.floor(Y / 3), z = Y % 3 + U - 8 - 3, N = (R >> Y & 1) === 1, $.set(O, z, N, !0), $.set(z, O, N, !0);
|
|
1611
1617
|
}
|
|
1612
1618
|
function p($, D, U) {
|
|
@@ -1629,7 +1635,7 @@ Make sure your charset is UTF-8`
|
|
|
1629
1635
|
}
|
|
1630
1636
|
}
|
|
1631
1637
|
}
|
|
1632
|
-
function
|
|
1638
|
+
function T($, D, U) {
|
|
1633
1639
|
var R = new i();
|
|
1634
1640
|
U.forEach(function(et) {
|
|
1635
1641
|
R.put(et.mode.bit, 4), R.put(et.getLength(), M.getCharCountIndicator(et.mode, $)), et.write(R);
|
|
@@ -1642,28 +1648,28 @@ Make sure your charset is UTF-8`
|
|
|
1642
1648
|
return L(R, $, D);
|
|
1643
1649
|
}
|
|
1644
1650
|
function L($, D, U) {
|
|
1645
|
-
for (var R = d.getSymbolTotalCodewords(D), O = x.getTotalCodewordsCount(D, U), z = R - O, N = x.getBlocksCount(D, U), Y = R % N, j = N - Y, et = Math.floor(R / N), X = Math.floor(z / N), mt = X + 1,
|
|
1646
|
-
var
|
|
1647
|
-
it[rt] = vt.slice(at, at +
|
|
1651
|
+
for (var R = d.getSymbolTotalCodewords(D), O = x.getTotalCodewordsCount(D, U), z = R - O, N = x.getBlocksCount(D, U), Y = R % N, j = N - Y, et = Math.floor(R / N), X = Math.floor(z / N), mt = X + 1, J = et - X, q = new b(J), at = 0, it = new Array(N), st = new Array(N), ut = 0, vt = h.from($.buffer), rt = 0; rt < N; rt++) {
|
|
1652
|
+
var lt = rt < j ? X : mt;
|
|
1653
|
+
it[rt] = vt.slice(at, at + lt), st[rt] = q.encode(it[rt]), at += lt, ut = Math.max(ut, lt);
|
|
1648
1654
|
}
|
|
1649
|
-
var
|
|
1655
|
+
var ct = h.alloc(R), ht = 0, tt, Q;
|
|
1650
1656
|
for (tt = 0; tt < ut; tt++)
|
|
1651
1657
|
for (Q = 0; Q < N; Q++)
|
|
1652
|
-
tt < it[Q].length && (
|
|
1653
|
-
for (tt = 0; tt <
|
|
1658
|
+
tt < it[Q].length && (ct[ht++] = it[Q][tt]);
|
|
1659
|
+
for (tt = 0; tt < J; tt++)
|
|
1654
1660
|
for (Q = 0; Q < N; Q++)
|
|
1655
|
-
|
|
1656
|
-
return
|
|
1661
|
+
ct[ht++] = st[Q][tt];
|
|
1662
|
+
return ct;
|
|
1657
1663
|
}
|
|
1658
1664
|
function W($, D, U, R) {
|
|
1659
1665
|
var O;
|
|
1660
|
-
if (
|
|
1666
|
+
if (B($))
|
|
1661
1667
|
O = C.fromArray($);
|
|
1662
1668
|
else if (typeof $ == "string") {
|
|
1663
1669
|
var z = D;
|
|
1664
1670
|
if (!z) {
|
|
1665
1671
|
var N = C.rawSplit($);
|
|
1666
|
-
z =
|
|
1672
|
+
z = A.getBestVersionForData(
|
|
1667
1673
|
N,
|
|
1668
1674
|
U
|
|
1669
1675
|
);
|
|
@@ -1671,7 +1677,7 @@ Make sure your charset is UTF-8`
|
|
|
1671
1677
|
O = C.fromString($, z || 40);
|
|
1672
1678
|
} else
|
|
1673
1679
|
throw new Error("Invalid data");
|
|
1674
|
-
var Y =
|
|
1680
|
+
var Y = A.getBestVersionForData(
|
|
1675
1681
|
O,
|
|
1676
1682
|
U
|
|
1677
1683
|
);
|
|
@@ -1686,8 +1692,8 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
1686
1692
|
Minimum version required to store current data is: ` + Y + `.
|
|
1687
1693
|
`
|
|
1688
1694
|
);
|
|
1689
|
-
var j =
|
|
1690
|
-
return I(X, D), k(X), _(X, D), p(X, U, 0), D >= 7 &&
|
|
1695
|
+
var j = T(D, U, O), et = d.getSymbolSize(D), X = new s(et);
|
|
1696
|
+
return I(X, D), k(X), _(X, D), p(X, U, 0), D >= 7 && m(X, D), E(X, j), isNaN(R) && (R = w.getBestMask(
|
|
1691
1697
|
X,
|
|
1692
1698
|
p.bind(null, X, U)
|
|
1693
1699
|
)), w.applyMask(R, X), p(X, U, R), {
|
|
@@ -1698,50 +1704,50 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
1698
1704
|
segments: O
|
|
1699
1705
|
};
|
|
1700
1706
|
}
|
|
1701
|
-
|
|
1707
|
+
u.create = function(D, U) {
|
|
1702
1708
|
if (typeof D > "u" || D === "")
|
|
1703
1709
|
throw new Error("No input text");
|
|
1704
1710
|
var R = c.M, O, z;
|
|
1705
|
-
return typeof U < "u" && (R = c.from(U.errorCorrectionLevel, c.M), O =
|
|
1711
|
+
return typeof U < "u" && (R = c.from(U.errorCorrectionLevel, c.M), O = A.from(U.version), z = w.from(U.maskPattern), U.toSJISFunc && d.setToSJISFunction(U.toSJISFunc)), W(D, O, R, z);
|
|
1706
1712
|
};
|
|
1707
|
-
}, { "../utils/buffer": 28, "./alignment-pattern": 2, "./bit-buffer": 4, "./bit-matrix": 5, "./error-correction-code": 7, "./error-correction-level": 8, "./finder-pattern": 9, "./format-info": 10, "./mask-pattern": 13, "./mode": 14, "./reed-solomon-encoder": 18, "./segments": 20, "./utils": 21, "./version": 23, isarray: 33 }], 18: [function(n, g,
|
|
1708
|
-
var
|
|
1713
|
+
}, { "../utils/buffer": 28, "./alignment-pattern": 2, "./bit-buffer": 4, "./bit-matrix": 5, "./error-correction-code": 7, "./error-correction-level": 8, "./finder-pattern": 9, "./format-info": 10, "./mask-pattern": 13, "./mode": 14, "./reed-solomon-encoder": 18, "./segments": 20, "./utils": 21, "./version": 23, isarray: 33 }], 18: [function(n, g, u) {
|
|
1714
|
+
var h = n("../utils/buffer"), d = n("./polynomial"), c = n("buffer").Buffer;
|
|
1709
1715
|
function i(s) {
|
|
1710
1716
|
this.genPoly = void 0, this.degree = s, this.degree && this.initialize(this.degree);
|
|
1711
1717
|
}
|
|
1712
|
-
i.prototype.initialize = function(
|
|
1713
|
-
this.degree =
|
|
1714
|
-
}, i.prototype.encode = function(
|
|
1718
|
+
i.prototype.initialize = function(f) {
|
|
1719
|
+
this.degree = f, this.genPoly = d.generateECPolynomial(this.degree);
|
|
1720
|
+
}, i.prototype.encode = function(f) {
|
|
1715
1721
|
if (!this.genPoly)
|
|
1716
1722
|
throw new Error("Encoder not initialized");
|
|
1717
|
-
var a =
|
|
1723
|
+
var a = h.alloc(this.degree), w = c.concat([f, a], f.length + this.degree), x = d.mod(w, this.genPoly), b = this.degree - x.length;
|
|
1718
1724
|
if (b > 0) {
|
|
1719
|
-
var
|
|
1720
|
-
return x.copy(
|
|
1725
|
+
var A = h.alloc(this.degree);
|
|
1726
|
+
return x.copy(A, b), A;
|
|
1721
1727
|
}
|
|
1722
1728
|
return x;
|
|
1723
1729
|
}, g.exports = i;
|
|
1724
|
-
}, { "../utils/buffer": 28, "./polynomial": 16, buffer: 30 }], 19: [function(n, g,
|
|
1725
|
-
var
|
|
1730
|
+
}, { "../utils/buffer": 28, "./polynomial": 16, buffer: 30 }], 19: [function(n, g, u) {
|
|
1731
|
+
var h = "[0-9]+", d = "[A-Z $%*+\\-./:]+", c = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
1726
1732
|
c = c.replace(/u/g, "\\u");
|
|
1727
1733
|
var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + c + `)(?:.|[\r
|
|
1728
1734
|
]))+`;
|
|
1729
|
-
|
|
1730
|
-
var s = new RegExp("^" + c + "$"),
|
|
1731
|
-
|
|
1735
|
+
u.KANJI = new RegExp(c, "g"), u.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), u.BYTE = new RegExp(i, "g"), u.NUMERIC = new RegExp(h, "g"), u.ALPHANUMERIC = new RegExp(d, "g");
|
|
1736
|
+
var s = new RegExp("^" + c + "$"), f = new RegExp("^" + h + "$"), a = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
1737
|
+
u.testKanji = function(x) {
|
|
1732
1738
|
return s.test(x);
|
|
1733
|
-
},
|
|
1734
|
-
return
|
|
1735
|
-
},
|
|
1739
|
+
}, u.testNumeric = function(x) {
|
|
1740
|
+
return f.test(x);
|
|
1741
|
+
}, u.testAlphanumeric = function(x) {
|
|
1736
1742
|
return a.test(x);
|
|
1737
1743
|
};
|
|
1738
|
-
}, {}], 20: [function(n, g,
|
|
1739
|
-
var
|
|
1744
|
+
}, {}], 20: [function(n, g, u) {
|
|
1745
|
+
var h = n("./mode"), d = n("./numeric-data"), c = n("./alphanumeric-data"), i = n("./byte-data"), s = n("./kanji-data"), f = n("./regex"), a = n("./utils"), w = n("dijkstrajs");
|
|
1740
1746
|
function x(k) {
|
|
1741
1747
|
return unescape(encodeURIComponent(k)).length;
|
|
1742
1748
|
}
|
|
1743
|
-
function b(k, _,
|
|
1744
|
-
for (var p = [], E; (E = k.exec(
|
|
1749
|
+
function b(k, _, m) {
|
|
1750
|
+
for (var p = [], E; (E = k.exec(m)) !== null; )
|
|
1745
1751
|
p.push({
|
|
1746
1752
|
data: E[0],
|
|
1747
1753
|
index: E.index,
|
|
@@ -1750,11 +1756,11 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
1750
1756
|
});
|
|
1751
1757
|
return p;
|
|
1752
1758
|
}
|
|
1753
|
-
function
|
|
1754
|
-
var _ = b(
|
|
1755
|
-
a.isKanjiModeEnabled() ? (p = b(
|
|
1756
|
-
var
|
|
1757
|
-
return
|
|
1759
|
+
function A(k) {
|
|
1760
|
+
var _ = b(f.NUMERIC, h.NUMERIC, k), m = b(f.ALPHANUMERIC, h.ALPHANUMERIC, k), p, E;
|
|
1761
|
+
a.isKanjiModeEnabled() ? (p = b(f.BYTE, h.BYTE, k), E = b(f.KANJI, h.KANJI, k)) : (p = b(f.BYTE_KANJI, h.BYTE, k), E = []);
|
|
1762
|
+
var T = _.concat(m, p, E);
|
|
1763
|
+
return T.sort(function(L, W) {
|
|
1758
1764
|
return L.index - W.index;
|
|
1759
1765
|
}).map(function(L) {
|
|
1760
1766
|
return {
|
|
@@ -1766,100 +1772,100 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
1766
1772
|
}
|
|
1767
1773
|
function F(k, _) {
|
|
1768
1774
|
switch (_) {
|
|
1769
|
-
case
|
|
1775
|
+
case h.NUMERIC:
|
|
1770
1776
|
return d.getBitsLength(k);
|
|
1771
|
-
case
|
|
1777
|
+
case h.ALPHANUMERIC:
|
|
1772
1778
|
return c.getBitsLength(k);
|
|
1773
|
-
case
|
|
1779
|
+
case h.KANJI:
|
|
1774
1780
|
return s.getBitsLength(k);
|
|
1775
|
-
case
|
|
1781
|
+
case h.BYTE:
|
|
1776
1782
|
return i.getBitsLength(k);
|
|
1777
1783
|
}
|
|
1778
1784
|
}
|
|
1779
1785
|
function M(k) {
|
|
1780
|
-
return k.reduce(function(_,
|
|
1786
|
+
return k.reduce(function(_, m) {
|
|
1781
1787
|
var p = _.length - 1 >= 0 ? _[_.length - 1] : null;
|
|
1782
|
-
return p && p.mode ===
|
|
1788
|
+
return p && p.mode === m.mode ? (_[_.length - 1].data += m.data, _) : (_.push(m), _);
|
|
1783
1789
|
}, []);
|
|
1784
1790
|
}
|
|
1785
1791
|
function C(k) {
|
|
1786
|
-
for (var _ = [],
|
|
1787
|
-
var p = k[
|
|
1792
|
+
for (var _ = [], m = 0; m < k.length; m++) {
|
|
1793
|
+
var p = k[m];
|
|
1788
1794
|
switch (p.mode) {
|
|
1789
|
-
case
|
|
1795
|
+
case h.NUMERIC:
|
|
1790
1796
|
_.push([
|
|
1791
1797
|
p,
|
|
1792
|
-
{ data: p.data, mode:
|
|
1793
|
-
{ data: p.data, mode:
|
|
1798
|
+
{ data: p.data, mode: h.ALPHANUMERIC, length: p.length },
|
|
1799
|
+
{ data: p.data, mode: h.BYTE, length: p.length }
|
|
1794
1800
|
]);
|
|
1795
1801
|
break;
|
|
1796
|
-
case
|
|
1802
|
+
case h.ALPHANUMERIC:
|
|
1797
1803
|
_.push([
|
|
1798
1804
|
p,
|
|
1799
|
-
{ data: p.data, mode:
|
|
1805
|
+
{ data: p.data, mode: h.BYTE, length: p.length }
|
|
1800
1806
|
]);
|
|
1801
1807
|
break;
|
|
1802
|
-
case
|
|
1808
|
+
case h.KANJI:
|
|
1803
1809
|
_.push([
|
|
1804
1810
|
p,
|
|
1805
|
-
{ data: p.data, mode:
|
|
1811
|
+
{ data: p.data, mode: h.BYTE, length: x(p.data) }
|
|
1806
1812
|
]);
|
|
1807
1813
|
break;
|
|
1808
|
-
case
|
|
1814
|
+
case h.BYTE:
|
|
1809
1815
|
_.push([
|
|
1810
|
-
{ data: p.data, mode:
|
|
1816
|
+
{ data: p.data, mode: h.BYTE, length: x(p.data) }
|
|
1811
1817
|
]);
|
|
1812
1818
|
}
|
|
1813
1819
|
}
|
|
1814
1820
|
return _;
|
|
1815
1821
|
}
|
|
1816
|
-
function
|
|
1817
|
-
for (var
|
|
1818
|
-
for (var L = k[
|
|
1819
|
-
var D = L[$], U = "" +
|
|
1820
|
-
W.push(U),
|
|
1822
|
+
function B(k, _) {
|
|
1823
|
+
for (var m = {}, p = { start: {} }, E = ["start"], T = 0; T < k.length; T++) {
|
|
1824
|
+
for (var L = k[T], W = [], $ = 0; $ < L.length; $++) {
|
|
1825
|
+
var D = L[$], U = "" + T + $;
|
|
1826
|
+
W.push(U), m[U] = { node: D, lastCount: 0 }, p[U] = {};
|
|
1821
1827
|
for (var R = 0; R < E.length; R++) {
|
|
1822
1828
|
var O = E[R];
|
|
1823
|
-
|
|
1829
|
+
m[O] && m[O].node.mode === D.mode ? (p[O][U] = F(m[O].lastCount + D.length, D.mode) - F(m[O].lastCount, D.mode), m[O].lastCount += D.length) : (m[O] && (m[O].lastCount = D.length), p[O][U] = F(D.length, D.mode) + 4 + h.getCharCountIndicator(D.mode, _));
|
|
1824
1830
|
}
|
|
1825
1831
|
}
|
|
1826
1832
|
E = W;
|
|
1827
1833
|
}
|
|
1828
1834
|
for (R = 0; R < E.length; R++)
|
|
1829
1835
|
p[E[R]].end = 0;
|
|
1830
|
-
return { map: p, table:
|
|
1836
|
+
return { map: p, table: m };
|
|
1831
1837
|
}
|
|
1832
1838
|
function I(k, _) {
|
|
1833
|
-
var
|
|
1834
|
-
if (
|
|
1835
|
-
throw new Error('"' + k + '" cannot be encoded with mode ' +
|
|
1836
|
-
Suggested mode is: ` +
|
|
1837
|
-
switch (
|
|
1838
|
-
case
|
|
1839
|
+
var m, p = h.getBestModeForData(k);
|
|
1840
|
+
if (m = h.from(_, p), m !== h.BYTE && m.bit < p.bit)
|
|
1841
|
+
throw new Error('"' + k + '" cannot be encoded with mode ' + h.toString(m) + `.
|
|
1842
|
+
Suggested mode is: ` + h.toString(p));
|
|
1843
|
+
switch (m === h.KANJI && !a.isKanjiModeEnabled() && (m = h.BYTE), m) {
|
|
1844
|
+
case h.NUMERIC:
|
|
1839
1845
|
return new d(k);
|
|
1840
|
-
case
|
|
1846
|
+
case h.ALPHANUMERIC:
|
|
1841
1847
|
return new c(k);
|
|
1842
|
-
case
|
|
1848
|
+
case h.KANJI:
|
|
1843
1849
|
return new s(k);
|
|
1844
|
-
case
|
|
1850
|
+
case h.BYTE:
|
|
1845
1851
|
return new i(k);
|
|
1846
1852
|
}
|
|
1847
1853
|
}
|
|
1848
|
-
|
|
1849
|
-
return _.reduce(function(
|
|
1850
|
-
return typeof p == "string" ?
|
|
1854
|
+
u.fromArray = function(_) {
|
|
1855
|
+
return _.reduce(function(m, p) {
|
|
1856
|
+
return typeof p == "string" ? m.push(I(p, null)) : p.data && m.push(I(p.data, p.mode)), m;
|
|
1851
1857
|
}, []);
|
|
1852
|
-
},
|
|
1853
|
-
for (var p =
|
|
1854
|
-
W.push(
|
|
1855
|
-
return
|
|
1856
|
-
},
|
|
1857
|
-
return
|
|
1858
|
-
|
|
1858
|
+
}, u.fromString = function(_, m) {
|
|
1859
|
+
for (var p = A(_, a.isKanjiModeEnabled()), E = C(p), T = B(E, m), L = w.find_path(T.map, "start", "end"), W = [], $ = 1; $ < L.length - 1; $++)
|
|
1860
|
+
W.push(T.table[L[$]].node);
|
|
1861
|
+
return u.fromArray(M(W));
|
|
1862
|
+
}, u.rawSplit = function(_) {
|
|
1863
|
+
return u.fromArray(
|
|
1864
|
+
A(_, a.isKanjiModeEnabled())
|
|
1859
1865
|
);
|
|
1860
1866
|
};
|
|
1861
|
-
}, { "./alphanumeric-data": 3, "./byte-data": 6, "./kanji-data": 12, "./mode": 14, "./numeric-data": 15, "./regex": 19, "./utils": 21, dijkstrajs: 31 }], 21: [function(n, g,
|
|
1862
|
-
var
|
|
1867
|
+
}, { "./alphanumeric-data": 3, "./byte-data": 6, "./kanji-data": 12, "./mode": 14, "./numeric-data": 15, "./regex": 19, "./utils": 21, dijkstrajs: 31 }], 21: [function(n, g, u) {
|
|
1868
|
+
var h, d = [
|
|
1863
1869
|
0,
|
|
1864
1870
|
// Not used
|
|
1865
1871
|
26,
|
|
@@ -1903,65 +1909,65 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
1903
1909
|
3532,
|
|
1904
1910
|
3706
|
|
1905
1911
|
];
|
|
1906
|
-
|
|
1912
|
+
u.getSymbolSize = function(i) {
|
|
1907
1913
|
if (!i)
|
|
1908
1914
|
throw new Error('"version" cannot be null or undefined');
|
|
1909
1915
|
if (i < 1 || i > 40)
|
|
1910
1916
|
throw new Error('"version" should be in range from 1 to 40');
|
|
1911
1917
|
return i * 4 + 17;
|
|
1912
|
-
},
|
|
1918
|
+
}, u.getSymbolTotalCodewords = function(i) {
|
|
1913
1919
|
return d[i];
|
|
1914
|
-
},
|
|
1920
|
+
}, u.getBCHDigit = function(c) {
|
|
1915
1921
|
for (var i = 0; c !== 0; )
|
|
1916
1922
|
i++, c >>>= 1;
|
|
1917
1923
|
return i;
|
|
1918
|
-
},
|
|
1924
|
+
}, u.setToSJISFunction = function(i) {
|
|
1919
1925
|
if (typeof i != "function")
|
|
1920
1926
|
throw new Error('"toSJISFunc" is not a valid function.');
|
|
1921
|
-
|
|
1922
|
-
},
|
|
1923
|
-
return typeof
|
|
1924
|
-
},
|
|
1925
|
-
return
|
|
1927
|
+
h = i;
|
|
1928
|
+
}, u.isKanjiModeEnabled = function() {
|
|
1929
|
+
return typeof h < "u";
|
|
1930
|
+
}, u.toSJIS = function(i) {
|
|
1931
|
+
return h(i);
|
|
1926
1932
|
};
|
|
1927
|
-
}, {}], 22: [function(n, g,
|
|
1928
|
-
|
|
1933
|
+
}, {}], 22: [function(n, g, u) {
|
|
1934
|
+
u.isValid = function(d) {
|
|
1929
1935
|
return !isNaN(d) && d >= 1 && d <= 40;
|
|
1930
1936
|
};
|
|
1931
|
-
}, {}], 23: [function(n, g,
|
|
1932
|
-
var
|
|
1933
|
-
function x(M, C,
|
|
1937
|
+
}, {}], 23: [function(n, g, u) {
|
|
1938
|
+
var h = n("./utils"), d = n("./error-correction-code"), c = n("./error-correction-level"), i = n("./mode"), s = n("./version-check"), f = n("isarray"), a = 7973, w = h.getBCHDigit(a);
|
|
1939
|
+
function x(M, C, B) {
|
|
1934
1940
|
for (var I = 1; I <= 40; I++)
|
|
1935
|
-
if (C <=
|
|
1941
|
+
if (C <= u.getCapacity(I, B, M))
|
|
1936
1942
|
return I;
|
|
1937
1943
|
}
|
|
1938
1944
|
function b(M, C) {
|
|
1939
1945
|
return i.getCharCountIndicator(M, C) + 4;
|
|
1940
1946
|
}
|
|
1941
|
-
function
|
|
1942
|
-
var
|
|
1947
|
+
function A(M, C) {
|
|
1948
|
+
var B = 0;
|
|
1943
1949
|
return M.forEach(function(I) {
|
|
1944
1950
|
var k = b(I.mode, C);
|
|
1945
|
-
|
|
1946
|
-
}),
|
|
1951
|
+
B += k + I.getBitsLength();
|
|
1952
|
+
}), B;
|
|
1947
1953
|
}
|
|
1948
1954
|
function F(M, C) {
|
|
1949
|
-
for (var
|
|
1950
|
-
var I =
|
|
1951
|
-
if (I <=
|
|
1952
|
-
return
|
|
1955
|
+
for (var B = 1; B <= 40; B++) {
|
|
1956
|
+
var I = A(M, B);
|
|
1957
|
+
if (I <= u.getCapacity(B, C, i.MIXED))
|
|
1958
|
+
return B;
|
|
1953
1959
|
}
|
|
1954
1960
|
}
|
|
1955
|
-
|
|
1956
|
-
return s.isValid(C) ? parseInt(C, 10) :
|
|
1957
|
-
},
|
|
1961
|
+
u.from = function(C, B) {
|
|
1962
|
+
return s.isValid(C) ? parseInt(C, 10) : B;
|
|
1963
|
+
}, u.getCapacity = function(C, B, I) {
|
|
1958
1964
|
if (!s.isValid(C))
|
|
1959
1965
|
throw new Error("Invalid QR Code version");
|
|
1960
1966
|
typeof I > "u" && (I = i.BYTE);
|
|
1961
|
-
var k =
|
|
1967
|
+
var k = h.getSymbolTotalCodewords(C), _ = d.getTotalCodewordsCount(C, B), m = (k - _) * 8;
|
|
1962
1968
|
if (I === i.MIXED)
|
|
1963
|
-
return
|
|
1964
|
-
var p =
|
|
1969
|
+
return m;
|
|
1970
|
+
var p = m - b(I, C);
|
|
1965
1971
|
switch (I) {
|
|
1966
1972
|
case i.NUMERIC:
|
|
1967
1973
|
return Math.floor(p / 10 * 3);
|
|
@@ -1973,9 +1979,9 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
1973
1979
|
default:
|
|
1974
1980
|
return Math.floor(p / 8);
|
|
1975
1981
|
}
|
|
1976
|
-
},
|
|
1977
|
-
var I, k = c.from(
|
|
1978
|
-
if (
|
|
1982
|
+
}, u.getBestVersionForData = function(C, B) {
|
|
1983
|
+
var I, k = c.from(B, c.M);
|
|
1984
|
+
if (f(C)) {
|
|
1979
1985
|
if (C.length > 1)
|
|
1980
1986
|
return F(C, k);
|
|
1981
1987
|
if (C.length === 0)
|
|
@@ -1984,18 +1990,18 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
1984
1990
|
} else
|
|
1985
1991
|
I = C;
|
|
1986
1992
|
return x(I.mode, I.getLength(), k);
|
|
1987
|
-
},
|
|
1993
|
+
}, u.getEncodedBits = function(C) {
|
|
1988
1994
|
if (!s.isValid(C) || C < 7)
|
|
1989
1995
|
throw new Error("Invalid QR Code version");
|
|
1990
|
-
for (var
|
|
1991
|
-
|
|
1992
|
-
return C << 12 |
|
|
1996
|
+
for (var B = C << 12; h.getBCHDigit(B) - w >= 0; )
|
|
1997
|
+
B ^= a << h.getBCHDigit(B) - w;
|
|
1998
|
+
return C << 12 | B;
|
|
1993
1999
|
};
|
|
1994
|
-
}, { "./error-correction-code": 7, "./error-correction-level": 8, "./mode": 14, "./utils": 21, "./version-check": 22, isarray: 33 }], 24: [function(n, g,
|
|
1995
|
-
var
|
|
1996
|
-
function s(
|
|
1997
|
-
var
|
|
1998
|
-
if (!M && !
|
|
2000
|
+
}, { "./error-correction-code": 7, "./error-correction-level": 8, "./mode": 14, "./utils": 21, "./version-check": 22, isarray: 33 }], 24: [function(n, g, u) {
|
|
2001
|
+
var h = n("./can-promise"), d = n("./core/qrcode"), c = n("./renderer/canvas"), i = n("./renderer/svg-tag.js");
|
|
2002
|
+
function s(f, a, w, x, b) {
|
|
2003
|
+
var A = [].slice.call(arguments, 1), F = A.length, M = typeof A[F - 1] == "function";
|
|
2004
|
+
if (!M && !h())
|
|
1999
2005
|
throw new Error("Callback required as last argument");
|
|
2000
2006
|
if (M) {
|
|
2001
2007
|
if (F < 2)
|
|
@@ -2004,10 +2010,10 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2004
2010
|
} else {
|
|
2005
2011
|
if (F < 1)
|
|
2006
2012
|
throw new Error("Too few arguments provided");
|
|
2007
|
-
return F === 1 ? (w = a, a = x = void 0) : F === 2 && !a.getContext && (x = w, w = a, a = void 0), new Promise(function(
|
|
2013
|
+
return F === 1 ? (w = a, a = x = void 0) : F === 2 && !a.getContext && (x = w, w = a, a = void 0), new Promise(function(B, I) {
|
|
2008
2014
|
try {
|
|
2009
2015
|
var k = d.create(w, x);
|
|
2010
|
-
|
|
2016
|
+
B(f(k, a, x));
|
|
2011
2017
|
} catch (_) {
|
|
2012
2018
|
I(_);
|
|
2013
2019
|
}
|
|
@@ -2015,18 +2021,18 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2015
2021
|
}
|
|
2016
2022
|
try {
|
|
2017
2023
|
var C = d.create(w, x);
|
|
2018
|
-
b(null,
|
|
2019
|
-
} catch (
|
|
2020
|
-
b(
|
|
2024
|
+
b(null, f(C, a, x));
|
|
2025
|
+
} catch (B) {
|
|
2026
|
+
b(B);
|
|
2021
2027
|
}
|
|
2022
2028
|
}
|
|
2023
|
-
|
|
2024
|
-
return i.render(
|
|
2029
|
+
u.create = d.create, u.toCanvas = s.bind(null, c.render), u.toDataURL = s.bind(null, c.renderToDataURL), u.toString = s.bind(null, function(f, a, w) {
|
|
2030
|
+
return i.render(f, w);
|
|
2025
2031
|
});
|
|
2026
|
-
}, { "./can-promise": 1, "./core/qrcode": 17, "./renderer/canvas": 25, "./renderer/svg-tag.js": 26 }], 25: [function(n, g,
|
|
2027
|
-
var
|
|
2028
|
-
function d(i, s,
|
|
2029
|
-
i.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height =
|
|
2032
|
+
}, { "./can-promise": 1, "./core/qrcode": 17, "./renderer/canvas": 25, "./renderer/svg-tag.js": 26 }], 25: [function(n, g, u) {
|
|
2033
|
+
var h = n("./utils");
|
|
2034
|
+
function d(i, s, f) {
|
|
2035
|
+
i.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height = f, s.width = f, s.style.height = f + "px", s.style.width = f + "px";
|
|
2030
2036
|
}
|
|
2031
2037
|
function c() {
|
|
2032
2038
|
try {
|
|
@@ -2035,41 +2041,41 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2035
2041
|
throw new Error("You need to specify a canvas element");
|
|
2036
2042
|
}
|
|
2037
2043
|
}
|
|
2038
|
-
|
|
2039
|
-
var w = a, x =
|
|
2040
|
-
typeof w > "u" && (!
|
|
2041
|
-
var b =
|
|
2042
|
-
return
|
|
2043
|
-
},
|
|
2044
|
+
u.render = function(s, f, a) {
|
|
2045
|
+
var w = a, x = f;
|
|
2046
|
+
typeof w > "u" && (!f || !f.getContext) && (w = f, f = void 0), f || (x = c()), w = h.getOptions(w);
|
|
2047
|
+
var b = h.getImageWidth(s.modules.size, w), A = x.getContext("2d"), F = A.createImageData(b, b);
|
|
2048
|
+
return h.qrToImageData(F.data, s, w), d(A, x, b), A.putImageData(F, 0, 0), x;
|
|
2049
|
+
}, u.renderToDataURL = function(s, f, a) {
|
|
2044
2050
|
var w = a;
|
|
2045
|
-
typeof w > "u" && (!
|
|
2046
|
-
var x =
|
|
2047
|
-
return x.toDataURL(b,
|
|
2051
|
+
typeof w > "u" && (!f || !f.getContext) && (w = f, f = void 0), w || (w = {});
|
|
2052
|
+
var x = u.render(s, f, w), b = w.type || "image/png", A = w.rendererOpts || {};
|
|
2053
|
+
return x.toDataURL(b, A.quality);
|
|
2048
2054
|
};
|
|
2049
|
-
}, { "./utils": 27 }], 26: [function(n, g,
|
|
2050
|
-
var
|
|
2051
|
-
function d(s,
|
|
2052
|
-
var a = s.a / 255, w =
|
|
2053
|
-
return a < 1 ? w + " " +
|
|
2054
|
-
}
|
|
2055
|
-
function c(s,
|
|
2056
|
-
var w = s +
|
|
2055
|
+
}, { "./utils": 27 }], 26: [function(n, g, u) {
|
|
2056
|
+
var h = n("./utils");
|
|
2057
|
+
function d(s, f) {
|
|
2058
|
+
var a = s.a / 255, w = f + '="' + s.hex + '"';
|
|
2059
|
+
return a < 1 ? w + " " + f + '-opacity="' + a.toFixed(2).slice(1) + '"' : w;
|
|
2060
|
+
}
|
|
2061
|
+
function c(s, f, a) {
|
|
2062
|
+
var w = s + f;
|
|
2057
2063
|
return typeof a < "u" && (w += " " + a), w;
|
|
2058
2064
|
}
|
|
2059
|
-
function i(s,
|
|
2060
|
-
for (var w = "", x = 0, b = !1,
|
|
2061
|
-
var M = Math.floor(F %
|
|
2062
|
-
!M && !b && (b = !0), s[F] ? (
|
|
2065
|
+
function i(s, f, a) {
|
|
2066
|
+
for (var w = "", x = 0, b = !1, A = 0, F = 0; F < s.length; F++) {
|
|
2067
|
+
var M = Math.floor(F % f), C = Math.floor(F / f);
|
|
2068
|
+
!M && !b && (b = !0), s[F] ? (A++, F > 0 && M > 0 && s[F - 1] || (w += b ? c("M", M + a, 0.5 + C + a) : c("m", x, 0), x = 0, b = !1), M + 1 < f && s[F + 1] || (w += c("h", A), A = 0)) : x++;
|
|
2063
2069
|
}
|
|
2064
2070
|
return w;
|
|
2065
2071
|
}
|
|
2066
|
-
|
|
2067
|
-
var x =
|
|
2072
|
+
u.render = function(f, a, w) {
|
|
2073
|
+
var x = h.getOptions(a), b = f.modules.size, A = f.modules.data, F = b + x.margin * 2, M = x.color.light.a ? "<path " + d(x.color.light, "fill") + ' d="M0 0h' + F + "v" + F + 'H0z"/>' : "", C = "<path " + d(x.color.dark, "stroke") + ' d="' + i(A, b, x.margin) + '"/>', B = 'viewBox="0 0 ' + F + " " + F + '"', I = x.width ? 'width="' + x.width + '" height="' + x.width + '" ' : "", k = '<svg xmlns="http://www.w3.org/2000/svg" ' + I + B + ' shape-rendering="crispEdges">' + M + C + `</svg>
|
|
2068
2074
|
`;
|
|
2069
2075
|
return typeof w == "function" && w(null, k), k;
|
|
2070
2076
|
};
|
|
2071
|
-
}, { "./utils": 27 }], 27: [function(n, g,
|
|
2072
|
-
function
|
|
2077
|
+
}, { "./utils": 27 }], 27: [function(n, g, u) {
|
|
2078
|
+
function h(d) {
|
|
2073
2079
|
if (typeof d == "number" && (d = d.toString()), typeof d != "string")
|
|
2074
2080
|
throw new Error("Color should be defined as hex string");
|
|
2075
2081
|
var c = d.slice().replace("#", "").split("");
|
|
@@ -2087,38 +2093,38 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2087
2093
|
hex: "#" + c.slice(0, 6).join("")
|
|
2088
2094
|
};
|
|
2089
2095
|
}
|
|
2090
|
-
|
|
2096
|
+
u.getOptions = function(c) {
|
|
2091
2097
|
c || (c = {}), c.color || (c.color = {});
|
|
2092
|
-
var i = typeof c.margin > "u" || c.margin === null || c.margin < 0 ? 4 : c.margin, s = c.width && c.width >= 21 ? c.width : void 0,
|
|
2098
|
+
var i = typeof c.margin > "u" || c.margin === null || c.margin < 0 ? 4 : c.margin, s = c.width && c.width >= 21 ? c.width : void 0, f = c.scale || 4;
|
|
2093
2099
|
return {
|
|
2094
2100
|
width: s,
|
|
2095
|
-
scale: s ? 4 :
|
|
2101
|
+
scale: s ? 4 : f,
|
|
2096
2102
|
margin: i,
|
|
2097
2103
|
color: {
|
|
2098
|
-
dark:
|
|
2099
|
-
light:
|
|
2104
|
+
dark: h(c.color.dark || "#000000ff"),
|
|
2105
|
+
light: h(c.color.light || "#ffffffff")
|
|
2100
2106
|
},
|
|
2101
2107
|
type: c.type,
|
|
2102
2108
|
rendererOpts: c.rendererOpts || {}
|
|
2103
2109
|
};
|
|
2104
|
-
},
|
|
2110
|
+
}, u.getScale = function(c, i) {
|
|
2105
2111
|
return i.width && i.width >= c + i.margin * 2 ? i.width / (c + i.margin * 2) : i.scale;
|
|
2106
|
-
},
|
|
2107
|
-
var s =
|
|
2112
|
+
}, u.getImageWidth = function(c, i) {
|
|
2113
|
+
var s = u.getScale(c, i);
|
|
2108
2114
|
return Math.floor((c + i.margin * 2) * s);
|
|
2109
|
-
},
|
|
2110
|
-
for (var
|
|
2115
|
+
}, u.qrToImageData = function(c, i, s) {
|
|
2116
|
+
for (var f = i.modules.size, a = i.modules.data, w = u.getScale(f, s), x = Math.floor((f + s.margin * 2) * w), b = s.margin * w, A = [s.color.light, s.color.dark], F = 0; F < x; F++)
|
|
2111
2117
|
for (var M = 0; M < x; M++) {
|
|
2112
|
-
var C = (F * x + M) * 4,
|
|
2118
|
+
var C = (F * x + M) * 4, B = s.color.light;
|
|
2113
2119
|
if (F >= b && M >= b && F < x - b && M < x - b) {
|
|
2114
2120
|
var I = Math.floor((F - b) / w), k = Math.floor((M - b) / w);
|
|
2115
|
-
|
|
2121
|
+
B = A[a[I * f + k] ? 1 : 0];
|
|
2116
2122
|
}
|
|
2117
|
-
c[C++] =
|
|
2123
|
+
c[C++] = B.r, c[C++] = B.g, c[C++] = B.b, c[C] = B.a;
|
|
2118
2124
|
}
|
|
2119
2125
|
};
|
|
2120
|
-
}, {}], 28: [function(n, g,
|
|
2121
|
-
var
|
|
2126
|
+
}, {}], 28: [function(n, g, u) {
|
|
2127
|
+
var h = n("isarray");
|
|
2122
2128
|
function d() {
|
|
2123
2129
|
try {
|
|
2124
2130
|
var _ = new Uint8Array(1);
|
|
@@ -2131,8 +2137,8 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2131
2137
|
}
|
|
2132
2138
|
i.TYPED_ARRAY_SUPPORT = d();
|
|
2133
2139
|
var c = i.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
|
|
2134
|
-
function i(_,
|
|
2135
|
-
return !i.TYPED_ARRAY_SUPPORT && !(this instanceof i) ? new i(_,
|
|
2140
|
+
function i(_, m, p) {
|
|
2141
|
+
return !i.TYPED_ARRAY_SUPPORT && !(this instanceof i) ? new i(_, m, p) : typeof _ == "number" ? w(this, _) : k(this, _, m, p);
|
|
2136
2142
|
}
|
|
2137
2143
|
i.TYPED_ARRAY_SUPPORT && (i.prototype.__proto__ = Uint8Array.prototype, i.__proto__ = Uint8Array, typeof Symbol < "u" && Symbol.species && i[Symbol.species] === i && Object.defineProperty(i, Symbol.species, {
|
|
2138
2144
|
value: null,
|
|
@@ -2145,85 +2151,85 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2145
2151
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + c.toString(16) + " bytes");
|
|
2146
2152
|
return _ | 0;
|
|
2147
2153
|
}
|
|
2148
|
-
function
|
|
2154
|
+
function f(_) {
|
|
2149
2155
|
return _ !== _;
|
|
2150
2156
|
}
|
|
2151
|
-
function a(_,
|
|
2157
|
+
function a(_, m) {
|
|
2152
2158
|
var p;
|
|
2153
|
-
return i.TYPED_ARRAY_SUPPORT ? (p = new Uint8Array(
|
|
2159
|
+
return i.TYPED_ARRAY_SUPPORT ? (p = new Uint8Array(m), p.__proto__ = i.prototype) : (p = _, p === null && (p = new i(m)), p.length = m), p;
|
|
2154
2160
|
}
|
|
2155
|
-
function w(_,
|
|
2156
|
-
var p = a(_,
|
|
2161
|
+
function w(_, m) {
|
|
2162
|
+
var p = a(_, m < 0 ? 0 : s(m) | 0);
|
|
2157
2163
|
if (!i.TYPED_ARRAY_SUPPORT)
|
|
2158
|
-
for (var E = 0; E <
|
|
2164
|
+
for (var E = 0; E < m; ++E)
|
|
2159
2165
|
p[E] = 0;
|
|
2160
2166
|
return p;
|
|
2161
2167
|
}
|
|
2162
|
-
function x(_,
|
|
2163
|
-
var p = C(
|
|
2164
|
-
return
|
|
2168
|
+
function x(_, m) {
|
|
2169
|
+
var p = C(m) | 0, E = a(_, p), T = E.write(m);
|
|
2170
|
+
return T !== p && (E = E.slice(0, T)), E;
|
|
2165
2171
|
}
|
|
2166
|
-
function b(_,
|
|
2167
|
-
for (var p =
|
|
2168
|
-
E[
|
|
2172
|
+
function b(_, m) {
|
|
2173
|
+
for (var p = m.length < 0 ? 0 : s(m.length) | 0, E = a(_, p), T = 0; T < p; T += 1)
|
|
2174
|
+
E[T] = m[T] & 255;
|
|
2169
2175
|
return E;
|
|
2170
2176
|
}
|
|
2171
|
-
function
|
|
2172
|
-
if (p < 0 ||
|
|
2177
|
+
function A(_, m, p, E) {
|
|
2178
|
+
if (p < 0 || m.byteLength < p)
|
|
2173
2179
|
throw new RangeError("'offset' is out of bounds");
|
|
2174
|
-
if (
|
|
2180
|
+
if (m.byteLength < p + (E || 0))
|
|
2175
2181
|
throw new RangeError("'length' is out of bounds");
|
|
2176
|
-
var
|
|
2177
|
-
return p === void 0 && E === void 0 ?
|
|
2182
|
+
var T;
|
|
2183
|
+
return p === void 0 && E === void 0 ? T = new Uint8Array(m) : E === void 0 ? T = new Uint8Array(m, p) : T = new Uint8Array(m, p, E), i.TYPED_ARRAY_SUPPORT ? T.__proto__ = i.prototype : T = b(_, T), T;
|
|
2178
2184
|
}
|
|
2179
|
-
function F(_,
|
|
2180
|
-
if (i.isBuffer(
|
|
2181
|
-
var p = s(
|
|
2182
|
-
return E.length === 0 ||
|
|
2185
|
+
function F(_, m) {
|
|
2186
|
+
if (i.isBuffer(m)) {
|
|
2187
|
+
var p = s(m.length) | 0, E = a(_, p);
|
|
2188
|
+
return E.length === 0 || m.copy(E, 0, 0, p), E;
|
|
2183
2189
|
}
|
|
2184
|
-
if (
|
|
2185
|
-
if (typeof ArrayBuffer < "u" &&
|
|
2186
|
-
return typeof
|
|
2187
|
-
if (
|
|
2188
|
-
return b(_,
|
|
2190
|
+
if (m) {
|
|
2191
|
+
if (typeof ArrayBuffer < "u" && m.buffer instanceof ArrayBuffer || "length" in m)
|
|
2192
|
+
return typeof m.length != "number" || f(m.length) ? a(_, 0) : b(_, m);
|
|
2193
|
+
if (m.type === "Buffer" && Array.isArray(m.data))
|
|
2194
|
+
return b(_, m.data);
|
|
2189
2195
|
}
|
|
2190
2196
|
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
2191
2197
|
}
|
|
2192
|
-
function M(_,
|
|
2193
|
-
|
|
2194
|
-
for (var p, E = _.length,
|
|
2198
|
+
function M(_, m) {
|
|
2199
|
+
m = m || 1 / 0;
|
|
2200
|
+
for (var p, E = _.length, T = null, L = [], W = 0; W < E; ++W) {
|
|
2195
2201
|
if (p = _.charCodeAt(W), p > 55295 && p < 57344) {
|
|
2196
|
-
if (!
|
|
2202
|
+
if (!T) {
|
|
2197
2203
|
if (p > 56319) {
|
|
2198
|
-
(
|
|
2204
|
+
(m -= 3) > -1 && L.push(239, 191, 189);
|
|
2199
2205
|
continue;
|
|
2200
2206
|
} else if (W + 1 === E) {
|
|
2201
|
-
(
|
|
2207
|
+
(m -= 3) > -1 && L.push(239, 191, 189);
|
|
2202
2208
|
continue;
|
|
2203
2209
|
}
|
|
2204
|
-
|
|
2210
|
+
T = p;
|
|
2205
2211
|
continue;
|
|
2206
2212
|
}
|
|
2207
2213
|
if (p < 56320) {
|
|
2208
|
-
(
|
|
2214
|
+
(m -= 3) > -1 && L.push(239, 191, 189), T = p;
|
|
2209
2215
|
continue;
|
|
2210
2216
|
}
|
|
2211
|
-
p = (
|
|
2217
|
+
p = (T - 55296 << 10 | p - 56320) + 65536;
|
|
2212
2218
|
} else
|
|
2213
|
-
|
|
2214
|
-
if (
|
|
2215
|
-
if ((
|
|
2219
|
+
T && (m -= 3) > -1 && L.push(239, 191, 189);
|
|
2220
|
+
if (T = null, p < 128) {
|
|
2221
|
+
if ((m -= 1) < 0)
|
|
2216
2222
|
break;
|
|
2217
2223
|
L.push(p);
|
|
2218
2224
|
} else if (p < 2048) {
|
|
2219
|
-
if ((
|
|
2225
|
+
if ((m -= 2) < 0)
|
|
2220
2226
|
break;
|
|
2221
2227
|
L.push(
|
|
2222
2228
|
p >> 6 | 192,
|
|
2223
2229
|
p & 63 | 128
|
|
2224
2230
|
);
|
|
2225
2231
|
} else if (p < 65536) {
|
|
2226
|
-
if ((
|
|
2232
|
+
if ((m -= 3) < 0)
|
|
2227
2233
|
break;
|
|
2228
2234
|
L.push(
|
|
2229
2235
|
p >> 12 | 224,
|
|
@@ -2231,7 +2237,7 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2231
2237
|
p & 63 | 128
|
|
2232
2238
|
);
|
|
2233
2239
|
} else if (p < 1114112) {
|
|
2234
|
-
if ((
|
|
2240
|
+
if ((m -= 4) < 0)
|
|
2235
2241
|
break;
|
|
2236
2242
|
L.push(
|
|
2237
2243
|
p >> 18 | 240,
|
|
@@ -2250,166 +2256,166 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2250
2256
|
if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(_) || _ instanceof ArrayBuffer))
|
|
2251
2257
|
return _.byteLength;
|
|
2252
2258
|
typeof _ != "string" && (_ = "" + _);
|
|
2253
|
-
var
|
|
2254
|
-
return
|
|
2259
|
+
var m = _.length;
|
|
2260
|
+
return m === 0 ? 0 : M(_).length;
|
|
2255
2261
|
}
|
|
2256
|
-
function
|
|
2257
|
-
for (var
|
|
2258
|
-
|
|
2259
|
-
return
|
|
2262
|
+
function B(_, m, p, E) {
|
|
2263
|
+
for (var T = 0; T < E && !(T + p >= m.length || T >= _.length); ++T)
|
|
2264
|
+
m[T + p] = _[T];
|
|
2265
|
+
return T;
|
|
2260
2266
|
}
|
|
2261
|
-
function I(_,
|
|
2262
|
-
return
|
|
2267
|
+
function I(_, m, p, E) {
|
|
2268
|
+
return B(M(m, _.length - p), _, p, E);
|
|
2263
2269
|
}
|
|
2264
|
-
function k(_,
|
|
2265
|
-
if (typeof
|
|
2270
|
+
function k(_, m, p, E) {
|
|
2271
|
+
if (typeof m == "number")
|
|
2266
2272
|
throw new TypeError('"value" argument must not be a number');
|
|
2267
|
-
return typeof ArrayBuffer < "u" &&
|
|
2273
|
+
return typeof ArrayBuffer < "u" && m instanceof ArrayBuffer ? A(_, m, p, E) : typeof m == "string" ? x(_, m) : F(_, m);
|
|
2268
2274
|
}
|
|
2269
|
-
i.prototype.write = function(
|
|
2275
|
+
i.prototype.write = function(m, p, E) {
|
|
2270
2276
|
p === void 0 ? (E = this.length, p = 0) : E === void 0 && typeof p == "string" ? (E = this.length, p = 0) : isFinite(p) && (p = p | 0, isFinite(E) ? E = E | 0 : E = void 0);
|
|
2271
|
-
var
|
|
2272
|
-
if ((E === void 0 || E >
|
|
2277
|
+
var T = this.length - p;
|
|
2278
|
+
if ((E === void 0 || E > T) && (E = T), m.length > 0 && (E < 0 || p < 0) || p > this.length)
|
|
2273
2279
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
2274
|
-
return I(this,
|
|
2275
|
-
}, i.prototype.slice = function(
|
|
2280
|
+
return I(this, m, p, E);
|
|
2281
|
+
}, i.prototype.slice = function(m, p) {
|
|
2276
2282
|
var E = this.length;
|
|
2277
|
-
|
|
2278
|
-
var
|
|
2283
|
+
m = ~~m, p = p === void 0 ? E : ~~p, m < 0 ? (m += E, m < 0 && (m = 0)) : m > E && (m = E), p < 0 ? (p += E, p < 0 && (p = 0)) : p > E && (p = E), p < m && (p = m);
|
|
2284
|
+
var T;
|
|
2279
2285
|
if (i.TYPED_ARRAY_SUPPORT)
|
|
2280
|
-
|
|
2286
|
+
T = this.subarray(m, p), T.__proto__ = i.prototype;
|
|
2281
2287
|
else {
|
|
2282
|
-
var L = p -
|
|
2283
|
-
|
|
2288
|
+
var L = p - m;
|
|
2289
|
+
T = new i(L, void 0);
|
|
2284
2290
|
for (var W = 0; W < L; ++W)
|
|
2285
|
-
|
|
2291
|
+
T[W] = this[W + m];
|
|
2286
2292
|
}
|
|
2287
|
-
return
|
|
2288
|
-
}, i.prototype.copy = function(
|
|
2289
|
-
if (E || (E = 0), !
|
|
2293
|
+
return T;
|
|
2294
|
+
}, i.prototype.copy = function(m, p, E, T) {
|
|
2295
|
+
if (E || (E = 0), !T && T !== 0 && (T = this.length), p >= m.length && (p = m.length), p || (p = 0), T > 0 && T < E && (T = E), T === E || m.length === 0 || this.length === 0)
|
|
2290
2296
|
return 0;
|
|
2291
2297
|
if (p < 0)
|
|
2292
2298
|
throw new RangeError("targetStart out of bounds");
|
|
2293
2299
|
if (E < 0 || E >= this.length)
|
|
2294
2300
|
throw new RangeError("sourceStart out of bounds");
|
|
2295
|
-
if (
|
|
2301
|
+
if (T < 0)
|
|
2296
2302
|
throw new RangeError("sourceEnd out of bounds");
|
|
2297
|
-
|
|
2298
|
-
var L =
|
|
2299
|
-
if (this ===
|
|
2303
|
+
T > this.length && (T = this.length), m.length - p < T - E && (T = m.length - p + E);
|
|
2304
|
+
var L = T - E, W;
|
|
2305
|
+
if (this === m && E < p && p < T)
|
|
2300
2306
|
for (W = L - 1; W >= 0; --W)
|
|
2301
|
-
|
|
2307
|
+
m[W + p] = this[W + E];
|
|
2302
2308
|
else if (L < 1e3 || !i.TYPED_ARRAY_SUPPORT)
|
|
2303
2309
|
for (W = 0; W < L; ++W)
|
|
2304
|
-
|
|
2310
|
+
m[W + p] = this[W + E];
|
|
2305
2311
|
else
|
|
2306
2312
|
Uint8Array.prototype.set.call(
|
|
2307
|
-
|
|
2313
|
+
m,
|
|
2308
2314
|
this.subarray(E, E + L),
|
|
2309
2315
|
p
|
|
2310
2316
|
);
|
|
2311
2317
|
return L;
|
|
2312
|
-
}, i.prototype.fill = function(
|
|
2313
|
-
if (typeof
|
|
2314
|
-
if (typeof p == "string" ? (p = 0, E = this.length) : typeof E == "string" && (E = this.length),
|
|
2315
|
-
var
|
|
2316
|
-
|
|
2318
|
+
}, i.prototype.fill = function(m, p, E) {
|
|
2319
|
+
if (typeof m == "string") {
|
|
2320
|
+
if (typeof p == "string" ? (p = 0, E = this.length) : typeof E == "string" && (E = this.length), m.length === 1) {
|
|
2321
|
+
var T = m.charCodeAt(0);
|
|
2322
|
+
T < 256 && (m = T);
|
|
2317
2323
|
}
|
|
2318
2324
|
} else
|
|
2319
|
-
typeof
|
|
2325
|
+
typeof m == "number" && (m = m & 255);
|
|
2320
2326
|
if (p < 0 || this.length < p || this.length < E)
|
|
2321
2327
|
throw new RangeError("Out of range index");
|
|
2322
2328
|
if (E <= p)
|
|
2323
2329
|
return this;
|
|
2324
|
-
p = p >>> 0, E = E === void 0 ? this.length : E >>> 0,
|
|
2330
|
+
p = p >>> 0, E = E === void 0 ? this.length : E >>> 0, m || (m = 0);
|
|
2325
2331
|
var L;
|
|
2326
|
-
if (typeof
|
|
2332
|
+
if (typeof m == "number")
|
|
2327
2333
|
for (L = p; L < E; ++L)
|
|
2328
|
-
this[L] =
|
|
2334
|
+
this[L] = m;
|
|
2329
2335
|
else {
|
|
2330
|
-
var W = i.isBuffer(
|
|
2336
|
+
var W = i.isBuffer(m) ? m : new i(m), $ = W.length;
|
|
2331
2337
|
for (L = 0; L < E - p; ++L)
|
|
2332
2338
|
this[L + p] = W[L % $];
|
|
2333
2339
|
}
|
|
2334
2340
|
return this;
|
|
2335
|
-
}, i.concat = function(
|
|
2336
|
-
if (!
|
|
2341
|
+
}, i.concat = function(m, p) {
|
|
2342
|
+
if (!h(m))
|
|
2337
2343
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
2338
|
-
if (
|
|
2344
|
+
if (m.length === 0)
|
|
2339
2345
|
return a(null, 0);
|
|
2340
2346
|
var E;
|
|
2341
2347
|
if (p === void 0)
|
|
2342
|
-
for (p = 0, E = 0; E <
|
|
2343
|
-
p +=
|
|
2344
|
-
var
|
|
2345
|
-
for (E = 0; E <
|
|
2346
|
-
var W =
|
|
2348
|
+
for (p = 0, E = 0; E < m.length; ++E)
|
|
2349
|
+
p += m[E].length;
|
|
2350
|
+
var T = w(null, p), L = 0;
|
|
2351
|
+
for (E = 0; E < m.length; ++E) {
|
|
2352
|
+
var W = m[E];
|
|
2347
2353
|
if (!i.isBuffer(W))
|
|
2348
2354
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
2349
|
-
W.copy(
|
|
2355
|
+
W.copy(T, L), L += W.length;
|
|
2350
2356
|
}
|
|
2351
|
-
return
|
|
2352
|
-
}, i.byteLength = C, i.prototype._isBuffer = !0, i.isBuffer = function(
|
|
2353
|
-
return !!(
|
|
2357
|
+
return T;
|
|
2358
|
+
}, i.byteLength = C, i.prototype._isBuffer = !0, i.isBuffer = function(m) {
|
|
2359
|
+
return !!(m != null && m._isBuffer);
|
|
2354
2360
|
}, g.exports.alloc = function(_) {
|
|
2355
|
-
var
|
|
2356
|
-
return
|
|
2361
|
+
var m = new i(_);
|
|
2362
|
+
return m.fill(0), m;
|
|
2357
2363
|
}, g.exports.from = function(_) {
|
|
2358
2364
|
return new i(_);
|
|
2359
2365
|
};
|
|
2360
|
-
}, { isarray: 33 }], 29: [function(n, g,
|
|
2361
|
-
|
|
2362
|
-
for (var
|
|
2363
|
-
|
|
2366
|
+
}, { isarray: 33 }], 29: [function(n, g, u) {
|
|
2367
|
+
u.byteLength = w, u.toByteArray = b, u.fromByteArray = M;
|
|
2368
|
+
for (var h = [], d = [], c = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, f = i.length; s < f; ++s)
|
|
2369
|
+
h[s] = i[s], d[i.charCodeAt(s)] = s;
|
|
2364
2370
|
d["-".charCodeAt(0)] = 62, d["_".charCodeAt(0)] = 63;
|
|
2365
2371
|
function a(C) {
|
|
2366
|
-
var
|
|
2367
|
-
if (
|
|
2372
|
+
var B = C.length;
|
|
2373
|
+
if (B % 4 > 0)
|
|
2368
2374
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
2369
2375
|
var I = C.indexOf("=");
|
|
2370
|
-
I === -1 && (I =
|
|
2371
|
-
var k = I ===
|
|
2376
|
+
I === -1 && (I = B);
|
|
2377
|
+
var k = I === B ? 0 : 4 - I % 4;
|
|
2372
2378
|
return [I, k];
|
|
2373
2379
|
}
|
|
2374
2380
|
function w(C) {
|
|
2375
|
-
var
|
|
2381
|
+
var B = a(C), I = B[0], k = B[1];
|
|
2376
2382
|
return (I + k) * 3 / 4 - k;
|
|
2377
2383
|
}
|
|
2378
|
-
function x(C,
|
|
2379
|
-
return (
|
|
2384
|
+
function x(C, B, I) {
|
|
2385
|
+
return (B + I) * 3 / 4 - I;
|
|
2380
2386
|
}
|
|
2381
2387
|
function b(C) {
|
|
2382
|
-
var
|
|
2383
|
-
for (
|
|
2384
|
-
|
|
2385
|
-
return _ === 2 && (
|
|
2388
|
+
var B, I = a(C), k = I[0], _ = I[1], m = new c(x(C, k, _)), p = 0, E = _ > 0 ? k - 4 : k, T;
|
|
2389
|
+
for (T = 0; T < E; T += 4)
|
|
2390
|
+
B = d[C.charCodeAt(T)] << 18 | d[C.charCodeAt(T + 1)] << 12 | d[C.charCodeAt(T + 2)] << 6 | d[C.charCodeAt(T + 3)], m[p++] = B >> 16 & 255, m[p++] = B >> 8 & 255, m[p++] = B & 255;
|
|
2391
|
+
return _ === 2 && (B = d[C.charCodeAt(T)] << 2 | d[C.charCodeAt(T + 1)] >> 4, m[p++] = B & 255), _ === 1 && (B = d[C.charCodeAt(T)] << 10 | d[C.charCodeAt(T + 1)] << 4 | d[C.charCodeAt(T + 2)] >> 2, m[p++] = B >> 8 & 255, m[p++] = B & 255), m;
|
|
2386
2392
|
}
|
|
2387
|
-
function
|
|
2388
|
-
return
|
|
2393
|
+
function A(C) {
|
|
2394
|
+
return h[C >> 18 & 63] + h[C >> 12 & 63] + h[C >> 6 & 63] + h[C & 63];
|
|
2389
2395
|
}
|
|
2390
|
-
function F(C,
|
|
2391
|
-
for (var k, _ = [],
|
|
2392
|
-
k = (C[
|
|
2396
|
+
function F(C, B, I) {
|
|
2397
|
+
for (var k, _ = [], m = B; m < I; m += 3)
|
|
2398
|
+
k = (C[m] << 16 & 16711680) + (C[m + 1] << 8 & 65280) + (C[m + 2] & 255), _.push(A(k));
|
|
2393
2399
|
return _.join("");
|
|
2394
2400
|
}
|
|
2395
2401
|
function M(C) {
|
|
2396
|
-
for (var
|
|
2402
|
+
for (var B, I = C.length, k = I % 3, _ = [], m = 16383, p = 0, E = I - k; p < E; p += m)
|
|
2397
2403
|
_.push(F(
|
|
2398
2404
|
C,
|
|
2399
2405
|
p,
|
|
2400
|
-
p +
|
|
2406
|
+
p + m > E ? E : p + m
|
|
2401
2407
|
));
|
|
2402
|
-
return k === 1 ? (
|
|
2403
|
-
|
|
2404
|
-
)) : k === 2 && (
|
|
2405
|
-
|
|
2408
|
+
return k === 1 ? (B = C[I - 1], _.push(
|
|
2409
|
+
h[B >> 2] + h[B << 4 & 63] + "=="
|
|
2410
|
+
)) : k === 2 && (B = (C[I - 2] << 8) + C[I - 1], _.push(
|
|
2411
|
+
h[B >> 10] + h[B >> 4 & 63] + h[B << 2 & 63] + "="
|
|
2406
2412
|
)), _.join("");
|
|
2407
2413
|
}
|
|
2408
|
-
}, {}], 30: [function(n, g,
|
|
2409
|
-
var
|
|
2410
|
-
|
|
2414
|
+
}, {}], 30: [function(n, g, u) {
|
|
2415
|
+
var h = n("base64-js"), d = n("ieee754"), c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
2416
|
+
u.Buffer = a, u.SlowBuffer = k, u.INSPECT_MAX_BYTES = 50;
|
|
2411
2417
|
var i = 2147483647;
|
|
2412
|
-
|
|
2418
|
+
u.kMaxLength = i, a.TYPED_ARRAY_SUPPORT = s(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
2413
2419
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
2414
2420
|
);
|
|
2415
2421
|
function s() {
|
|
@@ -2435,7 +2441,7 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2435
2441
|
return this.byteOffset;
|
|
2436
2442
|
}
|
|
2437
2443
|
});
|
|
2438
|
-
function
|
|
2444
|
+
function f(o) {
|
|
2439
2445
|
if (o > i)
|
|
2440
2446
|
throw new RangeError('The value "' + o + '" is invalid for option "size"');
|
|
2441
2447
|
var t = new Uint8Array(o);
|
|
@@ -2447,7 +2453,7 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2447
2453
|
throw new TypeError(
|
|
2448
2454
|
'The "string" argument must be of type string. Received type number'
|
|
2449
2455
|
);
|
|
2450
|
-
return
|
|
2456
|
+
return A(o);
|
|
2451
2457
|
}
|
|
2452
2458
|
return w(o, t, e);
|
|
2453
2459
|
}
|
|
@@ -2472,10 +2478,10 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2472
2478
|
throw new TypeError(
|
|
2473
2479
|
'The "value" argument must not be of type number. Received type number'
|
|
2474
2480
|
);
|
|
2475
|
-
var
|
|
2476
|
-
if (
|
|
2477
|
-
return a.from(
|
|
2478
|
-
var y =
|
|
2481
|
+
var l = o.valueOf && o.valueOf();
|
|
2482
|
+
if (l != null && l !== o)
|
|
2483
|
+
return a.from(l, t, e);
|
|
2484
|
+
var y = B(o);
|
|
2479
2485
|
if (y)
|
|
2480
2486
|
return y;
|
|
2481
2487
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof o[Symbol.toPrimitive] == "function")
|
|
@@ -2498,28 +2504,28 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2498
2504
|
throw new RangeError('The value "' + o + '" is invalid for option "size"');
|
|
2499
2505
|
}
|
|
2500
2506
|
function b(o, t, e) {
|
|
2501
|
-
return x(o), o <= 0 ?
|
|
2507
|
+
return x(o), o <= 0 ? f(o) : t !== void 0 ? typeof e == "string" ? f(o).fill(t, e) : f(o).fill(t) : f(o);
|
|
2502
2508
|
}
|
|
2503
2509
|
a.alloc = function(o, t, e) {
|
|
2504
2510
|
return b(o, t, e);
|
|
2505
2511
|
};
|
|
2506
|
-
function
|
|
2507
|
-
return x(o),
|
|
2512
|
+
function A(o) {
|
|
2513
|
+
return x(o), f(o < 0 ? 0 : I(o) | 0);
|
|
2508
2514
|
}
|
|
2509
2515
|
a.allocUnsafe = function(o) {
|
|
2510
|
-
return
|
|
2516
|
+
return A(o);
|
|
2511
2517
|
}, a.allocUnsafeSlow = function(o) {
|
|
2512
|
-
return
|
|
2518
|
+
return A(o);
|
|
2513
2519
|
};
|
|
2514
2520
|
function F(o, t) {
|
|
2515
2521
|
if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
|
|
2516
2522
|
throw new TypeError("Unknown encoding: " + t);
|
|
2517
|
-
var e = _(o, t) | 0,
|
|
2518
|
-
return y !== e && (
|
|
2523
|
+
var e = _(o, t) | 0, l = f(e), y = l.write(o, t);
|
|
2524
|
+
return y !== e && (l = l.slice(0, y)), l;
|
|
2519
2525
|
}
|
|
2520
2526
|
function M(o) {
|
|
2521
|
-
for (var t = o.length < 0 ? 0 : I(o.length) | 0, e =
|
|
2522
|
-
e[
|
|
2527
|
+
for (var t = o.length < 0 ? 0 : I(o.length) | 0, e = f(t), l = 0; l < t; l += 1)
|
|
2528
|
+
e[l] = o[l] & 255;
|
|
2523
2529
|
return e;
|
|
2524
2530
|
}
|
|
2525
2531
|
function C(o, t, e) {
|
|
@@ -2527,16 +2533,16 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2527
2533
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
2528
2534
|
if (o.byteLength < t + (e || 0))
|
|
2529
2535
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
2530
|
-
var
|
|
2531
|
-
return t === void 0 && e === void 0 ?
|
|
2536
|
+
var l;
|
|
2537
|
+
return t === void 0 && e === void 0 ? l = new Uint8Array(o) : e === void 0 ? l = new Uint8Array(o, t) : l = new Uint8Array(o, t, e), Object.setPrototypeOf(l, a.prototype), l;
|
|
2532
2538
|
}
|
|
2533
|
-
function
|
|
2539
|
+
function B(o) {
|
|
2534
2540
|
if (a.isBuffer(o)) {
|
|
2535
|
-
var t = I(o.length) | 0, e =
|
|
2541
|
+
var t = I(o.length) | 0, e = f(t);
|
|
2536
2542
|
return e.length === 0 || o.copy(e, 0, 0, t), e;
|
|
2537
2543
|
}
|
|
2538
2544
|
if (o.length !== void 0)
|
|
2539
|
-
return typeof o.length != "number" || yt(o.length) ?
|
|
2545
|
+
return typeof o.length != "number" || yt(o.length) ? f(0) : M(o);
|
|
2540
2546
|
if (o.type === "Buffer" && Array.isArray(o.data))
|
|
2541
2547
|
return M(o.data);
|
|
2542
2548
|
}
|
|
@@ -2557,12 +2563,12 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2557
2563
|
);
|
|
2558
2564
|
if (t === e)
|
|
2559
2565
|
return 0;
|
|
2560
|
-
for (var
|
|
2566
|
+
for (var l = t.length, y = e.length, P = 0, S = Math.min(l, y); P < S; ++P)
|
|
2561
2567
|
if (t[P] !== e[P]) {
|
|
2562
|
-
|
|
2568
|
+
l = t[P], y = e[P];
|
|
2563
2569
|
break;
|
|
2564
2570
|
}
|
|
2565
|
-
return
|
|
2571
|
+
return l < y ? -1 : y < l ? 1 : 0;
|
|
2566
2572
|
}, a.isEncoding = function(t) {
|
|
2567
2573
|
switch (String(t).toLowerCase()) {
|
|
2568
2574
|
case "hex":
|
|
@@ -2585,16 +2591,16 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2585
2591
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
2586
2592
|
if (t.length === 0)
|
|
2587
2593
|
return a.alloc(0);
|
|
2588
|
-
var
|
|
2594
|
+
var l;
|
|
2589
2595
|
if (e === void 0)
|
|
2590
|
-
for (e = 0,
|
|
2591
|
-
e += t[
|
|
2596
|
+
for (e = 0, l = 0; l < t.length; ++l)
|
|
2597
|
+
e += t[l].length;
|
|
2592
2598
|
var y = a.allocUnsafe(e), P = 0;
|
|
2593
|
-
for (
|
|
2594
|
-
var
|
|
2595
|
-
if (Q(
|
|
2599
|
+
for (l = 0; l < t.length; ++l) {
|
|
2600
|
+
var S = t[l];
|
|
2601
|
+
if (Q(S, Uint8Array) && (S = a.from(S)), !a.isBuffer(S))
|
|
2596
2602
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
2597
|
-
|
|
2603
|
+
S.copy(y, P), P += S.length;
|
|
2598
2604
|
}
|
|
2599
2605
|
return y;
|
|
2600
2606
|
};
|
|
@@ -2607,8 +2613,8 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2607
2613
|
throw new TypeError(
|
|
2608
2614
|
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof o
|
|
2609
2615
|
);
|
|
2610
|
-
var e = o.length,
|
|
2611
|
-
if (!
|
|
2616
|
+
var e = o.length, l = arguments.length > 2 && arguments[2] === !0;
|
|
2617
|
+
if (!l && e === 0)
|
|
2612
2618
|
return 0;
|
|
2613
2619
|
for (var y = !1; ; )
|
|
2614
2620
|
switch (t) {
|
|
@@ -2630,13 +2636,13 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2630
2636
|
return ht(o).length;
|
|
2631
2637
|
default:
|
|
2632
2638
|
if (y)
|
|
2633
|
-
return
|
|
2639
|
+
return l ? -1 : rt(o).length;
|
|
2634
2640
|
t = ("" + t).toLowerCase(), y = !0;
|
|
2635
2641
|
}
|
|
2636
2642
|
}
|
|
2637
2643
|
a.byteLength = _;
|
|
2638
|
-
function
|
|
2639
|
-
var
|
|
2644
|
+
function m(o, t, e) {
|
|
2645
|
+
var l = !1;
|
|
2640
2646
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
|
|
2641
2647
|
return "";
|
|
2642
2648
|
for (o || (o = "utf8"); ; )
|
|
@@ -2659,15 +2665,15 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2659
2665
|
case "utf-16le":
|
|
2660
2666
|
return mt(this, t, e);
|
|
2661
2667
|
default:
|
|
2662
|
-
if (
|
|
2668
|
+
if (l)
|
|
2663
2669
|
throw new TypeError("Unknown encoding: " + o);
|
|
2664
|
-
o = (o + "").toLowerCase(),
|
|
2670
|
+
o = (o + "").toLowerCase(), l = !0;
|
|
2665
2671
|
}
|
|
2666
2672
|
}
|
|
2667
2673
|
a.prototype._isBuffer = !0;
|
|
2668
2674
|
function p(o, t, e) {
|
|
2669
|
-
var
|
|
2670
|
-
o[t] = o[e], o[e] =
|
|
2675
|
+
var l = o[t];
|
|
2676
|
+
o[t] = o[e], o[e] = l;
|
|
2671
2677
|
}
|
|
2672
2678
|
a.prototype.swap16 = function() {
|
|
2673
2679
|
var t = this.length;
|
|
@@ -2692,40 +2698,40 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2692
2698
|
return this;
|
|
2693
2699
|
}, a.prototype.toString = function() {
|
|
2694
2700
|
var t = this.length;
|
|
2695
|
-
return t === 0 ? "" : arguments.length === 0 ? z(this, 0, t) :
|
|
2701
|
+
return t === 0 ? "" : arguments.length === 0 ? z(this, 0, t) : m.apply(this, arguments);
|
|
2696
2702
|
}, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
|
|
2697
2703
|
if (!a.isBuffer(t))
|
|
2698
2704
|
throw new TypeError("Argument must be a Buffer");
|
|
2699
2705
|
return this === t ? !0 : a.compare(this, t) === 0;
|
|
2700
2706
|
}, a.prototype.inspect = function() {
|
|
2701
|
-
var t = "", e =
|
|
2707
|
+
var t = "", e = u.INSPECT_MAX_BYTES;
|
|
2702
2708
|
return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
|
|
2703
|
-
}, c && (a.prototype[c] = a.prototype.inspect), a.prototype.compare = function(t, e,
|
|
2709
|
+
}, c && (a.prototype[c] = a.prototype.inspect), a.prototype.compare = function(t, e, l, y, P) {
|
|
2704
2710
|
if (Q(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
|
|
2705
2711
|
throw new TypeError(
|
|
2706
2712
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
|
|
2707
2713
|
);
|
|
2708
|
-
if (e === void 0 && (e = 0),
|
|
2714
|
+
if (e === void 0 && (e = 0), l === void 0 && (l = t ? t.length : 0), y === void 0 && (y = 0), P === void 0 && (P = this.length), e < 0 || l > t.length || y < 0 || P > this.length)
|
|
2709
2715
|
throw new RangeError("out of range index");
|
|
2710
|
-
if (y >= P && e >=
|
|
2716
|
+
if (y >= P && e >= l)
|
|
2711
2717
|
return 0;
|
|
2712
2718
|
if (y >= P)
|
|
2713
2719
|
return -1;
|
|
2714
|
-
if (e >=
|
|
2720
|
+
if (e >= l)
|
|
2715
2721
|
return 1;
|
|
2716
|
-
if (e >>>= 0,
|
|
2722
|
+
if (e >>>= 0, l >>>= 0, y >>>= 0, P >>>= 0, this === t)
|
|
2717
2723
|
return 0;
|
|
2718
|
-
for (var
|
|
2719
|
-
if (V
|
|
2720
|
-
|
|
2724
|
+
for (var S = P - y, H = l - e, G = Math.min(S, H), K = this.slice(y, P), Z = t.slice(e, l), V = 0; V < G; ++V)
|
|
2725
|
+
if (K[V] !== Z[V]) {
|
|
2726
|
+
S = K[V], H = Z[V];
|
|
2721
2727
|
break;
|
|
2722
2728
|
}
|
|
2723
|
-
return
|
|
2729
|
+
return S < H ? -1 : H < S ? 1 : 0;
|
|
2724
2730
|
};
|
|
2725
|
-
function E(o, t, e,
|
|
2731
|
+
function E(o, t, e, l, y) {
|
|
2726
2732
|
if (o.length === 0)
|
|
2727
2733
|
return -1;
|
|
2728
|
-
if (typeof e == "string" ? (
|
|
2734
|
+
if (typeof e == "string" ? (l = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, yt(e) && (e = y ? 0 : o.length - 1), e < 0 && (e = o.length + e), e >= o.length) {
|
|
2729
2735
|
if (y)
|
|
2730
2736
|
return -1;
|
|
2731
2737
|
e = o.length - 1;
|
|
@@ -2734,117 +2740,117 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2734
2740
|
e = 0;
|
|
2735
2741
|
else
|
|
2736
2742
|
return -1;
|
|
2737
|
-
if (typeof t == "string" && (t = a.from(t,
|
|
2738
|
-
return t.length === 0 ? -1 :
|
|
2743
|
+
if (typeof t == "string" && (t = a.from(t, l)), a.isBuffer(t))
|
|
2744
|
+
return t.length === 0 ? -1 : T(o, t, e, l, y);
|
|
2739
2745
|
if (typeof t == "number")
|
|
2740
|
-
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? y ? Uint8Array.prototype.indexOf.call(o, t, e) : Uint8Array.prototype.lastIndexOf.call(o, t, e) :
|
|
2746
|
+
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? y ? Uint8Array.prototype.indexOf.call(o, t, e) : Uint8Array.prototype.lastIndexOf.call(o, t, e) : T(o, [t], e, l, y);
|
|
2741
2747
|
throw new TypeError("val must be string, number or Buffer");
|
|
2742
2748
|
}
|
|
2743
|
-
function
|
|
2744
|
-
var P = 1,
|
|
2745
|
-
if (
|
|
2749
|
+
function T(o, t, e, l, y) {
|
|
2750
|
+
var P = 1, S = o.length, H = t.length;
|
|
2751
|
+
if (l !== void 0 && (l = String(l).toLowerCase(), l === "ucs2" || l === "ucs-2" || l === "utf16le" || l === "utf-16le")) {
|
|
2746
2752
|
if (o.length < 2 || t.length < 2)
|
|
2747
2753
|
return -1;
|
|
2748
|
-
P = 2,
|
|
2754
|
+
P = 2, S /= 2, H /= 2, e /= 2;
|
|
2749
2755
|
}
|
|
2750
|
-
function G(
|
|
2751
|
-
return P === 1 ?
|
|
2756
|
+
function G(Pt, St) {
|
|
2757
|
+
return P === 1 ? Pt[St] : Pt.readUInt16BE(St * P);
|
|
2752
2758
|
}
|
|
2753
|
-
var
|
|
2759
|
+
var K;
|
|
2754
2760
|
if (y) {
|
|
2755
2761
|
var Z = -1;
|
|
2756
|
-
for (
|
|
2757
|
-
if (G(o,
|
|
2758
|
-
if (Z === -1 && (Z =
|
|
2762
|
+
for (K = e; K < S; K++)
|
|
2763
|
+
if (G(o, K) === G(t, Z === -1 ? 0 : K - Z)) {
|
|
2764
|
+
if (Z === -1 && (Z = K), K - Z + 1 === H)
|
|
2759
2765
|
return Z * P;
|
|
2760
2766
|
} else
|
|
2761
|
-
Z !== -1 && (
|
|
2767
|
+
Z !== -1 && (K -= K - Z), Z = -1;
|
|
2762
2768
|
} else
|
|
2763
|
-
for (e + H >
|
|
2764
|
-
for (var
|
|
2765
|
-
if (G(o,
|
|
2766
|
-
|
|
2769
|
+
for (e + H > S && (e = S - H), K = e; K >= 0; K--) {
|
|
2770
|
+
for (var V = !0, dt = 0; dt < H; dt++)
|
|
2771
|
+
if (G(o, K + dt) !== G(t, dt)) {
|
|
2772
|
+
V = !1;
|
|
2767
2773
|
break;
|
|
2768
2774
|
}
|
|
2769
|
-
if (
|
|
2770
|
-
return
|
|
2775
|
+
if (V)
|
|
2776
|
+
return K;
|
|
2771
2777
|
}
|
|
2772
2778
|
return -1;
|
|
2773
2779
|
}
|
|
2774
|
-
a.prototype.includes = function(t, e,
|
|
2775
|
-
return this.indexOf(t, e,
|
|
2776
|
-
}, a.prototype.indexOf = function(t, e,
|
|
2777
|
-
return E(this, t, e,
|
|
2778
|
-
}, a.prototype.lastIndexOf = function(t, e,
|
|
2779
|
-
return E(this, t, e,
|
|
2780
|
+
a.prototype.includes = function(t, e, l) {
|
|
2781
|
+
return this.indexOf(t, e, l) !== -1;
|
|
2782
|
+
}, a.prototype.indexOf = function(t, e, l) {
|
|
2783
|
+
return E(this, t, e, l, !0);
|
|
2784
|
+
}, a.prototype.lastIndexOf = function(t, e, l) {
|
|
2785
|
+
return E(this, t, e, l, !1);
|
|
2780
2786
|
};
|
|
2781
|
-
function L(o, t, e,
|
|
2787
|
+
function L(o, t, e, l) {
|
|
2782
2788
|
e = Number(e) || 0;
|
|
2783
2789
|
var y = o.length - e;
|
|
2784
|
-
|
|
2790
|
+
l ? (l = Number(l), l > y && (l = y)) : l = y;
|
|
2785
2791
|
var P = t.length;
|
|
2786
|
-
|
|
2787
|
-
for (var
|
|
2788
|
-
var H = parseInt(t.substr(
|
|
2792
|
+
l > P / 2 && (l = P / 2);
|
|
2793
|
+
for (var S = 0; S < l; ++S) {
|
|
2794
|
+
var H = parseInt(t.substr(S * 2, 2), 16);
|
|
2789
2795
|
if (yt(H))
|
|
2790
|
-
return
|
|
2791
|
-
o[e +
|
|
2796
|
+
return S;
|
|
2797
|
+
o[e + S] = H;
|
|
2792
2798
|
}
|
|
2793
|
-
return
|
|
2799
|
+
return S;
|
|
2794
2800
|
}
|
|
2795
|
-
function W(o, t, e,
|
|
2796
|
-
return tt(rt(t, o.length - e), o, e,
|
|
2801
|
+
function W(o, t, e, l) {
|
|
2802
|
+
return tt(rt(t, o.length - e), o, e, l);
|
|
2797
2803
|
}
|
|
2798
|
-
function $(o, t, e,
|
|
2799
|
-
return tt(
|
|
2804
|
+
function $(o, t, e, l) {
|
|
2805
|
+
return tt(lt(t), o, e, l);
|
|
2800
2806
|
}
|
|
2801
|
-
function D(o, t, e,
|
|
2802
|
-
return $(o, t, e,
|
|
2807
|
+
function D(o, t, e, l) {
|
|
2808
|
+
return $(o, t, e, l);
|
|
2803
2809
|
}
|
|
2804
|
-
function U(o, t, e,
|
|
2805
|
-
return tt(ht(t), o, e,
|
|
2810
|
+
function U(o, t, e, l) {
|
|
2811
|
+
return tt(ht(t), o, e, l);
|
|
2806
2812
|
}
|
|
2807
|
-
function R(o, t, e,
|
|
2808
|
-
return tt(
|
|
2813
|
+
function R(o, t, e, l) {
|
|
2814
|
+
return tt(ct(t, o.length - e), o, e, l);
|
|
2809
2815
|
}
|
|
2810
|
-
a.prototype.write = function(t, e,
|
|
2816
|
+
a.prototype.write = function(t, e, l, y) {
|
|
2811
2817
|
if (e === void 0)
|
|
2812
|
-
y = "utf8",
|
|
2813
|
-
else if (
|
|
2814
|
-
y = e,
|
|
2818
|
+
y = "utf8", l = this.length, e = 0;
|
|
2819
|
+
else if (l === void 0 && typeof e == "string")
|
|
2820
|
+
y = e, l = this.length, e = 0;
|
|
2815
2821
|
else if (isFinite(e))
|
|
2816
|
-
e = e >>> 0, isFinite(
|
|
2822
|
+
e = e >>> 0, isFinite(l) ? (l = l >>> 0, y === void 0 && (y = "utf8")) : (y = l, l = void 0);
|
|
2817
2823
|
else
|
|
2818
2824
|
throw new Error(
|
|
2819
2825
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
2820
2826
|
);
|
|
2821
2827
|
var P = this.length - e;
|
|
2822
|
-
if ((
|
|
2828
|
+
if ((l === void 0 || l > P) && (l = P), t.length > 0 && (l < 0 || e < 0) || e > this.length)
|
|
2823
2829
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
2824
2830
|
y || (y = "utf8");
|
|
2825
|
-
for (var
|
|
2831
|
+
for (var S = !1; ; )
|
|
2826
2832
|
switch (y) {
|
|
2827
2833
|
case "hex":
|
|
2828
|
-
return L(this, t, e,
|
|
2834
|
+
return L(this, t, e, l);
|
|
2829
2835
|
case "utf8":
|
|
2830
2836
|
case "utf-8":
|
|
2831
|
-
return W(this, t, e,
|
|
2837
|
+
return W(this, t, e, l);
|
|
2832
2838
|
case "ascii":
|
|
2833
|
-
return $(this, t, e,
|
|
2839
|
+
return $(this, t, e, l);
|
|
2834
2840
|
case "latin1":
|
|
2835
2841
|
case "binary":
|
|
2836
|
-
return D(this, t, e,
|
|
2842
|
+
return D(this, t, e, l);
|
|
2837
2843
|
case "base64":
|
|
2838
|
-
return U(this, t, e,
|
|
2844
|
+
return U(this, t, e, l);
|
|
2839
2845
|
case "ucs2":
|
|
2840
2846
|
case "ucs-2":
|
|
2841
2847
|
case "utf16le":
|
|
2842
2848
|
case "utf-16le":
|
|
2843
|
-
return R(this, t, e,
|
|
2849
|
+
return R(this, t, e, l);
|
|
2844
2850
|
default:
|
|
2845
|
-
if (
|
|
2851
|
+
if (S)
|
|
2846
2852
|
throw new TypeError("Unknown encoding: " + y);
|
|
2847
|
-
y = ("" + y).toLowerCase(),
|
|
2853
|
+
y = ("" + y).toLowerCase(), S = !0;
|
|
2848
2854
|
}
|
|
2849
2855
|
}, a.prototype.toJSON = function() {
|
|
2850
2856
|
return {
|
|
@@ -2853,249 +2859,249 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
2853
2859
|
};
|
|
2854
2860
|
};
|
|
2855
2861
|
function O(o, t, e) {
|
|
2856
|
-
return t === 0 && e === o.length ?
|
|
2862
|
+
return t === 0 && e === o.length ? h.fromByteArray(o) : h.fromByteArray(o.slice(t, e));
|
|
2857
2863
|
}
|
|
2858
2864
|
function z(o, t, e) {
|
|
2859
2865
|
e = Math.min(o.length, e);
|
|
2860
|
-
for (var
|
|
2861
|
-
var P = o[y],
|
|
2866
|
+
for (var l = [], y = t; y < e; ) {
|
|
2867
|
+
var P = o[y], S = null, H = P > 239 ? 4 : P > 223 ? 3 : P > 191 ? 2 : 1;
|
|
2862
2868
|
if (y + H <= e) {
|
|
2863
|
-
var G,
|
|
2869
|
+
var G, K, Z, V;
|
|
2864
2870
|
switch (H) {
|
|
2865
2871
|
case 1:
|
|
2866
|
-
P < 128 && (
|
|
2872
|
+
P < 128 && (S = P);
|
|
2867
2873
|
break;
|
|
2868
2874
|
case 2:
|
|
2869
|
-
G = o[y + 1], (G & 192) === 128 && (
|
|
2875
|
+
G = o[y + 1], (G & 192) === 128 && (V = (P & 31) << 6 | G & 63, V > 127 && (S = V));
|
|
2870
2876
|
break;
|
|
2871
2877
|
case 3:
|
|
2872
|
-
G = o[y + 1],
|
|
2878
|
+
G = o[y + 1], K = o[y + 2], (G & 192) === 128 && (K & 192) === 128 && (V = (P & 15) << 12 | (G & 63) << 6 | K & 63, V > 2047 && (V < 55296 || V > 57343) && (S = V));
|
|
2873
2879
|
break;
|
|
2874
2880
|
case 4:
|
|
2875
|
-
G = o[y + 1],
|
|
2881
|
+
G = o[y + 1], K = o[y + 2], Z = o[y + 3], (G & 192) === 128 && (K & 192) === 128 && (Z & 192) === 128 && (V = (P & 15) << 18 | (G & 63) << 12 | (K & 63) << 6 | Z & 63, V > 65535 && V < 1114112 && (S = V));
|
|
2876
2882
|
}
|
|
2877
2883
|
}
|
|
2878
|
-
|
|
2884
|
+
S === null ? (S = 65533, H = 1) : S > 65535 && (S -= 65536, l.push(S >>> 10 & 1023 | 55296), S = 56320 | S & 1023), l.push(S), y += H;
|
|
2879
2885
|
}
|
|
2880
|
-
return Y(
|
|
2886
|
+
return Y(l);
|
|
2881
2887
|
}
|
|
2882
2888
|
var N = 4096;
|
|
2883
2889
|
function Y(o) {
|
|
2884
2890
|
var t = o.length;
|
|
2885
2891
|
if (t <= N)
|
|
2886
2892
|
return String.fromCharCode.apply(String, o);
|
|
2887
|
-
for (var e = "",
|
|
2893
|
+
for (var e = "", l = 0; l < t; )
|
|
2888
2894
|
e += String.fromCharCode.apply(
|
|
2889
2895
|
String,
|
|
2890
|
-
o.slice(
|
|
2896
|
+
o.slice(l, l += N)
|
|
2891
2897
|
);
|
|
2892
2898
|
return e;
|
|
2893
2899
|
}
|
|
2894
2900
|
function j(o, t, e) {
|
|
2895
|
-
var
|
|
2901
|
+
var l = "";
|
|
2896
2902
|
e = Math.min(o.length, e);
|
|
2897
2903
|
for (var y = t; y < e; ++y)
|
|
2898
|
-
|
|
2899
|
-
return
|
|
2904
|
+
l += String.fromCharCode(o[y] & 127);
|
|
2905
|
+
return l;
|
|
2900
2906
|
}
|
|
2901
2907
|
function et(o, t, e) {
|
|
2902
|
-
var
|
|
2908
|
+
var l = "";
|
|
2903
2909
|
e = Math.min(o.length, e);
|
|
2904
2910
|
for (var y = t; y < e; ++y)
|
|
2905
|
-
|
|
2906
|
-
return
|
|
2911
|
+
l += String.fromCharCode(o[y]);
|
|
2912
|
+
return l;
|
|
2907
2913
|
}
|
|
2908
2914
|
function X(o, t, e) {
|
|
2909
|
-
var
|
|
2910
|
-
(!t || t < 0) && (t = 0), (!e || e < 0 || e >
|
|
2915
|
+
var l = o.length;
|
|
2916
|
+
(!t || t < 0) && (t = 0), (!e || e < 0 || e > l) && (e = l);
|
|
2911
2917
|
for (var y = "", P = t; P < e; ++P)
|
|
2912
|
-
y +=
|
|
2918
|
+
y += kt[o[P]];
|
|
2913
2919
|
return y;
|
|
2914
2920
|
}
|
|
2915
2921
|
function mt(o, t, e) {
|
|
2916
|
-
for (var
|
|
2917
|
-
y += String.fromCharCode(
|
|
2922
|
+
for (var l = o.slice(t, e), y = "", P = 0; P < l.length; P += 2)
|
|
2923
|
+
y += String.fromCharCode(l[P] + l[P + 1] * 256);
|
|
2918
2924
|
return y;
|
|
2919
2925
|
}
|
|
2920
2926
|
a.prototype.slice = function(t, e) {
|
|
2921
|
-
var
|
|
2922
|
-
t = ~~t, e = e === void 0 ?
|
|
2927
|
+
var l = this.length;
|
|
2928
|
+
t = ~~t, e = e === void 0 ? l : ~~e, t < 0 ? (t += l, t < 0 && (t = 0)) : t > l && (t = l), e < 0 ? (e += l, e < 0 && (e = 0)) : e > l && (e = l), e < t && (e = t);
|
|
2923
2929
|
var y = this.subarray(t, e);
|
|
2924
2930
|
return Object.setPrototypeOf(y, a.prototype), y;
|
|
2925
2931
|
};
|
|
2926
|
-
function
|
|
2932
|
+
function J(o, t, e) {
|
|
2927
2933
|
if (o % 1 !== 0 || o < 0)
|
|
2928
2934
|
throw new RangeError("offset is not uint");
|
|
2929
2935
|
if (o + t > e)
|
|
2930
2936
|
throw new RangeError("Trying to access beyond buffer length");
|
|
2931
2937
|
}
|
|
2932
|
-
a.prototype.readUIntLE = function(t, e,
|
|
2933
|
-
t = t >>> 0, e = e >>> 0,
|
|
2934
|
-
for (var y = this[t], P = 1,
|
|
2935
|
-
y += this[t +
|
|
2938
|
+
a.prototype.readUIntLE = function(t, e, l) {
|
|
2939
|
+
t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
|
|
2940
|
+
for (var y = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
|
|
2941
|
+
y += this[t + S] * P;
|
|
2936
2942
|
return y;
|
|
2937
|
-
}, a.prototype.readUIntBE = function(t, e,
|
|
2938
|
-
t = t >>> 0, e = e >>> 0,
|
|
2943
|
+
}, a.prototype.readUIntBE = function(t, e, l) {
|
|
2944
|
+
t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
|
|
2939
2945
|
for (var y = this[t + --e], P = 1; e > 0 && (P *= 256); )
|
|
2940
2946
|
y += this[t + --e] * P;
|
|
2941
2947
|
return y;
|
|
2942
2948
|
}, a.prototype.readUInt8 = function(t, e) {
|
|
2943
|
-
return t = t >>> 0, e ||
|
|
2949
|
+
return t = t >>> 0, e || J(t, 1, this.length), this[t];
|
|
2944
2950
|
}, a.prototype.readUInt16LE = function(t, e) {
|
|
2945
|
-
return t = t >>> 0, e ||
|
|
2951
|
+
return t = t >>> 0, e || J(t, 2, this.length), this[t] | this[t + 1] << 8;
|
|
2946
2952
|
}, a.prototype.readUInt16BE = function(t, e) {
|
|
2947
|
-
return t = t >>> 0, e ||
|
|
2953
|
+
return t = t >>> 0, e || J(t, 2, this.length), this[t] << 8 | this[t + 1];
|
|
2948
2954
|
}, a.prototype.readUInt32LE = function(t, e) {
|
|
2949
|
-
return t = t >>> 0, e ||
|
|
2955
|
+
return t = t >>> 0, e || J(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
|
|
2950
2956
|
}, a.prototype.readUInt32BE = function(t, e) {
|
|
2951
|
-
return t = t >>> 0, e ||
|
|
2952
|
-
}, a.prototype.readIntLE = function(t, e,
|
|
2953
|
-
t = t >>> 0, e = e >>> 0,
|
|
2954
|
-
for (var y = this[t], P = 1,
|
|
2955
|
-
y += this[t +
|
|
2957
|
+
return t = t >>> 0, e || J(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
|
|
2958
|
+
}, a.prototype.readIntLE = function(t, e, l) {
|
|
2959
|
+
t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
|
|
2960
|
+
for (var y = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
|
|
2961
|
+
y += this[t + S] * P;
|
|
2956
2962
|
return P *= 128, y >= P && (y -= Math.pow(2, 8 * e)), y;
|
|
2957
|
-
}, a.prototype.readIntBE = function(t, e,
|
|
2958
|
-
t = t >>> 0, e = e >>> 0,
|
|
2959
|
-
for (var y = e, P = 1,
|
|
2960
|
-
|
|
2961
|
-
return P *= 128,
|
|
2963
|
+
}, a.prototype.readIntBE = function(t, e, l) {
|
|
2964
|
+
t = t >>> 0, e = e >>> 0, l || J(t, e, this.length);
|
|
2965
|
+
for (var y = e, P = 1, S = this[t + --y]; y > 0 && (P *= 256); )
|
|
2966
|
+
S += this[t + --y] * P;
|
|
2967
|
+
return P *= 128, S >= P && (S -= Math.pow(2, 8 * e)), S;
|
|
2962
2968
|
}, a.prototype.readInt8 = function(t, e) {
|
|
2963
|
-
return t = t >>> 0, e ||
|
|
2969
|
+
return t = t >>> 0, e || J(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
|
|
2964
2970
|
}, a.prototype.readInt16LE = function(t, e) {
|
|
2965
|
-
t = t >>> 0, e ||
|
|
2966
|
-
var
|
|
2967
|
-
return
|
|
2971
|
+
t = t >>> 0, e || J(t, 2, this.length);
|
|
2972
|
+
var l = this[t] | this[t + 1] << 8;
|
|
2973
|
+
return l & 32768 ? l | 4294901760 : l;
|
|
2968
2974
|
}, a.prototype.readInt16BE = function(t, e) {
|
|
2969
|
-
t = t >>> 0, e ||
|
|
2970
|
-
var
|
|
2971
|
-
return
|
|
2975
|
+
t = t >>> 0, e || J(t, 2, this.length);
|
|
2976
|
+
var l = this[t + 1] | this[t] << 8;
|
|
2977
|
+
return l & 32768 ? l | 4294901760 : l;
|
|
2972
2978
|
}, a.prototype.readInt32LE = function(t, e) {
|
|
2973
|
-
return t = t >>> 0, e ||
|
|
2979
|
+
return t = t >>> 0, e || J(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
|
|
2974
2980
|
}, a.prototype.readInt32BE = function(t, e) {
|
|
2975
|
-
return t = t >>> 0, e ||
|
|
2981
|
+
return t = t >>> 0, e || J(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
|
|
2976
2982
|
}, a.prototype.readFloatLE = function(t, e) {
|
|
2977
|
-
return t = t >>> 0, e ||
|
|
2983
|
+
return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !0, 23, 4);
|
|
2978
2984
|
}, a.prototype.readFloatBE = function(t, e) {
|
|
2979
|
-
return t = t >>> 0, e ||
|
|
2985
|
+
return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !1, 23, 4);
|
|
2980
2986
|
}, a.prototype.readDoubleLE = function(t, e) {
|
|
2981
|
-
return t = t >>> 0, e ||
|
|
2987
|
+
return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !0, 52, 8);
|
|
2982
2988
|
}, a.prototype.readDoubleBE = function(t, e) {
|
|
2983
|
-
return t = t >>> 0, e ||
|
|
2989
|
+
return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !1, 52, 8);
|
|
2984
2990
|
};
|
|
2985
|
-
function q(o, t, e,
|
|
2991
|
+
function q(o, t, e, l, y, P) {
|
|
2986
2992
|
if (!a.isBuffer(o))
|
|
2987
2993
|
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
2988
2994
|
if (t > y || t < P)
|
|
2989
2995
|
throw new RangeError('"value" argument is out of bounds');
|
|
2990
|
-
if (e +
|
|
2996
|
+
if (e + l > o.length)
|
|
2991
2997
|
throw new RangeError("Index out of range");
|
|
2992
2998
|
}
|
|
2993
|
-
a.prototype.writeUIntLE = function(t, e,
|
|
2994
|
-
if (t = +t, e = e >>> 0,
|
|
2995
|
-
var P = Math.pow(2, 8 *
|
|
2996
|
-
q(this, t, e,
|
|
2999
|
+
a.prototype.writeUIntLE = function(t, e, l, y) {
|
|
3000
|
+
if (t = +t, e = e >>> 0, l = l >>> 0, !y) {
|
|
3001
|
+
var P = Math.pow(2, 8 * l) - 1;
|
|
3002
|
+
q(this, t, e, l, P, 0);
|
|
2997
3003
|
}
|
|
2998
|
-
var
|
|
2999
|
-
for (this[e] = t & 255; ++H <
|
|
3000
|
-
this[e + H] = t /
|
|
3001
|
-
return e +
|
|
3002
|
-
}, a.prototype.writeUIntBE = function(t, e,
|
|
3003
|
-
if (t = +t, e = e >>> 0,
|
|
3004
|
-
var P = Math.pow(2, 8 *
|
|
3005
|
-
q(this, t, e,
|
|
3004
|
+
var S = 1, H = 0;
|
|
3005
|
+
for (this[e] = t & 255; ++H < l && (S *= 256); )
|
|
3006
|
+
this[e + H] = t / S & 255;
|
|
3007
|
+
return e + l;
|
|
3008
|
+
}, a.prototype.writeUIntBE = function(t, e, l, y) {
|
|
3009
|
+
if (t = +t, e = e >>> 0, l = l >>> 0, !y) {
|
|
3010
|
+
var P = Math.pow(2, 8 * l) - 1;
|
|
3011
|
+
q(this, t, e, l, P, 0);
|
|
3006
3012
|
}
|
|
3007
|
-
var
|
|
3008
|
-
for (this[e +
|
|
3009
|
-
this[e +
|
|
3010
|
-
return e +
|
|
3011
|
-
}, a.prototype.writeUInt8 = function(t, e,
|
|
3012
|
-
return t = +t, e = e >>> 0,
|
|
3013
|
-
}, a.prototype.writeUInt16LE = function(t, e,
|
|
3014
|
-
return t = +t, e = e >>> 0,
|
|
3015
|
-
}, a.prototype.writeUInt16BE = function(t, e,
|
|
3016
|
-
return t = +t, e = e >>> 0,
|
|
3017
|
-
}, a.prototype.writeUInt32LE = function(t, e,
|
|
3018
|
-
return t = +t, e = e >>> 0,
|
|
3019
|
-
}, a.prototype.writeUInt32BE = function(t, e,
|
|
3020
|
-
return t = +t, e = e >>> 0,
|
|
3021
|
-
}, a.prototype.writeIntLE = function(t, e,
|
|
3013
|
+
var S = l - 1, H = 1;
|
|
3014
|
+
for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
|
|
3015
|
+
this[e + S] = t / H & 255;
|
|
3016
|
+
return e + l;
|
|
3017
|
+
}, a.prototype.writeUInt8 = function(t, e, l) {
|
|
3018
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
|
|
3019
|
+
}, a.prototype.writeUInt16LE = function(t, e, l) {
|
|
3020
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
|
|
3021
|
+
}, a.prototype.writeUInt16BE = function(t, e, l) {
|
|
3022
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
|
|
3023
|
+
}, a.prototype.writeUInt32LE = function(t, e, l) {
|
|
3024
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
|
|
3025
|
+
}, a.prototype.writeUInt32BE = function(t, e, l) {
|
|
3026
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
|
|
3027
|
+
}, a.prototype.writeIntLE = function(t, e, l, y) {
|
|
3022
3028
|
if (t = +t, e = e >>> 0, !y) {
|
|
3023
|
-
var P = Math.pow(2, 8 *
|
|
3024
|
-
q(this, t, e,
|
|
3029
|
+
var P = Math.pow(2, 8 * l - 1);
|
|
3030
|
+
q(this, t, e, l, P - 1, -P);
|
|
3025
3031
|
}
|
|
3026
|
-
var
|
|
3027
|
-
for (this[e] = t & 255; ++
|
|
3028
|
-
t < 0 && G === 0 && this[e +
|
|
3029
|
-
return e +
|
|
3030
|
-
}, a.prototype.writeIntBE = function(t, e,
|
|
3032
|
+
var S = 0, H = 1, G = 0;
|
|
3033
|
+
for (this[e] = t & 255; ++S < l && (H *= 256); )
|
|
3034
|
+
t < 0 && G === 0 && this[e + S - 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
|
|
3035
|
+
return e + l;
|
|
3036
|
+
}, a.prototype.writeIntBE = function(t, e, l, y) {
|
|
3031
3037
|
if (t = +t, e = e >>> 0, !y) {
|
|
3032
|
-
var P = Math.pow(2, 8 *
|
|
3033
|
-
q(this, t, e,
|
|
3038
|
+
var P = Math.pow(2, 8 * l - 1);
|
|
3039
|
+
q(this, t, e, l, P - 1, -P);
|
|
3034
3040
|
}
|
|
3035
|
-
var
|
|
3036
|
-
for (this[e +
|
|
3037
|
-
t < 0 && G === 0 && this[e +
|
|
3038
|
-
return e +
|
|
3039
|
-
}, a.prototype.writeInt8 = function(t, e,
|
|
3040
|
-
return t = +t, e = e >>> 0,
|
|
3041
|
-
}, a.prototype.writeInt16LE = function(t, e,
|
|
3042
|
-
return t = +t, e = e >>> 0,
|
|
3043
|
-
}, a.prototype.writeInt16BE = function(t, e,
|
|
3044
|
-
return t = +t, e = e >>> 0,
|
|
3045
|
-
}, a.prototype.writeInt32LE = function(t, e,
|
|
3046
|
-
return t = +t, e = e >>> 0,
|
|
3047
|
-
}, a.prototype.writeInt32BE = function(t, e,
|
|
3048
|
-
return t = +t, e = e >>> 0,
|
|
3041
|
+
var S = l - 1, H = 1, G = 0;
|
|
3042
|
+
for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
|
|
3043
|
+
t < 0 && G === 0 && this[e + S + 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
|
|
3044
|
+
return e + l;
|
|
3045
|
+
}, a.prototype.writeInt8 = function(t, e, l) {
|
|
3046
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
|
|
3047
|
+
}, a.prototype.writeInt16LE = function(t, e, l) {
|
|
3048
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
|
|
3049
|
+
}, a.prototype.writeInt16BE = function(t, e, l) {
|
|
3050
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
|
|
3051
|
+
}, a.prototype.writeInt32LE = function(t, e, l) {
|
|
3052
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
|
|
3053
|
+
}, a.prototype.writeInt32BE = function(t, e, l) {
|
|
3054
|
+
return t = +t, e = e >>> 0, l || q(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
|
|
3049
3055
|
};
|
|
3050
|
-
function at(o, t, e,
|
|
3051
|
-
if (e +
|
|
3056
|
+
function at(o, t, e, l, y, P) {
|
|
3057
|
+
if (e + l > o.length)
|
|
3052
3058
|
throw new RangeError("Index out of range");
|
|
3053
3059
|
if (e < 0)
|
|
3054
3060
|
throw new RangeError("Index out of range");
|
|
3055
3061
|
}
|
|
3056
|
-
function it(o, t, e,
|
|
3057
|
-
return t = +t, e = e >>> 0, y || at(o, t, e, 4), d.write(o, t, e,
|
|
3062
|
+
function it(o, t, e, l, y) {
|
|
3063
|
+
return t = +t, e = e >>> 0, y || at(o, t, e, 4), d.write(o, t, e, l, 23, 4), e + 4;
|
|
3058
3064
|
}
|
|
3059
|
-
a.prototype.writeFloatLE = function(t, e,
|
|
3060
|
-
return it(this, t, e, !0,
|
|
3061
|
-
}, a.prototype.writeFloatBE = function(t, e,
|
|
3062
|
-
return it(this, t, e, !1,
|
|
3065
|
+
a.prototype.writeFloatLE = function(t, e, l) {
|
|
3066
|
+
return it(this, t, e, !0, l);
|
|
3067
|
+
}, a.prototype.writeFloatBE = function(t, e, l) {
|
|
3068
|
+
return it(this, t, e, !1, l);
|
|
3063
3069
|
};
|
|
3064
|
-
function st(o, t, e,
|
|
3065
|
-
return t = +t, e = e >>> 0, y || at(o, t, e, 8), d.write(o, t, e,
|
|
3066
|
-
}
|
|
3067
|
-
a.prototype.writeDoubleLE = function(t, e,
|
|
3068
|
-
return st(this, t, e, !0,
|
|
3069
|
-
}, a.prototype.writeDoubleBE = function(t, e,
|
|
3070
|
-
return st(this, t, e, !1,
|
|
3071
|
-
}, a.prototype.copy = function(t, e,
|
|
3070
|
+
function st(o, t, e, l, y) {
|
|
3071
|
+
return t = +t, e = e >>> 0, y || at(o, t, e, 8), d.write(o, t, e, l, 52, 8), e + 8;
|
|
3072
|
+
}
|
|
3073
|
+
a.prototype.writeDoubleLE = function(t, e, l) {
|
|
3074
|
+
return st(this, t, e, !0, l);
|
|
3075
|
+
}, a.prototype.writeDoubleBE = function(t, e, l) {
|
|
3076
|
+
return st(this, t, e, !1, l);
|
|
3077
|
+
}, a.prototype.copy = function(t, e, l, y) {
|
|
3072
3078
|
if (!a.isBuffer(t))
|
|
3073
3079
|
throw new TypeError("argument should be a Buffer");
|
|
3074
|
-
if (
|
|
3080
|
+
if (l || (l = 0), !y && y !== 0 && (y = this.length), e >= t.length && (e = t.length), e || (e = 0), y > 0 && y < l && (y = l), y === l || t.length === 0 || this.length === 0)
|
|
3075
3081
|
return 0;
|
|
3076
3082
|
if (e < 0)
|
|
3077
3083
|
throw new RangeError("targetStart out of bounds");
|
|
3078
|
-
if (
|
|
3084
|
+
if (l < 0 || l >= this.length)
|
|
3079
3085
|
throw new RangeError("Index out of range");
|
|
3080
3086
|
if (y < 0)
|
|
3081
3087
|
throw new RangeError("sourceEnd out of bounds");
|
|
3082
|
-
y > this.length && (y = this.length), t.length - e < y -
|
|
3083
|
-
var P = y -
|
|
3088
|
+
y > this.length && (y = this.length), t.length - e < y - l && (y = t.length - e + l);
|
|
3089
|
+
var P = y - l;
|
|
3084
3090
|
if (this === t && typeof Uint8Array.prototype.copyWithin == "function")
|
|
3085
|
-
this.copyWithin(e,
|
|
3086
|
-
else if (this === t &&
|
|
3087
|
-
for (var
|
|
3088
|
-
t[
|
|
3091
|
+
this.copyWithin(e, l, y);
|
|
3092
|
+
else if (this === t && l < e && e < y)
|
|
3093
|
+
for (var S = P - 1; S >= 0; --S)
|
|
3094
|
+
t[S + e] = this[S + l];
|
|
3089
3095
|
else
|
|
3090
3096
|
Uint8Array.prototype.set.call(
|
|
3091
3097
|
t,
|
|
3092
|
-
this.subarray(
|
|
3098
|
+
this.subarray(l, y),
|
|
3093
3099
|
e
|
|
3094
3100
|
);
|
|
3095
3101
|
return P;
|
|
3096
|
-
}, a.prototype.fill = function(t, e,
|
|
3102
|
+
}, a.prototype.fill = function(t, e, l, y) {
|
|
3097
3103
|
if (typeof t == "string") {
|
|
3098
|
-
if (typeof e == "string" ? (y = e, e = 0,
|
|
3104
|
+
if (typeof e == "string" ? (y = e, e = 0, l = this.length) : typeof l == "string" && (y = l, l = this.length), y !== void 0 && typeof y != "string")
|
|
3099
3105
|
throw new TypeError("encoding must be a string");
|
|
3100
3106
|
if (typeof y == "string" && !a.isEncoding(y))
|
|
3101
3107
|
throw new TypeError("Unknown encoding: " + y);
|
|
@@ -3105,21 +3111,21 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3105
3111
|
}
|
|
3106
3112
|
} else
|
|
3107
3113
|
typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
|
|
3108
|
-
if (e < 0 || this.length < e || this.length <
|
|
3114
|
+
if (e < 0 || this.length < e || this.length < l)
|
|
3109
3115
|
throw new RangeError("Out of range index");
|
|
3110
|
-
if (
|
|
3116
|
+
if (l <= e)
|
|
3111
3117
|
return this;
|
|
3112
|
-
e = e >>> 0,
|
|
3113
|
-
var
|
|
3118
|
+
e = e >>> 0, l = l === void 0 ? this.length : l >>> 0, t || (t = 0);
|
|
3119
|
+
var S;
|
|
3114
3120
|
if (typeof t == "number")
|
|
3115
|
-
for (
|
|
3116
|
-
this[
|
|
3121
|
+
for (S = e; S < l; ++S)
|
|
3122
|
+
this[S] = t;
|
|
3117
3123
|
else {
|
|
3118
3124
|
var H = a.isBuffer(t) ? t : a.from(t, y), G = H.length;
|
|
3119
3125
|
if (G === 0)
|
|
3120
3126
|
throw new TypeError('The value "' + t + '" is invalid for argument "value"');
|
|
3121
|
-
for (
|
|
3122
|
-
this[
|
|
3127
|
+
for (S = 0; S < l - e; ++S)
|
|
3128
|
+
this[S + e] = H[S % G];
|
|
3123
3129
|
}
|
|
3124
3130
|
return this;
|
|
3125
3131
|
};
|
|
@@ -3133,13 +3139,13 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3133
3139
|
}
|
|
3134
3140
|
function rt(o, t) {
|
|
3135
3141
|
t = t || 1 / 0;
|
|
3136
|
-
for (var e,
|
|
3137
|
-
if (e = o.charCodeAt(
|
|
3142
|
+
for (var e, l = o.length, y = null, P = [], S = 0; S < l; ++S) {
|
|
3143
|
+
if (e = o.charCodeAt(S), e > 55295 && e < 57344) {
|
|
3138
3144
|
if (!y) {
|
|
3139
3145
|
if (e > 56319) {
|
|
3140
3146
|
(t -= 3) > -1 && P.push(239, 191, 189);
|
|
3141
3147
|
continue;
|
|
3142
|
-
} else if (
|
|
3148
|
+
} else if (S + 1 === l) {
|
|
3143
3149
|
(t -= 3) > -1 && P.push(239, 191, 189);
|
|
3144
3150
|
continue;
|
|
3145
3151
|
}
|
|
@@ -3186,21 +3192,21 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3186
3192
|
}
|
|
3187
3193
|
return P;
|
|
3188
3194
|
}
|
|
3189
|
-
function
|
|
3195
|
+
function lt(o) {
|
|
3190
3196
|
for (var t = [], e = 0; e < o.length; ++e)
|
|
3191
3197
|
t.push(o.charCodeAt(e) & 255);
|
|
3192
3198
|
return t;
|
|
3193
3199
|
}
|
|
3194
|
-
function
|
|
3195
|
-
for (var e,
|
|
3196
|
-
e = o.charCodeAt(
|
|
3200
|
+
function ct(o, t) {
|
|
3201
|
+
for (var e, l, y, P = [], S = 0; S < o.length && !((t -= 2) < 0); ++S)
|
|
3202
|
+
e = o.charCodeAt(S), l = e >> 8, y = e % 256, P.push(y), P.push(l);
|
|
3197
3203
|
return P;
|
|
3198
3204
|
}
|
|
3199
3205
|
function ht(o) {
|
|
3200
|
-
return
|
|
3206
|
+
return h.toByteArray(vt(o));
|
|
3201
3207
|
}
|
|
3202
|
-
function tt(o, t, e,
|
|
3203
|
-
for (var y = 0; y <
|
|
3208
|
+
function tt(o, t, e, l) {
|
|
3209
|
+
for (var y = 0; y < l && !(y + e >= t.length || y >= o.length); ++y)
|
|
3204
3210
|
t[y + e] = o[y];
|
|
3205
3211
|
return y;
|
|
3206
3212
|
}
|
|
@@ -3210,25 +3216,25 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3210
3216
|
function yt(o) {
|
|
3211
3217
|
return o !== o;
|
|
3212
3218
|
}
|
|
3213
|
-
var
|
|
3219
|
+
var kt = function() {
|
|
3214
3220
|
for (var o = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
|
|
3215
|
-
for (var
|
|
3216
|
-
t[
|
|
3221
|
+
for (var l = e * 16, y = 0; y < 16; ++y)
|
|
3222
|
+
t[l + y] = o[e] + o[y];
|
|
3217
3223
|
return t;
|
|
3218
3224
|
}();
|
|
3219
|
-
}, { "base64-js": 29, ieee754: 32 }], 31: [function(n, g,
|
|
3220
|
-
var
|
|
3225
|
+
}, { "base64-js": 29, ieee754: 32 }], 31: [function(n, g, u) {
|
|
3226
|
+
var h = {
|
|
3221
3227
|
single_source_shortest_paths: function(d, c, i) {
|
|
3222
|
-
var s = {},
|
|
3223
|
-
|
|
3224
|
-
var a =
|
|
3228
|
+
var s = {}, f = {};
|
|
3229
|
+
f[c] = 0;
|
|
3230
|
+
var a = h.PriorityQueue.make();
|
|
3225
3231
|
a.push(c, 0);
|
|
3226
|
-
for (var w, x, b,
|
|
3227
|
-
w = a.pop(), x = w.value,
|
|
3232
|
+
for (var w, x, b, A, F, M, C, B, I; !a.empty(); ) {
|
|
3233
|
+
w = a.pop(), x = w.value, A = w.cost, F = d[x] || {};
|
|
3228
3234
|
for (b in F)
|
|
3229
|
-
F.hasOwnProperty(b) && (M = F[b], C =
|
|
3235
|
+
F.hasOwnProperty(b) && (M = F[b], C = A + M, B = f[b], I = typeof f[b] > "u", (I || B > C) && (f[b] = C, a.push(b, C), s[b] = x));
|
|
3230
3236
|
}
|
|
3231
|
-
if (typeof i < "u" && typeof
|
|
3237
|
+
if (typeof i < "u" && typeof f[i] > "u") {
|
|
3232
3238
|
var k = ["Could not find a path from ", c, " to ", i, "."].join("");
|
|
3233
3239
|
throw new Error(k);
|
|
3234
3240
|
}
|
|
@@ -3240,8 +3246,8 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3240
3246
|
return i.reverse(), i;
|
|
3241
3247
|
},
|
|
3242
3248
|
find_path: function(d, c, i) {
|
|
3243
|
-
var s =
|
|
3244
|
-
return
|
|
3249
|
+
var s = h.single_source_shortest_paths(d, c, i);
|
|
3250
|
+
return h.extract_shortest_path_from_predecessor_list(
|
|
3245
3251
|
s,
|
|
3246
3252
|
i
|
|
3247
3253
|
);
|
|
@@ -3251,7 +3257,7 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3251
3257
|
*/
|
|
3252
3258
|
PriorityQueue: {
|
|
3253
3259
|
make: function(d) {
|
|
3254
|
-
var c =
|
|
3260
|
+
var c = h.PriorityQueue, i = {}, s;
|
|
3255
3261
|
d = d || {};
|
|
3256
3262
|
for (s in c)
|
|
3257
3263
|
c.hasOwnProperty(s) && (i[s] = c[s]);
|
|
@@ -3279,38 +3285,38 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3279
3285
|
}
|
|
3280
3286
|
}
|
|
3281
3287
|
};
|
|
3282
|
-
typeof g < "u" && (g.exports =
|
|
3283
|
-
}, {}], 32: [function(n, g,
|
|
3284
|
-
|
|
3285
|
-
var
|
|
3286
|
-
for (F += M,
|
|
3288
|
+
typeof g < "u" && (g.exports = h);
|
|
3289
|
+
}, {}], 32: [function(n, g, u) {
|
|
3290
|
+
u.read = function(h, d, c, i, s) {
|
|
3291
|
+
var f, a, w = s * 8 - i - 1, x = (1 << w) - 1, b = x >> 1, A = -7, F = c ? s - 1 : 0, M = c ? -1 : 1, C = h[d + F];
|
|
3292
|
+
for (F += M, f = C & (1 << -A) - 1, C >>= -A, A += w; A > 0; f = f * 256 + h[d + F], F += M, A -= 8)
|
|
3287
3293
|
;
|
|
3288
|
-
for (a =
|
|
3294
|
+
for (a = f & (1 << -A) - 1, f >>= -A, A += i; A > 0; a = a * 256 + h[d + F], F += M, A -= 8)
|
|
3289
3295
|
;
|
|
3290
|
-
if (
|
|
3291
|
-
|
|
3296
|
+
if (f === 0)
|
|
3297
|
+
f = 1 - b;
|
|
3292
3298
|
else {
|
|
3293
|
-
if (
|
|
3299
|
+
if (f === x)
|
|
3294
3300
|
return a ? NaN : (C ? -1 : 1) * (1 / 0);
|
|
3295
|
-
a = a + Math.pow(2, i),
|
|
3301
|
+
a = a + Math.pow(2, i), f = f - b;
|
|
3296
3302
|
}
|
|
3297
|
-
return (C ? -1 : 1) * a * Math.pow(2,
|
|
3298
|
-
},
|
|
3299
|
-
var a, w, x, b =
|
|
3300
|
-
for (d = Math.abs(d), isNaN(d) || d === 1 / 0 ? (w = isNaN(d) ? 1 : 0, a =
|
|
3303
|
+
return (C ? -1 : 1) * a * Math.pow(2, f - i);
|
|
3304
|
+
}, u.write = function(h, d, c, i, s, f) {
|
|
3305
|
+
var a, w, x, b = f * 8 - s - 1, A = (1 << b) - 1, F = A >> 1, M = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, C = i ? 0 : f - 1, B = i ? 1 : -1, I = d < 0 || d === 0 && 1 / d < 0 ? 1 : 0;
|
|
3306
|
+
for (d = Math.abs(d), isNaN(d) || d === 1 / 0 ? (w = isNaN(d) ? 1 : 0, a = A) : (a = Math.floor(Math.log(d) / Math.LN2), d * (x = Math.pow(2, -a)) < 1 && (a--, x *= 2), a + F >= 1 ? d += M / x : d += M * Math.pow(2, 1 - F), d * x >= 2 && (a++, x /= 2), a + F >= A ? (w = 0, a = A) : a + F >= 1 ? (w = (d * x - 1) * Math.pow(2, s), a = a + F) : (w = d * Math.pow(2, F - 1) * Math.pow(2, s), a = 0)); s >= 8; h[c + C] = w & 255, C += B, w /= 256, s -= 8)
|
|
3301
3307
|
;
|
|
3302
|
-
for (a = a << s | w, b += s; b > 0;
|
|
3308
|
+
for (a = a << s | w, b += s; b > 0; h[c + C] = a & 255, C += B, a /= 256, b -= 8)
|
|
3303
3309
|
;
|
|
3304
|
-
|
|
3310
|
+
h[c + C - B] |= I * 128;
|
|
3305
3311
|
};
|
|
3306
|
-
}, {}], 33: [function(n, g,
|
|
3307
|
-
var
|
|
3312
|
+
}, {}], 33: [function(n, g, u) {
|
|
3313
|
+
var h = {}.toString;
|
|
3308
3314
|
g.exports = Array.isArray || function(d) {
|
|
3309
|
-
return
|
|
3315
|
+
return h.call(d) == "[object Array]";
|
|
3310
3316
|
};
|
|
3311
3317
|
}, {}] }, {}, [24])(24);
|
|
3312
3318
|
});
|
|
3313
|
-
}),
|
|
3319
|
+
}), ce = {
|
|
3314
3320
|
name: "qrcode",
|
|
3315
3321
|
props: {
|
|
3316
3322
|
/**
|
|
@@ -3350,17 +3356,17 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3350
3356
|
* Generate QR code.
|
|
3351
3357
|
*/
|
|
3352
3358
|
generate: function() {
|
|
3353
|
-
var r = this, n = this.options, g = this.tag,
|
|
3354
|
-
g === "canvas" ? xt.toCanvas(this.$el,
|
|
3355
|
-
if (
|
|
3356
|
-
throw
|
|
3357
|
-
}) : g === "img" ? xt.toDataURL(
|
|
3358
|
-
if (
|
|
3359
|
-
throw
|
|
3359
|
+
var r = this, n = this.options, g = this.tag, u = String(this.value);
|
|
3360
|
+
g === "canvas" ? xt.toCanvas(this.$el, u, n, function(h) {
|
|
3361
|
+
if (h)
|
|
3362
|
+
throw h;
|
|
3363
|
+
}) : g === "img" ? xt.toDataURL(u, n, function(h, d) {
|
|
3364
|
+
if (h)
|
|
3365
|
+
throw h;
|
|
3360
3366
|
r.$el.src = d;
|
|
3361
|
-
}) : xt.toString(
|
|
3362
|
-
if (
|
|
3363
|
-
throw
|
|
3367
|
+
}) : xt.toString(u, n, function(h, d) {
|
|
3368
|
+
if (h)
|
|
3369
|
+
throw h;
|
|
3364
3370
|
r.$el.innerHTML = d;
|
|
3365
3371
|
});
|
|
3366
3372
|
}
|
|
@@ -3369,22 +3375,90 @@ Minimum version required to store current data is: ` + Y + `.
|
|
|
3369
3375
|
this.generate();
|
|
3370
3376
|
}
|
|
3371
3377
|
};
|
|
3372
|
-
|
|
3378
|
+
class he {
|
|
3379
|
+
constructor() {
|
|
3380
|
+
this._activePolls = {}, this._pollingInterval = 1e3;
|
|
3381
|
+
}
|
|
3382
|
+
_startPolling(r) {
|
|
3383
|
+
const { handler: n, interval: g } = this._activePolls[r], u = async () => {
|
|
3384
|
+
var h;
|
|
3385
|
+
await n(), (h = this._activePolls[r]) != null && h.pollActive && setTimeout(u, g || this._pollingInterval);
|
|
3386
|
+
};
|
|
3387
|
+
u();
|
|
3388
|
+
}
|
|
3389
|
+
/**
|
|
3390
|
+
* Add a new poll to the active polls list.
|
|
3391
|
+
* @param {string} options.id - Unique identifier for the poll.
|
|
3392
|
+
* @param {function} options.handler - Function to be executed when the poll is activated.
|
|
3393
|
+
* @param {number} options.interval - Time interval in milliseconds at which the poll should run.
|
|
3394
|
+
* @param {number} [options.removeAfterMs=0] - Optional. Time in milliseconds after which the poll should be automatically removed.
|
|
3395
|
+
* @param {boolean} [options.startImmediately=true] - Optional. If true, the poll will start immediately after being added.
|
|
3396
|
+
* @param {*} [options.data] - Optional. Additional data associated with the poll.
|
|
3397
|
+
* @returns {function} - A function that can be used to manually remove the poll from the active polls list.
|
|
3398
|
+
*/
|
|
3399
|
+
addPoll({
|
|
3400
|
+
id: r,
|
|
3401
|
+
handler: n,
|
|
3402
|
+
interval: g,
|
|
3403
|
+
removeAfterMs: u = 0,
|
|
3404
|
+
startImmediately: h = !0,
|
|
3405
|
+
data: d
|
|
3406
|
+
}) {
|
|
3407
|
+
if (!r || typeof n != "function")
|
|
3408
|
+
throw new Error("Invalid poll definition");
|
|
3409
|
+
if (this._activePolls[r])
|
|
3410
|
+
throw new Error("Poll with the same ID already exists");
|
|
3411
|
+
return this._activePolls[r] = { handler: n, interval: g, pollActive: !1, data: d }, h && setTimeout(() => {
|
|
3412
|
+
this.activatePoll(r);
|
|
3413
|
+
}, 0), u && setTimeout(() => {
|
|
3414
|
+
this._activePolls[r] && this.removePoll(r);
|
|
3415
|
+
}, u), () => this.removePoll(r);
|
|
3416
|
+
}
|
|
3417
|
+
activatePoll(r) {
|
|
3418
|
+
if (!this._activePolls[r])
|
|
3419
|
+
throw new Error("Poll not found");
|
|
3420
|
+
this._activePolls[r].pollActive || (this._activePolls[r].pollActive = !0, this._startPolling(r));
|
|
3421
|
+
}
|
|
3422
|
+
deactivatePoll(r) {
|
|
3423
|
+
if (!this._activePolls[r]) {
|
|
3424
|
+
console.warn("[deactivatePoll] Poll not found");
|
|
3425
|
+
return;
|
|
3426
|
+
}
|
|
3427
|
+
this._activePolls[r].pollActive = !1;
|
|
3428
|
+
}
|
|
3429
|
+
removePoll(r) {
|
|
3430
|
+
if (!this._activePolls[r]) {
|
|
3431
|
+
console.warn("[removePoll] Poll not found");
|
|
3432
|
+
return;
|
|
3433
|
+
}
|
|
3434
|
+
delete this._activePolls[r];
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
let _t = null;
|
|
3438
|
+
function Ft() {
|
|
3439
|
+
return _t || (_t = new he()), _t;
|
|
3440
|
+
}
|
|
3441
|
+
function fe(v) {
|
|
3373
3442
|
window.history.replaceState({}, "", window.location.href);
|
|
3374
3443
|
let r = "";
|
|
3375
3444
|
const n = (navigator == null ? void 0 : navigator.userAgent) || "";
|
|
3376
|
-
return n.match("CriOS") ? r = "googlechromes://" : n.match("FxiOS") ? r = "firefox://" : n.match("GSA") && (r = "googleapp://open-url?url="), r + encodeURIComponent(`${window.location.href}#${
|
|
3445
|
+
return n.match("CriOS") ? r = "googlechromes://" : n.match("FxiOS") ? r = "firefox://" : n.match("GSA") && (r = "googleapp://open-url?url="), r + encodeURIComponent(`${window.location.href}#${v}`);
|
|
3377
3446
|
}
|
|
3378
|
-
const
|
|
3447
|
+
const de = {
|
|
3379
3448
|
name: "BankIdAnswer",
|
|
3380
3449
|
components: {
|
|
3381
|
-
QrCode:
|
|
3450
|
+
QrCode: ce
|
|
3382
3451
|
},
|
|
3383
3452
|
mixins: [ft([])],
|
|
3453
|
+
props: {
|
|
3454
|
+
onCompleteFunc: {
|
|
3455
|
+
type: Function,
|
|
3456
|
+
default: null
|
|
3457
|
+
}
|
|
3458
|
+
},
|
|
3384
3459
|
data() {
|
|
3385
3460
|
return {
|
|
3386
3461
|
signAnswerId: null,
|
|
3387
|
-
signInterval: null,
|
|
3388
3462
|
view: "form",
|
|
3389
3463
|
errorMessage: "",
|
|
3390
3464
|
isLoading: !1,
|
|
@@ -3395,61 +3469,74 @@ const ce = {
|
|
|
3395
3469
|
},
|
|
3396
3470
|
computed: {
|
|
3397
3471
|
viewText() {
|
|
3398
|
-
const
|
|
3472
|
+
const v = (r) => this._document.$t(`answerModal.bankId.component.viewText.${r}`);
|
|
3399
3473
|
return {
|
|
3400
3474
|
new: {
|
|
3401
|
-
title:
|
|
3402
|
-
text:
|
|
3403
|
-
spinnerText:
|
|
3475
|
+
title: v("new.title"),
|
|
3476
|
+
text: v("new.text"),
|
|
3477
|
+
spinnerText: v("new.spinnerText")
|
|
3404
3478
|
},
|
|
3405
3479
|
waiting: {
|
|
3406
|
-
title:
|
|
3407
|
-
text:
|
|
3408
|
-
spinnerText:
|
|
3480
|
+
title: v("waiting.title"),
|
|
3481
|
+
text: v("waiting.text"),
|
|
3482
|
+
spinnerText: v("waiting.spinnerText")
|
|
3409
3483
|
},
|
|
3410
3484
|
started: {
|
|
3411
|
-
title:
|
|
3412
|
-
text:
|
|
3413
|
-
spinnerText:
|
|
3485
|
+
title: v("waiting.title"),
|
|
3486
|
+
text: v("waiting.text"),
|
|
3487
|
+
spinnerText: v("waiting.spinnerText")
|
|
3414
3488
|
},
|
|
3415
3489
|
signing: {
|
|
3416
|
-
title:
|
|
3417
|
-
text:
|
|
3418
|
-
spinnerText:
|
|
3490
|
+
title: v("signing.title"),
|
|
3491
|
+
text: v("signing.text"),
|
|
3492
|
+
spinnerText: v("signing.spinnerText")
|
|
3419
3493
|
},
|
|
3420
3494
|
error: {
|
|
3421
|
-
title:
|
|
3422
|
-
text:
|
|
3495
|
+
title: v("error.title"),
|
|
3496
|
+
text: v("error.text")
|
|
3423
3497
|
},
|
|
3424
3498
|
canceled: {
|
|
3425
|
-
title:
|
|
3426
|
-
text:
|
|
3499
|
+
title: v("canceled.title"),
|
|
3500
|
+
text: v("canceled.text")
|
|
3427
3501
|
}
|
|
3428
3502
|
};
|
|
3429
3503
|
}
|
|
3430
3504
|
},
|
|
3431
3505
|
watch: {
|
|
3432
|
-
isLoading(
|
|
3433
|
-
this.$emit("loading",
|
|
3434
|
-
},
|
|
3435
|
-
$route: {
|
|
3436
|
-
immediate: !0,
|
|
3437
|
-
handler(m) {
|
|
3438
|
-
m != null && m.hash && this.resumePolling(m.hash.slice(1));
|
|
3439
|
-
}
|
|
3506
|
+
isLoading(v) {
|
|
3507
|
+
this.$emit("loading", v);
|
|
3440
3508
|
}
|
|
3441
3509
|
},
|
|
3442
3510
|
created() {
|
|
3443
|
-
this.isMobile =
|
|
3444
|
-
},
|
|
3445
|
-
beforeDestroy() {
|
|
3446
|
-
this.signInterval && this.stopPolling();
|
|
3511
|
+
this.isMobile = Mt(), this.tryResumeSigningSession();
|
|
3447
3512
|
},
|
|
3448
3513
|
methods: {
|
|
3449
|
-
|
|
3514
|
+
tryResumeSigningSession() {
|
|
3515
|
+
var n, g;
|
|
3516
|
+
const v = Ft(), r = Object.keys(v._activePolls).find(
|
|
3517
|
+
(u) => u.includes("bankId-")
|
|
3518
|
+
);
|
|
3519
|
+
try {
|
|
3520
|
+
if (r) {
|
|
3521
|
+
const { signAnswerId: u, autoStartToken: h, qrCode: d } = (n = v._activePolls[r]) == null ? void 0 : n.data;
|
|
3522
|
+
this.signAnswerId = u, this.autoStartToken = h, this.qrCode = d, v.removePoll(r), (g = window.location) != null && g.hash && window.history.replaceState(
|
|
3523
|
+
{},
|
|
3524
|
+
"",
|
|
3525
|
+
window.location.pathname
|
|
3526
|
+
// clears search + hash
|
|
3527
|
+
), this.isLoading = !0, this.startPolling();
|
|
3528
|
+
}
|
|
3529
|
+
} catch (u) {
|
|
3530
|
+
const h = this._document.$t(
|
|
3531
|
+
"answerModal.bankId.component.viewText.error.text"
|
|
3532
|
+
);
|
|
3533
|
+
Tt("error", h), console.error(u);
|
|
3534
|
+
}
|
|
3535
|
+
},
|
|
3536
|
+
async submit({ answer: v }) {
|
|
3450
3537
|
try {
|
|
3451
3538
|
this.isLoading = !0;
|
|
3452
|
-
const { id: r, autoStartToken: n, qrCodeData: g } = await
|
|
3539
|
+
const { id: r, autoStartToken: n, qrCodeData: g } = await v({
|
|
3453
3540
|
body: { isAccepted: !0 }
|
|
3454
3541
|
});
|
|
3455
3542
|
n && (this.autoStartToken = n), g && (this.qrCode = g), this.signAnswerId = r, this.startPolling(), this.isMobile && this.triggerAutoStart();
|
|
@@ -3458,38 +3545,58 @@ const ce = {
|
|
|
3458
3545
|
this.onError(r);
|
|
3459
3546
|
}
|
|
3460
3547
|
},
|
|
3461
|
-
async
|
|
3548
|
+
async startPolling() {
|
|
3462
3549
|
if (!this.signAnswerId)
|
|
3463
3550
|
throw Error("Missing signAnswerId");
|
|
3551
|
+
const v = Ft(), r = `bankId-${this.signAnswerId}`, n = async () => {
|
|
3552
|
+
if (!this.signAnswerId)
|
|
3553
|
+
throw Error("Missing signAnswerId");
|
|
3554
|
+
const g = () => {
|
|
3555
|
+
this.clearSignState(), v.removePoll(r);
|
|
3556
|
+
};
|
|
3557
|
+
try {
|
|
3558
|
+
const { data: u } = await $t.get(this.signAnswerId);
|
|
3559
|
+
u.qrCodeData && (this.qrCode = u.qrCodeData), ["completed", "canceled"].includes(u.status) && g(), u.status === "completed" ? this.onComplete() : u.status === "canceled" ? this.onCanceled() : this.view = u.status;
|
|
3560
|
+
} catch (u) {
|
|
3561
|
+
this.onError(u), g();
|
|
3562
|
+
}
|
|
3563
|
+
};
|
|
3464
3564
|
try {
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3565
|
+
v.addPoll({
|
|
3566
|
+
id: r,
|
|
3567
|
+
handler: n,
|
|
3568
|
+
interval: 1e3,
|
|
3569
|
+
data: {
|
|
3570
|
+
signAnswerId: this.signAnswerId,
|
|
3571
|
+
autoStartToken: this.autoStartToken,
|
|
3572
|
+
qrCode: this.qrCode
|
|
3573
|
+
}
|
|
3574
|
+
});
|
|
3575
|
+
} catch (g) {
|
|
3576
|
+
this.clearSignState();
|
|
3577
|
+
const u = this._document.$t(
|
|
3578
|
+
"answerModal.bankId.component.viewText.error.text"
|
|
3579
|
+
);
|
|
3580
|
+
Tt("error", u), console.error(g);
|
|
3469
3581
|
}
|
|
3470
3582
|
},
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
throw Error("Missing signAnswerId");
|
|
3474
|
-
this.signInterval = setInterval(this.requestStatus, 1e3);
|
|
3475
|
-
},
|
|
3476
|
-
stopPolling() {
|
|
3477
|
-
clearInterval(this.signInterval), this.autoStartToken = null, this.qrCode = null, this.isLoading = !1;
|
|
3583
|
+
clearSignState() {
|
|
3584
|
+
this.autoStartToken = null, this.qrCode = null, this.isLoading = !1;
|
|
3478
3585
|
},
|
|
3479
3586
|
onComplete() {
|
|
3480
|
-
this.
|
|
3587
|
+
typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
3481
3588
|
},
|
|
3482
3589
|
onCanceled() {
|
|
3483
|
-
this.
|
|
3590
|
+
this.view = "canceled", this.errorMessage = this._document.$t(
|
|
3484
3591
|
"answerModal.bankId.component.signingInterrupted"
|
|
3485
3592
|
);
|
|
3486
3593
|
},
|
|
3487
|
-
onError(
|
|
3594
|
+
onError(v) {
|
|
3488
3595
|
var n, g;
|
|
3489
|
-
if (
|
|
3490
|
-
throw
|
|
3596
|
+
if (v.httpStatusCode === 409)
|
|
3597
|
+
throw v;
|
|
3491
3598
|
this.$emit("error"), this.view = "error";
|
|
3492
|
-
const r = (g = (n =
|
|
3599
|
+
const r = (g = (n = v.response) == null ? void 0 : n.data) == null ? void 0 : g.errorCode;
|
|
3493
3600
|
switch (r) {
|
|
3494
3601
|
case 9001:
|
|
3495
3602
|
case 9002:
|
|
@@ -3498,99 +3605,100 @@ const ce = {
|
|
|
3498
3605
|
case 9005:
|
|
3499
3606
|
case 9006:
|
|
3500
3607
|
case 9007:
|
|
3501
|
-
|
|
3608
|
+
Rt.warn(v);
|
|
3502
3609
|
break;
|
|
3503
3610
|
case 9009:
|
|
3504
3611
|
this.$emit("complete");
|
|
3505
3612
|
break;
|
|
3506
3613
|
default:
|
|
3507
|
-
|
|
3614
|
+
Ct(v, { showMessage: !1 });
|
|
3508
3615
|
}
|
|
3509
3616
|
this.errorMessage = this.$i18n.te(`errors:${r}`) && this._document.$t(`answerModal.bankId.component.errors.${r}`) || this._document.$t("answerModal.bankId.component.defaultError");
|
|
3510
3617
|
},
|
|
3511
|
-
resumePolling(m) {
|
|
3512
|
-
this.view = "signing", this.signAnswerId = m, this.startPolling();
|
|
3513
|
-
const r = new URL(window.location.href);
|
|
3514
|
-
r.search = "", r.hash = "", window.history.replaceState({}, "", r.href);
|
|
3515
|
-
},
|
|
3516
3618
|
triggerAutoStart() {
|
|
3517
3619
|
if (!this.autoStartToken)
|
|
3518
3620
|
return;
|
|
3519
|
-
let
|
|
3621
|
+
let v = "bankid://", r = "null";
|
|
3520
3622
|
if (this.isMobile) {
|
|
3521
|
-
const g =
|
|
3522
|
-
(
|
|
3623
|
+
const g = Dt(), u = (navigator == null ? void 0 : navigator.userAgent) || (navigator == null ? void 0 : navigator.vendor) || (window == null ? void 0 : window.opera), h = g === "iOS" && (/Version\/[\d\.]+.*Safari/.test(u) || /GSA/.test(u)), d = g === "Android" && /Version\/[\d\.]+.*Chrome/.test(u);
|
|
3624
|
+
(h || d) && (v = "https://app.bankid.com"), g === "iOS" && this.$view !== "widget" && (r = fe(this.signAnswerId));
|
|
3523
3625
|
}
|
|
3524
|
-
const n = `${
|
|
3525
|
-
this.isMobile ? document.location = n :
|
|
3626
|
+
const n = `${v}/?autostarttoken=${this.autoStartToken}&redirect=${r}`;
|
|
3627
|
+
this.isMobile ? document.location = n : this.$refs.autoStartFrame.src = n;
|
|
3526
3628
|
}
|
|
3527
3629
|
}
|
|
3528
3630
|
};
|
|
3529
|
-
var
|
|
3631
|
+
var ge = function() {
|
|
3530
3632
|
var g;
|
|
3531
3633
|
var r = this, n = r._self._c;
|
|
3532
|
-
return n("div", { staticClass: "-my-4 flex flex-col items-center" }, [n("iframe", { staticClass: "hidden", attrs: {
|
|
3634
|
+
return n("div", { staticClass: "-my-4 flex flex-col items-center" }, [n("iframe", { ref: "autoStartFrame", staticClass: "hidden", attrs: { height: "0", width: "0" } }), ["form", "signing", "error", "canceled"].includes(r.view) ? n("div", { staticClass: "flex h-[250px] w-[250px] items-center justify-center rounded-xl bg-gray-100" }, [n("BaseIcon", { staticClass: "text-gray-500", attrs: { type: "bankId", size: "50" } })], 1) : r._e(), ["new", "waiting", "started"].includes(r.view) ? [r.qrCode ? n("QrCode", { attrs: { value: r.qrCode, options: {
|
|
3533
3635
|
width: 250,
|
|
3534
3636
|
errorCorrectionLevel: "L",
|
|
3535
3637
|
color: { dark: "#000000" }
|
|
3536
3638
|
} } }) : r._e()] : r._e(), n("Animation", { staticClass: "w-full" }, [n("div", { key: "a", staticClass: "min-h-[20px] pt-4 text-sm text-gray-500", domProps: { textContent: r._s((g = r.viewText[r.view]) == null ? void 0 : g.spinnerText) } }), !r.isMobile && ["new", "waiting", "started"].includes(r.view) ? n("CButton", { key: "b", staticClass: "mt-4", attrs: { type: "none", pattern: "secondary", size: "small" }, on: { click: r.triggerAutoStart } }, [r._v(" " + r._s(r._document.$t("answerModal.bankId.component.startOnThisDevice")) + " ")]) : r._e()], 1), ["form", "new", "waiting", "started"].includes(r.view) ? r._e() : n("div", [n("transition", { attrs: { name: "pop-in" } }, [n("div", { staticClass: "bankid-popup", on: { click: () => {
|
|
3537
3639
|
r.view = "form", r.isLoading = !1;
|
|
3538
|
-
} } }, [n("div", { staticClass: "flex flex-col items-center justify-center", staticStyle: { "background-color": "#183e4f", padding: "calc(2.5 * var(--rem)) calc(3 * var(--rem))" } }, [n("BaseIcon", { staticClass: "text-white", attrs: { type: "bankId", size: "34" } }), n("div", { staticClass: "pt-4 text-sm font-medium text-white opacity-75", domProps: { textContent: r._s(r.viewText[r.view].text) } })], 1), n("div", { staticClass: "flex w-full flex-col items-center justify-center text-center", staticStyle: { padding: "calc(3 * var(--rem)) calc(2 * var(--rem))" } }, [r.view === "signing" ? [n("div", { staticClass: "spinner" }), n("div", { staticClass: "pt-8 text-gray-500", domProps: { textContent: r._s(r.viewText[r.view].spinnerText) } })] : ["error", "canceled"].includes(r.view) ? [n("BaseIcon", { staticClass: "mb-2.5 text-gray-400", attrs: { type: "error", size: "22" } }), n("div", { staticStyle: { "font-size": "14px" }, domProps: { textContent: r._s(r.errorMessage) } }), n("CButton", { staticStyle: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" }, attrs: { loading: r.isLoading, type: "none", pattern: "secondary", size: "small" }, on: { click: function(
|
|
3640
|
+
} } }, [n("div", { staticClass: "flex flex-col items-center justify-center", staticStyle: { "background-color": "#183e4f", padding: "calc(2.5 * var(--rem)) calc(3 * var(--rem))" } }, [n("BaseIcon", { staticClass: "text-white", attrs: { type: "bankId", size: "34" } }), n("div", { staticClass: "pt-4 text-sm font-medium text-white opacity-75", domProps: { textContent: r._s(r.viewText[r.view].text) } })], 1), n("div", { staticClass: "flex w-full flex-col items-center justify-center text-center", staticStyle: { padding: "calc(3 * var(--rem)) calc(2 * var(--rem))" } }, [r.view === "signing" ? [n("div", { staticClass: "spinner" }), n("div", { staticClass: "pt-8 text-gray-500", domProps: { textContent: r._s(r.viewText[r.view].spinnerText) } })] : ["error", "canceled"].includes(r.view) ? [n("BaseIcon", { staticClass: "mb-2.5 text-gray-400", attrs: { type: "error", size: "22" } }), n("div", { staticStyle: { "font-size": "14px" }, domProps: { textContent: r._s(r.errorMessage) } }), n("CButton", { staticStyle: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" }, attrs: { loading: r.isLoading, type: "none", pattern: "secondary", size: "small" }, on: { click: function(u) {
|
|
3539
3641
|
r.view = "form";
|
|
3540
3642
|
} } }, [r._v(" " + r._s(r._document.$t("tryAgain")) + " ")])] : r._e()], 2)])])], 1)], 2);
|
|
3541
|
-
},
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3643
|
+
}, pe = [], me = /* @__PURE__ */ ot(
|
|
3644
|
+
de,
|
|
3645
|
+
ge,
|
|
3646
|
+
pe,
|
|
3545
3647
|
!1,
|
|
3546
3648
|
null,
|
|
3547
|
-
"
|
|
3649
|
+
"14eecff1",
|
|
3548
3650
|
null,
|
|
3549
3651
|
null
|
|
3550
3652
|
);
|
|
3551
|
-
const
|
|
3552
|
-
const
|
|
3653
|
+
const ve = me.exports;
|
|
3654
|
+
const ye = {
|
|
3553
3655
|
name: "DenyAnswer",
|
|
3554
3656
|
mixins: [ft([])],
|
|
3657
|
+
props: {
|
|
3658
|
+
onCompleteFunc: {
|
|
3659
|
+
type: Function,
|
|
3660
|
+
default: null
|
|
3661
|
+
}
|
|
3662
|
+
},
|
|
3555
3663
|
data() {
|
|
3556
3664
|
return {
|
|
3557
3665
|
rejectReason: ""
|
|
3558
3666
|
};
|
|
3559
3667
|
},
|
|
3560
3668
|
methods: {
|
|
3561
|
-
async submit({ update:
|
|
3669
|
+
async submit({ update: v, answer: r }) {
|
|
3562
3670
|
const n = [];
|
|
3563
3671
|
this.rejectReason && n.push({
|
|
3564
3672
|
key: "unclear-other",
|
|
3565
3673
|
category: "misc",
|
|
3566
3674
|
description: this.rejectReason,
|
|
3567
3675
|
sentAt: this._document.lastSentAt
|
|
3568
|
-
}), await
|
|
3676
|
+
}), await v({ body: { "data.rejectReasons": n } }), await r({ body: { isAccepted: !1 } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
|
|
3569
3677
|
}
|
|
3570
3678
|
}
|
|
3571
3679
|
};
|
|
3572
|
-
var
|
|
3680
|
+
var we = function() {
|
|
3573
3681
|
var r = this, n = r._self._c;
|
|
3574
3682
|
return n("div", { staticClass: "text-left" }, [n("label", [r._v(r._s(r._document.$t("answerModal.decline.component.label")))]), n("CInput", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { type: "textarea", filled: "", "custom-class": "decline-input" }, model: { value: r.rejectReason, callback: function(g) {
|
|
3575
3683
|
r.rejectReason = g;
|
|
3576
3684
|
}, expression: "rejectReason" } })], 1);
|
|
3577
|
-
},
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3685
|
+
}, xe = [], _e = /* @__PURE__ */ ot(
|
|
3686
|
+
ye,
|
|
3687
|
+
we,
|
|
3688
|
+
xe,
|
|
3581
3689
|
!1,
|
|
3582
3690
|
null,
|
|
3583
3691
|
null,
|
|
3584
3692
|
null,
|
|
3585
3693
|
null
|
|
3586
3694
|
);
|
|
3587
|
-
const
|
|
3588
|
-
const
|
|
3695
|
+
const Ee = _e.exports;
|
|
3696
|
+
const Ce = {
|
|
3589
3697
|
components: {
|
|
3590
|
-
Feedback:
|
|
3591
|
-
Signature:
|
|
3592
|
-
BankId:
|
|
3593
|
-
Deny:
|
|
3698
|
+
Feedback: Gt,
|
|
3699
|
+
Signature: ue,
|
|
3700
|
+
BankId: ve,
|
|
3701
|
+
Deny: Ee
|
|
3594
3702
|
},
|
|
3595
3703
|
mixins: [ft([])],
|
|
3596
3704
|
i18nOptions: {
|
|
@@ -3632,17 +3740,17 @@ const we = {
|
|
|
3632
3740
|
return this.isSender ? this._document.senderClient : this._document.viewer;
|
|
3633
3741
|
},
|
|
3634
3742
|
answerMethod() {
|
|
3635
|
-
var
|
|
3636
|
-
return (
|
|
3743
|
+
var v;
|
|
3744
|
+
return (v = this.signee.answerMethod) == null ? void 0 : v.accept;
|
|
3637
3745
|
},
|
|
3638
3746
|
successStrings() {
|
|
3639
|
-
const
|
|
3747
|
+
const v = this.signee.email ? this._document.$t(`answerModal.${this.answerType}.success.text`, {
|
|
3640
3748
|
email: this.signee.email
|
|
3641
3749
|
}) : this._document.$t(
|
|
3642
3750
|
`answerModal.${this.answerType}.success.textFallback`
|
|
3643
3751
|
), r = this.signee.email ? this._document.$t("answerModal.successTextSingle", {
|
|
3644
3752
|
email: this.signee.email
|
|
3645
|
-
}) : this._document.$t("answerModal.successTextFallbackSingle"), n = this._document.remainingSignatures === 0 ? r :
|
|
3753
|
+
}) : this._document.$t("answerModal.successTextFallbackSingle"), n = this._document.remainingSignatures === 0 ? r : v;
|
|
3646
3754
|
return {
|
|
3647
3755
|
title: this._document.$t(
|
|
3648
3756
|
`answerModal.${this.answerType}.success.title`
|
|
@@ -3655,7 +3763,7 @@ const we = {
|
|
|
3655
3763
|
this.calcHeight && this.$nextTick(() => this.setFixedHeight());
|
|
3656
3764
|
},
|
|
3657
3765
|
methods: {
|
|
3658
|
-
...
|
|
3766
|
+
...Ut({
|
|
3659
3767
|
answerCurrentDoc: wt.ANSWER_CURRENT_PUBLIC_DOCUMENT,
|
|
3660
3768
|
putCurrentDoc: wt.PUT_CURRENT_PUBLIC_DOCUMENT,
|
|
3661
3769
|
reloadCurrentDocument: wt.RELOAD_CURRENT_DOCUMENT
|
|
@@ -3667,37 +3775,40 @@ const we = {
|
|
|
3667
3775
|
if (!this.isPosting) {
|
|
3668
3776
|
this.isPosting = !0;
|
|
3669
3777
|
try {
|
|
3670
|
-
const { submit:
|
|
3671
|
-
if (typeof
|
|
3778
|
+
const { submit: v } = this.$refs.answerComponent;
|
|
3779
|
+
if (typeof v != "function")
|
|
3672
3780
|
throw Error("Missing answer type submit method");
|
|
3673
|
-
await
|
|
3781
|
+
await v({
|
|
3674
3782
|
update: (r) => this.putCurrentDoc({ includeChanges: !0, ...r }),
|
|
3675
3783
|
answer: this.answerCurrentDoc,
|
|
3676
3784
|
...this.isSender ? this.senderActions : null
|
|
3677
3785
|
});
|
|
3678
|
-
} catch (
|
|
3679
|
-
this.isPosting = !1,
|
|
3786
|
+
} catch (v) {
|
|
3787
|
+
this.isPosting = !1, v.httpStatusCode === 409 ? this.page = "versionError" : Ct(v);
|
|
3680
3788
|
}
|
|
3681
3789
|
}
|
|
3682
3790
|
},
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
this
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
this.mode === "accept" && this.answerMethod === "bankId" ? this.reloadCurrentDocument().then(
|
|
3690
|
-
() => {
|
|
3691
|
-
var n, g;
|
|
3692
|
-
return Bt.trigger("document:answer", {
|
|
3693
|
-
id: (n = this._document) == null ? void 0 : n.id,
|
|
3694
|
-
...(g = this.signee) == null ? void 0 : g.answer
|
|
3695
|
-
});
|
|
3791
|
+
onComplete() {
|
|
3792
|
+
return (async () => {
|
|
3793
|
+
var n, g, u;
|
|
3794
|
+
if (this.isSender && this.senderActions.send) {
|
|
3795
|
+
this.$emit("close"), await this.senderActions.send();
|
|
3796
|
+
return;
|
|
3696
3797
|
}
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3798
|
+
const r = (g = (n = this._document) == null ? void 0 : n.viewer) == null ? void 0 : g.answer;
|
|
3799
|
+
this.mode === "accept" && this.answerMethod === "bankId" ? this.reloadCurrentDocument().then(
|
|
3800
|
+
() => {
|
|
3801
|
+
var h;
|
|
3802
|
+
return At.trigger("document:answer", {
|
|
3803
|
+
id: (h = this._document) == null ? void 0 : h.id,
|
|
3804
|
+
...r
|
|
3805
|
+
});
|
|
3806
|
+
}
|
|
3807
|
+
) : At.trigger("document:answer", {
|
|
3808
|
+
id: (u = this._document) == null ? void 0 : u.id,
|
|
3809
|
+
...r
|
|
3810
|
+
}), await Bt(800), this.page = "intermediate", await Bt(2e3), this.page = "success", this.isPosting = !1;
|
|
3811
|
+
})();
|
|
3701
3812
|
},
|
|
3702
3813
|
reload() {
|
|
3703
3814
|
window.location.reload();
|
|
@@ -3705,9 +3816,9 @@ const we = {
|
|
|
3705
3816
|
setFixedHeight() {
|
|
3706
3817
|
this.$el.style.minHeight = `${this.$el.offsetHeight}px`;
|
|
3707
3818
|
},
|
|
3708
|
-
minimizeHeight(
|
|
3819
|
+
minimizeHeight(v, r) {
|
|
3709
3820
|
nt({
|
|
3710
|
-
targets:
|
|
3821
|
+
targets: v,
|
|
3711
3822
|
height: 0,
|
|
3712
3823
|
flexGrow: [1, 0],
|
|
3713
3824
|
opacity: [1, 0],
|
|
@@ -3722,9 +3833,9 @@ const we = {
|
|
|
3722
3833
|
easing: "easeOutQuint"
|
|
3723
3834
|
});
|
|
3724
3835
|
},
|
|
3725
|
-
enterAnim(
|
|
3836
|
+
enterAnim(v, r) {
|
|
3726
3837
|
nt({
|
|
3727
|
-
targets:
|
|
3838
|
+
targets: v.querySelectorAll(".stagger-anim"),
|
|
3728
3839
|
opacity: [0, 1],
|
|
3729
3840
|
delay: nt.stagger(180, { start: 800 }),
|
|
3730
3841
|
duration: 340,
|
|
@@ -3732,9 +3843,9 @@ const we = {
|
|
|
3732
3843
|
complete: r
|
|
3733
3844
|
});
|
|
3734
3845
|
},
|
|
3735
|
-
leaveAnim(
|
|
3736
|
-
|
|
3737
|
-
targets:
|
|
3846
|
+
leaveAnim(v, r) {
|
|
3847
|
+
v.style.position = "absolute", nt({
|
|
3848
|
+
targets: v.querySelectorAll(".stagger-anim"),
|
|
3738
3849
|
opacity: 0,
|
|
3739
3850
|
delay: nt.stagger(200),
|
|
3740
3851
|
duration: 200,
|
|
@@ -3744,29 +3855,29 @@ const we = {
|
|
|
3744
3855
|
}
|
|
3745
3856
|
}
|
|
3746
3857
|
};
|
|
3747
|
-
var
|
|
3858
|
+
var be = function() {
|
|
3748
3859
|
var g;
|
|
3749
3860
|
var r = this, n = r._self._c;
|
|
3750
|
-
return n("transition-group", { staticClass: "a-root font-inter", attrs: { tag: "div", css: !1, mode: "out-in" }, on: { enter: r.enterAnim, leave: r.leaveAnim } }, [n("CButton", { key: "btn", staticClass: "text-[hsl(0, 0%, 45%)] absolute right-5 top-5 z-[9]", attrs: { icon: "x", circle: "" }, on: { click: function(
|
|
3861
|
+
return n("transition-group", { staticClass: "a-root font-inter", attrs: { tag: "div", css: !1, mode: "out-in" }, on: { enter: r.enterAnim, leave: r.leaveAnim } }, [n("CButton", { key: "btn", staticClass: "text-[hsl(0, 0%, 45%)] absolute right-5 top-5 z-[9]", attrs: { icon: "x", circle: "" }, on: { click: function(u) {
|
|
3751
3862
|
r.$parent.$emit("cancel"), r.$emit("close");
|
|
3752
|
-
} } }), r.page === "start" ? n("div", { key: "start", staticClass: "root-padding flex-grow" }, [n("div", { staticClass: "stagger-anim", staticStyle: { "padding-bottom": "40px" } }, [n("div", { staticClass: "a-title", domProps: { textContent: r._s(r._document.$t(`answerModal.${r.answerType}.start.title`)) } }), n("div", { staticStyle: { color: "hsl(0, 0%, 40%)" }, domProps: { textContent: r._s(r._document.$t(`answerModal.${r.answerType}.start.text`)) } })]), n(r.answerComponentName, { ref: "answerComponent", tag: "component", staticClass: "stagger-anim", attrs: { _document: r._document, signee: r.signee }, on: { invalid: function(
|
|
3753
|
-
r.actionInvalid =
|
|
3754
|
-
}, loading: function(
|
|
3755
|
-
r.isPosting =
|
|
3756
|
-
}
|
|
3863
|
+
} } }), r.page === "start" ? n("div", { key: "start", staticClass: "root-padding flex-grow" }, [n("div", { staticClass: "stagger-anim", staticStyle: { "padding-bottom": "40px" } }, [n("div", { staticClass: "a-title", domProps: { textContent: r._s(r._document.$t(`answerModal.${r.answerType}.start.title`)) } }), n("div", { staticStyle: { color: "hsl(0, 0%, 40%)" }, domProps: { textContent: r._s(r._document.$t(`answerModal.${r.answerType}.start.text`)) } })]), n(r.answerComponentName, { ref: "answerComponent", tag: "component", staticClass: "stagger-anim", attrs: { _document: r._document, signee: r.signee, "on-complete-func": r.onComplete }, on: { invalid: function(u) {
|
|
3864
|
+
r.actionInvalid = u;
|
|
3865
|
+
}, loading: function(u) {
|
|
3866
|
+
r.isPosting = u;
|
|
3867
|
+
} } }), n("div", { staticClass: "stagger-anim", staticStyle: { "padding-top": "3em" } }, [n("CButton", { staticClass: "a-btn", attrs: { loading: r.isPosting, disabled: r.actionInvalid, type: r.mode === "decline" ? "text" : "secondary", icon: r.answerType === "bankId" ? "bankId" : "" }, on: { click: r.onSubmit } }, [r._v(" " + r._s(r._document.$t(`answerModal.${r.answerType}.start.action`)) + " ")])], 1)], 1) : r.page === "intermediate" ? n("div", { key: "intermediate", staticClass: "flex w-full flex-grow flex-col items-center justify-center text-center", staticStyle: { height: "100%" } }, [n("div", { staticClass: "a-title stagger-anim", domProps: { textContent: r._s(r._document.$t("answerModal.answerSuccess")) } })]) : r.page === "success" ? n("div", { key: "success", staticClass: "flex w-full flex-grow flex-col", staticStyle: { height: "100%" } }, [n("transition", { attrs: { css: !1 }, on: { leave: r.minimizeHeight } }, [r.isFeedbackInitiated ? r._e() : n("div", { staticClass: "flex w-full flex-grow flex-col items-center justify-center", staticStyle: { overflow: "hidden" } }, [n("div", { staticClass: "root-padding flex w-full flex-col items-center justify-center", staticStyle: { height: "100%" } }, [n("div", { staticClass: "a-title stagger-anim", staticStyle: { padding: "calc(2.5 * var(--rem)) 0 calc(2 * var(--rem))" } }, [n("div", { domProps: { textContent: r._s(r.successStrings.title) } })]), n("div", { staticClass: "stagger-anim", domProps: { textContent: r._s(r.successStrings.text) } })])])]), n("Feedback", { ref: "feedback", staticClass: "stagger-anim", staticStyle: { flex: "0 0", overflow: "hidden", "min-height": "200px" }, attrs: { "public-id": (g = r._document.viewer) == null ? void 0 : g.publicDocumentId, _document: r._document }, on: { page: () => r.isFeedbackInitiated = !0, close: function(u) {
|
|
3757
3868
|
return r.$emit("close");
|
|
3758
3869
|
} } })], 1) : r.page === "versionError" ? n("div", { key: "versionError", staticClass: "root-padding flex flex-grow flex-col items-center justify-center text-center" }, [n("div", { staticClass: "stagger-anim" }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { padding: "20px 0" } }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { width: "52px", height: "52px", "border-radius": "50%" } }, [n("BaseIcon", { attrs: { size: 30, type: "error" } })], 1)]), n("div", { staticClass: "a-title", domProps: { textContent: r._s(r._document.$t(`answerModal.versionError.${r.mode}.title`)) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerModal.versionError.text")) } })]), n("div", { staticClass: "stagger-anim", staticStyle: { "padding-top": "3em" } }, [n("CButton", { staticClass: "a-btn", attrs: { loading: r.isPosting, type: "none" }, on: { click: r.reload } }, [r._v(" " + r._s(r._document.$t("answerModal.versionError.btn")) + " ")])], 1)]) : r._e()], 1);
|
|
3759
|
-
},
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3870
|
+
}, Pe = [], Se = /* @__PURE__ */ ot(
|
|
3871
|
+
Ce,
|
|
3872
|
+
be,
|
|
3873
|
+
Pe,
|
|
3763
3874
|
!1,
|
|
3764
3875
|
null,
|
|
3765
|
-
"
|
|
3876
|
+
"0450455f",
|
|
3766
3877
|
null,
|
|
3767
3878
|
null
|
|
3768
3879
|
);
|
|
3769
|
-
const
|
|
3880
|
+
const Re = Se.exports;
|
|
3770
3881
|
export {
|
|
3771
|
-
|
|
3882
|
+
Re as default
|
|
3772
3883
|
};
|