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