ablok-components 0.3.119 → 0.3.120
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.
|
@@ -140,77 +140,77 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
140
140
|
},
|
|
141
141
|
emits: ["update:modelValue"],
|
|
142
142
|
setup(o, { expose: p, emit: De }) {
|
|
143
|
-
let { debounce: ke } = ce, y = o, Ae = De, b = _(), x = _(), je = _(!1), S = _([]), C = _(), w = _(), T = _(), E = _(
|
|
144
|
-
function R() {
|
|
145
|
-
I &&= (window.removeEventListener("pointerdown", I, !0), window.removeEventListener("touchend", I, !0), void 0);
|
|
146
|
-
}
|
|
143
|
+
let { debounce: ke } = ce, y = o, Ae = De, b = _(), x = _(), je = _(!1), S = _([]), C = _(), w = _(), T = _(), E = _(), D = _(!1), O = _(!1), k = _(0), A = _(0), j = _(), M = _(y.zoom || 1), Me = _(!1), N = _(!1), P = _(null), F = _(!1), I, L, Ne = typeof window < "u" && "DeviceMotionEvent" in window && (window.matchMedia?.("(pointer: coarse)")?.matches || "ontouchstart" in window), Pe = s(() => y.correctOrientation && Ne), R = s(() => je.value && (!Pe.value || F.value));
|
|
147
144
|
function z() {
|
|
148
|
-
|
|
145
|
+
L &&= (window.removeEventListener("pointerdown", L, !0), window.removeEventListener("touchend", L, !0), void 0);
|
|
146
|
+
}
|
|
147
|
+
function B() {
|
|
148
|
+
F.value = !0, I &&= (clearTimeout(I), void 0), z();
|
|
149
149
|
}
|
|
150
150
|
function Fe() {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}, window.addEventListener("pointerdown",
|
|
151
|
+
L || (L = () => {
|
|
152
|
+
V();
|
|
153
|
+
}, window.addEventListener("pointerdown", L, !0), window.addEventListener("touchend", L, !0));
|
|
154
154
|
}
|
|
155
155
|
function Ie(e) {
|
|
156
156
|
let t = e.accelerationIncludingGravity;
|
|
157
157
|
if (!t || t.x == null || t.y == null) return;
|
|
158
158
|
let n = Math.round(Math.atan2(t.x, t.y) * 180 / Math.PI);
|
|
159
|
-
if (
|
|
159
|
+
if (P.value = n, !(typeof screen < "u" && screen.orientation && screen.orientation.type || "portrait-primary").startsWith("portrait")) N.value = !1;
|
|
160
160
|
else {
|
|
161
161
|
let e = Math.abs(Math.abs(n) - 90);
|
|
162
|
-
!
|
|
162
|
+
!N.value && e < 40 ? N.value = !0 : N.value && e > 50 && (N.value = !1);
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
F.value || B();
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
166
|
+
async function V() {
|
|
167
167
|
if (!(!y.correctOrientation || Me.value)) try {
|
|
168
168
|
let e = window.DeviceOrientationEvent, t = window.DeviceMotionEvent;
|
|
169
169
|
if (e && typeof e.requestPermission == "function" && await e.requestPermission() !== "granted") {
|
|
170
|
-
|
|
170
|
+
B();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
t && typeof t.requestPermission == "function" && await t.requestPermission().catch(() => {}), window.addEventListener("devicemotion", Ie, !0), Me.value = !0,
|
|
173
|
+
t && typeof t.requestPermission == "function" && await t.requestPermission().catch(() => {}), window.addEventListener("devicemotion", Ie, !0), Me.value = !0, z();
|
|
174
174
|
} catch (e) {
|
|
175
|
-
console.error(e, "enableMotion: failed"),
|
|
175
|
+
console.error(e, "enableMotion: failed"), B();
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
let
|
|
178
|
+
let H = s(() => ({
|
|
179
179
|
...Oe,
|
|
180
180
|
...y.resolutions
|
|
181
|
-
})), Le = s(() => Object.values(
|
|
181
|
+
})), Le = s(() => Object.values(H.value)[0]);
|
|
182
182
|
function Re(e) {
|
|
183
183
|
return String(e || "").trim().toLowerCase().replace(/\s+/g, "").replace(/[:/]/g, "x");
|
|
184
184
|
}
|
|
185
|
-
let
|
|
186
|
-
if (
|
|
185
|
+
let U = s(() => {
|
|
186
|
+
if (H.value[y.ratio]) return y.ratio;
|
|
187
187
|
let e = Re(y.ratio);
|
|
188
|
-
if (
|
|
189
|
-
}),
|
|
190
|
-
let e =
|
|
188
|
+
if (H.value[e]) return e;
|
|
189
|
+
}), W = s(() => U.value ? H.value[U.value] : Le.value), ze = s(() => {
|
|
190
|
+
let e = U.value ? H.value[U.value] : void 0;
|
|
191
191
|
return e ? `${e.width} / ${e.height}` : void 0;
|
|
192
|
-
}),
|
|
193
|
-
function Ve(e) {
|
|
194
|
-
e && !G.value.includes(e) && (G.value = [...G.value, e]);
|
|
195
|
-
}
|
|
192
|
+
}), G = s(() => S.value.filter((e) => e.kind === "videoinput")), Be = s(() => S.value.filter((e) => e.kind === "audioinput")), K = _([]), Ve = s(() => G.value.filter((e) => !K.value.includes(e.deviceId)));
|
|
196
193
|
function He(e) {
|
|
197
|
-
|
|
194
|
+
e && !K.value.includes(e) && (K.value = [...K.value, e]);
|
|
195
|
+
}
|
|
196
|
+
function Ue(e) {
|
|
197
|
+
let t = G.value;
|
|
198
198
|
if (!t.length) return;
|
|
199
199
|
let n = t.findIndex((t) => t.deviceId === e);
|
|
200
200
|
for (let e = 1; e <= t.length; e++) {
|
|
201
201
|
let r = t[(Math.max(n, 0) + e) % t.length];
|
|
202
|
-
if (r && !
|
|
202
|
+
if (r && !K.value.includes(r.deviceId)) return r;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
let
|
|
205
|
+
let We = s(() => Ve.value.map((e, t) => ({
|
|
206
206
|
text: e.label.slice(0, e.label.indexOf("(")) || `Camera ${t + 1}`,
|
|
207
207
|
value: e.deviceId
|
|
208
|
-
}))),
|
|
208
|
+
}))), Ge = s({
|
|
209
209
|
get() {
|
|
210
210
|
return C.value && C.value.deviceId;
|
|
211
211
|
},
|
|
212
212
|
set(e) {
|
|
213
|
-
C.value =
|
|
213
|
+
C.value = G.value.find((t) => t.deviceId === e), T.value = void 0;
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
s({
|
|
@@ -221,33 +221,30 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
221
221
|
w.value = Be.value.find((t) => t.deviceId === e);
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
|
-
let q = s(() => {
|
|
225
|
-
let e = C.value && W.value.findIndex((e) => e.deviceId === C.value?.deviceId);
|
|
226
|
-
return y.enableMirrorCamera && e === 0 ? "mirror-cam" : "";
|
|
227
|
-
}), Ge = s(() => {
|
|
224
|
+
let q = s(() => y.enableMirrorCamera ? E.value ? E.value === "user" ? "mirror-cam" : "" : T.value ? T.value === "user" ? "mirror-cam" : "" : (C.value && G.value.findIndex((e) => e.deviceId === C.value?.deviceId)) === 0 ? "mirror-cam" : "" : ""), Ke = s(() => {
|
|
228
225
|
let e = C.value && S.value.findIndex((e) => e.deviceId === C.value?.deviceId);
|
|
229
226
|
return q.value ? `${q.value} mirror-device-${e}` : "";
|
|
230
|
-
}), { tintRgb:
|
|
231
|
-
function
|
|
232
|
-
if (
|
|
233
|
-
|
|
227
|
+
}), { tintRgb: qe, applyFilterToCanvas: Je } = i(y);
|
|
228
|
+
function Ye() {
|
|
229
|
+
if (U.value && W.value) {
|
|
230
|
+
k.value = W.value.width, A.value = W.value.height;
|
|
234
231
|
return;
|
|
235
232
|
}
|
|
236
|
-
|
|
233
|
+
k.value = b.value.parentElement && b.value.parentElement.clientWidth, A.value = b.value.parentElement && b.value.parentElement.clientHeight;
|
|
237
234
|
}
|
|
238
|
-
let
|
|
239
|
-
|
|
235
|
+
let Xe = ke(() => {
|
|
236
|
+
Ye();
|
|
240
237
|
}, 300, {
|
|
241
238
|
trailing: !0,
|
|
242
239
|
leading: !1
|
|
243
240
|
});
|
|
244
|
-
function
|
|
241
|
+
function Ze(e) {
|
|
245
242
|
return new Promise((t) => setTimeout(t, e));
|
|
246
243
|
}
|
|
247
|
-
async function
|
|
248
|
-
let e =
|
|
249
|
-
width:
|
|
250
|
-
height:
|
|
244
|
+
async function Qe() {
|
|
245
|
+
let e = W.value ? {
|
|
246
|
+
width: W.value.width,
|
|
247
|
+
height: W.value.height
|
|
251
248
|
} : void 0, t = e ? Math.max(e.width, e.height) : void 0, n = e ? Math.min(e.width, e.height) : void 0, r = y.enableAudio && { ...w.value ? { deviceId: w.value.deviceId } : {} }, i = C.value && C.value.deviceId, a = T.value, o = [];
|
|
252
249
|
i ? (t && n && o.push({
|
|
253
250
|
deviceId: { exact: i },
|
|
@@ -272,7 +269,7 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
272
269
|
} catch (e) {
|
|
273
270
|
let t = e && e.name;
|
|
274
271
|
if (t === "NotReadableError" || t === "AbortError") {
|
|
275
|
-
await
|
|
272
|
+
await Ze(500);
|
|
276
273
|
continue;
|
|
277
274
|
}
|
|
278
275
|
break;
|
|
@@ -283,16 +280,16 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
283
280
|
e.stop();
|
|
284
281
|
}), b.value.srcObject = null);
|
|
285
282
|
}
|
|
286
|
-
let Y = 0, X,
|
|
283
|
+
let Y = 0, X, $e;
|
|
287
284
|
function Z() {
|
|
288
|
-
X &&= (clearTimeout(X), void 0),
|
|
285
|
+
X &&= (clearTimeout(X), void 0), $e &&= ($e(), void 0);
|
|
289
286
|
}
|
|
290
|
-
function
|
|
291
|
-
|
|
292
|
-
let t =
|
|
287
|
+
function et(e) {
|
|
288
|
+
He(e);
|
|
289
|
+
let t = Ue(e);
|
|
293
290
|
t && t.deviceId !== e && (C.value = t);
|
|
294
291
|
}
|
|
295
|
-
function
|
|
292
|
+
function tt(e) {
|
|
296
293
|
Z();
|
|
297
294
|
let t = C.value && C.value.deviceId, n = b.value;
|
|
298
295
|
if (!t || !n) return;
|
|
@@ -300,38 +297,38 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
300
297
|
if (!r || typeof r.addEventListener != "function" || n.videoWidth > 0) return;
|
|
301
298
|
let i = () => {
|
|
302
299
|
if (Z(), e !== Y || !b.value) return;
|
|
303
|
-
let n =
|
|
304
|
-
n && n.deviceId !== t && (J(),
|
|
300
|
+
let n = Ue(t);
|
|
301
|
+
n && n.deviceId !== t && (J(), et(t));
|
|
305
302
|
}, a = () => {
|
|
306
303
|
e === Y && b.value && b.value.videoWidth > 0 && Z();
|
|
307
304
|
}, o = () => {
|
|
308
305
|
i();
|
|
309
306
|
};
|
|
310
|
-
r.addEventListener("unmute", a), r.addEventListener("ended", o),
|
|
307
|
+
r.addEventListener("unmute", a), r.addEventListener("ended", o), $e = () => {
|
|
311
308
|
r.removeEventListener("unmute", a), r.removeEventListener("ended", o);
|
|
312
309
|
}, X = setTimeout(() => {
|
|
313
310
|
X = void 0, !(e !== Y || !b.value) && (b.value.videoWidth === 0 ? i() : Z());
|
|
314
311
|
}, 8e3);
|
|
315
312
|
}
|
|
316
|
-
let
|
|
313
|
+
let nt = 0;
|
|
317
314
|
async function Q() {
|
|
318
315
|
let e = ++Y;
|
|
319
316
|
Z();
|
|
320
317
|
let t = !!(b.value && b.value.srcObject);
|
|
321
|
-
if (J(), t && (await
|
|
322
|
-
let n = await
|
|
318
|
+
if (J(), t && (await Ze(350), e !== Y)) return;
|
|
319
|
+
let n = await Qe();
|
|
323
320
|
if (e !== Y) {
|
|
324
321
|
n?.getTracks?.().forEach((e) => e.stop());
|
|
325
322
|
return;
|
|
326
323
|
}
|
|
327
324
|
if (n && b.value) {
|
|
328
|
-
|
|
325
|
+
nt = 0, b.value.srcObject = n, E.value = n.getVideoTracks?.()[0]?.getSettings?.().facingMode, b.value.muted = !0;
|
|
329
326
|
try {
|
|
330
327
|
await b.value.play?.();
|
|
331
328
|
} catch {}
|
|
332
|
-
|
|
329
|
+
tt(e);
|
|
333
330
|
} else if (!n && C.value) {
|
|
334
|
-
|
|
331
|
+
nt < 2 && (nt++, await Ze(600), e === Y && await Q());
|
|
335
332
|
return;
|
|
336
333
|
}
|
|
337
334
|
return S.value = await navigator.mediaDevices.enumerateDevices(), {
|
|
@@ -339,65 +336,65 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
339
336
|
devices: S.value
|
|
340
337
|
};
|
|
341
338
|
}
|
|
342
|
-
function nt() {
|
|
343
|
-
E.value ? (E.value = !1, D.value = !1, J()) : (E.value = !0, Q());
|
|
344
|
-
}
|
|
345
339
|
function rt() {
|
|
340
|
+
D.value ? (D.value = !1, O.value = !1, J()) : (D.value = !0, Q());
|
|
341
|
+
}
|
|
342
|
+
function it() {
|
|
346
343
|
C.value = void 0, T.value = T.value === "user" ? "environment" : "user", Q();
|
|
347
344
|
}
|
|
348
|
-
async function
|
|
345
|
+
async function at(e, t) {
|
|
349
346
|
e && (!t || e.deviceId !== t.deviceId) && await Q();
|
|
350
347
|
}
|
|
351
|
-
ie(() => C.value,
|
|
348
|
+
ie(() => C.value, at), ie(() => w.value, at);
|
|
352
349
|
function $() {
|
|
353
|
-
y.countdown ? (
|
|
350
|
+
y.countdown ? (j.value = j.value ? j.value - 1 : y.countdown, j.value ? setTimeout($, 1e3) : ct()) : ct();
|
|
354
351
|
}
|
|
355
352
|
p({
|
|
356
353
|
onCapture: $,
|
|
357
|
-
enableMotion:
|
|
354
|
+
enableMotion: V,
|
|
358
355
|
camera: b.value,
|
|
359
|
-
zoom:
|
|
356
|
+
zoom: M
|
|
360
357
|
});
|
|
361
|
-
function
|
|
362
|
-
if (!y.correctOrientation ||
|
|
363
|
-
let e = ((
|
|
358
|
+
function ot() {
|
|
359
|
+
if (!y.correctOrientation || P.value == null) return 0;
|
|
360
|
+
let e = ((P.value - 180) % 360 + 360) % 360;
|
|
364
361
|
return (-1 * (Math.round(e / 90) * 90 % 360) % 360 + 360) % 360;
|
|
365
362
|
}
|
|
366
|
-
function
|
|
363
|
+
function st(e, t, n, r, i) {
|
|
367
364
|
let a = x.value.width, o = x.value.height;
|
|
368
365
|
e.translate(a / 2, o / 2), q.value && e.scale(-1, 1), e.rotate(n * Math.PI / 180);
|
|
369
|
-
let s = o, c = a, l = Math.max(s / r, c / i) * (
|
|
366
|
+
let s = o, c = a, l = Math.max(s / r, c / i) * (M.value && M.value > 0 ? M.value : 1), u = r * l, d = i * l;
|
|
370
367
|
e.drawImage(t, -u / 2, -d / 2, u, d);
|
|
371
368
|
}
|
|
372
|
-
function
|
|
373
|
-
|
|
374
|
-
let e = x.value.getContext("2d"), t = b.value, n = t && t.srcObject && t.srcObject.getTracks(), { aspectRatio: r, width: i, height: a } = n.length && n[0].getSettings(), o = t?.videoWidth || i ||
|
|
369
|
+
function ct() {
|
|
370
|
+
O.value = !0;
|
|
371
|
+
let e = x.value.getContext("2d"), t = b.value, n = t && t.srcObject && t.srcObject.getTracks(), { aspectRatio: r, width: i, height: a } = n.length && n[0].getSettings(), o = t?.videoWidth || i || k.value, s = t?.videoHeight || a || A.value, c = o && s ? o / s : r, l = W.value || {
|
|
375
372
|
width: o,
|
|
376
373
|
height: s
|
|
377
|
-
}, u = l?.width || o, d =
|
|
374
|
+
}, u = l?.width || o, d = U.value ? l?.height || s : Math.round(u / c), f = u / d;
|
|
378
375
|
if (x.value.width = u, x.value.height = d, !o || !s || !c) return;
|
|
379
|
-
let p =
|
|
376
|
+
let p = ot();
|
|
380
377
|
if (e.save(), p === 90 || p === 270) {
|
|
381
|
-
|
|
378
|
+
st(e, t, p, o, s), e.restore(), Je(e, x.value.width, x.value.height), lt(x.value.toDataURL("image/png"));
|
|
382
379
|
return;
|
|
383
380
|
}
|
|
384
381
|
if (p === 180 && (e.translate(x.value.width, x.value.height), e.scale(-1, -1)), q.value && (e.translate(x.value.width, 0), e.scale(-1, 1)), y.enableCropImage) {
|
|
385
382
|
let n = 0, r = 0, i = o, a = s;
|
|
386
|
-
if (c > f ? (i = s * f, n = (o - i) / 2) : c < f && (a = o / f, r = (s - a) / 2),
|
|
387
|
-
let e = i /
|
|
383
|
+
if (c > f ? (i = s * f, n = (o - i) / 2) : c < f && (a = o / f, r = (s - a) / 2), M.value && M.value !== 1) {
|
|
384
|
+
let e = i / M.value, t = a / M.value;
|
|
388
385
|
n += (i - e) / 2, r += (a - t) / 2, i = e, a = t;
|
|
389
386
|
}
|
|
390
387
|
e.drawImage(t, n, r, i, a, 0, 0, x.value.width, x.value.height);
|
|
391
388
|
} else {
|
|
392
389
|
let n = x.value.width, r = x.value.height, i = 0, a = 0;
|
|
393
|
-
if (c > f ? (r = x.value.width / c, a = (x.value.height - r) / 2) : c < f && (n = x.value.height * c, i = (x.value.width - n) / 2),
|
|
394
|
-
let c = o /
|
|
390
|
+
if (c > f ? (r = x.value.width / c, a = (x.value.height - r) / 2) : c < f && (n = x.value.height * c, i = (x.value.width - n) / 2), M.value && M.value !== 1) {
|
|
391
|
+
let c = o / M.value, l = s / M.value, u = (o - c) / 2, d = (s - l) / 2;
|
|
395
392
|
q.value && (i = x.value.width - i - n), e.drawImage(t, u, d, c, l, i, a, n, r);
|
|
396
393
|
} else q.value && (i = x.value.width - i - n), e.drawImage(t, 0, 0, o, s, i, a, n, r);
|
|
397
394
|
}
|
|
398
|
-
e.restore(),
|
|
395
|
+
e.restore(), Je(e, x.value.width, x.value.height), lt(x.value.toDataURL("image/png"));
|
|
399
396
|
}
|
|
400
|
-
function
|
|
397
|
+
function lt(e) {
|
|
401
398
|
let t = n(e);
|
|
402
399
|
Ae("update:modelValue", {
|
|
403
400
|
name: `cam-pic-${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
@@ -407,21 +404,21 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
407
404
|
});
|
|
408
405
|
}
|
|
409
406
|
return ne(async () => {
|
|
410
|
-
await Q(),
|
|
411
|
-
let e = y.defaultRearCamera &&
|
|
407
|
+
await Q(), D.value = !0, T.value = y.defaultRearCamera ? "environment" : "user";
|
|
408
|
+
let e = y.defaultRearCamera && G.value.length > 1 ? G.value[G.value.length - 1] : G.value[0];
|
|
412
409
|
if (C.value = e, y.enableAudio && (w.value = Be.value[0]), navigator.mediaDevices.addEventListener("devicechange", async (e) => {
|
|
413
410
|
await Q();
|
|
414
|
-
}), window.addEventListener("resize",
|
|
415
|
-
|
|
411
|
+
}), window.addEventListener("resize", Xe), Ye(), Pe.value) {
|
|
412
|
+
I = setTimeout(B, 3e3);
|
|
416
413
|
let e = window.DeviceOrientationEvent;
|
|
417
|
-
e && typeof e.requestPermission == "function" ? Fe() :
|
|
414
|
+
e && typeof e.requestPermission == "function" ? Fe() : V();
|
|
418
415
|
}
|
|
419
416
|
await ee(), je.value = !0;
|
|
420
417
|
}), te(() => {
|
|
421
|
-
|
|
422
|
-
}), (n, i) => (g(), u("div", { class: m(["camera",
|
|
418
|
+
D.value = !1, O.value = !1, Z(), J(), window.removeEventListener("resize", Xe), window.removeEventListener("devicemotion", Ie, !0), I && clearTimeout(I), z();
|
|
419
|
+
}), (n, i) => (g(), u("div", { class: m(["camera", Ke.value]) }, [
|
|
423
420
|
d("div", le, [
|
|
424
|
-
|
|
421
|
+
R.value ? l("", !0) : (g(), u("div", ue, [f(t, { color: "#000" }, {
|
|
425
422
|
default: ae(() => [d("span", {
|
|
426
423
|
class: m("d-block text-center"),
|
|
427
424
|
innerHTML: n.$t("camera.waitForCameraNotification")
|
|
@@ -429,10 +426,10 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
429
426
|
_: 1
|
|
430
427
|
})])),
|
|
431
428
|
oe(d("div", {
|
|
432
|
-
class: m(["camera__video-wrapper",
|
|
429
|
+
class: m(["camera__video-wrapper", U.value ? `aspect-ratio--${U.value}` : ""]),
|
|
433
430
|
style: h({
|
|
434
431
|
aspectRatio: ze.value || void 0,
|
|
435
|
-
transform:
|
|
432
|
+
transform: M.value === 1 ? void 0 : `scale(${M.value})`
|
|
436
433
|
})
|
|
437
434
|
}, [d("video", {
|
|
438
435
|
ref_key: "camera",
|
|
@@ -440,7 +437,7 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
440
437
|
class: "camera__video",
|
|
441
438
|
style: h({
|
|
442
439
|
filter: y.filter === "grayscale" ? "grayscale(100%)" : y.filter === "sepia" ? "sepia(100%)" : "none",
|
|
443
|
-
transform: o.correctOrientation &&
|
|
440
|
+
transform: o.correctOrientation && N.value ? "rotate(180deg)" : void 0
|
|
444
441
|
}),
|
|
445
442
|
autoplay: "",
|
|
446
443
|
muted: "",
|
|
@@ -453,49 +450,49 @@ var le = { class: "camera__preview" }, ue = {
|
|
|
453
450
|
opacity: o.tintIntensity,
|
|
454
451
|
mixBlendMode: "multiply"
|
|
455
452
|
})
|
|
456
|
-
}, null, 4)) : l("", !0)], 6), [[re,
|
|
453
|
+
}, null, 4)) : l("", !0)], 6), [[re, R.value]]),
|
|
457
454
|
oe(d("canvas", {
|
|
458
455
|
ref_key: "canvas",
|
|
459
456
|
ref: x,
|
|
460
457
|
class: "camera__canvas",
|
|
461
|
-
width:
|
|
462
|
-
height:
|
|
463
|
-
}, null, 8, fe), [[re,
|
|
464
|
-
|
|
458
|
+
width: k.value,
|
|
459
|
+
height: A.value
|
|
460
|
+
}, null, 8, fe), [[re, O.value]]),
|
|
461
|
+
j.value ? (g(), u("div", pe, [(g(), u("p", {
|
|
465
462
|
class: "countdown",
|
|
466
|
-
key:
|
|
467
|
-
innerHTML:
|
|
468
|
-
"data-countdown":
|
|
463
|
+
key: j.value,
|
|
464
|
+
innerHTML: j.value,
|
|
465
|
+
"data-countdown": j.value
|
|
469
466
|
}, null, 8, me))])) : l("", !0),
|
|
470
|
-
o.enableGuide &&
|
|
467
|
+
o.enableGuide && D.value && R.value ? (g(), u("img", {
|
|
471
468
|
key: 2,
|
|
472
469
|
class: "camera__guide",
|
|
473
470
|
src: o.guideSrc
|
|
474
471
|
}, null, 8, he)) : l("", !0),
|
|
475
472
|
o.enableZoomSlider ? (g(), u("div", ge, [f(a, {
|
|
476
|
-
modelValue:
|
|
477
|
-
"onUpdate:modelValue": i[0] ||= (e) =>
|
|
473
|
+
modelValue: M.value,
|
|
474
|
+
"onUpdate:modelValue": i[0] ||= (e) => M.value = e
|
|
478
475
|
}, null, 8, ["modelValue"])])) : l("", !0)
|
|
479
476
|
]),
|
|
480
477
|
d("div", _e, [d("div", ve, [d("div", ye, [d("div", be, [d("div", xe, [d("button", {
|
|
481
478
|
type: "button",
|
|
482
479
|
class: "camera__toggle btn btn-primary",
|
|
483
|
-
onClick:
|
|
484
|
-
}, [
|
|
480
|
+
onClick: rt
|
|
481
|
+
}, [D.value ? (g(), u("span", Ce, v(n.$t("common.pause")), 1)) : (g(), u("span", Se, v(n.$t("common.play")), 1))]), d("button", {
|
|
485
482
|
type: "button",
|
|
486
483
|
class: "camera__capture btn btn-primary",
|
|
487
484
|
onClick: $
|
|
488
485
|
}, v(n.$t("camera.capture")), 1)])])])])]),
|
|
489
|
-
(o.enableSwitchCamera || o.enableSelectDevice) &&
|
|
486
|
+
(o.enableSwitchCamera || o.enableSelectDevice) && Ve.value && Ve.value.length > 1 ? (g(), u("div", we, [d("div", Te, [o.enableSelectDevice ? (g(), c(r, {
|
|
490
487
|
key: 0,
|
|
491
|
-
modelValue:
|
|
492
|
-
"onUpdate:modelValue": i[1] ||= (e) =>
|
|
493
|
-
options:
|
|
488
|
+
modelValue: Ge.value,
|
|
489
|
+
"onUpdate:modelValue": i[1] ||= (e) => Ge.value = e,
|
|
490
|
+
options: We.value,
|
|
494
491
|
class: "w-100"
|
|
495
492
|
}, null, 8, ["modelValue", "options"])) : l("", !0)]), d("div", Ee, [o.enableSwitchCamera ? (g(), u("button", {
|
|
496
493
|
key: 0,
|
|
497
494
|
class: "btn",
|
|
498
|
-
onClick: se(
|
|
495
|
+
onClick: se(it, ["prevent"])
|
|
499
496
|
}, [f(e, { symbol: "switch-camera" })])) : l("", !0)])])) : l("", !0)
|
|
500
497
|
], 2));
|
|
501
498
|
}
|