@wix/bookings 1.0.1781 → 1.0.1783
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/build/cjs/context-booking-checkout.d.ts +32 -0
- package/build/cjs/context-booking-checkout.js +2002 -1762
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-my-booking.d.ts +2832 -0
- package/build/cjs/context-my-booking.js +592 -0
- package/build/cjs/context-my-booking.js.map +1 -0
- package/build/cjs/context-my-bookings.d.ts +2862 -0
- package/build/cjs/context-my-bookings.js +12885 -0
- package/build/cjs/context-my-bookings.js.map +1 -0
- package/build/cjs/context-service-addons.d.ts +54 -3
- package/build/cjs/context-service-addons.js +1065 -578
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +35 -24
- package/build/cjs/context-service.js +985 -966
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +44 -98
- package/build/cjs/context-time-slots.js +456 -474
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +32 -0
- package/build/es/context-booking-checkout.mjs +2002 -1762
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-my-booking.d.mts +2832 -0
- package/build/es/context-my-booking.mjs +562 -0
- package/build/es/context-my-booking.mjs.map +1 -0
- package/build/es/context-my-bookings.d.mts +2862 -0
- package/build/es/context-my-bookings.mjs +12844 -0
- package/build/es/context-my-bookings.mjs.map +1 -0
- package/build/es/context-service-addons.d.mts +54 -3
- package/build/es/context-service-addons.mjs +1061 -574
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +35 -24
- package/build/es/context-service.mjs +985 -966
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +44 -98
- package/build/es/context-time-slots.mjs +456 -474
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +32 -0
- package/build/internal/cjs/context-my-booking.d.ts +2832 -0
- package/build/internal/cjs/context-my-bookings.d.ts +2862 -0
- package/build/internal/cjs/context-service-addons.d.ts +54 -3
- package/build/internal/cjs/context-service.d.ts +35 -24
- package/build/internal/cjs/context-time-slots.d.ts +44 -98
- package/build/internal/es/context-booking-checkout.d.mts +32 -0
- package/build/internal/es/context-my-booking.d.mts +2832 -0
- package/build/internal/es/context-my-bookings.d.mts +2862 -0
- package/build/internal/es/context-service-addons.d.mts +54 -3
- package/build/internal/es/context-service.d.mts +35 -24
- package/build/internal/es/context-time-slots.d.mts +44 -98
- package/context/my-booking/package.json +3 -0
- package/context/my-bookings/package.json +3 -0
- package/context-runtime/context-booking-checkout/runtime.d.ts +32 -0
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-my-booking/runtime.d.ts +2832 -0
- package/context-runtime/context-my-booking/runtime.js +2 -0
- package/context-runtime/context-my-bookings/runtime.d.ts +2862 -0
- package/context-runtime/context-my-bookings/runtime.js +11 -0
- package/context-runtime/context-service/runtime.d.ts +35 -24
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.d.ts +54 -3
- package/context-runtime/context-service-addons/runtime.js +2 -2
- package/context-runtime/context-time-slots/runtime.d.ts +44 -98
- package/context-runtime/context-time-slots/runtime.js +3 -3
- package/package.json +20 -4
|
@@ -7,24 +7,24 @@ var __export = (target, all) => {
|
|
|
7
7
|
for (var name in all)
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
|
-
var __copyProps = (
|
|
10
|
+
var __copyProps = (to2, from, except, desc) => {
|
|
11
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(
|
|
14
|
-
__defProp(
|
|
13
|
+
if (!__hasOwnProp.call(to2, key) && key !== except)
|
|
14
|
+
__defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return to2;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// context-service-addons.ts
|
|
21
21
|
var context_service_addons_exports = {};
|
|
22
22
|
__export(context_service_addons_exports, {
|
|
23
|
-
ServiceAddOnsContextProvider: () =>
|
|
24
|
-
default: () =>
|
|
25
|
-
injectAccessTokenGetter: () =>
|
|
26
|
-
serviceAddOnsContext: () =>
|
|
27
|
-
useServiceAddOnsContext: () =>
|
|
23
|
+
ServiceAddOnsContextProvider: () => $s,
|
|
24
|
+
default: () => $s,
|
|
25
|
+
injectAccessTokenGetter: () => ec,
|
|
26
|
+
serviceAddOnsContext: () => Xs,
|
|
27
|
+
useServiceAddOnsContext: () => Zs
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(context_service_addons_exports);
|
|
30
30
|
|
|
@@ -462,21 +462,21 @@ function Ue(e5) {
|
|
|
462
462
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
463
463
|
let e6 = await i3(n3, { ...r3, headers: c3 });
|
|
464
464
|
l3?.handleError(e6, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
465
|
-
let a3 =
|
|
465
|
+
let a3 = We(e6);
|
|
466
466
|
return a3 && (t2[T] = a3), e6;
|
|
467
467
|
}
|
|
468
468
|
{
|
|
469
469
|
for (let [e7, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e7, t3);
|
|
470
470
|
let e6 = await i3(n3, r3);
|
|
471
471
|
l3?.handleError(e6, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
472
|
-
let a3 =
|
|
472
|
+
let a3 = We(e6);
|
|
473
473
|
return a3 && (t2[T] = a3), e6;
|
|
474
474
|
}
|
|
475
475
|
} catch (e6) {
|
|
476
476
|
throw l3?.handleError(e6, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e6;
|
|
477
477
|
}
|
|
478
478
|
}, { client: c2, initModule: l2 } = He(i2), { client: u2, initModule: d2 } = Be(i2), f2 = async (n3, r3) => {
|
|
479
|
-
let i3 = o2(), s3 = await a2(), c3 = ee(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [T]: t2[T] } : {} } }), u3 =
|
|
479
|
+
let i3 = o2(), s3 = await a2(), c3 = ee(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e5.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [T]: t2[T] } : {} } }), u3 = We(l3);
|
|
480
480
|
return u3 && (t2[T] = u3), l3;
|
|
481
481
|
}, m2 = (t3, n3) => {
|
|
482
482
|
if (Re(t3)) return d2(t3);
|
|
@@ -509,19 +509,497 @@ function Ue(e5) {
|
|
|
509
509
|
return { data: o3 ?? {}, errors: s3 };
|
|
510
510
|
}, webhooks: u2, servicePlugins: c2 };
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function We(e5) {
|
|
513
513
|
return e5.headers?.get(`X-Wix-Consistent`) ?? e5.headers?.get(`x-wix-consistent`);
|
|
514
514
|
}
|
|
515
|
-
var
|
|
516
|
-
var
|
|
517
|
-
|
|
515
|
+
var Ge = 1920;
|
|
516
|
+
var Ke = 1920;
|
|
517
|
+
var qe = 1e3;
|
|
518
|
+
var Je = 1e3;
|
|
519
|
+
var E = { SCALE_TO_FILL: `fill`, SCALE_TO_FIT: `fit`, STRETCH: `stretch`, ORIGINAL_SIZE: `original_size`, TILE: `tile`, TILE_HORIZONTAL: `tile_horizontal`, TILE_VERTICAL: `tile_vertical`, FIT_AND_TILE: `fit_and_tile`, LEGACY_STRIP_TILE: `legacy_strip_tile`, LEGACY_STRIP_TILE_HORIZONTAL: `legacy_strip_tile_horizontal`, LEGACY_STRIP_TILE_VERTICAL: `legacy_strip_tile_vertical`, LEGACY_STRIP_SCALE_TO_FILL: `legacy_strip_fill`, LEGACY_STRIP_SCALE_TO_FIT: `legacy_strip_fit`, LEGACY_STRIP_FIT_AND_TILE: `legacy_strip_fit_and_tile`, LEGACY_STRIP_ORIGINAL_SIZE: `legacy_strip_original_size`, LEGACY_ORIGINAL_SIZE: `actual_size`, LEGACY_FIT_WIDTH: `fitWidth`, LEGACY_FIT_HEIGHT: `fitHeight`, LEGACY_FULL: `full`, LEGACY_BG_FIT_AND_TILE: `legacy_tile`, LEGACY_BG_FIT_AND_TILE_HORIZONTAL: `legacy_tile_horizontal`, LEGACY_BG_FIT_AND_TILE_VERTICAL: `legacy_tile_vertical`, LEGACY_BG_NORMAL: `legacy_normal` };
|
|
520
|
+
var D = { FIT: `fit`, FILL: `fill`, FILL_FOCAL: `fill_focal`, CROP: `crop`, LEGACY_CROP: `legacy_crop`, LEGACY_FILL: `legacy_fill` };
|
|
521
|
+
var O = { CENTER: `center`, TOP: `top`, TOP_LEFT: `top_left`, TOP_RIGHT: `top_right`, BOTTOM: `bottom`, BOTTOM_LEFT: `bottom_left`, BOTTOM_RIGHT: `bottom_right`, LEFT: `left`, RIGHT: `right` };
|
|
522
|
+
var Ye = { [O.CENTER]: { x: 0.5, y: 0.5 }, [O.TOP_LEFT]: { x: 0, y: 0 }, [O.TOP_RIGHT]: { x: 1, y: 0 }, [O.TOP]: { x: 0.5, y: 0 }, [O.BOTTOM_LEFT]: { x: 0, y: 1 }, [O.BOTTOM_RIGHT]: { x: 1, y: 1 }, [O.BOTTOM]: { x: 0.5, y: 1 }, [O.RIGHT]: { x: 1, y: 0.5 }, [O.LEFT]: { x: 0, y: 0.5 } };
|
|
523
|
+
var Xe = { center: `c`, top: `t`, top_left: `tl`, top_right: `tr`, bottom: `b`, bottom_left: `bl`, bottom_right: `br`, left: `l`, right: `r` };
|
|
524
|
+
var Ze = { BG: `bg`, IMG: `img`, SVG: `svg` };
|
|
525
|
+
var Qe = { AUTO: `auto`, CLASSIC: `classic`, SUPER: `super` };
|
|
526
|
+
var $e = { classic: 1, super: 2 };
|
|
527
|
+
var et = { radius: `0.66`, amount: `1.00`, threshold: `0.01` };
|
|
528
|
+
var tt = 25e6;
|
|
529
|
+
var nt = [1.5, 2, 4];
|
|
530
|
+
var k = { HIGH: { size: 196e4, quality: 90, maxUpscale: 1 }, MEDIUM: { size: 36e4, quality: 85, maxUpscale: 1 }, LOW: { size: 16e4, quality: 80, maxUpscale: 1.2 }, TINY: { size: 0, quality: 80, maxUpscale: 1.4 } };
|
|
531
|
+
var A = { HIGH: `HIGH`, MEDIUM: `MEDIUM`, LOW: `LOW`, TINY: `TINY` };
|
|
532
|
+
var j = { CONTRAST: `contrast`, BRIGHTNESS: `brightness`, SATURATION: `saturation`, HUE: `hue`, BLUR: `blur` };
|
|
533
|
+
var M = { JPG: `jpg`, JPEG: `jpeg`, JPE: `jpe`, PNG: `png`, WEBP: `webp`, WIX_ICO_MP: `wix_ico_mp`, WIX_MP: `wix_mp`, GIF: `gif`, SVG: `svg`, AVIF: `avif`, UNRECOGNIZED: `unrecognized` };
|
|
534
|
+
var rt = { AVIF: `AVIF`, PAVIF: `PAVIF` };
|
|
535
|
+
M.JPG, M.JPEG, M.JPE, M.PNG, M.GIF, M.WEBP;
|
|
536
|
+
function N(e5, ...t2) {
|
|
537
|
+
return function(...n2) {
|
|
538
|
+
let r2 = n2[n2.length - 1] || {}, i2 = [e5[0]];
|
|
539
|
+
return t2.forEach(function(t3, a2) {
|
|
540
|
+
let o2 = Number.isInteger(t3) ? n2[t3] : r2[t3];
|
|
541
|
+
i2.push(o2, e5[a2 + 1]);
|
|
542
|
+
}), i2.join(``);
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
function P(e5) {
|
|
546
|
+
return e5[e5.length - 1];
|
|
547
|
+
}
|
|
548
|
+
var it = [M.PNG, M.JPEG, M.JPG, M.JPE, M.WIX_ICO_MP, M.WIX_MP, M.WEBP, M.AVIF];
|
|
549
|
+
var at = [M.JPEG, M.JPG, M.JPE];
|
|
550
|
+
function ot(e5) {
|
|
551
|
+
return it.includes(L(e5));
|
|
552
|
+
}
|
|
553
|
+
function st(e5, t2, n2) {
|
|
554
|
+
return n2 && t2 && !ht(t2.id) && Object.values(E).includes(e5);
|
|
555
|
+
}
|
|
556
|
+
function ct(e5, t2, n2) {
|
|
557
|
+
return !(F(e5) || I(e5)) || !t2 || n2;
|
|
558
|
+
}
|
|
559
|
+
function lt(e5, t2, n2) {
|
|
560
|
+
return pt(e5) ? !!(t2 || n2) : false;
|
|
561
|
+
}
|
|
562
|
+
function ut(e5, t2, n2, r2) {
|
|
563
|
+
if (mt(e5) || !ct(e5, t2, n2)) return false;
|
|
564
|
+
let i2 = ot(e5), a2 = lt(e5, n2, r2);
|
|
565
|
+
return i2 || a2;
|
|
566
|
+
}
|
|
567
|
+
function dt(e5) {
|
|
568
|
+
return at.includes(L(e5));
|
|
569
|
+
}
|
|
570
|
+
function ft(e5) {
|
|
571
|
+
return L(e5) === M.PNG;
|
|
572
|
+
}
|
|
573
|
+
function F(e5) {
|
|
574
|
+
return L(e5) === M.WEBP;
|
|
575
|
+
}
|
|
576
|
+
function pt(e5) {
|
|
577
|
+
return L(e5) === M.GIF;
|
|
578
|
+
}
|
|
579
|
+
function I(e5) {
|
|
580
|
+
return L(e5) === M.AVIF;
|
|
581
|
+
}
|
|
582
|
+
function mt(e5) {
|
|
583
|
+
return /(^https?)|(^data)|(^\/\/)/.test(e5);
|
|
584
|
+
}
|
|
585
|
+
function ht(e5) {
|
|
586
|
+
return !e5 || !e5.trim() || e5.toLowerCase() === `none`;
|
|
587
|
+
}
|
|
588
|
+
function gt(e5) {
|
|
589
|
+
return e5?.isSEOBot ?? false;
|
|
590
|
+
}
|
|
591
|
+
var _t = [`/`, `\\`, `?`, `<`, `>`, `|`, `\u201C`, `:`, `"`].map(encodeURIComponent);
|
|
592
|
+
var vt = [`\\.`, `\\*`];
|
|
593
|
+
var yt = `_`;
|
|
594
|
+
function bt(e5, t2) {
|
|
595
|
+
let n2 = /\/(.*?)$/, r2 = /\.([^.]*)$/, i2 = RegExp(`(${_t.concat(vt).join(`|`)})`, `g`);
|
|
596
|
+
if (t2 && t2.length) {
|
|
597
|
+
let e6 = t2, n3 = t2.match(r2);
|
|
598
|
+
return n3 && it.includes(n3[1]) && (e6 = t2.replace(r2, ``)), encodeURIComponent(e6).replace(i2, yt);
|
|
599
|
+
}
|
|
600
|
+
let a2 = e5.match(n2);
|
|
601
|
+
return (a2 ? a2[1] : e5).replace(r2, ``);
|
|
602
|
+
}
|
|
603
|
+
function xt(e5) {
|
|
604
|
+
return dt(e5) ? M.JPG : ft(e5) ? M.PNG : F(e5) ? M.WEBP : pt(e5) ? M.GIF : I(e5) ? M.AVIF : M.UNRECOGNIZED;
|
|
605
|
+
}
|
|
606
|
+
function L(e5) {
|
|
607
|
+
return (/[.]([^.]+)$/.exec(e5) && /[.]([^.]+)$/.exec(e5)[1] || ``).toLowerCase();
|
|
608
|
+
}
|
|
609
|
+
function St(e5, t2, n2, r2) {
|
|
610
|
+
return Math.min(n2 / e5, r2 / t2);
|
|
611
|
+
}
|
|
612
|
+
function Ct(e5, t2, n2, r2) {
|
|
613
|
+
return Math.max(n2 / e5, r2 / t2);
|
|
614
|
+
}
|
|
615
|
+
function wt(e5, t2, n2, r2, i2) {
|
|
616
|
+
let a2;
|
|
617
|
+
return a2 = i2 === D.FILL ? Ct(e5, t2, n2, r2) : i2 === D.FIT ? St(e5, t2, n2, r2) : 1, a2;
|
|
618
|
+
}
|
|
619
|
+
function Tt(e5, t2, n2, r2, i2) {
|
|
620
|
+
let a2, o2 = n2, s2 = r2;
|
|
621
|
+
if (a2 = wt(e5, t2, n2, r2, i2), i2 === D.FIT && (o2 = e5 * a2, s2 = t2 * a2), o2 && s2 && o2 * s2 > 25e6) {
|
|
622
|
+
let n3 = Math.sqrt(tt / (o2 * s2));
|
|
623
|
+
o2 *= n3, s2 *= n3, a2 = wt(e5, t2, o2, s2, i2);
|
|
624
|
+
}
|
|
625
|
+
return { scaleFactor: a2, width: o2, height: s2 };
|
|
626
|
+
}
|
|
627
|
+
function Et(e5, t2, n2, r2, i2, a2) {
|
|
628
|
+
e5 ||= r2.width, t2 ||= r2.height;
|
|
629
|
+
let { scaleFactor: o2, width: s2, height: c2 } = Tt(e5, t2, r2.width * i2, r2.height * i2, n2);
|
|
630
|
+
return Rt(e5, t2, s2, c2, a2, o2, n2);
|
|
631
|
+
}
|
|
632
|
+
function Dt(e5 = O.CENTER) {
|
|
633
|
+
return Ye[e5];
|
|
634
|
+
}
|
|
635
|
+
function Ot(e5, t2, n2, r2) {
|
|
636
|
+
let i2 = Mt(n2) || Dt(r2);
|
|
637
|
+
return { x: Math.max(0, Math.min(e5.width - t2.width, i2.x * e5.width - t2.width / 2)), y: Math.max(0, Math.min(e5.height - t2.height, i2.y * e5.height - t2.height / 2)), width: Math.min(e5.width, t2.width), height: Math.min(e5.height, t2.height) };
|
|
638
|
+
}
|
|
639
|
+
function kt(e5, t2) {
|
|
640
|
+
let n2 = Math.max(0, Math.min(e5.width, t2.x + t2.width) - Math.max(0, t2.x)), r2 = Math.max(0, Math.min(e5.height, t2.y + t2.height) - Math.max(0, t2.y));
|
|
641
|
+
return n2 && r2 && (e5.width !== n2 || e5.height !== r2) ? { x: Math.max(0, t2.x), y: Math.max(0, t2.y), width: n2, height: r2 } : null;
|
|
642
|
+
}
|
|
643
|
+
function At(e5) {
|
|
644
|
+
return Math.min(e5.pixelAspectRatio || 1, 2);
|
|
645
|
+
}
|
|
646
|
+
function jt(e5) {
|
|
647
|
+
return e5.alignment && Xe[e5.alignment] || Xe[O.CENTER];
|
|
648
|
+
}
|
|
649
|
+
function Mt(e5) {
|
|
650
|
+
let t2;
|
|
651
|
+
return e5 && typeof e5.x == `number` && !isNaN(e5.x) && typeof e5.y == `number` && !isNaN(e5.y) && (t2 = { x: R(Math.max(0, Math.min(100, e5.x)) / 100, 2), y: R(Math.max(0, Math.min(100, e5.y)) / 100, 2) }), t2;
|
|
652
|
+
}
|
|
653
|
+
function Nt(e5, t2) {
|
|
654
|
+
return k[zt(e5, t2)].quality;
|
|
655
|
+
}
|
|
656
|
+
function Pt(e5, t2) {
|
|
657
|
+
return { optimizedScaleFactor: k[zt(e5, t2)].maxUpscale, upscaleMethodValue: $e.classic, forceUSM: false };
|
|
658
|
+
}
|
|
659
|
+
function Ft(e5, t2) {
|
|
660
|
+
return { optimizedScaleFactor: k[zt(e5, t2)].maxUpscale, upscaleMethodValue: $e.classic, forceUSM: false };
|
|
661
|
+
}
|
|
662
|
+
function It(e5) {
|
|
663
|
+
return { optimizedScaleFactor: P(nt), upscaleMethodValue: $e.super, forceUSM: !(nt.includes(e5) || e5 > P(nt)) };
|
|
664
|
+
}
|
|
665
|
+
function Lt(e5, t2, n2, r2) {
|
|
666
|
+
return r2 === `auto` ? Ft(e5, t2) : r2 === `super` ? It(n2) : Pt(e5, t2);
|
|
667
|
+
}
|
|
668
|
+
function Rt(e5, t2, n2, r2, i2, a2, o2) {
|
|
669
|
+
let { optimizedScaleFactor: s2, upscaleMethodValue: c2, forceUSM: l2 } = Lt(e5, t2, a2, i2), u2 = n2, d2 = r2;
|
|
670
|
+
if (a2 <= s2) return { width: u2, height: d2, scaleFactor: a2, upscaleMethodValue: c2, forceUSM: l2, cssUpscaleNeeded: false };
|
|
671
|
+
switch (o2) {
|
|
672
|
+
case D.FILL:
|
|
673
|
+
u2 = s2 / a2 * n2, d2 = s2 / a2 * r2;
|
|
674
|
+
break;
|
|
675
|
+
case D.FIT:
|
|
676
|
+
u2 = e5 * s2, d2 = t2 * s2;
|
|
677
|
+
}
|
|
678
|
+
return { width: u2, height: d2, scaleFactor: s2, upscaleMethodValue: c2, forceUSM: l2, cssUpscaleNeeded: true };
|
|
679
|
+
}
|
|
680
|
+
function zt(e5, t2) {
|
|
681
|
+
let n2 = e5 * t2;
|
|
682
|
+
return n2 > k[A.HIGH].size ? A.HIGH : n2 > k[A.MEDIUM].size ? A.MEDIUM : n2 > k[A.LOW].size ? A.LOW : A.TINY;
|
|
683
|
+
}
|
|
684
|
+
function R(e5, t2) {
|
|
685
|
+
let n2 = 10 ** (t2 || 0);
|
|
686
|
+
return (e5 * n2 / n2).toFixed(t2);
|
|
687
|
+
}
|
|
688
|
+
function Bt(e5) {
|
|
689
|
+
return !e5 || !e5.upscaleMethod ? Qe.AUTO : Qe[e5.upscaleMethod.toUpperCase()] || Qe.AUTO;
|
|
690
|
+
}
|
|
691
|
+
function Vt(e5, t2) {
|
|
692
|
+
let n2 = F(e5) || I(e5);
|
|
693
|
+
return L(e5) === M.GIF || n2 && t2;
|
|
694
|
+
}
|
|
695
|
+
var Ht = { isMobile: false };
|
|
696
|
+
var Ut = function(e5) {
|
|
697
|
+
return Ht[e5];
|
|
698
|
+
};
|
|
699
|
+
var Wt = function(e5, t2) {
|
|
700
|
+
Ht[e5] = t2;
|
|
701
|
+
};
|
|
702
|
+
function Gt() {
|
|
703
|
+
if (typeof window < `u` && typeof navigator < `u`) {
|
|
704
|
+
let e5 = window.matchMedia && window.matchMedia(`(max-width: 767px)`).matches, t2 = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
705
|
+
Wt(`isMobile`, e5 && t2);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
O.CENTER, O.TOP, O.TOP_LEFT, O.TOP_RIGHT, O.BOTTOM, O.BOTTOM_LEFT, O.BOTTOM_RIGHT, O.LEFT, O.RIGHT;
|
|
709
|
+
function Kt() {
|
|
710
|
+
return Ut(`isMobile`);
|
|
711
|
+
}
|
|
712
|
+
function qt(e5, t2, n2) {
|
|
713
|
+
let r2;
|
|
714
|
+
switch (t2.crop && (r2 = kt(t2, t2.crop), r2 && (e5.src.width = r2.width, e5.src.height = r2.height, e5.src.isCropped = true, e5.parts.push(Zt(r2)))), e5.fittingType) {
|
|
715
|
+
case E.SCALE_TO_FIT:
|
|
716
|
+
case E.LEGACY_FIT_WIDTH:
|
|
717
|
+
case E.LEGACY_FIT_HEIGHT:
|
|
718
|
+
case E.LEGACY_FULL:
|
|
719
|
+
case E.FIT_AND_TILE:
|
|
720
|
+
case E.LEGACY_BG_FIT_AND_TILE:
|
|
721
|
+
case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:
|
|
722
|
+
case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:
|
|
723
|
+
case E.LEGACY_BG_NORMAL:
|
|
724
|
+
e5.parts.push(Jt(e5, n2));
|
|
725
|
+
break;
|
|
726
|
+
case E.SCALE_TO_FILL:
|
|
727
|
+
e5.parts.push(Yt(e5, n2));
|
|
728
|
+
break;
|
|
729
|
+
case E.STRETCH:
|
|
730
|
+
e5.parts.push(Xt(e5, n2));
|
|
731
|
+
break;
|
|
732
|
+
case E.TILE_HORIZONTAL:
|
|
733
|
+
case E.TILE_VERTICAL:
|
|
734
|
+
case E.TILE:
|
|
735
|
+
case E.LEGACY_ORIGINAL_SIZE:
|
|
736
|
+
case E.ORIGINAL_SIZE:
|
|
737
|
+
r2 = Ot(e5.src, n2, e5.focalPoint, n2.alignment), e5.src.isCropped ? (Object.assign(e5.parts[0], r2), e5.src.width = r2.width, e5.src.height = r2.height) : e5.parts.push(Zt(r2));
|
|
738
|
+
break;
|
|
739
|
+
case E.LEGACY_STRIP_TILE_HORIZONTAL:
|
|
740
|
+
case E.LEGACY_STRIP_TILE_VERTICAL:
|
|
741
|
+
case E.LEGACY_STRIP_TILE:
|
|
742
|
+
case E.LEGACY_STRIP_ORIGINAL_SIZE:
|
|
743
|
+
e5.parts.push(en(n2));
|
|
744
|
+
break;
|
|
745
|
+
case E.LEGACY_STRIP_SCALE_TO_FIT:
|
|
746
|
+
case E.LEGACY_STRIP_FIT_AND_TILE:
|
|
747
|
+
e5.parts.push(Qt(n2));
|
|
748
|
+
break;
|
|
749
|
+
case E.LEGACY_STRIP_SCALE_TO_FILL:
|
|
750
|
+
e5.parts.push($t(n2));
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function Jt(e5, t2) {
|
|
754
|
+
let n2 = Et(e5.src.width, e5.src.height, D.FIT, t2, e5.devicePixelRatio, e5.upscaleMethod);
|
|
755
|
+
return { transformType: !e5.src.width || !e5.src.height ? D.FIT : D.FILL, width: Math.round(n2.width), height: Math.round(n2.height), alignment: Xe.center, upscale: n2.scaleFactor > 1, forceUSM: n2.forceUSM, scaleFactor: n2.scaleFactor, cssUpscaleNeeded: n2.cssUpscaleNeeded, upscaleMethodValue: n2.upscaleMethodValue };
|
|
756
|
+
}
|
|
757
|
+
function Yt(e5, t2) {
|
|
758
|
+
let n2 = Et(e5.src.width, e5.src.height, D.FILL, t2, e5.devicePixelRatio, e5.upscaleMethod), r2 = Mt(e5.focalPoint);
|
|
759
|
+
return { transformType: r2 ? D.FILL_FOCAL : D.FILL, width: Math.round(n2.width), height: Math.round(n2.height), alignment: jt(t2), focalPointX: r2 && r2.x, focalPointY: r2 && r2.y, upscale: n2.scaleFactor > 1, forceUSM: n2.forceUSM, scaleFactor: n2.scaleFactor, cssUpscaleNeeded: n2.cssUpscaleNeeded, upscaleMethodValue: n2.upscaleMethodValue };
|
|
760
|
+
}
|
|
761
|
+
function Xt(e5, t2) {
|
|
762
|
+
let n2 = wt(e5.src.width, e5.src.height, t2.width, t2.height, D.FILL), r2 = { ...t2 };
|
|
763
|
+
return r2.width = e5.src.width * n2, r2.height = e5.src.height * n2, Jt(e5, r2);
|
|
764
|
+
}
|
|
765
|
+
function Zt(e5) {
|
|
766
|
+
return { transformType: D.CROP, x: Math.round(e5.x), y: Math.round(e5.y), width: Math.round(e5.width), height: Math.round(e5.height), upscale: false, forceUSM: false, scaleFactor: 1, cssUpscaleNeeded: false };
|
|
767
|
+
}
|
|
768
|
+
function Qt(e5) {
|
|
769
|
+
return { transformType: D.FIT, width: Math.round(e5.width), height: Math.round(e5.height), upscale: false, forceUSM: true, scaleFactor: 1, cssUpscaleNeeded: false };
|
|
770
|
+
}
|
|
771
|
+
function $t(e5) {
|
|
772
|
+
return { transformType: D.LEGACY_FILL, width: Math.round(e5.width), height: Math.round(e5.height), alignment: jt(e5), upscale: false, forceUSM: true, scaleFactor: 1, cssUpscaleNeeded: false };
|
|
773
|
+
}
|
|
774
|
+
function en(e5) {
|
|
775
|
+
return { transformType: D.LEGACY_CROP, width: Math.round(e5.width), height: Math.round(e5.height), alignment: jt(e5), upscale: false, forceUSM: false, scaleFactor: 1, cssUpscaleNeeded: false };
|
|
776
|
+
}
|
|
777
|
+
function tn(e5, t2) {
|
|
778
|
+
t2 ||= {}, e5.quality = an(e5, t2), e5.progressive = rn(t2), e5.watermark = nn(t2), e5.autoEncode = t2.autoEncode ?? true, e5.encoding = t2?.encoding, e5.unsharpMask = sn(e5, t2), e5.filters = on(t2);
|
|
779
|
+
}
|
|
780
|
+
function nn(e5) {
|
|
781
|
+
return e5.watermark;
|
|
782
|
+
}
|
|
783
|
+
function rn(e5) {
|
|
784
|
+
return e5.progressive !== false;
|
|
785
|
+
}
|
|
786
|
+
function an(e5, t2) {
|
|
787
|
+
let n2 = e5.fileType === M.PNG, r2 = e5.fileType === M.JPG, i2 = e5.fileType === M.WEBP, a2 = e5.fileType === M.AVIF;
|
|
788
|
+
if (r2 || n2 || i2 || a2) {
|
|
789
|
+
let r3 = P(e5.parts), i3 = Nt(r3.width, r3.height), a3 = t2.quality && t2.quality >= 5 && t2.quality <= 90 ? t2.quality : i3;
|
|
790
|
+
return a3 = n2 ? a3 + 5 : a3, a3;
|
|
791
|
+
}
|
|
792
|
+
return 0;
|
|
793
|
+
}
|
|
794
|
+
function on(e5) {
|
|
795
|
+
let t2 = e5.filters || {}, n2 = {};
|
|
796
|
+
return z(t2[j.CONTRAST], -100, 100) && (n2[j.CONTRAST] = t2[j.CONTRAST]), z(t2[j.BRIGHTNESS], -100, 100) && (n2[j.BRIGHTNESS] = t2[j.BRIGHTNESS]), z(t2[j.SATURATION], -100, 100) && (n2[j.SATURATION] = t2[j.SATURATION]), z(t2[j.HUE], -180, 180) && (n2[j.HUE] = t2[j.HUE]), z(t2[j.BLUR], 0, 100) && (n2[j.BLUR] = t2[j.BLUR]), n2;
|
|
797
|
+
}
|
|
798
|
+
function z(e5, t2, n2) {
|
|
799
|
+
return typeof e5 == `number` && !isNaN(e5) && e5 !== 0 && e5 >= t2 && e5 <= n2;
|
|
800
|
+
}
|
|
801
|
+
function sn(e5, t2) {
|
|
802
|
+
if (ln(t2.unsharpMask)) return { radius: R(t2.unsharpMask?.radius, 2), amount: R(t2.unsharpMask?.amount, 2), threshold: R(t2.unsharpMask?.threshold, 2) };
|
|
803
|
+
if (!un(t2.unsharpMask) && cn(e5)) return et;
|
|
804
|
+
}
|
|
805
|
+
function cn(e5) {
|
|
806
|
+
let t2 = P(e5.parts);
|
|
807
|
+
return !(t2.scaleFactor >= 1) || t2.forceUSM || t2.transformType === D.FIT;
|
|
808
|
+
}
|
|
809
|
+
function ln(e5) {
|
|
810
|
+
e5 ||= {};
|
|
811
|
+
let t2 = typeof e5.radius == `number` && !isNaN(e5.radius) && e5.radius >= 0.1 && e5.radius <= 500, n2 = typeof e5.amount == `number` && !isNaN(e5.amount) && e5.amount >= 0 && e5.amount <= 10, r2 = typeof e5.threshold == `number` && !isNaN(e5.threshold) && e5.threshold >= 0 && e5.threshold <= 255;
|
|
812
|
+
return t2 && n2 && r2;
|
|
813
|
+
}
|
|
814
|
+
function un(e5) {
|
|
815
|
+
return e5 ||= {}, typeof e5.radius == `number` && !isNaN(e5.radius) && e5.radius === 0 && typeof e5.amount == `number` && !isNaN(e5.amount) && e5.amount === 0 && typeof e5.threshold == `number` && !isNaN(e5.threshold) && e5.threshold === 0;
|
|
816
|
+
}
|
|
817
|
+
function dn(e5, t2, n2, r2) {
|
|
818
|
+
let i2 = gt(r2), a2 = xt(t2.id), o2 = bt(t2.id, t2.name), s2 = i2 ? 1 : At(n2), c2 = L(t2.id), l2 = c2, u2 = ut(t2.id, r2?.hasAnimation, r2?.allowAnimatedTransform, r2?.allowFullGIFTransformation), d2 = { fileName: o2, fileExtension: c2, fileType: a2, fittingType: e5, preferredExtension: l2, src: { id: t2.id, width: t2.width, height: t2.height, isCropped: false, isAnimated: Vt(t2.id, r2?.hasAnimation) }, focalPoint: { x: t2.focalPoint && t2.focalPoint.x, y: t2.focalPoint && t2.focalPoint.y }, parts: [], devicePixelRatio: s2, quality: 0, upscaleMethod: Bt(r2), progressive: true, watermark: ``, unsharpMask: {}, filters: {}, transformed: u2, allowFullGIFTransformation: r2?.allowFullGIFTransformation, isPlaceholderFlow: r2?.isPlaceholderFlow };
|
|
819
|
+
return u2 && (qt(d2, t2, n2), tn(d2, r2)), d2;
|
|
820
|
+
}
|
|
821
|
+
function fn(e5, t2, n2) {
|
|
822
|
+
let r2 = { ...n2 }, i2 = Kt();
|
|
823
|
+
switch (e5) {
|
|
824
|
+
case E.LEGACY_BG_FIT_AND_TILE:
|
|
825
|
+
case E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL:
|
|
826
|
+
case E.LEGACY_BG_FIT_AND_TILE_VERTICAL:
|
|
827
|
+
case E.LEGACY_BG_NORMAL:
|
|
828
|
+
let e6 = i2 ? qe : Ge, n3 = i2 ? Je : Ke;
|
|
829
|
+
r2.width = Math.min(e6, t2.width), r2.height = Math.min(n3, Math.round(r2.width / (t2.width / t2.height))), r2.pixelAspectRatio = 1;
|
|
830
|
+
}
|
|
831
|
+
return r2;
|
|
832
|
+
}
|
|
833
|
+
var pn = N`fit/w_${`width`},h_${`height`}`;
|
|
834
|
+
var mn = N`fill/w_${`width`},h_${`height`},al_${`alignment`}`;
|
|
835
|
+
var hn = N`fill/w_${`width`},h_${`height`},fp_${`focalPointX`}_${`focalPointY`}`;
|
|
836
|
+
var gn = N`crop/x_${`x`},y_${`y`},w_${`width`},h_${`height`}`;
|
|
837
|
+
var _n = N`crop/w_${`width`},h_${`height`},al_${`alignment`}`;
|
|
838
|
+
var vn = N`fill/w_${`width`},h_${`height`},al_${`alignment`}`;
|
|
839
|
+
var yn = N`,lg_${`upscaleMethodValue`}`;
|
|
840
|
+
var bn = N`,q_${`quality`}`;
|
|
841
|
+
var xn = N`,quality_auto`;
|
|
842
|
+
var Sn = N`,usm_${`radius`}_${`amount`}_${`threshold`}`;
|
|
843
|
+
var Cn = N`,bl`;
|
|
844
|
+
var wn = N`,wm_${`watermark`}`;
|
|
845
|
+
var Tn = { [j.CONTRAST]: N`,con_${`contrast`}`, [j.BRIGHTNESS]: N`,br_${`brightness`}`, [j.SATURATION]: N`,sat_${`saturation`}`, [j.HUE]: N`,hue_${`hue`}`, [j.BLUR]: N`,blur_${`blur`}` };
|
|
846
|
+
var En = N`,enc_auto`;
|
|
847
|
+
var Dn = N`,enc_avif`;
|
|
848
|
+
var On = N`,enc_pavif`;
|
|
849
|
+
var kn = N`,pstr`;
|
|
850
|
+
var An = N`,anm_all`;
|
|
851
|
+
function jn(e5) {
|
|
852
|
+
if (e5.parts.some(({ width: e6, height: t3 }) => !Number.isFinite(e6) || e6 <= 0 || !Number.isFinite(t3) || t3 <= 0)) return e5.src.id;
|
|
853
|
+
let t2 = [];
|
|
854
|
+
e5.parts.forEach((e6) => {
|
|
855
|
+
switch (e6.transformType) {
|
|
856
|
+
case D.CROP:
|
|
857
|
+
t2.push(gn(e6));
|
|
858
|
+
break;
|
|
859
|
+
case D.LEGACY_CROP:
|
|
860
|
+
t2.push(_n(e6));
|
|
861
|
+
break;
|
|
862
|
+
case D.LEGACY_FILL:
|
|
863
|
+
let n3 = vn(e6);
|
|
864
|
+
e6.upscale && (n3 += yn(e6)), t2.push(n3);
|
|
865
|
+
break;
|
|
866
|
+
case D.FIT:
|
|
867
|
+
let r2 = pn(e6);
|
|
868
|
+
e6.upscale && (r2 += yn(e6)), t2.push(r2);
|
|
869
|
+
break;
|
|
870
|
+
case D.FILL:
|
|
871
|
+
let i2 = mn(e6);
|
|
872
|
+
e6.upscale && (i2 += yn(e6)), t2.push(i2);
|
|
873
|
+
break;
|
|
874
|
+
case D.FILL_FOCAL:
|
|
875
|
+
let a2 = hn(e6);
|
|
876
|
+
e6.upscale && (a2 += yn(e6)), t2.push(a2);
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
let n2 = t2.join(`/`);
|
|
880
|
+
if (e5.quality && (n2 += bn(e5)), e5.unsharpMask && (n2 += Sn(e5.unsharpMask)), e5.progressive || (n2 += Cn(e5)), e5.watermark && (n2 += wn(e5)), e5.filters && (n2 += Object.keys(e5.filters).map((t3) => Tn[t3](e5.filters)).join(``)), e5.fileType !== M.GIF && (e5.encoding === rt.AVIF ? (n2 += Dn(e5), n2 += xn(e5)) : e5.encoding === rt.PAVIF ? (n2 += On(e5), n2 += xn(e5)) : e5.autoEncode && (n2 += En(e5))), e5.src?.isAnimated && e5.transformed) {
|
|
881
|
+
let t3 = pt(e5.src.id), r2 = e5.isPlaceholderFlow === true, i2 = e5.allowFullGIFTransformation === true;
|
|
882
|
+
r2 ? n2 += kn(e5) : t3 && i2 && (n2 += An(e5));
|
|
883
|
+
}
|
|
884
|
+
return `${e5.src.id}/v1/${n2}/${e5.fileName}.${e5.preferredExtension}`;
|
|
885
|
+
}
|
|
886
|
+
function Mn(e5, t2, n2, r2 = {}, i2) {
|
|
887
|
+
if (ut(t2.id, r2?.hasAnimation, r2?.allowAnimatedTransform, r2?.allowFullGIFTransformation)) {
|
|
888
|
+
if ((F(t2.id) || I(t2.id)) && !r2.allowWebpAvifTransforms) {
|
|
889
|
+
let { alignment: a2, ...o2 } = n2;
|
|
890
|
+
t2.focalPoint = { x: void 0, y: void 0 }, delete t2?.crop, i2 = dn(e5, t2, o2, r2);
|
|
891
|
+
} else i2 ||= dn(e5, t2, n2, r2);
|
|
892
|
+
return jn(i2);
|
|
893
|
+
}
|
|
894
|
+
return t2.id;
|
|
895
|
+
}
|
|
896
|
+
var Nn = { [O.CENTER]: `50% 50%`, [O.TOP_LEFT]: `0% 0%`, [O.TOP_RIGHT]: `100% 0%`, [O.TOP]: `50% 0%`, [O.BOTTOM_LEFT]: `0% 100%`, [O.BOTTOM_RIGHT]: `100% 100%`, [O.BOTTOM]: `50% 100%`, [O.RIGHT]: `100% 50%`, [O.LEFT]: `0% 50%` };
|
|
897
|
+
Object.entries(Nn).reduce((e5, [t2, n2]) => (e5[n2] = t2, e5), {}), E.TILE, E.TILE_HORIZONTAL, E.TILE_VERTICAL, E.LEGACY_BG_FIT_AND_TILE, E.LEGACY_BG_FIT_AND_TILE_HORIZONTAL, E.LEGACY_BG_FIT_AND_TILE_VERTICAL, E.LEGACY_ORIGINAL_SIZE, E.ORIGINAL_SIZE, E.LEGACY_BG_NORMAL;
|
|
898
|
+
function Pn(e5, t2, n2, r2) {
|
|
899
|
+
if (st(e5, t2, n2)) {
|
|
900
|
+
let i2 = fn(e5, t2, n2), a2 = dn(e5, t2, i2, r2);
|
|
901
|
+
return { uri: Mn(e5, t2, i2, r2 || {}, a2) };
|
|
902
|
+
}
|
|
903
|
+
return { uri: `` };
|
|
904
|
+
}
|
|
905
|
+
var Fn = `https://static.wixstatic.com/`;
|
|
906
|
+
var In = `https://static.wixstatic.com/media/`;
|
|
907
|
+
var Ln = /^media\//i;
|
|
908
|
+
var Rn = typeof window < `u` ? window.devicePixelRatio : 1;
|
|
909
|
+
var zn = (e5) => Ln.test(e5) ? `${Fn}${e5}` : `${In}${e5}`;
|
|
910
|
+
var Bn = (e5, t2) => {
|
|
911
|
+
let n2 = t2 && t2.baseHostURL;
|
|
912
|
+
return n2 ? `${n2}${e5}` : zn(e5);
|
|
913
|
+
};
|
|
914
|
+
function Vn(e5, t2, n2, r2, i2, a2) {
|
|
915
|
+
return Bn(Pn(E.SCALE_TO_FIT, { id: e5, width: t2, height: n2, name: a2 && a2.name }, { width: r2, height: i2, htmlTag: Ze.IMG, alignment: O.CENTER, pixelAspectRatio: a2?.devicePixelRatio ?? Rn }, a2).uri, a2);
|
|
916
|
+
}
|
|
917
|
+
function Hn(e5, t2, n2, r2, i2, a2) {
|
|
918
|
+
return Bn(Pn(E.SCALE_TO_FILL, { id: e5, width: t2, height: n2, name: a2 && a2.name, focalPoint: { x: a2 && a2.focalPoint && a2.focalPoint.x, y: a2 && a2.focalPoint && a2.focalPoint.y } }, { width: r2, height: i2, htmlTag: Ze.IMG, alignment: O.CENTER, pixelAspectRatio: a2?.devicePixelRatio ?? Rn }, a2).uri, a2);
|
|
919
|
+
}
|
|
920
|
+
function Un(e5, t2, n2, r2, i2, a2, o2, s2, c2, l2) {
|
|
921
|
+
return Bn(Pn(E.SCALE_TO_FILL, { id: e5, width: t2, height: n2, name: l2 && l2.name, crop: { x: r2, y: i2, width: a2, height: o2 } }, { width: s2, height: c2, htmlTag: Ze.IMG, alignment: O.CENTER, pixelAspectRatio: l2?.devicePixelRatio ?? Rn }, l2).uri, l2);
|
|
922
|
+
}
|
|
923
|
+
Gt(), Gt();
|
|
924
|
+
var Wn = { getScaleToFitImageURL: Vn, getScaleToFillImageURL: Hn, getCropImageURL: Un };
|
|
925
|
+
var Gn = `wix:`;
|
|
926
|
+
var Kn = `image`;
|
|
927
|
+
var qn = `video`;
|
|
928
|
+
var Jn = `audio`;
|
|
929
|
+
var Yn = `document`;
|
|
930
|
+
var Xn = `https://static.wixstatic.com/media/`;
|
|
931
|
+
var Zn = `https://static.wixstatic.com/shapes/`;
|
|
932
|
+
var Qn = `https://video.wixstatic.com/video/`;
|
|
933
|
+
var $n = `https://static.wixstatic.com/mp3/`;
|
|
934
|
+
var er = `https://d945e594-8657-47e2-9cd9-e9033c3d8da0.usrfiles.com/`;
|
|
935
|
+
function tr(e5, t2, n2, r2) {
|
|
936
|
+
let i2 = ir(e5);
|
|
937
|
+
return Wn.getScaleToFillImageURL(i2.id, i2.height, i2.width, t2, n2, r2);
|
|
938
|
+
}
|
|
939
|
+
function nr(e5, t2, n2, r2) {
|
|
940
|
+
let i2 = ir(e5);
|
|
941
|
+
return Wn.getScaleToFitImageURL(i2.id, i2.height, i2.width, t2, n2, r2);
|
|
942
|
+
}
|
|
943
|
+
function rr(e5, t2, n2, r2, i2, a2, o2, s2) {
|
|
944
|
+
let c2 = ir(e5);
|
|
945
|
+
return Wn.getCropImageURL(c2.id, c2.height, c2.width, t2, n2, r2, i2, a2, o2, s2);
|
|
946
|
+
}
|
|
947
|
+
function ir(e5) {
|
|
948
|
+
return or(e5, Xn);
|
|
949
|
+
}
|
|
950
|
+
function ar(e5) {
|
|
951
|
+
return or(e5, Zn);
|
|
952
|
+
}
|
|
953
|
+
function or(e5, t2 = Xn) {
|
|
954
|
+
let n2, r2, i2, a2;
|
|
955
|
+
if (e5.startsWith(t2)) n2 = e5.split(t2).pop().split(`/`)[0], a2 = e5.split(`/w_`).pop().split(`,`)[0], i2 = e5.split(`,h_`).pop().split(`,`)[0];
|
|
956
|
+
else {
|
|
957
|
+
let t3 = dr(e5, Kn), { hash: o3, pathname: s3 } = new URL(t3), c2 = new URLSearchParams(o3.replace(`#`, ``));
|
|
958
|
+
i2 = c2.get(`originHeight`), a2 = c2.get(`originWidth`), [n2, r2] = s3.replace(`${Kn}://v1/`, ``).split(`/`);
|
|
959
|
+
}
|
|
960
|
+
let o2 = ur(r2), s2 = { id: n2, url: `${t2}${n2}`, height: Number(i2), width: Number(a2) };
|
|
961
|
+
return o2 ? { ...s2, altText: o2, filename: o2 } : s2;
|
|
962
|
+
}
|
|
963
|
+
function sr(e5, t2) {
|
|
964
|
+
let n2, r2, i2, a2, o2 = ``;
|
|
965
|
+
if (e5.startsWith(Qn)) n2 = e5.split(Qn).pop().split(`/`)[0], r2 = `${n2}.jpg`, i2 = `50`, a2 = `50`;
|
|
966
|
+
else {
|
|
967
|
+
let t3 = dr(e5, qn), { pathname: s3, hash: c2 } = new URL(t3), l2 = new URLSearchParams(c2.replace(`#`, ``)), [u2, d2] = s3.replace(`${qn}://v1/`, ``).split(`/`);
|
|
968
|
+
n2 = u2, r2 = l2.get(`posterUri`) || `${n2}.jpg`, i2 = l2.get(`posterWidth`) || `50`, a2 = l2.get(`posterHeight`) || `50`, o2 = ur(d2);
|
|
969
|
+
}
|
|
970
|
+
let s2 = { id: n2, url: `${Qn}${n2}/${t2 ? `${t2}/mp4/file.mp4` : `file`}`, thumbnail: `${Gn}${Kn}://v1/${r2}#originWidth=${i2}&originHeight=${a2}` };
|
|
971
|
+
return o2 ? { ...s2, filename: o2 } : s2;
|
|
972
|
+
}
|
|
973
|
+
function cr(e5) {
|
|
974
|
+
let t2 = dr(e5, Jn), { pathname: n2, hash: r2 } = new URL(t2), [i2, a2] = n2.replace(`${Jn}://v1/`, ``).split(`/`), o2 = ur(a2), s2 = new URLSearchParams(r2.replace(`#`, ``)), c2 = { id: i2, duration: Number(s2.get(`duration`) || ``), url: `${$n}${i2}` };
|
|
975
|
+
return o2 ? { ...c2, filename: o2 } : c2;
|
|
976
|
+
}
|
|
977
|
+
function lr(e5) {
|
|
978
|
+
let t2 = dr(e5, Yn), { pathname: n2 } = new URL(t2), r2 = n2.replace(`${Yn}://v1/`, ``).split(`/`), i2 = r2[0] === `ugd` || r2[0] === `archives` ? r2.shift() : `ugd`, [a2, o2] = r2, s2 = ur(o2), c2 = { id: a2, url: `${er}${i2}/${a2}` };
|
|
979
|
+
return s2 ? { ...c2, filename: s2 } : c2;
|
|
980
|
+
}
|
|
981
|
+
function ur(e5) {
|
|
982
|
+
return e5 && decodeURIComponent(e5);
|
|
983
|
+
}
|
|
984
|
+
function dr(e5, t2) {
|
|
985
|
+
let { protocol: n2 } = new URL(e5);
|
|
986
|
+
return n2 === `${t2}:` ? `${Gn}${e5}` : e5;
|
|
987
|
+
}
|
|
988
|
+
var fr;
|
|
989
|
+
(function(e5) {
|
|
990
|
+
e5.MOBILE = `360p`, e5.LOW = `480p`, e5.MID = `720p`, e5.HIGH = `1080p`;
|
|
991
|
+
})(fr ||= {});
|
|
992
|
+
var pr = { getCroppedImageUrl: rr, getScaledToFillImageUrl: tr, getScaledToFitImageUrl: nr, getImageUrl: ir, getVideoUrl: sr, getAudioUrl: cr, getDocumentUrl: lr, getShapeUrl: ar };
|
|
993
|
+
var mr = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
994
|
+
var hr = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
995
|
+
function gr(e5, t2) {
|
|
518
996
|
return e5?.split(`.`).map((e6) => t2?.[e6] ?? e6).join(`.`);
|
|
519
997
|
}
|
|
520
|
-
var
|
|
521
|
-
function
|
|
522
|
-
return (e5 ===
|
|
998
|
+
var _r = `sort.fieldName`;
|
|
999
|
+
function vr(e5, t2, n2) {
|
|
1000
|
+
return (e5 === _r || e5.endsWith(`.${_r}`)) && typeof t2 == `string` ? gr(t2, n2) : t2;
|
|
523
1001
|
}
|
|
524
|
-
function
|
|
1002
|
+
function yr(e5, t2, n2) {
|
|
525
1003
|
let r2 = (e6) => n2.includes(e6), i2 = (e6, n3) => {
|
|
526
1004
|
if (Array.isArray(e6)) e6.forEach((e7) => {
|
|
527
1005
|
i2(e7, n3);
|
|
@@ -531,144 +1009,144 @@ function Ye(e5, t2, n2) {
|
|
|
531
1009
|
Object.keys(a2).forEach((e7) => {
|
|
532
1010
|
let o2 = n3 === `` ? e7 : `${n3}.${e7}`;
|
|
533
1011
|
if (r2(o2)) return;
|
|
534
|
-
let s2 =
|
|
535
|
-
s2 !== e7 && !(s2 in a2) && (a2[s2] = a2[e7], delete a2[e7]), a2[s2] =
|
|
1012
|
+
let s2 = br(e7, t2);
|
|
1013
|
+
s2 !== e7 && !(s2 in a2) && (a2[s2] = a2[e7], delete a2[e7]), a2[s2] = vr(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
536
1014
|
});
|
|
537
1015
|
}
|
|
538
1016
|
};
|
|
539
1017
|
return i2(e5, ``), e5;
|
|
540
1018
|
}
|
|
541
|
-
function
|
|
1019
|
+
function br(e5, t2) {
|
|
542
1020
|
let n2;
|
|
543
1021
|
return n2 = e5.includes(`.`) ? e5.split(`.`).map((e6) => t2[e6] ?? e6).join(`.`) : t2[e5] ?? e5, n2;
|
|
544
1022
|
}
|
|
545
|
-
function
|
|
546
|
-
return
|
|
1023
|
+
function xr(e5, t2 = []) {
|
|
1024
|
+
return yr(e5, mr, t2);
|
|
547
1025
|
}
|
|
548
|
-
function
|
|
549
|
-
return
|
|
1026
|
+
function Sr(e5, t2 = []) {
|
|
1027
|
+
return yr(e5, hr, t2);
|
|
550
1028
|
}
|
|
551
|
-
function
|
|
1029
|
+
function Cr(e5) {
|
|
552
1030
|
return e5 ? new Date(e5) : void 0;
|
|
553
1031
|
}
|
|
554
|
-
var
|
|
555
|
-
function
|
|
1032
|
+
var wr = /* @__PURE__ */ new WeakMap();
|
|
1033
|
+
function Tr() {
|
|
556
1034
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
557
1035
|
}
|
|
558
|
-
function
|
|
1036
|
+
function Er(e5, t2) {
|
|
559
1037
|
let n2 = e5.get(t2);
|
|
560
|
-
return n2 || (n2 =
|
|
1038
|
+
return n2 || (n2 = Tr(), e5.set(t2, n2)), n2;
|
|
561
1039
|
}
|
|
562
|
-
function
|
|
563
|
-
return t2 === `*` ? (e5.anyField ??=
|
|
1040
|
+
function Dr(e5, t2) {
|
|
1041
|
+
return t2 === `*` ? (e5.anyField ??= Tr(), e5.anyField) : t2.endsWith(`{}`) ? (e5.mapFields ??= /* @__PURE__ */ new Map(), Er(e5.mapFields, t2.slice(0, -2))) : (e5.fields ??= /* @__PURE__ */ new Map(), Er(e5.fields, t2));
|
|
564
1042
|
}
|
|
565
|
-
function
|
|
566
|
-
let t2 =
|
|
1043
|
+
function Or(e5) {
|
|
1044
|
+
let t2 = Tr();
|
|
567
1045
|
for (let n2 of e5) {
|
|
568
|
-
let e6 = n2.path.split(`.`).reduce(
|
|
1046
|
+
let e6 = n2.path.split(`.`).reduce(Dr, t2);
|
|
569
1047
|
e6.leaves ??= [], e6.leaves.push(n2);
|
|
570
1048
|
}
|
|
571
1049
|
return t2;
|
|
572
1050
|
}
|
|
573
|
-
function
|
|
574
|
-
let t2 =
|
|
575
|
-
return t2 || (t2 =
|
|
1051
|
+
function kr(e5) {
|
|
1052
|
+
let t2 = wr.get(e5);
|
|
1053
|
+
return t2 || (t2 = Or(e5), wr.set(e5, t2)), t2;
|
|
576
1054
|
}
|
|
577
|
-
function
|
|
1055
|
+
function Ar(e5) {
|
|
578
1056
|
return typeof e5 == `object` && !!e5;
|
|
579
1057
|
}
|
|
580
|
-
function
|
|
581
|
-
return t2 ? Array.isArray(e5) ? e5.map(r2) : e5 : n2 ?
|
|
1058
|
+
function jr(e5, { isRepeated: t2, isMap: n2 }, r2) {
|
|
1059
|
+
return t2 ? Array.isArray(e5) ? e5.map(r2) : e5 : n2 ? Ar(e5) ? Object.fromEntries(Object.entries(e5).map(([e6, t3]) => [e6, r2(t3)])) : e5 : r2(e5);
|
|
582
1060
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
1061
|
+
function Mr(e5, t2, n2) {
|
|
1062
|
+
Ar(e5) && Fr(e5, t2, n2);
|
|
585
1063
|
}
|
|
586
|
-
function
|
|
1064
|
+
function Nr(e5, t2, n2) {
|
|
587
1065
|
for (let [r2, i2] of t2) {
|
|
588
1066
|
if (!(r2 in e5)) continue;
|
|
589
|
-
if (i2.leaves) for (let t4 of i2.leaves) e5[r2] =
|
|
1067
|
+
if (i2.leaves) for (let t4 of i2.leaves) e5[r2] = jr(e5[r2], t4, n2);
|
|
590
1068
|
let t3 = e5[r2];
|
|
591
|
-
Array.isArray(t3) ? t3.forEach((e6) =>
|
|
1069
|
+
Array.isArray(t3) ? t3.forEach((e6) => Mr(e6, i2, n2)) : Mr(t3, i2, n2);
|
|
592
1070
|
}
|
|
593
1071
|
}
|
|
594
|
-
function
|
|
1072
|
+
function Pr(e5, t2, n2) {
|
|
595
1073
|
for (let [r2, i2] of t2) {
|
|
596
1074
|
let t3 = e5[r2];
|
|
597
|
-
|
|
1075
|
+
Ar(t3) && Object.values(t3).forEach((e6) => Mr(e6, i2, n2));
|
|
598
1076
|
}
|
|
599
1077
|
}
|
|
600
|
-
function
|
|
601
|
-
t2 &&
|
|
1078
|
+
function Fr(e5, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
1079
|
+
t2 && Nr(e5, t2, i2), n2 && Pr(e5, n2, i2), r2 && Object.values(e5).forEach((e6) => Mr(e6, r2, i2));
|
|
602
1080
|
}
|
|
603
|
-
function
|
|
604
|
-
if (!
|
|
605
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
1081
|
+
function Ir(e5, t2) {
|
|
1082
|
+
if (!Ar(e5)) return e5;
|
|
1083
|
+
for (let { paths: n2, transformFn: r2 } of t2) Fr(e5, kr(n2), r2);
|
|
606
1084
|
return e5;
|
|
607
1085
|
}
|
|
608
|
-
function
|
|
609
|
-
return
|
|
1086
|
+
function Lr(e5) {
|
|
1087
|
+
return Hr(e5).map((e6) => e6.toLocaleUpperCase()).join(`_`);
|
|
610
1088
|
}
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var
|
|
614
|
-
var
|
|
615
|
-
function
|
|
1089
|
+
var Rr = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
1090
|
+
var zr = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
1091
|
+
var Br = `$1\0$2`;
|
|
1092
|
+
var Vr = /[^\p{L}\d]+/giu;
|
|
1093
|
+
function Hr(e5) {
|
|
616
1094
|
let t2 = e5.trim();
|
|
617
|
-
t2 = t2.replace(
|
|
1095
|
+
t2 = t2.replace(Rr, Br).replace(zr, Br), t2 = t2.replace(Vr, `\0`);
|
|
618
1096
|
let n2 = 0, r2 = t2.length;
|
|
619
1097
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
620
1098
|
if (n2 === r2) return [];
|
|
621
1099
|
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
622
1100
|
return t2.slice(n2, r2).split(/\0/g);
|
|
623
1101
|
}
|
|
624
|
-
var
|
|
625
|
-
var
|
|
626
|
-
var
|
|
627
|
-
function
|
|
1102
|
+
var Ur = (e5) => `validationError` in (e5.response?.data?.details ?? {});
|
|
1103
|
+
var Wr = (e5) => `applicationError` in (e5.response?.data?.details ?? {});
|
|
1104
|
+
var Gr = (e5) => (e5.response?.status ?? -1) >= 400 && (e5.response?.status ?? -1) < 500;
|
|
1105
|
+
function Kr(e5, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
628
1106
|
if (typeof e5 != `object` || !e5) throw e5;
|
|
629
|
-
if (
|
|
630
|
-
if (
|
|
631
|
-
if (
|
|
632
|
-
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
633
|
-
return
|
|
1107
|
+
if (Ur(e5)) return qr(e5, t2, n2);
|
|
1108
|
+
if (Wr(e5)) return Yr(e5);
|
|
1109
|
+
if (Gr(e5)) {
|
|
1110
|
+
let t3 = e5.response?.status, n3 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: Lr(n3), data: {} }, requestId: e5.requestId };
|
|
1111
|
+
return Jr(e5, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
634
1112
|
}
|
|
635
|
-
return
|
|
1113
|
+
return Xr(e5);
|
|
636
1114
|
}
|
|
637
|
-
var
|
|
638
|
-
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 =
|
|
639
|
-
return
|
|
1115
|
+
var qr = (e5, t2, n2) => {
|
|
1116
|
+
let r2 = e5.response?.data, i2 = e5.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Zr(t2, a2, n2)?.sort((e6, t3) => e6.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e6, description: t3 }) => `"${e6}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
1117
|
+
return Jr(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e5.response?.status, requestId: i2 } });
|
|
640
1118
|
};
|
|
641
|
-
var
|
|
642
|
-
var
|
|
643
|
-
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ??
|
|
644
|
-
return
|
|
1119
|
+
var Jr = (e5, { message: t2, extraProperties: n2 }) => Object.assign(e5, { ...n2, message: t2 });
|
|
1120
|
+
var Yr = (e5) => {
|
|
1121
|
+
let t2 = e5.response?.status, n2 = e5.response?.statusText ?? `UNKNOWN`, r2 = e5.response?.data?.message ?? n2, i2 = e5.response?.data?.details?.applicationError?.description ?? n2, a2 = e5.response?.data?.details?.applicationError?.code ?? Lr(n2), o2 = e5.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e5.requestId };
|
|
1122
|
+
return Jr(e5, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e5.requestId } });
|
|
645
1123
|
};
|
|
646
|
-
var
|
|
647
|
-
var
|
|
1124
|
+
var Xr = (e5) => Jr(e5, { message: e5.requestId ? `System error occurred, request-id: ${e5.requestId}` : `System error occurred: ${JSON.stringify(e5)}`, extraProperties: { requestId: e5.requestId, status: e5.response?.status, code: Lr(e5.response?.statusText ?? `UNKNOWN`), ...!e5.response && { runtimeError: e5 } } });
|
|
1125
|
+
var Zr = ({ spreadPathsToArguments: e5, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
648
1126
|
let a2 = { ...e5, ...t2 }, o2 = Object.keys(a2);
|
|
649
1127
|
return r2?.filter((e6) => !r2.some((t3) => t3.field.length > e6.field.length && t3.field.startsWith(e6.field) && o2.includes(t3.field))).map((e6) => {
|
|
650
1128
|
let r3 = t2[e6.field];
|
|
651
|
-
if (r3) return { ...e6, field:
|
|
1129
|
+
if (r3) return { ...e6, field: Qr(r3, i2) };
|
|
652
1130
|
let s2 = o2?.sort((e7, t3) => t3.length - e7.length)?.find((t3) => e6.field.startsWith(t3));
|
|
653
1131
|
if (s2) {
|
|
654
1132
|
let t3 = a2[s2];
|
|
655
|
-
if (t3) return { ...e6, field: e6.field.replace(s2,
|
|
1133
|
+
if (t3) return { ...e6, field: e6.field.replace(s2, Qr(t3, i2)) };
|
|
656
1134
|
}
|
|
657
1135
|
return n2 ? { ...e6, field: `${i2[0]}.${e6.field}` } : e6;
|
|
658
1136
|
});
|
|
659
1137
|
};
|
|
660
|
-
var
|
|
661
|
-
let n2 =
|
|
1138
|
+
var Qr = (e5, t2) => {
|
|
1139
|
+
let n2 = $r(e5);
|
|
662
1140
|
return n2 == null ? e5 : e5.replace(`$[${n2}]`, t2[n2]);
|
|
663
1141
|
};
|
|
664
|
-
var
|
|
1142
|
+
var $r = (e5) => {
|
|
665
1143
|
let t2 = e5.match(/\$\[(?<argIndex>\d+)\]/);
|
|
666
1144
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
667
1145
|
};
|
|
668
|
-
function
|
|
1146
|
+
function ei() {
|
|
669
1147
|
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
670
1148
|
if (e5) return { initWixModules(t3, n3) {
|
|
671
|
-
return
|
|
1149
|
+
return ti(() => e5(t3, n3));
|
|
672
1150
|
}, fetchWithAuth() {
|
|
673
1151
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
674
1152
|
}, graphql() {
|
|
@@ -678,10 +1156,10 @@ function Dt() {
|
|
|
678
1156
|
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
679
1157
|
if (r2) {
|
|
680
1158
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
681
|
-
return
|
|
1159
|
+
return ti(() => n2.use(e6));
|
|
682
1160
|
}
|
|
683
1161
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
684
|
-
return
|
|
1162
|
+
return ti(() => t2.use(e6));
|
|
685
1163
|
}, fetchWithAuth: (e6, n3) => {
|
|
686
1164
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
687
1165
|
return t2.fetchWithAuth(e6, n3);
|
|
@@ -693,7 +1171,7 @@ function Dt() {
|
|
|
693
1171
|
return t2.graphql(e6, n3, r2);
|
|
694
1172
|
} };
|
|
695
1173
|
}
|
|
696
|
-
function
|
|
1174
|
+
function ti(e5) {
|
|
697
1175
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
698
1176
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
699
1177
|
try {
|
|
@@ -702,78 +1180,78 @@ function Ot(e5) {
|
|
|
702
1180
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
703
1181
|
}
|
|
704
1182
|
}
|
|
705
|
-
function
|
|
1183
|
+
function ni(e5, t2) {
|
|
706
1184
|
return (...n2) => {
|
|
707
|
-
let r2 =
|
|
1185
|
+
let r2 = ei();
|
|
708
1186
|
return r2 ? r2.initWixModules(e5, t2).apply(void 0, n2) : e5.apply(void 0, n2);
|
|
709
1187
|
};
|
|
710
1188
|
}
|
|
711
|
-
function
|
|
712
|
-
return
|
|
713
|
-
}
|
|
714
|
-
function
|
|
715
|
-
let t2 =
|
|
716
|
-
return
|
|
717
|
-
}
|
|
718
|
-
var
|
|
719
|
-
var
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
-
var
|
|
725
|
-
var
|
|
726
|
-
var
|
|
727
|
-
var
|
|
728
|
-
function
|
|
729
|
-
return
|
|
730
|
-
}
|
|
731
|
-
function
|
|
732
|
-
return
|
|
733
|
-
}
|
|
734
|
-
function
|
|
1189
|
+
function ri(e5, t2 = false) {
|
|
1190
|
+
return ni(e5, t2);
|
|
1191
|
+
}
|
|
1192
|
+
function ii(e5) {
|
|
1193
|
+
let t2 = _i(hi(e5.host), e5.domainToMappings);
|
|
1194
|
+
return Ei(Ci(e5.protoPath, e5.data || {}), t2);
|
|
1195
|
+
}
|
|
1196
|
+
var ai = [`wix.com`, `editorx.com`];
|
|
1197
|
+
var oi = `_`;
|
|
1198
|
+
var si = `*.`;
|
|
1199
|
+
var ci = RegExp(`\\.(${ai.join(`|`)})$`);
|
|
1200
|
+
var li = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
1201
|
+
var ui = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
1202
|
+
var di = `dev.wix-code.com`;
|
|
1203
|
+
var fi = /{(.*)}/;
|
|
1204
|
+
var pi = RegExp(`\\.(${li.join(`|`)})$`);
|
|
1205
|
+
var mi = RegExp(`.*\\.${di}$`);
|
|
1206
|
+
function hi(e5) {
|
|
1207
|
+
return gi(e5).replace(ci, `._base_domain_`).replace(pi, `._api_base_domain_`).replace(mi, `*.dev.wix-code.com`);
|
|
1208
|
+
}
|
|
1209
|
+
function gi(e5) {
|
|
1210
|
+
return ui[e5] ?? e5;
|
|
1211
|
+
}
|
|
1212
|
+
function _i(e5, t2) {
|
|
735
1213
|
let n2 = t2[e5];
|
|
736
1214
|
if (n2) return n2;
|
|
737
|
-
let r2 =
|
|
1215
|
+
let r2 = vi(e5, t2) ?? yi(e5, t2);
|
|
738
1216
|
if (!r2) {
|
|
739
|
-
if (
|
|
740
|
-
let e6 = t2[
|
|
1217
|
+
if (xi(e5)) {
|
|
1218
|
+
let e6 = t2[Si];
|
|
741
1219
|
if (e6) return e6;
|
|
742
1220
|
}
|
|
743
|
-
let n3 = t2[
|
|
1221
|
+
let n3 = t2[oi];
|
|
744
1222
|
if (n3) return n3;
|
|
745
1223
|
}
|
|
746
1224
|
return r2 ?? [];
|
|
747
1225
|
}
|
|
748
|
-
function
|
|
1226
|
+
function vi(e5, t2) {
|
|
749
1227
|
return Object.entries(t2).find(([t3]) => {
|
|
750
1228
|
let [, ...n2] = e5.split(`.`);
|
|
751
1229
|
return n2.join(`.`) === t3;
|
|
752
1230
|
})?.[1];
|
|
753
1231
|
}
|
|
754
|
-
function
|
|
755
|
-
let [n2] = Object.entries(t2).filter(([t3]) =>
|
|
1232
|
+
function yi(e5, t2) {
|
|
1233
|
+
let [n2] = Object.entries(t2).filter(([t3]) => bi(e5, t3)).sort(([e6], [t3]) => t3.length - e6.length);
|
|
756
1234
|
if (!n2) return;
|
|
757
1235
|
let [, r2] = n2;
|
|
758
1236
|
return r2;
|
|
759
1237
|
}
|
|
760
|
-
function
|
|
761
|
-
if (!t2.startsWith(
|
|
1238
|
+
function bi(e5, t2) {
|
|
1239
|
+
if (!t2.startsWith(si)) return false;
|
|
762
1240
|
let n2 = t2.slice(1);
|
|
763
1241
|
return e5.length > n2.length && e5.endsWith(n2);
|
|
764
1242
|
}
|
|
765
|
-
function
|
|
1243
|
+
function xi(e5) {
|
|
766
1244
|
return !!e5.match(/\._base_domain_$/);
|
|
767
1245
|
}
|
|
768
|
-
var
|
|
769
|
-
function
|
|
770
|
-
return e5.split(`/`).map((e6) =>
|
|
1246
|
+
var Si = `www._base_domain_`;
|
|
1247
|
+
function Ci(e5, t2) {
|
|
1248
|
+
return e5.split(`/`).map((e6) => wi(e6, t2)).join(`/`);
|
|
771
1249
|
}
|
|
772
|
-
function
|
|
773
|
-
let n2 = e5.match(
|
|
774
|
-
return r2 ?
|
|
1250
|
+
function wi(e5, t2) {
|
|
1251
|
+
let n2 = e5.match(fi) || [], r2 = n2[1];
|
|
1252
|
+
return r2 ? Ti(t2, r2, e5, e5.replace(n2[0], ``)) : e5;
|
|
775
1253
|
}
|
|
776
|
-
function
|
|
1254
|
+
function Ti(e5, t2, n2, r2) {
|
|
777
1255
|
let i2 = e5;
|
|
778
1256
|
for (let e6 of t2.split(`.`)) {
|
|
779
1257
|
if (!i2) return n2;
|
|
@@ -781,31 +1259,31 @@ function Qt(e5, t2, n2, r2) {
|
|
|
781
1259
|
}
|
|
782
1260
|
return `${i2}${r2}`;
|
|
783
1261
|
}
|
|
784
|
-
function
|
|
1262
|
+
function Ei(e5, t2) {
|
|
785
1263
|
let n2 = t2?.find((t3) => e5.startsWith(t3.destPath));
|
|
786
1264
|
return n2 ? n2.srcPath + e5.slice(n2.destPath.length) : e5;
|
|
787
1265
|
}
|
|
788
|
-
var
|
|
1266
|
+
var B;
|
|
789
1267
|
(function(e5) {
|
|
790
1268
|
e5.QUERY_PARAM = `QUERY_PARAM`, e5.SUBDOMAIN = `SUBDOMAIN`, e5.SUBDIRECTORY = `SUBDIRECTORY`;
|
|
791
|
-
})(
|
|
792
|
-
var
|
|
793
|
-
var
|
|
1269
|
+
})(B ||= {});
|
|
1270
|
+
var Di = { cs: `\u010Ce\u0161tina`, da: `Dansk`, de: `Deutsch`, en: `English`, es: `Espa\xF1ol`, fr: `Fran\xE7ais`, hi: `\u0939\u093F\u0928\u094D\u0926\u0940`, id: `Bahasa Indonesia`, it: `Italiano`, ja: `\u65E5\u672C\u8A9E`, ko: `\uD55C\uAD6D\uC5B4`, nl: `Nederlands`, no: `Norsk`, pl: `Polski`, pt: `Portugu\xEAs`, ru: `\u0420\u0443\u0441\u0441\u043A\u0438\u0439`, sv: `Svenska`, th: `\u0E44\u0E17\u0E22`, tr: `T\xFCrk\xE7e`, uk: `\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430`, vi: `Ti\u1EBFng Vi\u1EC7t`, zh: `\u7E41\u9AD4\u4E2D\u6587`, sq: `Shqip`, am: `\u12A0\u121B\u122D\u129B`, ar: `\u0627\u0644\u0639\u0631\u0628\u064A\u0629`, hy: `\u0540\u0561\u0575\u0565\u0580\u0565\u0576`, az: `Az\u0259rbaycan dili`, eu: `Euskara`, be: `\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F`, bn: `\u09AC\u09BE\u0982\u09B2\u09BE`, bs: `Bosanski`, bg: `\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438`, ca: `Catal\xE0`, ny: `ChiChe\u0175a`, co: `Corsu`, hr: `Hrvatski`, et: `Eesti`, fj: `Vosa Vakaviti`, fi: `Suomi`, ga: `Gaeilge`, gl: `Galego`, ka: `\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8`, el: `\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC`, gu: `\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0`, ht: `Krey\xF2l Ayisyen`, ha: `Hausa`, he: `\u05E2\u05D1\u05E8\u05D9\u05EA`, hu: `Magyar`, is: `\xCDslenska`, ig: `Igbo`, kn: `\u0C95\u0CA8\u0CCD\u0CA8\u0CA1`, kk: `\u049A\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456`, km: `\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A`, ku: `Kurd\xEE`, ky: `\u041A\u044B\u0440\u0433\u044B\u0437\u0447\u0430`, lb: `L\xEBtzebuergesch`, lo: `\u0EA5\u0EB2\u0EA7`, la: `Latina`, lv: `Latvie\u0161u`, lt: `Lietuvi\u0173`, mk: `\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438`, mg: `Malagasy`, ms: `Bahasa Melayu`, ml: `\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02`, mt: `Malti`, mn: `\u041C\u043E\u043D\u0433\u043E\u043B`, ne: `\u0928\u0947\u092A\u093E\u0932\u0940`, ps: `\u067E\u069A\u062A\u0648`, fa: `\u0641\u0627\u0631\u0633\u06CC`, ro: `Rom\xE2n\u0103`, sm: `Gagana Samoa`, sr: `\u0421\u0440\u043F\u0441\u043A\u0438`, sn: `Shona`, sd: `\u0633\u0646\u068C\u064A`, si: `\u0DC3\u0DD2\u0D82\u0DC4\u0DBD`, sk: `Sloven\u010Dina`, sl: `Sloven\u0161\u010Dina`, so: `Soomaaliga`, su: `Basa Sunda`, sw: `Kiswahili`, tl: `Filipino`, tg: `\u0422\u043E\u04B7\u0438\u043A\u04E3`, ta: `\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD`, te: `\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41`, tk: `T\xFCrkmen`, ur: `\u0627\u0631\u062F\u0648`, uz: `O'zbek`, cy: `Cymraeg`, xh: `isiXhosa`, yi: `\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9`, yo: `Yor\xF9b\xE1`, zu: `isiZulu`, kl: `Kalaallisut`, fo: `F\xF8royskt`, ln: `Ling\xE1la`, mi: `M\u0101ori`, mr: `\u092E\u0930\u093E\u0920\u0940`, my: `\u1019\u103C\u1014\u103A\u1019\u102C`, se: `S\xE1megiella`, ug: `\u0626\u06C7\u064A\u063A\u06C7\u0631\u0686\u06D5`, qu: `Runa Simi`, aa: `Afar`, ab: `\u0410\u04A7\u0441\u0443\u0430`, ae: `Avestan`, ak: `Akan`, an: `Aragon\xE9s`, as: `\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE`, av: `\u0410\u0432\u0430\u0440`, ay: `Aymar aru`, ba: `\u0411\u0430\u0448\u04A1\u043E\u0440\u0442\u0441\u0430`, bh: `\u092D\u094B\u091C\u092A\u0941\u0930\u0940`, bi: `Bislama`, bm: `Bamanankan`, bo: `\u0F56\u0F7C\u0F51\u0F0B\u0F66\u0F90\u0F51\u0F0B`, br: `Brezhoneg`, ce: `\u041D\u043E\u0445\u0447\u0438\u0439\u043D`, ch: `Chamoru`, cr: `\u14C0\u1426\u1403\u152D\u140D\u140F\u1423`, cu: `\u0426\u0440\u044C\u043A\u044A\u0432\u044C\u043D\u043E\u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A`, cv: `\u0427\u04D1\u0432\u0430\u0448\u043B\u0430`, dv: `\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0784\u07A6\u0790\u07B0`, dz: `\u0F62\u0FAB\u0F7C\u0F44\u0F0B\u0F41`, ee: `E\u028Begbe`, eo: `Esperanto`, ff: `Fulah`, fy: `Frysk`, gd: `G\xE0idhlig`, gn: `Ava\xF1e'\u1EBD`, gv: `Gaelg`, ho: `Hiri Motu`, hz: `Otjiherero`, ia: `Interlingua`, ie: `Interlingue`, ii: `\uA188\uA320\uA259`, ik: `I\xF1upiaq`, io: `Ido`, iu: `\u1403\u14C4\u1483\u144E\u1450\u1466`, jv: `Basa Jawa`, ki: `Gikuyu`, kr: `Kanuri`, ks: `\u06A9\u0672\u0634\u064F\u0631`, kw: `Kernewek`, lg: `Luganda`, li: `Limburgs`, lu: `Tshiluba`, mh: `Kajin M\u0327aje\u013C`, na: `Dorerin Naoero`, nb: `Norsk Bokm\xE5l`, nd: `isiNdebele`, ng: `Oshiwambo`, nn: `Norsk Nynorsk`, nr: `isiNdebele (South)`, nv: `Din\xE9 Bizaad`, oc: `Occitan`, oj: `Anishinaabemowin`, om: `Afaan Oromoo`, or: `\u0B13\u0B21\u0B3C\u0B3F\u0B06`, os: `\u0418\u0440\u043E\u043D`, pa: `\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40`, pi: `\u{11005}\u{1102F}\u{11022}`, rm: `Rumantsch`, rn: `Ikirundi`, rw: `Kinyarwanda`, sa: `\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D`, sc: `Sardu`, sg: `S\xE4ng\xF6`, ss: `SiSwati`, st: `Sesotho`, ti: `\u1275\u130D\u122D\u129B`, tn: `Setswana`, to: `Faka Tonga`, ts: `Xitsonga`, tt: `\u0422\u0430\u0442\u0430\u0440\u0447\u0430`, tw: `Twi`, ty: `Reo Tahiti`, ve: `Tshiven\u1E13a`, vo: `Volap\xFCk`, wa: `Walon`, wo: `Wolof`, za: `Sa\u026F cue\u014B\u0185` };
|
|
1271
|
+
var Oi = (e5, t2) => {
|
|
794
1272
|
e5.searchParams.set(`lang`, t2);
|
|
795
1273
|
};
|
|
796
|
-
var
|
|
1274
|
+
var ki = (e5, t2) => {
|
|
797
1275
|
let n2 = e5.hostname.split(`.`);
|
|
798
1276
|
n2[0] === `www` && (n2 = n2.slice(1)), n2 = [t2, ...n2], e5.hostname = n2.join(`.`);
|
|
799
1277
|
};
|
|
800
|
-
var
|
|
1278
|
+
var Ai = (e5, t2) => {
|
|
801
1279
|
e5.pathname = `/${t2}${e5.pathname}`;
|
|
802
1280
|
};
|
|
803
|
-
var
|
|
1281
|
+
var ji = (e5, t2) => {
|
|
804
1282
|
if (!t2.languageCode || !t2?.resolutionMethod) return e5;
|
|
805
1283
|
let n2 = new URL(e5);
|
|
806
|
-
return (t2?.resolutionMethod === `QUERY_PARAM` ?
|
|
1284
|
+
return (t2?.resolutionMethod === `QUERY_PARAM` ? Oi : t2?.resolutionMethod === `SUBDOMAIN` ? ki : Ai)(n2, t2.languageCode), n2.href;
|
|
807
1285
|
};
|
|
808
|
-
var
|
|
1286
|
+
var Mi = (e5, t2) => {
|
|
809
1287
|
if (!e5?.length) return e5;
|
|
810
1288
|
let n2;
|
|
811
1289
|
try {
|
|
@@ -826,91 +1304,91 @@ var on = (e5, t2) => {
|
|
|
826
1304
|
}
|
|
827
1305
|
return n2.href;
|
|
828
1306
|
};
|
|
829
|
-
function
|
|
830
|
-
let e5 =
|
|
831
|
-
return e5 ?
|
|
1307
|
+
function Ni() {
|
|
1308
|
+
let e5 = Pi();
|
|
1309
|
+
return e5 ? Fi(e5) : [];
|
|
832
1310
|
}
|
|
833
|
-
function
|
|
1311
|
+
function Pi() {
|
|
834
1312
|
let e5 = typeof globals < `u` ? globals?.$ns?.[`wix-window`]?.multilingual : void 0, t2 = typeof window < `u` ? window?.essentials?.multilingual : void 0;
|
|
835
1313
|
return e5 ?? t2 ?? globalThis?.__wix_site_metadata__?.multilingual;
|
|
836
1314
|
}
|
|
837
|
-
function
|
|
1315
|
+
function Fi(e5) {
|
|
838
1316
|
try {
|
|
839
1317
|
if (e5?.supportedLanguages?.length) {
|
|
840
|
-
let t2 = e5.supportedLanguages, n2 = t2.map((e6) => e6.languageCode).filter(Boolean), r2 = e5.cleanUrl ??
|
|
841
|
-
return t2.map((e6) => ({ id: e6.languageCode, displayName:
|
|
1318
|
+
let t2 = e5.supportedLanguages, n2 = t2.map((e6) => e6.languageCode).filter(Boolean), r2 = e5.cleanUrl ?? zi(n2);
|
|
1319
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Ii(e6), regionalFormat: [e6.locale?.languageCode, e6.locale?.country].filter(Boolean).join(`-`), url: Li(e6, r2), primary: e6.isPrimary, resolutionMethod: e6.resolutionMethod }));
|
|
842
1320
|
}
|
|
843
1321
|
if (e5?.siteLanguages?.length) {
|
|
844
|
-
let t2 = e5.siteLanguages, n2 =
|
|
845
|
-
return t2.map((e6) => ({ id: e6.languageCode, displayName:
|
|
1322
|
+
let t2 = e5.siteLanguages, n2 = zi(t2.map((e6) => e6.languageCode).filter(Boolean));
|
|
1323
|
+
return t2.map((e6) => ({ id: e6.languageCode, displayName: Ii(e6), regionalFormat: e6.locale, url: Li(e6, n2), primary: e6.isPrimaryLanguage, resolutionMethod: e6.resolutionMethod ? Ri(e6.resolutionMethod) : void 0 }));
|
|
846
1324
|
}
|
|
847
1325
|
} catch (e6) {
|
|
848
1326
|
return console.warn(`[Multilingual Manager] listSupportedLanguages failed`, e6), [];
|
|
849
1327
|
}
|
|
850
1328
|
return console.warn(`[Multilingual Manager] listSupportedLanguages is not available`), [];
|
|
851
1329
|
}
|
|
852
|
-
function
|
|
853
|
-
let t2 =
|
|
1330
|
+
function Ii(e5) {
|
|
1331
|
+
let t2 = Di[e5.languageCode];
|
|
854
1332
|
if (t2) return t2;
|
|
855
1333
|
let n2 = e5.name ?? e5.countryCode;
|
|
856
1334
|
if (n2) return n2;
|
|
857
1335
|
}
|
|
858
|
-
function
|
|
1336
|
+
function Li(e5, t2) {
|
|
859
1337
|
if (e5.url || !t2 || !e5.resolutionMethod) return e5.url;
|
|
860
1338
|
if (e5.languageCode) try {
|
|
861
|
-
return
|
|
1339
|
+
return ji(t2, { languageCode: e5.languageCode, countryCode: e5.countryCode, resolutionMethod: Ri(e5.resolutionMethod), locale: { languageCode: e5.languageCode, country: e5.countryCode } });
|
|
862
1340
|
} catch (e6) {
|
|
863
1341
|
console.warn(`[Multilingual Manager] buildUrlForLanguage failed`, e6);
|
|
864
1342
|
return;
|
|
865
1343
|
}
|
|
866
1344
|
}
|
|
867
|
-
function
|
|
1345
|
+
function Ri(e5) {
|
|
868
1346
|
switch (e5) {
|
|
869
1347
|
case `QUERY_PARAM`:
|
|
870
1348
|
case `QueryParam`:
|
|
871
|
-
return
|
|
1349
|
+
return B.QUERY_PARAM;
|
|
872
1350
|
case `SUBDOMAIN`:
|
|
873
1351
|
case `Subdomain`:
|
|
874
|
-
return
|
|
1352
|
+
return B.SUBDOMAIN;
|
|
875
1353
|
case `SUBDIRECTORY`:
|
|
876
1354
|
case `Subdirectory`:
|
|
877
|
-
return
|
|
1355
|
+
return B.SUBDIRECTORY;
|
|
878
1356
|
default:
|
|
879
1357
|
return;
|
|
880
1358
|
}
|
|
881
1359
|
}
|
|
882
|
-
function
|
|
1360
|
+
function zi(e5) {
|
|
883
1361
|
let t2 = typeof window < `u` && window.location?.href ? window.location.href : ``;
|
|
884
1362
|
try {
|
|
885
|
-
return
|
|
1363
|
+
return Mi(t2, e5);
|
|
886
1364
|
} catch (e6) {
|
|
887
1365
|
return console.warn(`[Multilingual Manager] cleanCurrentUrl failed`, e6), t2;
|
|
888
1366
|
}
|
|
889
1367
|
}
|
|
890
|
-
var
|
|
891
|
-
var
|
|
892
|
-
var
|
|
893
|
-
var
|
|
894
|
-
let e5 =
|
|
895
|
-
if (e5) return { [
|
|
1368
|
+
var Bi = `x-wix-linguist`;
|
|
1369
|
+
var Vi = `00000000-0000-0000-0000-000000000000`;
|
|
1370
|
+
var Hi = `false`;
|
|
1371
|
+
var Ui = () => {
|
|
1372
|
+
let e5 = V(`language`), t2 = V(`locale`);
|
|
1373
|
+
if (e5) return { [Bi]: [e5, t2 || e5, Hi, Vi].join(`|`) };
|
|
896
1374
|
};
|
|
897
|
-
function
|
|
1375
|
+
function Wi() {
|
|
898
1376
|
let e5 = null, t2 = null;
|
|
899
1377
|
return { promise: new Promise((n2, r2) => {
|
|
900
1378
|
e5 = n2, t2 = r2;
|
|
901
1379
|
}), resolve: e5, reject: t2 };
|
|
902
1380
|
}
|
|
903
|
-
var
|
|
904
|
-
var
|
|
905
|
-
var
|
|
906
|
-
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 =
|
|
907
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
908
|
-
return
|
|
1381
|
+
var Gi = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
1382
|
+
var V = (e5) => Gi()?.[e5];
|
|
1383
|
+
var Ki = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host: (t2) => {
|
|
1384
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e5(t2), o2 = Ji();
|
|
1385
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: V(`language`), locale: V(`locale`), get passThroughHeaders() {
|
|
1386
|
+
return Ui();
|
|
909
1387
|
} } };
|
|
910
1388
|
}, auth: (e6) => {
|
|
911
1389
|
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
912
|
-
!e6 &&
|
|
913
|
-
let n2 = false, { resolve: r2, promise: i2 } =
|
|
1390
|
+
!e6 && qi() && (e6 = t2?.getAccessTokenFunction?.());
|
|
1391
|
+
let n2 = false, { resolve: r2, promise: i2 } = Wi();
|
|
914
1392
|
return { getAuthHeaders: async () => {
|
|
915
1393
|
if (!e6 && n2 && (e6 = await i2), !e6) throw Error(`Failed to resolve auth token`);
|
|
916
1394
|
return { headers: { Authorization: await e6() } };
|
|
@@ -918,89 +1396,89 @@ var bn = ({ createHost: e5 }) => ({ __type: `host`, create: (e6) => ({}), host:
|
|
|
918
1396
|
r2(e7);
|
|
919
1397
|
}) };
|
|
920
1398
|
} });
|
|
921
|
-
function
|
|
1399
|
+
function qi() {
|
|
922
1400
|
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
923
1401
|
}
|
|
924
|
-
function
|
|
1402
|
+
function Ji() {
|
|
925
1403
|
let e5 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
926
1404
|
if (!e5) return;
|
|
927
1405
|
let t2 = new URL(e5);
|
|
928
1406
|
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
929
1407
|
}
|
|
930
|
-
var
|
|
1408
|
+
var Yi = ({ clientSdk: e5, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
931
1409
|
if (!e5) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
932
1410
|
return e5.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
933
1411
|
}, getAccessToken: () => {
|
|
934
1412
|
throw Error(`Not implemented`);
|
|
935
1413
|
}, observeState: () => ({ disconnect: () => {
|
|
936
1414
|
} }) });
|
|
937
|
-
var
|
|
1415
|
+
var Xi = Ki({ createHost: function(e5) {
|
|
938
1416
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e5?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e5 || {};
|
|
939
1417
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
940
|
-
return { channel:
|
|
1418
|
+
return { channel: Yi({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
941
1419
|
} };
|
|
942
1420
|
} });
|
|
943
|
-
var
|
|
944
|
-
let n2 =
|
|
1421
|
+
var Zi = (e5, t2) => {
|
|
1422
|
+
let n2 = Xi.host({ applicationId: e5, componentId: t2 }), r2 = Xi.auth();
|
|
945
1423
|
return Ue({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
946
1424
|
};
|
|
947
|
-
var
|
|
948
|
-
function
|
|
1425
|
+
var Qi = (e5) => Zi(`13d21c63-b5ec-5912-8397-c3a5ddb27a97`, e5);
|
|
1426
|
+
function H(e5, t2) {
|
|
949
1427
|
for (let n2 of e5) {
|
|
950
1428
|
let e6 = n2.addOns.find((e7) => e7.addOnId === t2);
|
|
951
1429
|
if (e6) return { group: n2, addOn: e6 };
|
|
952
1430
|
}
|
|
953
1431
|
return null;
|
|
954
1432
|
}
|
|
955
|
-
function
|
|
956
|
-
return
|
|
1433
|
+
function $i(e5, t2) {
|
|
1434
|
+
return H(e5, t2)?.addOn ?? null;
|
|
957
1435
|
}
|
|
958
|
-
function
|
|
959
|
-
return t2.filter((t3) =>
|
|
1436
|
+
function U(e5, t2) {
|
|
1437
|
+
return t2.filter((t3) => H(e5, t3.id) !== null);
|
|
960
1438
|
}
|
|
961
|
-
function
|
|
962
|
-
return n2.filter((n3) =>
|
|
1439
|
+
function ea(e5, t2, n2) {
|
|
1440
|
+
return n2.filter((n3) => H(e5, n3.id)?.group === t2).length;
|
|
963
1441
|
}
|
|
964
|
-
function
|
|
1442
|
+
function ta(e5, t2) {
|
|
965
1443
|
return !e5.maxNumberOfAddOns || t2 < e5.maxNumberOfAddOns;
|
|
966
1444
|
}
|
|
967
|
-
function
|
|
1445
|
+
function na(e5, t2) {
|
|
968
1446
|
return e5.map((n2) => {
|
|
969
|
-
let r2 =
|
|
1447
|
+
let r2 = ea(e5, n2, t2);
|
|
970
1448
|
return { ...n2, addOns: n2.addOns.map((e6) => {
|
|
971
1449
|
let n3 = t2.find((t3) => t3.id === e6.addOnId)?.quantity ?? 0;
|
|
972
1450
|
return { ...e6, isSelected: n3 > 0, selectedQuantity: n3 };
|
|
973
|
-
}), selectedCount: r2, canSelectMore:
|
|
1451
|
+
}), selectedCount: r2, canSelectMore: ta(n2, r2) };
|
|
974
1452
|
});
|
|
975
1453
|
}
|
|
976
|
-
function
|
|
977
|
-
let r2 =
|
|
978
|
-
return r2 ? t2.some((e6) => e6.id === n2) ? true :
|
|
1454
|
+
function ra(e5, t2, n2) {
|
|
1455
|
+
let r2 = H(e5, n2);
|
|
1456
|
+
return r2 ? t2.some((e6) => e6.id === n2) ? true : ta(r2.group, ea(e5, r2.group, t2)) : false;
|
|
979
1457
|
}
|
|
980
|
-
function
|
|
1458
|
+
function ia(e5, t2) {
|
|
981
1459
|
let n2 = e5.maxQuantity ?? 1;
|
|
982
1460
|
return Number.isFinite(t2) ? Math.min(Math.max(Math.trunc(t2), 0), n2) : 0;
|
|
983
1461
|
}
|
|
984
|
-
var
|
|
985
|
-
function
|
|
1462
|
+
var aa = { category: `category`, location: `location`, page: `page`, blob: `b`, resource: `resource`, referral: `referral`, timezone: `timezone`, bookingId: `bookingId`, token: `token`, rescheduleRedirectUrl: `rescheduleRedirectUrl` };
|
|
1463
|
+
function W(e5) {
|
|
986
1464
|
return e5.addOns ?? [];
|
|
987
1465
|
}
|
|
988
|
-
function
|
|
1466
|
+
function oa(e5, t2) {
|
|
989
1467
|
let n2 = { ...e5 };
|
|
990
1468
|
return t2.length ? n2.addOns = t2 : delete n2.addOns, n2;
|
|
991
1469
|
}
|
|
992
|
-
function
|
|
993
|
-
let n2 =
|
|
994
|
-
return
|
|
1470
|
+
function sa(e5, t2) {
|
|
1471
|
+
let n2 = W(e5);
|
|
1472
|
+
return oa(e5, n2.some((e6) => e6.id === t2) ? n2.filter((e6) => e6.id !== t2) : [...n2, { id: t2, quantity: 1 }]);
|
|
995
1473
|
}
|
|
996
|
-
function
|
|
997
|
-
let r2 =
|
|
998
|
-
return n2 <= 0 ?
|
|
1474
|
+
function ca(e5, t2, n2) {
|
|
1475
|
+
let r2 = W(e5);
|
|
1476
|
+
return n2 <= 0 ? oa(e5, r2.filter((e6) => e6.id !== t2)) : oa(e5, r2.some((e6) => e6.id === t2) ? r2.map((e6) => e6.id === t2 ? { ...e6, quantity: n2 } : e6) : [...r2, { id: t2, quantity: n2 }]);
|
|
999
1477
|
}
|
|
1000
|
-
function
|
|
1478
|
+
function la() {
|
|
1001
1479
|
let e5 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
1002
1480
|
if (e5) return { initWixModules(t3, n3) {
|
|
1003
|
-
return
|
|
1481
|
+
return ua(() => e5(t3, n3));
|
|
1004
1482
|
}, fetchWithAuth() {
|
|
1005
1483
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
1006
1484
|
}, graphql() {
|
|
@@ -1010,10 +1488,10 @@ function Ln() {
|
|
|
1010
1488
|
if (t2 || n2) return { initWixModules(e6, r2) {
|
|
1011
1489
|
if (r2) {
|
|
1012
1490
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
1013
|
-
return
|
|
1491
|
+
return ua(() => n2.use(e6));
|
|
1014
1492
|
}
|
|
1015
1493
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1016
|
-
return
|
|
1494
|
+
return ua(() => t2.use(e6));
|
|
1017
1495
|
}, fetchWithAuth: (e6, n3) => {
|
|
1018
1496
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1019
1497
|
return t2.fetchWithAuth(e6, n3);
|
|
@@ -1025,7 +1503,7 @@ function Ln() {
|
|
|
1025
1503
|
return t2.graphql(e6, n3, r2);
|
|
1026
1504
|
} };
|
|
1027
1505
|
}
|
|
1028
|
-
function
|
|
1506
|
+
function ua(e5) {
|
|
1029
1507
|
let t2 = globalThis.__wix_context__, n2 = { client: p.client, elevatedClient: p.elevatedClient }, r2;
|
|
1030
1508
|
globalThis.__wix_context__ = void 0, p.client = void 0, p.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
1031
1509
|
try {
|
|
@@ -1034,71 +1512,71 @@ function Rn(e5) {
|
|
|
1034
1512
|
globalThis.__wix_context__ = t2, p.client = n2.client, p.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
1035
1513
|
}
|
|
1036
1514
|
}
|
|
1037
|
-
function
|
|
1515
|
+
function da(e5, t2) {
|
|
1038
1516
|
return { ...e5, ...Object.fromEntries(t2.map((t3) => [t3, (...n2) => {
|
|
1039
|
-
let r2 =
|
|
1517
|
+
let r2 = la();
|
|
1040
1518
|
if (!r2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
1041
1519
|
return r2.initWixModules(e5)[t3].apply(void 0, n2);
|
|
1042
1520
|
}])) };
|
|
1043
1521
|
}
|
|
1044
|
-
function
|
|
1045
|
-
return
|
|
1522
|
+
function fa(e5) {
|
|
1523
|
+
return da({ __type: `host`, create: (t2) => Object.entries(e5).reduce((e6, [n2, r2]) => ({ ...e6, [n2]: r2(t2) }), {}) }, Object.keys(e5));
|
|
1046
1524
|
}
|
|
1047
|
-
var
|
|
1048
|
-
var
|
|
1525
|
+
var G = (e5) => typeof e5 == `string`;
|
|
1526
|
+
var K = () => {
|
|
1049
1527
|
let e5, t2, n2 = new Promise((n3, r2) => {
|
|
1050
1528
|
e5 = n3, t2 = r2;
|
|
1051
1529
|
});
|
|
1052
1530
|
return n2.resolve = e5, n2.reject = t2, n2;
|
|
1053
1531
|
};
|
|
1054
|
-
var
|
|
1055
|
-
var
|
|
1532
|
+
var pa = (e5) => e5 == null ? `` : `` + e5;
|
|
1533
|
+
var ma = (e5, t2, n2) => {
|
|
1056
1534
|
e5.forEach((e6) => {
|
|
1057
1535
|
t2[e6] && (n2[e6] = t2[e6]);
|
|
1058
1536
|
});
|
|
1059
1537
|
};
|
|
1060
|
-
var
|
|
1061
|
-
var
|
|
1062
|
-
var
|
|
1063
|
-
var
|
|
1064
|
-
let r2 =
|
|
1538
|
+
var ha = /###/g;
|
|
1539
|
+
var ga = (e5) => e5 && e5.indexOf(`###`) > -1 ? e5.replace(ha, `.`) : e5;
|
|
1540
|
+
var _a = (e5) => !e5 || G(e5);
|
|
1541
|
+
var q = (e5, t2, n2) => {
|
|
1542
|
+
let r2 = G(t2) ? t2.split(`.`) : t2, i2 = 0;
|
|
1065
1543
|
for (; i2 < r2.length - 1; ) {
|
|
1066
|
-
if (
|
|
1067
|
-
let t3 =
|
|
1544
|
+
if (_a(e5)) return {};
|
|
1545
|
+
let t3 = ga(r2[i2]);
|
|
1068
1546
|
!e5[t3] && n2 && (e5[t3] = new n2()), e5 = Object.prototype.hasOwnProperty.call(e5, t3) ? e5[t3] : {}, ++i2;
|
|
1069
1547
|
}
|
|
1070
|
-
return
|
|
1548
|
+
return _a(e5) ? {} : { obj: e5, k: ga(r2[i2]) };
|
|
1071
1549
|
};
|
|
1072
|
-
var
|
|
1073
|
-
let { obj: r2, k: i2 } =
|
|
1550
|
+
var va = (e5, t2, n2) => {
|
|
1551
|
+
let { obj: r2, k: i2 } = q(e5, t2, Object);
|
|
1074
1552
|
if (r2 !== void 0 || t2.length === 1) {
|
|
1075
1553
|
r2[i2] = n2;
|
|
1076
1554
|
return;
|
|
1077
1555
|
}
|
|
1078
|
-
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 =
|
|
1079
|
-
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 =
|
|
1556
|
+
let a2 = t2[t2.length - 1], o2 = t2.slice(0, t2.length - 1), s2 = q(e5, o2, Object);
|
|
1557
|
+
for (; s2.obj === void 0 && o2.length; ) a2 = `${o2[o2.length - 1]}.${a2}`, o2 = o2.slice(0, o2.length - 1), s2 = q(e5, o2, Object), s2?.obj && s2.obj[`${s2.k}.${a2}`] !== void 0 && (s2.obj = void 0);
|
|
1080
1558
|
s2.obj[`${s2.k}.${a2}`] = n2;
|
|
1081
1559
|
};
|
|
1082
|
-
var
|
|
1083
|
-
let { obj: i2, k: a2 } =
|
|
1560
|
+
var ya = (e5, t2, n2, r2) => {
|
|
1561
|
+
let { obj: i2, k: a2 } = q(e5, t2, Object);
|
|
1084
1562
|
i2[a2] = i2[a2] || [], i2[a2].push(n2);
|
|
1085
1563
|
};
|
|
1086
|
-
var
|
|
1087
|
-
let { obj: n2, k: r2 } =
|
|
1564
|
+
var ba = (e5, t2) => {
|
|
1565
|
+
let { obj: n2, k: r2 } = q(e5, t2);
|
|
1088
1566
|
if (n2 && Object.prototype.hasOwnProperty.call(n2, r2)) return n2[r2];
|
|
1089
1567
|
};
|
|
1090
|
-
var
|
|
1091
|
-
let r2 =
|
|
1092
|
-
return r2 === void 0 ?
|
|
1568
|
+
var xa = (e5, t2, n2) => {
|
|
1569
|
+
let r2 = ba(e5, n2);
|
|
1570
|
+
return r2 === void 0 ? ba(t2, n2) : r2;
|
|
1093
1571
|
};
|
|
1094
|
-
var
|
|
1095
|
-
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (r2 in e5 ?
|
|
1572
|
+
var Sa = (e5, t2, n2) => {
|
|
1573
|
+
for (let r2 in t2) r2 !== `__proto__` && r2 !== `constructor` && (r2 in e5 ? G(e5[r2]) || e5[r2] instanceof String || G(t2[r2]) || t2[r2] instanceof String ? n2 && (e5[r2] = t2[r2]) : Sa(e5[r2], t2[r2], n2) : e5[r2] = t2[r2]);
|
|
1096
1574
|
return e5;
|
|
1097
1575
|
};
|
|
1098
|
-
var
|
|
1099
|
-
var
|
|
1100
|
-
var
|
|
1101
|
-
var
|
|
1576
|
+
var J = (e5) => e5.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, `\\$&`);
|
|
1577
|
+
var Ca = { "&": `&`, "<": `<`, ">": `>`, '"': `"`, "'": `'`, "/": `/` };
|
|
1578
|
+
var wa = (e5) => G(e5) ? e5.replace(/[&<>"'\/]/g, (e6) => Ca[e6]) : e5;
|
|
1579
|
+
var Ta = class {
|
|
1102
1580
|
constructor(e5) {
|
|
1103
1581
|
this.capacity = e5, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1104
1582
|
}
|
|
@@ -1109,20 +1587,20 @@ var Qn = class {
|
|
|
1109
1587
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e5, n2), this.regExpQueue.push(e5), n2;
|
|
1110
1588
|
}
|
|
1111
1589
|
};
|
|
1112
|
-
var
|
|
1113
|
-
var
|
|
1114
|
-
var
|
|
1590
|
+
var Ea = [` `, `,`, `?`, `!`, `;`];
|
|
1591
|
+
var Da = new Ta(20);
|
|
1592
|
+
var Oa = (e5, t2, n2) => {
|
|
1115
1593
|
t2 ||= ``, n2 ||= ``;
|
|
1116
|
-
let r2 =
|
|
1594
|
+
let r2 = Ea.filter((e6) => t2.indexOf(e6) < 0 && n2.indexOf(e6) < 0);
|
|
1117
1595
|
if (r2.length === 0) return true;
|
|
1118
|
-
let i2 =
|
|
1596
|
+
let i2 = Da.getRegExp(`(${r2.map((e6) => e6 === `?` ? `\\?` : e6).join(`|`)})`), a2 = !i2.test(e5);
|
|
1119
1597
|
if (!a2) {
|
|
1120
1598
|
let t3 = e5.indexOf(n2);
|
|
1121
1599
|
t3 > 0 && !i2.test(e5.substring(0, t3)) && (a2 = true);
|
|
1122
1600
|
}
|
|
1123
1601
|
return a2;
|
|
1124
1602
|
};
|
|
1125
|
-
var
|
|
1603
|
+
var ka = (e5, t2, n2 = `.`) => {
|
|
1126
1604
|
if (!e5) return;
|
|
1127
1605
|
if (e5[t2]) return Object.prototype.hasOwnProperty.call(e5, t2) ? e5[t2] : void 0;
|
|
1128
1606
|
let r2 = t2.split(n2), i2 = e5;
|
|
@@ -1138,8 +1616,8 @@ var B = (e5, t2, n2 = `.`) => {
|
|
|
1138
1616
|
}
|
|
1139
1617
|
return i2;
|
|
1140
1618
|
};
|
|
1141
|
-
var
|
|
1142
|
-
var
|
|
1619
|
+
var Y = (e5) => e5?.replace(/_/g, `-`);
|
|
1620
|
+
var Aa = { type: `logger`, log(e5) {
|
|
1143
1621
|
this.output(`log`, e5);
|
|
1144
1622
|
}, warn(e5) {
|
|
1145
1623
|
this.output(`warn`, e5);
|
|
@@ -1148,12 +1626,12 @@ var nr = { type: `logger`, log(e5) {
|
|
|
1148
1626
|
}, output(e5, t2) {
|
|
1149
1627
|
console?.[e5]?.apply?.(console, t2);
|
|
1150
1628
|
} };
|
|
1151
|
-
var
|
|
1629
|
+
var X = new class e2 {
|
|
1152
1630
|
constructor(e5, t2 = {}) {
|
|
1153
1631
|
this.init(e5, t2);
|
|
1154
1632
|
}
|
|
1155
1633
|
init(e5, t2 = {}) {
|
|
1156
|
-
this.prefix = t2.prefix || `i18next:`, this.logger = e5 ||
|
|
1634
|
+
this.prefix = t2.prefix || `i18next:`, this.logger = e5 || Aa, this.options = t2, this.debug = t2.debug;
|
|
1157
1635
|
}
|
|
1158
1636
|
log(...e5) {
|
|
1159
1637
|
return this.forward(e5, `log`, ``, true);
|
|
@@ -1168,7 +1646,7 @@ var H = new class e2 {
|
|
|
1168
1646
|
return this.forward(e5, `warn`, `WARNING DEPRECATED: `, true);
|
|
1169
1647
|
}
|
|
1170
1648
|
forward(e5, t2, n2, r2) {
|
|
1171
|
-
return r2 && !this.debug ? null : (
|
|
1649
|
+
return r2 && !this.debug ? null : (G(e5[0]) && (e5[0] = `${n2}${this.prefix} ${e5[0]}`), this.logger[t2](e5));
|
|
1172
1650
|
}
|
|
1173
1651
|
create(t2) {
|
|
1174
1652
|
return new e2(this.logger, { prefix: `${this.prefix}:${t2}:`, ...this.options });
|
|
@@ -1177,7 +1655,7 @@ var H = new class e2 {
|
|
|
1177
1655
|
return t2 ||= this.options, t2.prefix = t2.prefix || this.prefix, new e2(this.logger, t2);
|
|
1178
1656
|
}
|
|
1179
1657
|
}();
|
|
1180
|
-
var
|
|
1658
|
+
var ja = class {
|
|
1181
1659
|
constructor() {
|
|
1182
1660
|
this.observers = {};
|
|
1183
1661
|
}
|
|
@@ -1205,7 +1683,7 @@ var U = class {
|
|
|
1205
1683
|
});
|
|
1206
1684
|
}
|
|
1207
1685
|
};
|
|
1208
|
-
var
|
|
1686
|
+
var Ma = class extends ja {
|
|
1209
1687
|
constructor(e5, t2 = { ns: [`translation`], defaultNS: `translation` }) {
|
|
1210
1688
|
super(), this.data = e5 || {}, this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = true);
|
|
1211
1689
|
}
|
|
@@ -1218,23 +1696,23 @@ var rr = class extends U {
|
|
|
1218
1696
|
}
|
|
1219
1697
|
getResource(e5, t2, n2, r2 = {}) {
|
|
1220
1698
|
let i2 = r2.keySeparator === void 0 ? this.options.keySeparator : r2.keySeparator, a2 = r2.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r2.ignoreJSONStructure, o2;
|
|
1221
|
-
e5.indexOf(`.`) > -1 ? o2 = e5.split(`.`) : (o2 = [e5, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) :
|
|
1222
|
-
let s2 =
|
|
1223
|
-
return !s2 && !t2 && !n2 && e5.indexOf(`.`) > -1 && (e5 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !
|
|
1699
|
+
e5.indexOf(`.`) > -1 ? o2 = e5.split(`.`) : (o2 = [e5, t2], n2 && (Array.isArray(n2) ? o2.push(...n2) : G(n2) && i2 ? o2.push(...n2.split(i2)) : o2.push(n2)));
|
|
1700
|
+
let s2 = ba(this.data, o2);
|
|
1701
|
+
return !s2 && !t2 && !n2 && e5.indexOf(`.`) > -1 && (e5 = o2[0], t2 = o2[1], n2 = o2.slice(2).join(`.`)), s2 || !a2 || !G(n2) ? s2 : ka(this.data?.[e5]?.[t2], n2, i2);
|
|
1224
1702
|
}
|
|
1225
1703
|
addResource(e5, t2, n2, r2, i2 = { silent: false }) {
|
|
1226
1704
|
let a2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, o2 = [e5, t2];
|
|
1227
|
-
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2),
|
|
1705
|
+
n2 && (o2 = o2.concat(a2 ? n2.split(a2) : n2)), e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = t2, t2 = o2[1]), this.addNamespaces(t2), va(this.data, o2, r2), i2.silent || this.emit(`added`, e5, t2, n2, r2);
|
|
1228
1706
|
}
|
|
1229
1707
|
addResources(e5, t2, n2, r2 = { silent: false }) {
|
|
1230
|
-
for (let r3 in n2) (
|
|
1708
|
+
for (let r3 in n2) (G(n2[r3]) || Array.isArray(n2[r3])) && this.addResource(e5, t2, r3, n2[r3], { silent: true });
|
|
1231
1709
|
r2.silent || this.emit(`added`, e5, t2, n2);
|
|
1232
1710
|
}
|
|
1233
1711
|
addResourceBundle(e5, t2, n2, r2, i2, a2 = { silent: false, skipCopy: false }) {
|
|
1234
1712
|
let o2 = [e5, t2];
|
|
1235
1713
|
e5.indexOf(`.`) > -1 && (o2 = e5.split(`.`), r2 = n2, n2 = t2, t2 = o2[1]), this.addNamespaces(t2);
|
|
1236
|
-
let s2 =
|
|
1237
|
-
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ?
|
|
1714
|
+
let s2 = ba(this.data, o2) || {};
|
|
1715
|
+
a2.skipCopy || (n2 = JSON.parse(JSON.stringify(n2))), r2 ? Sa(s2, n2, i2) : s2 = { ...s2, ...n2 }, va(this.data, o2, s2), a2.silent || this.emit(`added`, e5, t2, n2);
|
|
1238
1716
|
}
|
|
1239
1717
|
removeResourceBundle(e5, t2) {
|
|
1240
1718
|
this.hasResourceBundle(e5, t2) && delete this.data[e5][t2], this.removeNamespaces(t2), this.emit(`removed`, e5, t2);
|
|
@@ -1256,31 +1734,31 @@ var rr = class extends U {
|
|
|
1256
1734
|
return this.data;
|
|
1257
1735
|
}
|
|
1258
1736
|
};
|
|
1259
|
-
var
|
|
1737
|
+
var Na = { processors: {}, addPostProcessor(e5) {
|
|
1260
1738
|
this.processors[e5.name] = e5;
|
|
1261
1739
|
}, handle(e5, t2, n2, r2, i2) {
|
|
1262
1740
|
return e5.forEach((e6) => {
|
|
1263
1741
|
t2 = this.processors[e6]?.process(t2, n2, r2, i2) ?? t2;
|
|
1264
1742
|
}), t2;
|
|
1265
1743
|
} };
|
|
1266
|
-
var
|
|
1267
|
-
function
|
|
1744
|
+
var Pa = Symbol(`i18next/PATH_KEY`);
|
|
1745
|
+
function Fa() {
|
|
1268
1746
|
let e5 = [], t2 = /* @__PURE__ */ Object.create(null), n2;
|
|
1269
|
-
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 ===
|
|
1747
|
+
return t2.get = (r2, i2) => (n2?.revoke?.(), i2 === Pa ? e5 : (e5.push(i2), n2 = Proxy.revocable(r2, t2), n2.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), t2).proxy;
|
|
1270
1748
|
}
|
|
1271
|
-
function
|
|
1272
|
-
let { [
|
|
1749
|
+
function Z(e5, t2) {
|
|
1750
|
+
let { [Pa]: n2 } = e5(Fa()), r2 = t2?.keySeparator ?? `.`, i2 = t2?.nsSeparator ?? `:`;
|
|
1273
1751
|
if (n2.length > 1 && i2) {
|
|
1274
1752
|
let e6 = t2?.ns, a2 = Array.isArray(e6) ? e6 : null;
|
|
1275
1753
|
if (a2 && a2.length > 1 && a2.slice(1).includes(n2[0])) return `${n2[0]}${i2}${n2.slice(1).join(r2)}`;
|
|
1276
1754
|
}
|
|
1277
1755
|
return n2.join(r2);
|
|
1278
1756
|
}
|
|
1279
|
-
var
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1757
|
+
var Ia = {};
|
|
1758
|
+
var La = (e5) => !G(e5) && typeof e5 != `boolean` && typeof e5 != `number`;
|
|
1759
|
+
var Ra = class e3 extends ja {
|
|
1282
1760
|
constructor(e5, t2 = {}) {
|
|
1283
|
-
super(),
|
|
1761
|
+
super(), ma([`resourceStore`, `languageUtils`, `pluralResolver`, `interpolator`, `backendConnector`, `i18nFormat`, `utils`], e5, this), this.options = t2, this.options.keySeparator === void 0 && (this.options.keySeparator = `.`), this.logger = X.create(`translator`);
|
|
1284
1762
|
}
|
|
1285
1763
|
changeLanguage(e5) {
|
|
1286
1764
|
e5 && (this.language = e5);
|
|
@@ -1290,33 +1768,33 @@ var lr = class e3 extends U {
|
|
|
1290
1768
|
if (e5 == null) return false;
|
|
1291
1769
|
let r2 = this.resolve(e5, n2);
|
|
1292
1770
|
if (r2?.res === void 0) return false;
|
|
1293
|
-
let i2 =
|
|
1771
|
+
let i2 = La(r2.res);
|
|
1294
1772
|
return !(n2.returnObjects === false && i2);
|
|
1295
1773
|
}
|
|
1296
1774
|
extractFromKey(e5, t2) {
|
|
1297
1775
|
let n2 = t2.nsSeparator === void 0 ? this.options.nsSeparator : t2.nsSeparator;
|
|
1298
1776
|
n2 === void 0 && (n2 = `:`);
|
|
1299
|
-
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e5.indexOf(n2) > -1, o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !
|
|
1777
|
+
let r2 = t2.keySeparator === void 0 ? this.options.keySeparator : t2.keySeparator, i2 = t2.ns || this.options.defaultNS || [], a2 = n2 && e5.indexOf(n2) > -1, o2 = !this.options.userDefinedKeySeparator && !t2.keySeparator && !this.options.userDefinedNsSeparator && !t2.nsSeparator && !Oa(e5, n2, r2);
|
|
1300
1778
|
if (a2 && !o2) {
|
|
1301
1779
|
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1302
|
-
if (t3 && t3.length > 0) return { key: e5, namespaces:
|
|
1780
|
+
if (t3 && t3.length > 0) return { key: e5, namespaces: G(i2) ? [i2] : i2 };
|
|
1303
1781
|
let a3 = e5.split(n2);
|
|
1304
1782
|
(n2 !== r2 || n2 === r2 && this.options.ns.indexOf(a3[0]) > -1) && (i2 = a3.shift()), e5 = a3.join(r2);
|
|
1305
1783
|
}
|
|
1306
|
-
return { key: e5, namespaces:
|
|
1784
|
+
return { key: e5, namespaces: G(i2) ? [i2] : i2 };
|
|
1307
1785
|
}
|
|
1308
1786
|
translate(t2, n2, r2) {
|
|
1309
1787
|
let i2 = typeof n2 == `object` ? { ...n2 } : n2;
|
|
1310
1788
|
if (typeof i2 != `object` && this.options.overloadTranslationOptionHandler && (i2 = this.options.overloadTranslationOptionHandler(arguments)), typeof i2 == `object` && (i2 = { ...i2 }), i2 ||= {}, t2 == null) return ``;
|
|
1311
|
-
typeof t2 == `function` && (t2 =
|
|
1789
|
+
typeof t2 == `function` && (t2 = Z(t2, { ...this.options, ...i2 })), Array.isArray(t2) || (t2 = [String(t2)]), t2 = t2.map((e5) => typeof e5 == `function` ? Z(e5, { ...this.options, ...i2 }) : String(e5));
|
|
1312
1790
|
let a2 = i2.returnDetails === void 0 ? this.options.returnDetails : i2.returnDetails, o2 = i2.keySeparator === void 0 ? this.options.keySeparator : i2.keySeparator, { key: s2, namespaces: c2 } = this.extractFromKey(t2[t2.length - 1], i2), l2 = c2[c2.length - 1], u2 = i2.nsSeparator === void 0 ? this.options.nsSeparator : i2.nsSeparator;
|
|
1313
1791
|
u2 === void 0 && (u2 = `:`);
|
|
1314
1792
|
let d2 = i2.lng || this.language, f2 = i2.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1315
1793
|
if (d2?.toLowerCase() === `cimode`) return f2 ? a2 ? { res: `${l2}${u2}${s2}`, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : `${l2}${u2}${s2}` : a2 ? { res: s2, usedKey: s2, exactUsedKey: s2, usedLng: d2, usedNS: l2, usedParams: this.getUsedParamsDetails(i2) } : s2;
|
|
1316
|
-
let p2 = this.resolve(t2, i2), m2 = p2?.res, h2 = p2?.usedKey || s2, g2 = p2?.exactUsedKey || s2, _2 = [`[object Number]`, `[object Function]`, `[object RegExp]`], v2 = i2.joinArrays === void 0 ? this.options.joinArrays : i2.joinArrays, y2 = !this.i18nFormat || this.i18nFormat.handleAsObject, b2 = i2.count !== void 0 && !
|
|
1794
|
+
let p2 = this.resolve(t2, i2), m2 = p2?.res, h2 = p2?.usedKey || s2, g2 = p2?.exactUsedKey || s2, _2 = [`[object Number]`, `[object Function]`, `[object RegExp]`], v2 = i2.joinArrays === void 0 ? this.options.joinArrays : i2.joinArrays, y2 = !this.i18nFormat || this.i18nFormat.handleAsObject, b2 = i2.count !== void 0 && !G(i2.count), x2 = e3.hasDefaultValue(i2), ee2 = b2 ? this.pluralResolver.getSuffix(d2, i2.count, i2) : ``, te2 = i2.ordinal && b2 ? this.pluralResolver.getSuffix(d2, i2.count, { ordinal: false }) : ``, ne2 = b2 && !i2.ordinal && i2.count === 0, S2 = ne2 && i2[`defaultValue${this.options.pluralSeparator}zero`] || i2[`defaultValue${ee2}`] || i2[`defaultValue${te2}`] || i2.defaultValue, C2 = m2;
|
|
1317
1795
|
y2 && !m2 && x2 && (C2 = S2);
|
|
1318
|
-
let re2 =
|
|
1319
|
-
if (y2 && C2 && re2 && _2.indexOf(ie2) < 0 && !(
|
|
1796
|
+
let re2 = La(C2), ie2 = Object.prototype.toString.apply(C2);
|
|
1797
|
+
if (y2 && C2 && re2 && _2.indexOf(ie2) < 0 && !(G(v2) && Array.isArray(C2))) {
|
|
1320
1798
|
if (!i2.returnObjects && !this.options.returnObjects) {
|
|
1321
1799
|
this.options.returnedObjectHandler || this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);
|
|
1322
1800
|
let e5 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h2, C2, { ...i2, ns: c2 }) : `key '${s2} (${this.language})' returned an object instead of string.`;
|
|
@@ -1326,11 +1804,11 @@ var lr = class e3 extends U {
|
|
|
1326
1804
|
let e5 = Array.isArray(C2), t3 = e5 ? [] : {}, n3 = e5 ? g2 : h2;
|
|
1327
1805
|
for (let e6 in C2) if (Object.prototype.hasOwnProperty.call(C2, e6)) {
|
|
1328
1806
|
let r3 = `${n3}${o2}${e6}`;
|
|
1329
|
-
t3[e6] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue:
|
|
1807
|
+
t3[e6] = x2 && !m2 ? this.translate(r3, { ...i2, defaultValue: La(S2) ? S2[e6] : void 0, joinArrays: false, ns: c2 }) : this.translate(r3, { ...i2, joinArrays: false, ns: c2 }), t3[e6] === r3 && (t3[e6] = C2[e6]);
|
|
1330
1808
|
}
|
|
1331
1809
|
m2 = t3;
|
|
1332
1810
|
}
|
|
1333
|
-
} else if (y2 &&
|
|
1811
|
+
} else if (y2 && G(v2) && Array.isArray(m2)) m2 = m2.join(v2), m2 &&= this.extendTranslation(m2, t2, i2, r2);
|
|
1334
1812
|
else {
|
|
1335
1813
|
let e5 = false, n3 = false;
|
|
1336
1814
|
!this.isValidLookup(m2) && x2 && (e5 = true, m2 = S2), this.isValidLookup(m2) || (n3 = true, m2 = s2);
|
|
@@ -1362,32 +1840,32 @@ var lr = class e3 extends U {
|
|
|
1362
1840
|
if (this.i18nFormat?.parse) e5 = this.i18nFormat.parse(e5, { ...this.options.interpolation.defaultVariables, ...n2 }, n2.lng || this.language || r2.usedLng, r2.usedNS, r2.usedKey, { resolved: r2 });
|
|
1363
1841
|
else if (!n2.skipInterpolation) {
|
|
1364
1842
|
n2.interpolation && this.interpolator.init({ ...n2, interpolation: { ...this.options.interpolation, ...n2.interpolation } });
|
|
1365
|
-
let a3 =
|
|
1843
|
+
let a3 = G(e5) && (n2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n2.interpolation.skipOnVariables), o3;
|
|
1366
1844
|
if (a3) {
|
|
1367
1845
|
let t3 = e5.match(this.interpolator.nestingRegexp);
|
|
1368
1846
|
o3 = t3 && t3.length;
|
|
1369
1847
|
}
|
|
1370
|
-
let s2 = n2.replace && !
|
|
1848
|
+
let s2 = n2.replace && !G(n2.replace) ? n2.replace : n2;
|
|
1371
1849
|
if (this.options.interpolation.defaultVariables && (s2 = { ...this.options.interpolation.defaultVariables, ...s2 }), e5 = this.interpolator.interpolate(e5, s2, n2.lng || this.language || r2.usedLng, n2), a3) {
|
|
1372
1850
|
let t3 = e5.match(this.interpolator.nestingRegexp), r3 = t3 && t3.length;
|
|
1373
1851
|
o3 < r3 && (n2.nest = false);
|
|
1374
1852
|
}
|
|
1375
1853
|
!n2.lng && r2 && r2.res && (n2.lng = this.language || r2.usedLng), n2.nest !== false && (e5 = this.interpolator.nest(e5, (...e6) => i2?.[0] === e6[0] && !n2.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e6[0]} in key: ${t2[0]}`), null) : this.translate(...e6, t2), n2)), n2.interpolation && this.interpolator.reset();
|
|
1376
1854
|
}
|
|
1377
|
-
let a2 = n2.postProcess || this.options.postProcess, o2 =
|
|
1378
|
-
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 =
|
|
1855
|
+
let a2 = n2.postProcess || this.options.postProcess, o2 = G(a2) ? [a2] : a2;
|
|
1856
|
+
return e5 != null && o2?.length && n2.applyPostProcessor !== false && (e5 = Na.handle(o2, e5, t2, this.options && this.options.postProcessPassResolved ? { i18nResolved: { ...r2, usedParams: this.getUsedParamsDetails(n2) }, ...n2 } : n2, this)), e5;
|
|
1379
1857
|
}
|
|
1380
1858
|
resolve(e5, t2 = {}) {
|
|
1381
1859
|
let n2, r2, i2, a2, o2;
|
|
1382
|
-
return
|
|
1860
|
+
return G(e5) && (e5 = [e5]), Array.isArray(e5) && (e5 = e5.map((e6) => typeof e6 == `function` ? Z(e6, { ...this.options, ...t2 }) : e6)), e5.forEach((e6) => {
|
|
1383
1861
|
if (this.isValidLookup(n2)) return;
|
|
1384
1862
|
let s2 = this.extractFromKey(e6, t2), c2 = s2.key;
|
|
1385
1863
|
r2 = c2;
|
|
1386
1864
|
let l2 = s2.namespaces;
|
|
1387
1865
|
this.options.fallbackNS && (l2 = l2.concat(this.options.fallbackNS));
|
|
1388
|
-
let u2 = t2.count !== void 0 && !
|
|
1866
|
+
let u2 = t2.count !== void 0 && !G(t2.count), d2 = u2 && !t2.ordinal && t2.count === 0, f2 = t2.context !== void 0 && (G(t2.context) || typeof t2.context == `number`) && t2.context !== ``, p2 = t2.lngs ? t2.lngs : this.languageUtils.toResolveHierarchy(t2.lng || this.language, t2.fallbackLng);
|
|
1389
1867
|
l2.forEach((e7) => {
|
|
1390
|
-
this.isValidLookup(n2) || (o2 = e7, !
|
|
1868
|
+
this.isValidLookup(n2) || (o2 = e7, !Ia[`${p2[0]}-${e7}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o2) && (Ia[`${p2[0]}-${e7}`] = true, this.logger.warn(`key "${r2}" for languages "${p2.join(`, `)}" won't get resolved as namespace "${o2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)), p2.forEach((r3) => {
|
|
1391
1869
|
if (this.isValidLookup(n2)) return;
|
|
1392
1870
|
a2 = r3;
|
|
1393
1871
|
let o3 = [c2];
|
|
@@ -1414,7 +1892,7 @@ var lr = class e3 extends U {
|
|
|
1414
1892
|
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e5, t2, n2, r2) : this.resourceStore.getResource(e5, t2, n2, r2);
|
|
1415
1893
|
}
|
|
1416
1894
|
getUsedParamsDetails(e5 = {}) {
|
|
1417
|
-
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e5.replace && !
|
|
1895
|
+
let t2 = [`defaultValue`, `ordinal`, `context`, `replace`, `lng`, `lngs`, `fallbackLng`, `ns`, `keySeparator`, `nsSeparator`, `returnObjects`, `returnDetails`, `joinArrays`, `postProcess`, `interpolation`], n2 = e5.replace && !G(e5.replace), r2 = n2 ? e5.replace : e5;
|
|
1418
1896
|
if (n2 && e5.count !== void 0 && (r2.count = e5.count), this.options.interpolation.defaultVariables && (r2 = { ...this.options.interpolation.defaultVariables, ...r2 }), !n2) {
|
|
1419
1897
|
r2 = { ...r2 };
|
|
1420
1898
|
for (let e6 of t2) delete r2[e6];
|
|
@@ -1426,22 +1904,22 @@ var lr = class e3 extends U {
|
|
|
1426
1904
|
return false;
|
|
1427
1905
|
}
|
|
1428
1906
|
};
|
|
1429
|
-
var
|
|
1907
|
+
var za = class {
|
|
1430
1908
|
constructor(e5) {
|
|
1431
|
-
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger =
|
|
1909
|
+
this.options = e5, this.supportedLngs = this.options.supportedLngs || false, this.logger = X.create(`languageUtils`);
|
|
1432
1910
|
}
|
|
1433
1911
|
getScriptPartFromCode(e5) {
|
|
1434
|
-
if (e5 =
|
|
1912
|
+
if (e5 = Y(e5), !e5 || e5.indexOf(`-`) < 0) return null;
|
|
1435
1913
|
let t2 = e5.split(`-`);
|
|
1436
1914
|
return t2.length === 2 || (t2.pop(), t2[t2.length - 1].toLowerCase() === `x`) ? null : this.formatLanguageCode(t2.join(`-`));
|
|
1437
1915
|
}
|
|
1438
1916
|
getLanguagePartFromCode(e5) {
|
|
1439
|
-
if (e5 =
|
|
1917
|
+
if (e5 = Y(e5), !e5 || e5.indexOf(`-`) < 0) return e5;
|
|
1440
1918
|
let t2 = e5.split(`-`);
|
|
1441
1919
|
return this.formatLanguageCode(t2[0]);
|
|
1442
1920
|
}
|
|
1443
1921
|
formatLanguageCode(e5) {
|
|
1444
|
-
if (
|
|
1922
|
+
if (G(e5) && e5.indexOf(`-`) > -1) {
|
|
1445
1923
|
let t2;
|
|
1446
1924
|
try {
|
|
1447
1925
|
t2 = Intl.getCanonicalLocales(e5)[0];
|
|
@@ -1474,7 +1952,7 @@ var ur = class {
|
|
|
1474
1952
|
}
|
|
1475
1953
|
getFallbackCodes(e5, t2) {
|
|
1476
1954
|
if (!e5) return [];
|
|
1477
|
-
if (typeof e5 == `function` && (e5 = e5(t2)),
|
|
1955
|
+
if (typeof e5 == `function` && (e5 = e5(t2)), G(e5) && (e5 = [e5]), Array.isArray(e5)) return e5;
|
|
1478
1956
|
if (!t2) return e5.default || [];
|
|
1479
1957
|
let n2 = e5[t2];
|
|
1480
1958
|
return n2 ||= e5[this.getScriptPartFromCode(t2)], n2 ||= e5[this.formatLanguageCode(t2)], n2 ||= e5[this.getLanguagePartFromCode(t2)], n2 ||= e5.default, n2 || [];
|
|
@@ -1483,29 +1961,29 @@ var ur = class {
|
|
|
1483
1961
|
let n2 = this.getFallbackCodes((t2 === false ? [] : t2) || this.options.fallbackLng || [], e5), r2 = [], i2 = (e6) => {
|
|
1484
1962
|
e6 && (this.isSupportedCode(e6) ? r2.push(e6) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e6}`));
|
|
1485
1963
|
};
|
|
1486
|
-
return
|
|
1964
|
+
return G(e5) && (e5.indexOf(`-`) > -1 || e5.indexOf(`_`) > -1) ? (this.options.load !== `languageOnly` && i2(this.formatLanguageCode(e5)), this.options.load !== `languageOnly` && this.options.load !== `currentOnly` && i2(this.getScriptPartFromCode(e5)), this.options.load !== `currentOnly` && i2(this.getLanguagePartFromCode(e5))) : G(e5) && i2(this.formatLanguageCode(e5)), n2.forEach((e6) => {
|
|
1487
1965
|
r2.indexOf(e6) < 0 && i2(this.formatLanguageCode(e6));
|
|
1488
1966
|
}), r2;
|
|
1489
1967
|
}
|
|
1490
1968
|
};
|
|
1491
|
-
var
|
|
1492
|
-
var
|
|
1493
|
-
var
|
|
1969
|
+
var Ba = { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 };
|
|
1970
|
+
var Va = { select: (e5) => e5 === 1 ? `one` : `other`, resolvedOptions: () => ({ pluralCategories: [`one`, `other`] }) };
|
|
1971
|
+
var Ha = class {
|
|
1494
1972
|
constructor(e5, t2 = {}) {
|
|
1495
|
-
this.languageUtils = e5, this.options = t2, this.logger =
|
|
1973
|
+
this.languageUtils = e5, this.options = t2, this.logger = X.create(`pluralResolver`), this.pluralRulesCache = {};
|
|
1496
1974
|
}
|
|
1497
1975
|
clearCache() {
|
|
1498
1976
|
this.pluralRulesCache = {};
|
|
1499
1977
|
}
|
|
1500
1978
|
getRule(e5, t2 = {}) {
|
|
1501
|
-
let n2 =
|
|
1979
|
+
let n2 = Y(e5 === `dev` ? `en` : e5), r2 = t2.ordinal ? `ordinal` : `cardinal`, i2 = JSON.stringify({ cleanedCode: n2, type: r2 });
|
|
1502
1980
|
if (i2 in this.pluralRulesCache) return this.pluralRulesCache[i2];
|
|
1503
1981
|
let a2;
|
|
1504
1982
|
try {
|
|
1505
1983
|
a2 = new Intl.PluralRules(n2, { type: r2 });
|
|
1506
1984
|
} catch {
|
|
1507
|
-
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`),
|
|
1508
|
-
if (!e5.match(/-|_/)) return
|
|
1985
|
+
if (typeof Intl > `u`) return this.logger.error(`No Intl support, please use an Intl polyfill!`), Va;
|
|
1986
|
+
if (!e5.match(/-|_/)) return Va;
|
|
1509
1987
|
let n3 = this.languageUtils.getLanguagePartFromCode(e5);
|
|
1510
1988
|
a2 = this.getRule(n3, t2);
|
|
1511
1989
|
}
|
|
@@ -1520,26 +1998,26 @@ var pr = class {
|
|
|
1520
1998
|
}
|
|
1521
1999
|
getSuffixes(e5, t2 = {}) {
|
|
1522
2000
|
let n2 = this.getRule(e5, t2);
|
|
1523
|
-
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e6, t3) =>
|
|
2001
|
+
return n2 ||= this.getRule(`dev`, t2), n2 ? n2.resolvedOptions().pluralCategories.sort((e6, t3) => Ba[e6] - Ba[t3]).map((e6) => `${this.options.prepend}${t2.ordinal ? `ordinal${this.options.prepend}` : ``}${e6}`) : [];
|
|
1524
2002
|
}
|
|
1525
2003
|
getSuffix(e5, t2, n2 = {}) {
|
|
1526
2004
|
let r2 = this.getRule(e5, n2);
|
|
1527
2005
|
return r2 ? `${this.options.prepend}${n2.ordinal ? `ordinal${this.options.prepend}` : ``}${r2.select(t2)}` : (this.logger.warn(`no plural rule found for: ${e5}`), this.getSuffix(`dev`, t2, n2));
|
|
1528
2006
|
}
|
|
1529
2007
|
};
|
|
1530
|
-
var
|
|
1531
|
-
let a2 =
|
|
1532
|
-
return !a2 && i2 &&
|
|
2008
|
+
var Ua = (e5, t2, n2, r2 = `.`, i2 = true) => {
|
|
2009
|
+
let a2 = xa(e5, t2, n2);
|
|
2010
|
+
return !a2 && i2 && G(n2) && (a2 = ka(e5, n2, r2), a2 === void 0 && (a2 = ka(t2, n2, r2))), a2;
|
|
1533
2011
|
};
|
|
1534
|
-
var
|
|
1535
|
-
var
|
|
2012
|
+
var Wa = (e5) => e5.replace(/\$/g, `$$$$`);
|
|
2013
|
+
var Ga = class {
|
|
1536
2014
|
constructor(e5 = {}) {
|
|
1537
|
-
this.logger =
|
|
2015
|
+
this.logger = X.create(`interpolator`), this.options = e5, this.format = e5?.interpolation?.format || ((e6) => e6), this.init(e5);
|
|
1538
2016
|
}
|
|
1539
2017
|
init(e5 = {}) {
|
|
1540
2018
|
e5.interpolation ||= { escapeValue: true };
|
|
1541
2019
|
let { escape: t2, escapeValue: n2, useRawValueToEscape: r2, prefix: i2, prefixEscaped: a2, suffix: o2, suffixEscaped: s2, formatSeparator: c2, unescapeSuffix: l2, unescapePrefix: u2, nestingPrefix: d2, nestingPrefixEscaped: f2, nestingSuffix: p2, nestingSuffixEscaped: m2, nestingOptionsSeparator: h2, maxReplaces: g2, alwaysFormat: _2 } = e5.interpolation;
|
|
1542
|
-
this.escape = t2 === void 0 ?
|
|
2020
|
+
this.escape = t2 === void 0 ? wa : t2, this.escapeValue = n2 === void 0 || n2, this.useRawValueToEscape = r2 !== void 0 && r2, this.prefix = i2 ? J(i2) : a2 || `{{`, this.suffix = o2 ? J(o2) : s2 || `}}`, this.formatSeparator = c2 || `,`, this.unescapePrefix = l2 ? `` : u2 || `-`, this.unescapeSuffix = this.unescapePrefix ? `` : l2 || ``, this.nestingPrefix = d2 ? J(d2) : f2 || J(`$t(`), this.nestingSuffix = p2 ? J(p2) : m2 || J(`)`), this.nestingOptionsSeparator = h2 || `,`, this.maxReplaces = g2 || 1e3, this.alwaysFormat = _2 !== void 0 && _2, this.resetRegExp();
|
|
1543
2021
|
}
|
|
1544
2022
|
reset() {
|
|
1545
2023
|
this.options && this.init(this.options);
|
|
@@ -1551,27 +2029,27 @@ var gr = class {
|
|
|
1551
2029
|
interpolate(e5, t2, n2, r2) {
|
|
1552
2030
|
let i2, a2, o2, s2 = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c2 = (e6) => {
|
|
1553
2031
|
if (e6.indexOf(this.formatSeparator) < 0) {
|
|
1554
|
-
let i4 =
|
|
2032
|
+
let i4 = Ua(t2, s2, e6, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1555
2033
|
return this.alwaysFormat ? this.format(i4, void 0, n2, { ...r2, ...t2, interpolationkey: e6 }) : i4;
|
|
1556
2034
|
}
|
|
1557
2035
|
let i3 = e6.split(this.formatSeparator), a3 = i3.shift().trim(), o3 = i3.join(this.formatSeparator).trim();
|
|
1558
|
-
return this.format(
|
|
2036
|
+
return this.format(Ua(t2, s2, a3, this.options.keySeparator, this.options.ignoreJSONStructure), o3, n2, { ...r2, ...t2, interpolationkey: a3 });
|
|
1559
2037
|
};
|
|
1560
2038
|
this.resetRegExp();
|
|
1561
2039
|
let l2 = r2?.missingInterpolationHandler || this.options.missingInterpolationHandler, u2 = r2?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r2.interpolation.skipOnVariables;
|
|
1562
|
-
return [{ regex: this.regexpUnescape, safeValue: (e6) =>
|
|
2040
|
+
return [{ regex: this.regexpUnescape, safeValue: (e6) => Wa(e6) }, { regex: this.regexp, safeValue: (e6) => this.escapeValue ? Wa(this.escape(e6)) : Wa(e6) }].forEach((t3) => {
|
|
1563
2041
|
for (o2 = 0; i2 = t3.regex.exec(e5); ) {
|
|
1564
2042
|
let n3 = i2[1].trim();
|
|
1565
2043
|
if (a2 = c2(n3), a2 === void 0) {
|
|
1566
2044
|
if (typeof l2 == `function`) {
|
|
1567
2045
|
let t4 = l2(e5, i2, r2);
|
|
1568
|
-
a2 =
|
|
2046
|
+
a2 = G(t4) ? t4 : ``;
|
|
1569
2047
|
} else if (r2 && Object.prototype.hasOwnProperty.call(r2, n3)) a2 = ``;
|
|
1570
2048
|
else if (u2) {
|
|
1571
2049
|
a2 = i2[0];
|
|
1572
2050
|
continue;
|
|
1573
2051
|
} else this.logger.warn(`missed to pass in variable ${n3} for interpolating ${e5}`), a2 = ``;
|
|
1574
|
-
} else !
|
|
2052
|
+
} else !G(a2) && !this.useRawValueToEscape && (a2 = pa(a2));
|
|
1575
2053
|
let s3 = t3.safeValue(a2);
|
|
1576
2054
|
if (e5 = e5.replace(i2[0], s3), u2 ? (t3.regex.lastIndex += a2.length, t3.regex.lastIndex -= i2[0].length) : t3.regex.lastIndex = 0, o2++, o2 >= this.maxReplaces) break;
|
|
1577
2055
|
}
|
|
@@ -1581,7 +2059,7 @@ var gr = class {
|
|
|
1581
2059
|
let r2, i2, a2, o2 = (e6, t3) => {
|
|
1582
2060
|
let n3 = this.nestingOptionsSeparator;
|
|
1583
2061
|
if (e6.indexOf(n3) < 0) return e6;
|
|
1584
|
-
let r3 = e6.split(RegExp(`${
|
|
2062
|
+
let r3 = e6.split(RegExp(`${J(n3)}[ ]*{`)), i3 = `{${r3[1]}`;
|
|
1585
2063
|
e6 = r3[0], i3 = this.interpolate(i3, a2);
|
|
1586
2064
|
let o3 = i3.match(/'/g), s2 = i3.match(/"/g);
|
|
1587
2065
|
((o3?.length ?? 0) % 2 == 0 && !s2 || (s2?.length ?? 0) % 2 != 0) && (i3 = i3.replace(/'/g, `"`));
|
|
@@ -1594,15 +2072,15 @@ var gr = class {
|
|
|
1594
2072
|
};
|
|
1595
2073
|
for (; r2 = this.nestingRegexp.exec(e5); ) {
|
|
1596
2074
|
let s2 = [];
|
|
1597
|
-
a2 = { ...n2 }, a2 = a2.replace && !
|
|
2075
|
+
a2 = { ...n2 }, a2 = a2.replace && !G(a2.replace) ? a2.replace : a2, a2.applyPostProcessor = false, delete a2.defaultValue;
|
|
1598
2076
|
let c2 = /{.*}/.test(r2[1]) ? r2[1].lastIndexOf(`}`) + 1 : r2[1].indexOf(this.formatSeparator);
|
|
1599
|
-
if (c2 !== -1 && (s2 = r2[1].slice(c2).split(this.formatSeparator).map((e6) => e6.trim()).filter(Boolean), r2[1] = r2[1].slice(0, c2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e5 && !
|
|
1600
|
-
|
|
2077
|
+
if (c2 !== -1 && (s2 = r2[1].slice(c2).split(this.formatSeparator).map((e6) => e6.trim()).filter(Boolean), r2[1] = r2[1].slice(0, c2)), i2 = t2(o2.call(this, r2[1].trim(), a2), a2), i2 && r2[0] === e5 && !G(i2)) return i2;
|
|
2078
|
+
G(i2) || (i2 = pa(i2)), i2 ||= (this.logger.warn(`missed to resolve ${r2[1]} for nesting ${e5}`), ``), s2.length && (i2 = s2.reduce((e6, t3) => this.format(e6, t3, n2.lng, { ...n2, interpolationkey: r2[1].trim() }), i2.trim())), e5 = e5.replace(r2[0], i2), this.regexp.lastIndex = 0;
|
|
1601
2079
|
}
|
|
1602
2080
|
return e5;
|
|
1603
2081
|
}
|
|
1604
2082
|
};
|
|
1605
|
-
var
|
|
2083
|
+
var Ka = (e5) => {
|
|
1606
2084
|
let t2 = e5.toLowerCase().trim(), n2 = {};
|
|
1607
2085
|
if (e5.indexOf(`(`) > -1) {
|
|
1608
2086
|
let r2 = e5.split(`(`);
|
|
@@ -1617,23 +2095,23 @@ var _r = (e5) => {
|
|
|
1617
2095
|
}
|
|
1618
2096
|
return { formatName: t2, formatOptions: n2 };
|
|
1619
2097
|
};
|
|
1620
|
-
var
|
|
2098
|
+
var qa = (e5) => {
|
|
1621
2099
|
let t2 = {};
|
|
1622
2100
|
return (n2, r2, i2) => {
|
|
1623
2101
|
let a2 = i2;
|
|
1624
2102
|
i2 && i2.interpolationkey && i2.formatParams && i2.formatParams[i2.interpolationkey] && i2[i2.interpolationkey] && (a2 = { ...a2, [i2.interpolationkey]: void 0 });
|
|
1625
2103
|
let o2 = r2 + JSON.stringify(a2), s2 = t2[o2];
|
|
1626
|
-
return s2 || (s2 = e5(
|
|
2104
|
+
return s2 || (s2 = e5(Y(r2), i2), t2[o2] = s2), s2(n2);
|
|
1627
2105
|
};
|
|
1628
2106
|
};
|
|
1629
|
-
var
|
|
1630
|
-
var
|
|
2107
|
+
var Ja = (e5) => (t2, n2, r2) => e5(Y(n2), r2)(t2);
|
|
2108
|
+
var Ya = class {
|
|
1631
2109
|
constructor(e5 = {}) {
|
|
1632
|
-
this.logger =
|
|
2110
|
+
this.logger = X.create(`formatter`), this.options = e5, this.init(e5);
|
|
1633
2111
|
}
|
|
1634
2112
|
init(e5, t2 = { interpolation: {} }) {
|
|
1635
2113
|
this.formatSeparator = t2.interpolation.formatSeparator || `,`;
|
|
1636
|
-
let n2 = t2.cacheInBuiltFormats ?
|
|
2114
|
+
let n2 = t2.cacheInBuiltFormats ? qa : Ja;
|
|
1637
2115
|
this.formats = { number: n2((e6, t3) => {
|
|
1638
2116
|
let n3 = new Intl.NumberFormat(e6, { ...t3 });
|
|
1639
2117
|
return (e7) => n3.format(e7);
|
|
@@ -1655,7 +2133,7 @@ var br = class {
|
|
|
1655
2133
|
this.formats[e5.toLowerCase().trim()] = t2;
|
|
1656
2134
|
}
|
|
1657
2135
|
addCached(e5, t2) {
|
|
1658
|
-
this.formats[e5.toLowerCase().trim()] =
|
|
2136
|
+
this.formats[e5.toLowerCase().trim()] = qa(t2);
|
|
1659
2137
|
}
|
|
1660
2138
|
format(e5, t2, n2, r2 = {}) {
|
|
1661
2139
|
let i2 = t2.split(this.formatSeparator);
|
|
@@ -1664,7 +2142,7 @@ var br = class {
|
|
|
1664
2142
|
i2[0] = [i2[0], ...i2.splice(1, e6)].join(this.formatSeparator);
|
|
1665
2143
|
}
|
|
1666
2144
|
return i2.reduce((e6, t3) => {
|
|
1667
|
-
let { formatName: i3, formatOptions: a2 } =
|
|
2145
|
+
let { formatName: i3, formatOptions: a2 } = Ka(t3);
|
|
1668
2146
|
if (this.formats[i3]) {
|
|
1669
2147
|
let t4 = e6;
|
|
1670
2148
|
try {
|
|
@@ -1679,12 +2157,12 @@ var br = class {
|
|
|
1679
2157
|
}, e5);
|
|
1680
2158
|
}
|
|
1681
2159
|
};
|
|
1682
|
-
var
|
|
2160
|
+
var Xa = (e5, t2) => {
|
|
1683
2161
|
e5.pending[t2] !== void 0 && (delete e5.pending[t2], e5.pendingCount--);
|
|
1684
2162
|
};
|
|
1685
|
-
var
|
|
2163
|
+
var Za = class extends ja {
|
|
1686
2164
|
constructor(e5, t2, n2, r2 = {}) {
|
|
1687
|
-
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger =
|
|
2165
|
+
super(), this.backend = e5, this.store = t2, this.services = n2, this.languageUtils = n2.languageUtils, this.options = r2, this.logger = X.create(`backendConnector`), this.waitingReads = [], this.maxParallelReads = r2.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r2.maxRetries >= 0 ? r2.maxRetries : 5, this.retryTimeout = r2.retryTimeout >= 1 ? r2.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n2, r2.backend, r2);
|
|
1688
2166
|
}
|
|
1689
2167
|
queueLoad(e5, t2, n2, r2) {
|
|
1690
2168
|
let i2 = {}, a2 = {}, o2 = {}, s2 = {};
|
|
@@ -1701,7 +2179,7 @@ var Sr = class extends U {
|
|
|
1701
2179
|
t2 && this.emit(`failedLoading`, i2, a2, t2), !t2 && n2 && this.store.addResourceBundle(i2, a2, n2, void 0, void 0, { skipCopy: true }), this.state[e5] = t2 ? -1 : 2, t2 && n2 && (this.state[e5] = 0);
|
|
1702
2180
|
let o2 = {};
|
|
1703
2181
|
this.queue.forEach((n3) => {
|
|
1704
|
-
|
|
2182
|
+
ya(n3.loaded, [i2], a2), Xa(n3, e5), t2 && n3.errors.push(t2), n3.pendingCount === 0 && !n3.done && (Object.keys(n3.loaded).forEach((e6) => {
|
|
1705
2183
|
o2[e6] || (o2[e6] = {});
|
|
1706
2184
|
let t3 = n3.loaded[e6];
|
|
1707
2185
|
t3.length && t3.forEach((t4) => {
|
|
@@ -1743,7 +2221,7 @@ var Sr = class extends U {
|
|
|
1743
2221
|
}
|
|
1744
2222
|
prepareLoading(e5, t2, n2 = {}, r2) {
|
|
1745
2223
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
1746
|
-
|
|
2224
|
+
G(e5) && (e5 = this.languageUtils.toResolveHierarchy(e5)), G(t2) && (t2 = [t2]);
|
|
1747
2225
|
let i2 = this.queueLoad(e5, t2, n2, r2);
|
|
1748
2226
|
if (!i2.toLoad.length) return i2.pending.length || r2(), null;
|
|
1749
2227
|
i2.toLoad.forEach((e6) => {
|
|
@@ -1783,9 +2261,9 @@ var Sr = class extends U {
|
|
|
1783
2261
|
}
|
|
1784
2262
|
}
|
|
1785
2263
|
};
|
|
1786
|
-
var
|
|
2264
|
+
var Qa = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS: [`translation`], fallbackLng: [`dev`], fallbackNS: false, supportedLngs: false, nonExplicitSupportedLngs: false, load: `all`, preload: false, simplifyPluralSuffix: true, keySeparator: `.`, nsSeparator: `:`, pluralSeparator: `_`, contextSeparator: `_`, partialBundledLanguages: false, saveMissing: false, updateMissing: false, saveMissingTo: `fallback`, saveMissingPlurals: true, missingKeyHandler: false, missingInterpolationHandler: false, postProcess: false, postProcessPassResolved: false, returnNull: false, returnEmptyString: true, returnObjects: false, joinArrays: false, returnedObjectHandler: false, parseMissingKeyHandler: false, appendNamespaceToMissingKey: false, appendNamespaceToCIMode: false, overloadTranslationOptionHandler: (e5) => {
|
|
1787
2265
|
let t2 = {};
|
|
1788
|
-
if (typeof e5[1] == `object` && (t2 = e5[1]),
|
|
2266
|
+
if (typeof e5[1] == `object` && (t2 = e5[1]), G(e5[1]) && (t2.defaultValue = e5[1]), G(e5[2]) && (t2.tDescription = e5[2]), typeof e5[2] == `object` || typeof e5[3] == `object`) {
|
|
1789
2267
|
let n2 = e5[3] || e5[2];
|
|
1790
2268
|
Object.keys(n2).forEach((e6) => {
|
|
1791
2269
|
t2[e6] = n2[e6];
|
|
@@ -1793,23 +2271,23 @@ var Cr = () => ({ debug: false, initAsync: true, ns: [`translation`], defaultNS:
|
|
|
1793
2271
|
}
|
|
1794
2272
|
return t2;
|
|
1795
2273
|
}, interpolation: { escapeValue: true, format: (e5) => e5, prefix: `{{`, suffix: `}}`, formatSeparator: `,`, unescapePrefix: `-`, nestingPrefix: `$t(`, nestingSuffix: `)`, nestingOptionsSeparator: `,`, maxReplaces: 1e3, skipOnVariables: true }, cacheInBuiltFormats: true });
|
|
1796
|
-
var
|
|
1797
|
-
var
|
|
2274
|
+
var $a = (e5) => (G(e5.ns) && (e5.ns = [e5.ns]), G(e5.fallbackLng) && (e5.fallbackLng = [e5.fallbackLng]), G(e5.fallbackNS) && (e5.fallbackNS = [e5.fallbackNS]), e5.supportedLngs?.indexOf?.(`cimode`) < 0 && (e5.supportedLngs = e5.supportedLngs.concat([`cimode`])), typeof e5.initImmediate == `boolean` && (e5.initAsync = e5.initImmediate), e5);
|
|
2275
|
+
var eo = () => {
|
|
1798
2276
|
};
|
|
1799
|
-
var
|
|
2277
|
+
var to = (e5) => {
|
|
1800
2278
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e5)).forEach((t2) => {
|
|
1801
2279
|
typeof e5[t2] == `function` && (e5[t2] = e5[t2].bind(e5));
|
|
1802
2280
|
});
|
|
1803
2281
|
};
|
|
1804
|
-
var
|
|
1805
|
-
var
|
|
1806
|
-
var
|
|
1807
|
-
typeof globalThis < `u` && (globalThis[
|
|
2282
|
+
var no = `__i18next_supportNoticeShown`;
|
|
2283
|
+
var ro = () => !!(typeof globalThis < `u` && globalThis[no] || typeof process < `u` && {}.I18NEXT_NO_SUPPORT_NOTICE || typeof process < `u`);
|
|
2284
|
+
var io = () => {
|
|
2285
|
+
typeof globalThis < `u` && (globalThis[no] = true);
|
|
1808
2286
|
};
|
|
1809
|
-
var
|
|
1810
|
-
var
|
|
2287
|
+
var ao = (e5) => !!(e5?.modules?.backend?.name?.indexOf(`Locize`) > 0 || e5?.modules?.backend?.constructor?.name?.indexOf(`Locize`) > 0 || e5?.options?.backend?.backends && e5.options.backend.backends.some((e6) => e6?.name?.indexOf(`Locize`) > 0 || e6?.constructor?.name?.indexOf(`Locize`) > 0) || e5?.options?.backend?.projectId || e5?.options?.backend?.backendOptions && e5.options.backend.backendOptions.some((e6) => e6?.projectId));
|
|
2288
|
+
var Q = class e4 extends ja {
|
|
1811
2289
|
constructor(e5 = {}, t2) {
|
|
1812
|
-
if (super(), this.options =
|
|
2290
|
+
if (super(), this.options = $a(e5), this.services = {}, this.logger = X, this.modules = { external: [] }, to(this), t2 && !this.isInitialized && !e5.isClone) {
|
|
1813
2291
|
if (!this.options.initAsync) return this.init(e5, t2), this;
|
|
1814
2292
|
setTimeout(() => {
|
|
1815
2293
|
this.init(e5, t2);
|
|
@@ -1817,26 +2295,26 @@ var K = class e4 extends U {
|
|
|
1817
2295
|
}
|
|
1818
2296
|
}
|
|
1819
2297
|
init(e5 = {}, t2) {
|
|
1820
|
-
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (
|
|
1821
|
-
let n2 =
|
|
1822
|
-
this.options = { ...n2, ...this.options,
|
|
2298
|
+
this.isInitializing = true, typeof e5 == `function` && (t2 = e5, e5 = {}), e5.defaultNS == null && e5.ns && (G(e5.ns) ? e5.defaultNS = e5.ns : e5.ns.indexOf(`translation`) < 0 && (e5.defaultNS = e5.ns[0]));
|
|
2299
|
+
let n2 = Qa();
|
|
2300
|
+
this.options = { ...n2, ...this.options, ...$a(e5) }, this.options.interpolation = { ...n2.interpolation, ...this.options.interpolation }, e5.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e5.keySeparator), e5.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e5.nsSeparator), typeof this.options.overloadTranslationOptionHandler != `function` && (this.options.overloadTranslationOptionHandler = n2.overloadTranslationOptionHandler), this.options.showSupportNotice !== false && !ao(this) && !ro() && (typeof console < `u` && console.info !== void 0 && console.info(`\u{1F310} i18next is made possible by our own product, Locize \u2014 consider powering your project with managed localization (AI, CDN, integrations): https://locize.com \u{1F499}`), io());
|
|
1823
2301
|
let r2 = (e6) => e6 ? typeof e6 == `function` ? new e6() : e6 : null;
|
|
1824
2302
|
if (!this.options.isClone) {
|
|
1825
|
-
this.modules.logger ?
|
|
2303
|
+
this.modules.logger ? X.init(r2(this.modules.logger), this.options) : X.init(null, this.options);
|
|
1826
2304
|
let e6;
|
|
1827
|
-
e6 = this.modules.formatter ? this.modules.formatter :
|
|
1828
|
-
let t3 = new
|
|
1829
|
-
this.store = new
|
|
2305
|
+
e6 = this.modules.formatter ? this.modules.formatter : Ya;
|
|
2306
|
+
let t3 = new za(this.options);
|
|
2307
|
+
this.store = new Ma(this.options.resources, this.options);
|
|
1830
2308
|
let i3 = this.services;
|
|
1831
|
-
i3.logger =
|
|
2309
|
+
i3.logger = X, i3.resourceStore = this.store, i3.languageUtils = t3, i3.pluralResolver = new Ha(t3, { prepend: this.options.pluralSeparator, simplifyPluralSuffix: this.options.simplifyPluralSuffix }), this.options.interpolation.format && this.options.interpolation.format !== n2.interpolation.format && this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`), e6 && (!this.options.interpolation.format || this.options.interpolation.format === n2.interpolation.format) && (i3.formatter = r2(e6), i3.formatter.init && i3.formatter.init(i3, this.options), this.options.interpolation.format = i3.formatter.format.bind(i3.formatter)), i3.interpolator = new Ga(this.options), i3.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i3.backendConnector = new Za(r2(this.modules.backend), i3.resourceStore, i3, this.options), i3.backendConnector.on(`*`, (e7, ...t4) => {
|
|
1832
2310
|
this.emit(e7, ...t4);
|
|
1833
|
-
}), this.modules.languageDetector && (i3.languageDetector = r2(this.modules.languageDetector), i3.languageDetector.init && i3.languageDetector.init(i3, this.options.detection, this.options)), this.modules.i18nFormat && (i3.i18nFormat = r2(this.modules.i18nFormat), i3.i18nFormat.init && i3.i18nFormat.init(this)), this.translator = new
|
|
2311
|
+
}), this.modules.languageDetector && (i3.languageDetector = r2(this.modules.languageDetector), i3.languageDetector.init && i3.languageDetector.init(i3, this.options.detection, this.options)), this.modules.i18nFormat && (i3.i18nFormat = r2(this.modules.i18nFormat), i3.i18nFormat.init && i3.i18nFormat.init(this)), this.translator = new Ra(this.services, this.options), this.translator.on(`*`, (e7, ...t4) => {
|
|
1834
2312
|
this.emit(e7, ...t4);
|
|
1835
2313
|
}), this.modules.external.forEach((e7) => {
|
|
1836
2314
|
e7.init && e7.init(this);
|
|
1837
2315
|
});
|
|
1838
2316
|
}
|
|
1839
|
-
if (this.format = this.options.interpolation.format, t2 ||=
|
|
2317
|
+
if (this.format = this.options.interpolation.format, t2 ||= eo, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1840
2318
|
let e6 = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1841
2319
|
e6.length > 0 && e6[0] !== `dev` && (this.options.lng = e6[0]);
|
|
1842
2320
|
}
|
|
@@ -1845,7 +2323,7 @@ var K = class e4 extends U {
|
|
|
1845
2323
|
}), [`addResource`, `addResources`, `addResourceBundle`, `removeResourceBundle`].forEach((e6) => {
|
|
1846
2324
|
this[e6] = (...t3) => (this.store[e6](...t3), this);
|
|
1847
2325
|
});
|
|
1848
|
-
let i2 =
|
|
2326
|
+
let i2 = K(), a2 = () => {
|
|
1849
2327
|
let e6 = (e7, n3) => {
|
|
1850
2328
|
this.isInitializing = false, this.isInitialized && !this.initializedStoreOnce && this.logger.warn(`init: i18next is already initialized. You should call init just once!`), this.isInitialized = true, this.options.isClone || this.logger.log(`initialized`, this.options), this.emit(`initialized`, this.options), i2.resolve(n3), t2(e7, n3);
|
|
1851
2329
|
};
|
|
@@ -1854,8 +2332,8 @@ var K = class e4 extends U {
|
|
|
1854
2332
|
};
|
|
1855
2333
|
return this.options.resources || !this.options.initAsync ? a2() : setTimeout(a2, 0), i2;
|
|
1856
2334
|
}
|
|
1857
|
-
loadResources(e5, t2 =
|
|
1858
|
-
let n2 = t2, r2 =
|
|
2335
|
+
loadResources(e5, t2 = eo) {
|
|
2336
|
+
let n2 = t2, r2 = G(e5) ? e5 : this.language;
|
|
1859
2337
|
if (typeof e5 == `function` && (n2 = e5), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1860
2338
|
if (r2?.toLowerCase() === `cimode` && (!this.options.preload || this.options.preload.length === 0)) return n2();
|
|
1861
2339
|
let e6 = [], t3 = (t4) => {
|
|
@@ -1869,15 +2347,15 @@ var K = class e4 extends U {
|
|
|
1869
2347
|
} else n2(null);
|
|
1870
2348
|
}
|
|
1871
2349
|
reloadResources(e5, t2, n2) {
|
|
1872
|
-
let r2 =
|
|
1873
|
-
return typeof e5 == `function` && (n2 = e5, e5 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e5 ||= this.languages, t2 ||= this.options.ns, n2 ||=
|
|
2350
|
+
let r2 = K();
|
|
2351
|
+
return typeof e5 == `function` && (n2 = e5, e5 = void 0), typeof t2 == `function` && (n2 = t2, t2 = void 0), e5 ||= this.languages, t2 ||= this.options.ns, n2 ||= eo, this.services.backendConnector.reload(e5, t2, (e6) => {
|
|
1874
2352
|
r2.resolve(), n2(e6);
|
|
1875
2353
|
}), r2;
|
|
1876
2354
|
}
|
|
1877
2355
|
use(e5) {
|
|
1878
2356
|
if (!e5) throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);
|
|
1879
2357
|
if (!e5.type) throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);
|
|
1880
|
-
return e5.type === `backend` && (this.modules.backend = e5), (e5.type === `logger` || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), e5.type === `languageDetector` && (this.modules.languageDetector = e5), e5.type === `i18nFormat` && (this.modules.i18nFormat = e5), e5.type === `postProcessor` &&
|
|
2358
|
+
return e5.type === `backend` && (this.modules.backend = e5), (e5.type === `logger` || e5.log && e5.warn && e5.error) && (this.modules.logger = e5), e5.type === `languageDetector` && (this.modules.languageDetector = e5), e5.type === `i18nFormat` && (this.modules.i18nFormat = e5), e5.type === `postProcessor` && Na.addPostProcessor(e5), e5.type === `formatter` && (this.modules.formatter = e5), e5.type === `3rdParty` && this.modules.external.push(e5), this;
|
|
1881
2359
|
}
|
|
1882
2360
|
setResolvedLanguage(e5) {
|
|
1883
2361
|
if (e5 && this.languages && !([`cimode`, `dev`].indexOf(e5) > -1)) {
|
|
@@ -1893,7 +2371,7 @@ var K = class e4 extends U {
|
|
|
1893
2371
|
}
|
|
1894
2372
|
changeLanguage(e5, t2) {
|
|
1895
2373
|
this.isLanguageChangingTo = e5;
|
|
1896
|
-
let n2 =
|
|
2374
|
+
let n2 = K();
|
|
1897
2375
|
this.emit(`languageChanging`, e5);
|
|
1898
2376
|
let r2 = (e6) => {
|
|
1899
2377
|
this.language = e6, this.languages = this.services.languageUtils.toResolveHierarchy(e6), this.resolvedLanguage = void 0, this.setResolvedLanguage(e6);
|
|
@@ -1901,7 +2379,7 @@ var K = class e4 extends U {
|
|
|
1901
2379
|
a3 ? this.isLanguageChangingTo === e5 && (r2(a3), this.translator.changeLanguage(a3), this.isLanguageChangingTo = void 0, this.emit(`languageChanged`, a3), this.logger.log(`languageChanged`, a3)) : this.isLanguageChangingTo = void 0, n2.resolve((...e6) => this.t(...e6)), t2 && t2(i3, (...e6) => this.t(...e6));
|
|
1902
2380
|
}, a2 = (t3) => {
|
|
1903
2381
|
!e5 && !t3 && this.services.languageDetector && (t3 = []);
|
|
1904
|
-
let n3 =
|
|
2382
|
+
let n3 = G(t3) ? t3 : t3 && t3[0], a3 = this.store.hasLanguageSomeTranslations(n3) ? n3 : this.services.languageUtils.getBestMatchFromCodes(G(t3) ? [t3] : t3);
|
|
1905
2383
|
a3 && (this.language || r2(a3), this.translator.language || this.translator.changeLanguage(a3), this.services.languageDetector?.cacheUserLanguage?.(a3)), this.loadResources(a3, (e6) => {
|
|
1906
2384
|
i2(e6, a3);
|
|
1907
2385
|
});
|
|
@@ -1913,11 +2391,11 @@ var K = class e4 extends U {
|
|
|
1913
2391
|
let a2;
|
|
1914
2392
|
a2 = typeof t3 == `object` ? { ...t3 } : this.options.overloadTranslationOptionHandler([e6, t3].concat(i2)), a2.lng = a2.lng || r2.lng, a2.lngs = a2.lngs || r2.lngs, a2.ns = a2.ns || r2.ns, a2.keyPrefix !== `` && (a2.keyPrefix = a2.keyPrefix || n2 || r2.keyPrefix);
|
|
1915
2393
|
let o2 = { ...this.options, ...a2 };
|
|
1916
|
-
typeof a2.keyPrefix == `function` && (a2.keyPrefix =
|
|
2394
|
+
typeof a2.keyPrefix == `function` && (a2.keyPrefix = Z(a2.keyPrefix, o2));
|
|
1917
2395
|
let s2 = this.options.keySeparator || `.`, c2;
|
|
1918
|
-
return a2.keyPrefix && Array.isArray(e6) ? c2 = e6.map((e7) => (typeof e7 == `function` && (e7 =
|
|
2396
|
+
return a2.keyPrefix && Array.isArray(e6) ? c2 = e6.map((e7) => (typeof e7 == `function` && (e7 = Z(e7, o2)), `${a2.keyPrefix}${s2}${e7}`)) : (typeof e6 == `function` && (e6 = Z(e6, o2)), c2 = a2.keyPrefix ? `${a2.keyPrefix}${s2}${e6}` : e6), this.t(c2, a2);
|
|
1919
2397
|
};
|
|
1920
|
-
return
|
|
2398
|
+
return G(e5) ? r2.lng = e5 : r2.lngs = e5, r2.ns = t2, r2.keyPrefix = n2, r2;
|
|
1921
2399
|
}
|
|
1922
2400
|
t(...e5) {
|
|
1923
2401
|
return this.translator?.translate(...e5);
|
|
@@ -1944,16 +2422,16 @@ var K = class e4 extends U {
|
|
|
1944
2422
|
return !!(this.hasResourceBundle(n2, e5) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a2(n2, e5) && (!r2 || a2(i2, e5)));
|
|
1945
2423
|
}
|
|
1946
2424
|
loadNamespaces(e5, t2) {
|
|
1947
|
-
let n2 =
|
|
1948
|
-
return this.options.ns ? (
|
|
2425
|
+
let n2 = K();
|
|
2426
|
+
return this.options.ns ? (G(e5) && (e5 = [e5]), e5.forEach((e6) => {
|
|
1949
2427
|
this.options.ns.indexOf(e6) < 0 && this.options.ns.push(e6);
|
|
1950
2428
|
}), this.loadResources((e6) => {
|
|
1951
2429
|
n2.resolve(), t2 && t2(e6);
|
|
1952
2430
|
}), n2) : (t2 && t2(), Promise.resolve());
|
|
1953
2431
|
}
|
|
1954
2432
|
loadLanguages(e5, t2) {
|
|
1955
|
-
let n2 =
|
|
1956
|
-
|
|
2433
|
+
let n2 = K();
|
|
2434
|
+
G(e5) && (e5 = [e5]);
|
|
1957
2435
|
let r2 = this.options.preload || [], i2 = e5.filter((e6) => r2.indexOf(e6) < 0 && this.services.languageUtils.isSupportedCode(e6));
|
|
1958
2436
|
return i2.length ? (this.options.preload = r2.concat(i2), this.loadResources((e6) => {
|
|
1959
2437
|
n2.resolve(), t2 && t2(e6);
|
|
@@ -1969,24 +2447,24 @@ var K = class e4 extends U {
|
|
|
1969
2447
|
}
|
|
1970
2448
|
} catch {
|
|
1971
2449
|
}
|
|
1972
|
-
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new
|
|
2450
|
+
let t2 = `ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`), n2 = this.services?.languageUtils || new za(Qa());
|
|
1973
2451
|
return e5.toLowerCase().indexOf(`-latn`) > 1 ? `ltr` : t2.indexOf(n2.getLanguagePartFromCode(e5)) > -1 || e5.toLowerCase().indexOf(`-arab`) > 1 ? `rtl` : `ltr`;
|
|
1974
2452
|
}
|
|
1975
2453
|
static createInstance(t2 = {}, n2) {
|
|
1976
2454
|
let r2 = new e4(t2, n2);
|
|
1977
2455
|
return r2.createInstance = e4.createInstance, r2;
|
|
1978
2456
|
}
|
|
1979
|
-
cloneInstance(t2 = {}, n2 =
|
|
2457
|
+
cloneInstance(t2 = {}, n2 = eo) {
|
|
1980
2458
|
let r2 = t2.forkResourceStore;
|
|
1981
2459
|
r2 && delete t2.forkResourceStore;
|
|
1982
2460
|
let i2 = { ...this.options, ...t2, isClone: true }, a2 = new e4(i2);
|
|
1983
2461
|
if ((t2.debug !== void 0 || t2.prefix !== void 0) && (a2.logger = a2.logger.clone(t2)), [`store`, `services`, `language`].forEach((e5) => {
|
|
1984
2462
|
a2[e5] = this[e5];
|
|
1985
|
-
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new
|
|
1986
|
-
let e5 = { ...
|
|
1987
|
-
a2.services.interpolator = new
|
|
2463
|
+
}), a2.services = { ...this.services }, a2.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, r2 && (a2.store = new Ma(Object.keys(this.store.data).reduce((e5, t3) => (e5[t3] = { ...this.store.data[t3] }, e5[t3] = Object.keys(e5[t3]).reduce((n3, r3) => (n3[r3] = { ...e5[t3][r3] }, n3), e5[t3]), e5), {}), i2), a2.services.resourceStore = a2.store), t2.interpolation) {
|
|
2464
|
+
let e5 = { ...Qa().interpolation, ...this.options.interpolation, ...t2.interpolation }, n3 = { ...i2, interpolation: e5 };
|
|
2465
|
+
a2.services.interpolator = new Ga(n3);
|
|
1988
2466
|
}
|
|
1989
|
-
return a2.translator = new
|
|
2467
|
+
return a2.translator = new Ra(a2.services, i2), a2.translator.on(`*`, (e5, ...t3) => {
|
|
1990
2468
|
a2.emit(e5, ...t3);
|
|
1991
2469
|
}), a2.init(i2, n2), a2.translator.options = i2, a2.translator.backendConnector.services.utils = { hasLoadedNamespace: a2.hasLoadedNamespace.bind(a2) }, a2;
|
|
1992
2470
|
}
|
|
@@ -1994,54 +2472,54 @@ var K = class e4 extends U {
|
|
|
1994
2472
|
return { options: this.options, store: this.store, language: this.language, languages: this.languages, resolvedLanguage: this.resolvedLanguage };
|
|
1995
2473
|
}
|
|
1996
2474
|
}.createInstance();
|
|
1997
|
-
|
|
1998
|
-
var
|
|
1999
|
-
var
|
|
2000
|
-
var
|
|
2001
|
-
var
|
|
2002
|
-
var
|
|
2003
|
-
|
|
2475
|
+
Q.createInstance, Q.dir, Q.init, Q.loadResources, Q.reloadResources, Q.use, Q.changeLanguage, Q.getFixedT, Q.t, Q.exists, Q.setDefaultNamespace, Q.hasLoadedNamespace, Q.loadNamespaces, Q.loadLanguages;
|
|
2476
|
+
var oo = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
2477
|
+
var so = { "&": `&`, "&": `&`, "<": `<`, "<": `<`, ">": `>`, ">": `>`, "'": `'`, "'": `'`, """: `"`, """: `"`, " ": ` `, " ": ` `, "©": `\xA9`, "©": `\xA9`, "®": `\xAE`, "®": `\xAE`, "…": `\u2026`, "…": `\u2026`, "/": `/`, "/": `/` };
|
|
2478
|
+
var co = (e5) => so[e5];
|
|
2479
|
+
var lo = { bindI18n: `languageChanged`, bindI18nStore: ``, transEmptyNodeValue: ``, transSupportBasicHtmlNodes: true, transWrapTextNodes: ``, transKeepBasicHtmlNodesFor: [`br`, `strong`, `i`, `p`], useSuspense: true, unescape: (e5) => e5.replace(oo, co), transDefaultProps: void 0 };
|
|
2480
|
+
var uo = (e5 = {}) => {
|
|
2481
|
+
lo = { ...lo, ...e5 };
|
|
2004
2482
|
};
|
|
2005
|
-
var
|
|
2006
|
-
|
|
2483
|
+
var fo = { type: `3rdParty`, init(e5) {
|
|
2484
|
+
uo(e5.options.react);
|
|
2007
2485
|
} };
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2010
|
-
var
|
|
2011
|
-
function
|
|
2012
|
-
if (
|
|
2013
|
-
|
|
2486
|
+
var po = /* @__PURE__ */ new Map();
|
|
2487
|
+
var mo = 500;
|
|
2488
|
+
var $;
|
|
2489
|
+
function ho() {
|
|
2490
|
+
if ($ === void 0) try {
|
|
2491
|
+
$ = new Intl.NumberFormat(`en-US`, { useGrouping: false, maximumFractionDigits: 0 }).format(`9007199254740993`) === `9007199254740993`;
|
|
2014
2492
|
} catch {
|
|
2015
|
-
|
|
2493
|
+
$ = false;
|
|
2016
2494
|
}
|
|
2017
|
-
return
|
|
2495
|
+
return $;
|
|
2018
2496
|
}
|
|
2019
|
-
var
|
|
2020
|
-
function
|
|
2021
|
-
if (!(typeof e5 != `string` ||
|
|
2497
|
+
var go = 15;
|
|
2498
|
+
function _o(e5) {
|
|
2499
|
+
if (!(typeof e5 != `string` || ho()) && e5.replace(/[^0-9]/g, ``).replace(/^0+/, ``).length > go) throw Error(`Cannot format the amount '${e5}' exactly: this runtime's Intl implementation predates ES2023 string support and would lose precision. Use a runtime with ES2023 Intl support (for example Node 20+), or pass a value within 15 significant digits.`);
|
|
2022
2500
|
}
|
|
2023
|
-
function
|
|
2501
|
+
function vo(e5, t2, n2) {
|
|
2024
2502
|
return `${e5}|${t2}|${Object.entries(n2).filter(([, e6]) => e6 !== void 0).sort(([e6], [t3]) => e6 < t3 ? -1 : 1).map(([e6, t3]) => `${e6}=${String(t3)}`).join(`&`)}`;
|
|
2025
2503
|
}
|
|
2026
|
-
function
|
|
2027
|
-
let r2 =
|
|
2028
|
-
return i2 || (i2 = new Intl.NumberFormat(e5, { ...n2, style: `currency`, currency: t2 }),
|
|
2504
|
+
function yo(e5, t2, n2) {
|
|
2505
|
+
let r2 = vo(e5, t2, n2), i2 = po.get(r2);
|
|
2506
|
+
return i2 || (i2 = new Intl.NumberFormat(e5, { ...n2, style: `currency`, currency: t2 }), po.size >= mo && po.clear(), po.set(r2, i2)), i2;
|
|
2029
2507
|
}
|
|
2030
|
-
function
|
|
2031
|
-
return
|
|
2508
|
+
function bo(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
2509
|
+
return _o(t2), yo(e5, n2, r2).format(t2);
|
|
2032
2510
|
}
|
|
2033
|
-
function
|
|
2034
|
-
return
|
|
2511
|
+
function xo(e5, { value: t2, currency: n2 }, r2 = {}) {
|
|
2512
|
+
return _o(t2), yo(e5, n2, r2).formatToParts(t2);
|
|
2035
2513
|
}
|
|
2036
|
-
function
|
|
2037
|
-
return
|
|
2514
|
+
function So(e5) {
|
|
2515
|
+
return Ni().find((e6) => e6.primary)?.id ?? e5;
|
|
2038
2516
|
}
|
|
2039
|
-
function
|
|
2517
|
+
function Co(e5, t2) {
|
|
2040
2518
|
let { locale: n2, ...r2 } = t2 ?? {}, i2 = n2 ?? e5.essentials?.locale;
|
|
2041
2519
|
if (!i2) throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
2042
2520
|
return { locale: i2, formatOptions: r2 };
|
|
2043
2521
|
}
|
|
2044
|
-
var
|
|
2522
|
+
var wo = fa({ getLanguage: (e5) => () => {
|
|
2045
2523
|
let t2 = e5.essentials?.language;
|
|
2046
2524
|
if (!t2) throw Error(`Host language is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
2047
2525
|
return t2;
|
|
@@ -2050,20 +2528,20 @@ var Kr = Bn({ getLanguage: (e5) => () => {
|
|
|
2050
2528
|
if (!t2) throw Error(`Host locale is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
2051
2529
|
return t2;
|
|
2052
2530
|
}, formatCurrency: (e5) => (t2, n2) => {
|
|
2053
|
-
let { locale: r2, formatOptions: i2 } =
|
|
2054
|
-
return
|
|
2531
|
+
let { locale: r2, formatOptions: i2 } = Co(e5, n2);
|
|
2532
|
+
return bo(r2, t2, i2);
|
|
2055
2533
|
}, formatCurrencyToParts: (e5) => (t2, n2) => {
|
|
2056
|
-
let { locale: r2, formatOptions: i2 } =
|
|
2057
|
-
return
|
|
2534
|
+
let { locale: r2, formatOptions: i2 } = Co(e5, n2);
|
|
2535
|
+
return xo(r2, t2, i2);
|
|
2058
2536
|
}, getTranslationFunction: (e5) => () => {
|
|
2059
2537
|
let t2 = e5.translations?.();
|
|
2060
2538
|
if (!t2) throw Error(`Host translation resources are not available.`);
|
|
2061
|
-
let n2 =
|
|
2062
|
-
return n2.use(
|
|
2539
|
+
let n2 = Q.createInstance(), r2 = So(e5.essentials?.language) || `en`, i2 = { lng: e5.essentials?.language || r2, fallbackLng: r2, resources: t2 };
|
|
2540
|
+
return n2.use(fo).init(i2, (e6) => {
|
|
2063
2541
|
if (e6) throw e6;
|
|
2064
2542
|
}), n2.t.bind(n2);
|
|
2065
2543
|
} });
|
|
2066
|
-
var
|
|
2544
|
+
var To = class {
|
|
2067
2545
|
constructor(e5) {
|
|
2068
2546
|
this.message = e5, this.captureException = () => {
|
|
2069
2547
|
console.error(this.message);
|
|
@@ -2078,42 +2556,42 @@ var qr = class {
|
|
|
2078
2556
|
};
|
|
2079
2557
|
}
|
|
2080
2558
|
};
|
|
2081
|
-
var
|
|
2082
|
-
var
|
|
2083
|
-
var
|
|
2084
|
-
function
|
|
2559
|
+
var Eo = (e5) => new To(e5);
|
|
2560
|
+
var Do = fa({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : Eo(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
2561
|
+
var Oo = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
|
|
2562
|
+
function ko(e5) {
|
|
2085
2563
|
try {
|
|
2086
|
-
let t2 =
|
|
2564
|
+
let t2 = Do.getMonitoringClient?.();
|
|
2087
2565
|
return t2 && typeof t2[e5] == `function` ? t2 : null;
|
|
2088
2566
|
} catch {
|
|
2089
2567
|
return null;
|
|
2090
2568
|
}
|
|
2091
2569
|
}
|
|
2092
|
-
function
|
|
2093
|
-
let a2 =
|
|
2570
|
+
function Ao(e5, { feature: t2, action: n2, level: r2 = `error`, contexts: i2 }) {
|
|
2571
|
+
let a2 = ko(`captureException`);
|
|
2094
2572
|
if (!a2) return;
|
|
2095
2573
|
let o2 = e5 instanceof Error ? e5 : Error(String(e5));
|
|
2096
2574
|
a2.captureException(o2, { level: r2, tags: { feature: t2, action: n2 }, ...i2 ? { contexts: i2 } : {} });
|
|
2097
2575
|
}
|
|
2098
|
-
function
|
|
2099
|
-
let i2 =
|
|
2576
|
+
function jo(e5, { feature: t2, tags: n2 }, r2) {
|
|
2577
|
+
let i2 = ko(`startSpanManual`);
|
|
2100
2578
|
if (!i2) return r2;
|
|
2101
2579
|
let a2 = i2.startSpanManual({ name: e5, tags: { feature: t2, ...n2 } });
|
|
2102
2580
|
return r2.then(() => a2.end(), (e6) => a2.fail(e6)), r2;
|
|
2103
2581
|
}
|
|
2104
|
-
var
|
|
2582
|
+
var Mo = class extends import_react.Component {
|
|
2105
2583
|
state = { hasError: false };
|
|
2106
2584
|
static getDerivedStateFromError() {
|
|
2107
2585
|
return { hasError: true };
|
|
2108
2586
|
}
|
|
2109
2587
|
componentDidCatch(e5, t2) {
|
|
2110
|
-
|
|
2588
|
+
Ao(e5, { feature: this.props.feature ?? `service`, action: `render`, contexts: { react: { componentStack: t2.componentStack } } });
|
|
2111
2589
|
}
|
|
2112
2590
|
render() {
|
|
2113
2591
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
2114
2592
|
}
|
|
2115
2593
|
};
|
|
2116
|
-
function
|
|
2594
|
+
function No(e5) {
|
|
2117
2595
|
let t2 = e5;
|
|
2118
2596
|
if (t2.__state || (t2.__state = { status: `pending` }, t2.then((e6) => {
|
|
2119
2597
|
t2.__state = { status: `fulfilled`, value: e6 };
|
|
@@ -2122,49 +2600,49 @@ function ei(e5) {
|
|
|
2122
2600
|
})), t2.__state.status === `fulfilled`) return t2.__state.value;
|
|
2123
2601
|
throw t2.__state.status === `rejected` ? t2.__state.reason : t2;
|
|
2124
2602
|
}
|
|
2125
|
-
function
|
|
2603
|
+
function Po(e5) {
|
|
2126
2604
|
let t2 = Promise.resolve(e5);
|
|
2127
2605
|
return t2.__state = { status: `fulfilled`, value: e5 }, t2;
|
|
2128
2606
|
}
|
|
2129
|
-
var
|
|
2130
|
-
function
|
|
2131
|
-
let r2 =
|
|
2132
|
-
r2 || (r2 = /* @__PURE__ */ new WeakMap(),
|
|
2607
|
+
var Fo = /* @__PURE__ */ new WeakMap();
|
|
2608
|
+
function Io(e5, t2, n2) {
|
|
2609
|
+
let r2 = Fo.get(e5);
|
|
2610
|
+
r2 || (r2 = /* @__PURE__ */ new WeakMap(), Fo.set(e5, r2));
|
|
2133
2611
|
let i2 = r2.get(t2);
|
|
2134
2612
|
i2 || (i2 = /* @__PURE__ */ new WeakMap(), r2.set(t2, i2));
|
|
2135
2613
|
let a2 = i2.get(n2);
|
|
2136
2614
|
if (!a2) {
|
|
2137
2615
|
let r3 = e5;
|
|
2138
|
-
a2 = r3.__state?.status === `fulfilled` ?
|
|
2616
|
+
a2 = r3.__state?.status === `fulfilled` ? Po(t2(r3.__state.value)) : r3.__state?.status === `rejected` ? Po(n2(r3.__state.reason)) : e5.then(t2, n2), i2.set(n2, a2);
|
|
2139
2617
|
}
|
|
2140
2618
|
return a2;
|
|
2141
2619
|
}
|
|
2142
|
-
function
|
|
2620
|
+
function Lo(e5) {
|
|
2143
2621
|
return e5;
|
|
2144
2622
|
}
|
|
2145
|
-
var
|
|
2146
|
-
function
|
|
2623
|
+
var Ro = Lo(`@wix/site-service-warmup-data`);
|
|
2624
|
+
function zo() {
|
|
2147
2625
|
try {
|
|
2148
2626
|
return (0, import_services_manager_react.useGetService)();
|
|
2149
2627
|
} catch {
|
|
2150
2628
|
return null;
|
|
2151
2629
|
}
|
|
2152
2630
|
}
|
|
2153
|
-
function
|
|
2631
|
+
function Bo(e5) {
|
|
2154
2632
|
try {
|
|
2155
|
-
return e5 ? e5(
|
|
2633
|
+
return e5 ? e5(Ro) : null;
|
|
2156
2634
|
} catch {
|
|
2157
2635
|
return null;
|
|
2158
2636
|
}
|
|
2159
2637
|
}
|
|
2160
|
-
function
|
|
2161
|
-
let e5 =
|
|
2638
|
+
function Vo() {
|
|
2639
|
+
let e5 = Bo(zo()), t2 = typeof window > `u`;
|
|
2162
2640
|
return { scope: e5 ?? void 0, get: async (n2) => {
|
|
2163
2641
|
if (t2 || !e5) return null;
|
|
2164
2642
|
try {
|
|
2165
2643
|
return await e5.get(n2);
|
|
2166
2644
|
} catch (e6) {
|
|
2167
|
-
return
|
|
2645
|
+
return Ao(e6, { feature: Oo.warmup, action: `read`, level: `warning`, contexts: { warmup: { key: n2 } } }), null;
|
|
2168
2646
|
}
|
|
2169
2647
|
}, set: (n2, r2) => {
|
|
2170
2648
|
if (t2 && e5) try {
|
|
@@ -2173,75 +2651,75 @@ function oi() {
|
|
|
2173
2651
|
}
|
|
2174
2652
|
} };
|
|
2175
2653
|
}
|
|
2176
|
-
var
|
|
2177
|
-
var
|
|
2178
|
-
var
|
|
2179
|
-
function
|
|
2654
|
+
var Ho = Lo(`@wix/site-service-locale`);
|
|
2655
|
+
var Uo = Lo;
|
|
2656
|
+
var Wo = Uo(`@wix/viewer-service-multilingual`);
|
|
2657
|
+
function Go() {
|
|
2180
2658
|
try {
|
|
2181
|
-
return
|
|
2659
|
+
return wo.getLanguage() ?? `en`;
|
|
2182
2660
|
} catch {
|
|
2183
2661
|
return `en`;
|
|
2184
2662
|
}
|
|
2185
2663
|
}
|
|
2186
|
-
function
|
|
2664
|
+
function Ko(e5) {
|
|
2187
2665
|
try {
|
|
2188
2666
|
return (0, import_services_manager_react.useService)(e5);
|
|
2189
2667
|
} catch {
|
|
2190
2668
|
return null;
|
|
2191
2669
|
}
|
|
2192
2670
|
}
|
|
2193
|
-
function
|
|
2194
|
-
let e5 =
|
|
2195
|
-
return t2?.multilingualEnabled && t2.currentLocale?.languageCode || e5?.language ||
|
|
2671
|
+
function qo() {
|
|
2672
|
+
let e5 = Ko(Ho), t2 = Ko(Wo);
|
|
2673
|
+
return t2?.multilingualEnabled && t2.currentLocale?.languageCode || e5?.language || Go();
|
|
2196
2674
|
}
|
|
2197
|
-
var
|
|
2198
|
-
var
|
|
2199
|
-
var
|
|
2200
|
-
function
|
|
2201
|
-
let r2 = { addOnGroups:
|
|
2675
|
+
var Jo = [];
|
|
2676
|
+
var Yo = [];
|
|
2677
|
+
var Xo = `useServiceAddOnsContext must be used within ServiceAddOnsContextProvider`;
|
|
2678
|
+
function Zo({ isLoading: e5, hasError: t2, children: n2 }) {
|
|
2679
|
+
let r2 = { addOnGroups: Jo, selected: Yo, isLoading: e5, hasError: t2, toggleAddOn: () => {
|
|
2202
2680
|
}, setAddOnQuantity: () => {
|
|
2203
2681
|
} };
|
|
2204
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2682
|
+
return (0, import_jsx_runtime.jsx)(Xs.Provider, { value: r2, children: n2 });
|
|
2205
2683
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2684
|
+
function Qo({ children: e5 }) {
|
|
2685
|
+
return (0, import_jsx_runtime.jsx)(Zo, { isLoading: true, hasError: false, children: e5 });
|
|
2208
2686
|
}
|
|
2209
|
-
function
|
|
2210
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2687
|
+
function $o({ children: e5 }) {
|
|
2688
|
+
return (0, import_jsx_runtime.jsx)(Zo, { isLoading: false, hasError: true, children: e5 });
|
|
2211
2689
|
}
|
|
2212
|
-
function
|
|
2690
|
+
function es(e5) {
|
|
2213
2691
|
if (!e5) return;
|
|
2214
2692
|
let t2 = ``;
|
|
2215
2693
|
return (e5.filename || e5.altText) && (t2 = `/${encodeURIComponent(e5.filename || e5.altText)}`), e5.id ? `wix:image://v1/${e5.id}${t2}#originWidth=${e5.width}&originHeight=${e5.height}` : e5.url;
|
|
2216
2694
|
}
|
|
2217
|
-
var
|
|
2218
|
-
function
|
|
2219
|
-
return
|
|
2695
|
+
var ts = [{ path: `addOnGroupsDetails.addOns.mainMedia.image.urlExpirationDate` }];
|
|
2696
|
+
function ns(e5) {
|
|
2697
|
+
return ii(Object.assign(e5, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/services-2`, destPath: `` }, { srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www.wixapis.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }, { srcPath: `/bookings/services/v2/bulk/services`, destPath: `/v2/bulk/services` }], "manage._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "editor._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "blocks._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], "create.editorx": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }, { srcPath: `/_api/bookings/v2/bulk/services`, destPath: `/v2/bulk/services` }], _: [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "www._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "bo._base_domain_": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wixbo.ai": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "wix-bo.com": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "editor.wixapps.net": [{ srcPath: `/_api/bookings/v2/services`, destPath: `/v2/services` }], "api._api_base_domain_": [{ srcPath: `/services-2`, destPath: `` }] } }));
|
|
2220
2698
|
}
|
|
2221
|
-
var
|
|
2222
|
-
function
|
|
2699
|
+
var rs = `@wix/auto_sdk_bookings_services`;
|
|
2700
|
+
function is(e5) {
|
|
2223
2701
|
function t2({ host: t3 }) {
|
|
2224
|
-
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`, packageName:
|
|
2702
|
+
return { entityFqdn: `wix.bookings.services.v2.service`, method: `POST`, methodFqn: `wix.bookings.services.v2.AddOnGroupsService.ListAddOnGroupsByServiceId`, packageName: rs, migrationOptions: { optInTransformResponse: true }, url: ns({ protoPath: `/v2/services/add-on-groups/list-add-on-groups-by-service-id`, data: e5, host: t3 }), data: e5, transformResponse: (e6) => Ir(e6, [{ transformFn: Cr, paths: ts }]) };
|
|
2225
2703
|
}
|
|
2226
2704
|
return t2;
|
|
2227
2705
|
}
|
|
2228
|
-
var
|
|
2229
|
-
async function
|
|
2230
|
-
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 =
|
|
2706
|
+
var as = [{ path: `addOnGroupsDetails.addOns.mainMedia.image` }];
|
|
2707
|
+
async function os(e5, t2) {
|
|
2708
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = is(xr({ serviceId: e5, groupIds: t2?.groupIds }));
|
|
2231
2709
|
r2?.onSiteCall?.();
|
|
2232
2710
|
try {
|
|
2233
2711
|
let e6 = await n2.request(i2);
|
|
2234
|
-
return r2?.onSuccess?.(e6),
|
|
2712
|
+
return r2?.onSuccess?.(e6), Sr(Ir(e6.data, [{ transformFn: es, paths: as }]));
|
|
2235
2713
|
} catch (e6) {
|
|
2236
|
-
let t3 =
|
|
2714
|
+
let t3 = Kr(e6, { spreadPathsToArguments: {}, explicitPathsToArguments: { serviceId: `$[0]`, groupIds: `$[1].groupIds` }, singleArgumentUnchanged: false }, [`serviceId`, `options`]);
|
|
2237
2715
|
throw r2?.onError?.(e6), t3;
|
|
2238
2716
|
}
|
|
2239
2717
|
}
|
|
2240
|
-
function
|
|
2241
|
-
return (t2, n2) =>
|
|
2718
|
+
function ss(e5) {
|
|
2719
|
+
return (t2, n2) => os(t2, n2, { httpClient: e5 });
|
|
2242
2720
|
}
|
|
2243
|
-
var
|
|
2244
|
-
function
|
|
2721
|
+
var cs = ri(ss);
|
|
2722
|
+
function ls(e5, t2) {
|
|
2245
2723
|
let n2 = e5?.value, r2 = e5?.currency;
|
|
2246
2724
|
if (n2 == null || !r2) return null;
|
|
2247
2725
|
let i2 = Number(n2);
|
|
@@ -2249,64 +2727,73 @@ function Oi(e5, t2) {
|
|
|
2249
2727
|
let a2 = i2 % 1 == 0 ? 0 : 2;
|
|
2250
2728
|
return new Intl.NumberFormat(t2, { style: `currency`, currency: r2, currencyDisplay: `symbol`, maximumFractionDigits: a2, minimumFractionDigits: a2 }).format(i2).replace(/\p{Zs}/gu, `\xA0`);
|
|
2251
2729
|
}
|
|
2252
|
-
async function
|
|
2253
|
-
return (await
|
|
2730
|
+
async function us(e5) {
|
|
2731
|
+
return (await cs(e5)).addOnGroupsDetails ?? [];
|
|
2254
2732
|
}
|
|
2255
|
-
function
|
|
2733
|
+
function ds(e5) {
|
|
2734
|
+
if (!e5) return null;
|
|
2735
|
+
try {
|
|
2736
|
+
let { id: t2, url: n2, width: r2, height: i2 } = pr.getImageUrl(e5);
|
|
2737
|
+
return t2 && n2 ? { uri: t2, url: n2, width: r2, height: i2 } : null;
|
|
2738
|
+
} catch {
|
|
2739
|
+
return null;
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
function fs(e5, t2) {
|
|
2256
2743
|
let n2 = e5.price?.value == null ? null : Number(e5.price.value);
|
|
2257
|
-
return { addOnId: e5.addOnId ?? null, addOnName: e5.nameTranslated ?? e5.name ?? null, addOnPrice:
|
|
2744
|
+
return { addOnId: e5.addOnId ?? null, addOnName: e5.nameTranslated ?? e5.name ?? null, addOnPrice: ls(e5.price, t2), addOnPriceValue: n2 != null && Number.isFinite(n2) ? n2 : null, addOnCurrency: e5.price?.currency ?? null, durationInMinutes: e5.durationInMinutes ?? null, maxQuantity: e5.maxQuantity ?? null, addOnImage: ds(e5.mainMedia?.image), isSelected: false, selectedQuantity: 0 };
|
|
2258
2745
|
}
|
|
2259
|
-
function
|
|
2260
|
-
return e5.map((e6) => ({ groupId: e6.groupId ?? null, groupName: e6.groupNameTranslated ?? e6.groupName ?? null, prompt: e6.promptTranslated ?? e6.prompt ?? null, maxNumberOfAddOns: e6.maxNumberOfAddOns ?? null, addOns: (e6.addOns ?? []).map((e7) =>
|
|
2746
|
+
function ps(e5, t2) {
|
|
2747
|
+
return e5.map((e6) => ({ groupId: e6.groupId ?? null, groupName: e6.groupNameTranslated ?? e6.groupName ?? null, prompt: e6.promptTranslated ?? e6.prompt ?? null, maxNumberOfAddOns: e6.maxNumberOfAddOns ?? null, addOns: (e6.addOns ?? []).map((e7) => fs(e7, t2)), selectedCount: 0, canSelectMore: true }));
|
|
2261
2748
|
}
|
|
2262
|
-
var
|
|
2263
|
-
function
|
|
2264
|
-
return `${
|
|
2749
|
+
var ms = `bookings-uou`;
|
|
2750
|
+
function hs(e5, t2, n2) {
|
|
2751
|
+
return `${ms}:${e5}:addons:${t2}:${n2}`;
|
|
2265
2752
|
}
|
|
2266
|
-
var
|
|
2267
|
-
var
|
|
2268
|
-
var
|
|
2269
|
-
var
|
|
2270
|
-
function
|
|
2753
|
+
var gs = 5e3;
|
|
2754
|
+
var _s = 100;
|
|
2755
|
+
var vs = `wix-warmup-data`;
|
|
2756
|
+
var ys = null;
|
|
2757
|
+
function bs(e5) {
|
|
2271
2758
|
if (typeof document < `u`) try {
|
|
2272
|
-
let t2 = document.getElementById(
|
|
2273
|
-
return t2 ? (
|
|
2759
|
+
let t2 = document.getElementById(vs)?.textContent;
|
|
2760
|
+
return t2 ? (ys?.text !== t2 && (ys = { text: t2, data: JSON.parse(t2).builderComponentsWarmupData ?? {} }), ys.data[e5] ?? void 0) : void 0;
|
|
2274
2761
|
} catch {
|
|
2275
2762
|
return;
|
|
2276
2763
|
}
|
|
2277
2764
|
}
|
|
2278
|
-
var
|
|
2279
|
-
var
|
|
2280
|
-
var
|
|
2281
|
-
var
|
|
2282
|
-
function
|
|
2283
|
-
if (!e5) return
|
|
2284
|
-
let t2 =
|
|
2285
|
-
return t2 || (t2 =
|
|
2765
|
+
var xs = () => ({ promises: /* @__PURE__ */ new Map(), invalidatedWarmup: /* @__PURE__ */ new Set() });
|
|
2766
|
+
var Ss = xs();
|
|
2767
|
+
var Cs = /* @__PURE__ */ new WeakMap();
|
|
2768
|
+
var ws = /* @__PURE__ */ new WeakMap();
|
|
2769
|
+
function Ts(e5) {
|
|
2770
|
+
if (!e5) return Ss;
|
|
2771
|
+
let t2 = Cs.get(e5);
|
|
2772
|
+
return t2 || (t2 = xs(), Cs.set(e5, t2)), t2;
|
|
2286
2773
|
}
|
|
2287
|
-
function
|
|
2774
|
+
function Es({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
2288
2775
|
if (e5 === null) return n2();
|
|
2289
2776
|
if (typeof window > `u`) {
|
|
2290
2777
|
let r3 = () => n2().then((n3) => (t2.set(e5, n3), n3)), { scope: i3 } = t2;
|
|
2291
2778
|
if (!i3) return r3();
|
|
2292
|
-
let a3 =
|
|
2293
|
-
a3 || (a3 = /* @__PURE__ */ new Map(),
|
|
2779
|
+
let a3 = ws.get(i3);
|
|
2780
|
+
a3 || (a3 = /* @__PURE__ */ new Map(), ws.set(i3, a3));
|
|
2294
2781
|
let o3 = a3.get(e5);
|
|
2295
2782
|
if (o3) return o3;
|
|
2296
2783
|
let s3 = r3();
|
|
2297
2784
|
return a3.set(e5, s3), s3.catch(() => a3.delete(e5)), s3;
|
|
2298
2785
|
}
|
|
2299
|
-
let i2 =
|
|
2786
|
+
let i2 = Ts(t2.scope), a2 = Date.now();
|
|
2300
2787
|
for (let [e6, t3] of i2.promises) t3.expiresAt <= a2 && i2.promises.delete(e6);
|
|
2301
2788
|
let o2 = i2.promises.get(e5);
|
|
2302
2789
|
if (o2 && !r2) return o2.promise;
|
|
2303
2790
|
r2 && i2.invalidatedWarmup.add(e5);
|
|
2304
2791
|
let s2 = !i2.invalidatedWarmup.has(e5);
|
|
2305
2792
|
if (s2) {
|
|
2306
|
-
let t3 =
|
|
2793
|
+
let t3 = bs(e5);
|
|
2307
2794
|
if (t3 !== void 0) {
|
|
2308
|
-
let n3 =
|
|
2309
|
-
return i2.promises.set(e5, { promise: n3, expiresAt: a2 +
|
|
2795
|
+
let n3 = Po(t3);
|
|
2796
|
+
return i2.promises.set(e5, { promise: n3, expiresAt: a2 + gs }), n3;
|
|
2310
2797
|
}
|
|
2311
2798
|
}
|
|
2312
2799
|
let c2 = (async () => {
|
|
@@ -2316,37 +2803,37 @@ function Wi({ key: e5, warmupData: t2, fetchData: n2, refresh: r2 = false }) {
|
|
|
2316
2803
|
}
|
|
2317
2804
|
return n2();
|
|
2318
2805
|
})();
|
|
2319
|
-
i2.promises.size >=
|
|
2806
|
+
i2.promises.size >= _s && i2.promises.delete(i2.promises.keys().next().value);
|
|
2320
2807
|
let l2 = { promise: c2, expiresAt: 1 / 0 };
|
|
2321
2808
|
return i2.promises.set(e5, l2), c2.then(() => {
|
|
2322
|
-
l2.expiresAt = Date.now() +
|
|
2809
|
+
l2.expiresAt = Date.now() + gs;
|
|
2323
2810
|
}, () => {
|
|
2324
2811
|
i2.promises.get(e5) === l2 && i2.promises.delete(e5);
|
|
2325
2812
|
}), c2;
|
|
2326
2813
|
}
|
|
2327
|
-
function
|
|
2328
|
-
return
|
|
2329
|
-
throw
|
|
2814
|
+
function Ds(e5, t2) {
|
|
2815
|
+
return jo(`service-addons-context-load`, { feature: Oo.serviceAddOns, tags: { serviceId: e5 } }, us(e5)).then((e6) => ps(e6, t2), (t3) => {
|
|
2816
|
+
throw Ao(t3, { feature: Oo.serviceAddOns, action: `fetch-add-on-groups`, level: `warning`, contexts: { service: { serviceId: e5 } } }), t3;
|
|
2330
2817
|
});
|
|
2331
2818
|
}
|
|
2332
|
-
function
|
|
2333
|
-
return
|
|
2819
|
+
function Os({ serviceId: e5, locale: t2, language: n2, warmupData: r2 }) {
|
|
2820
|
+
return Es({ key: hs(n2, e5, t2), warmupData: r2, fetchData: () => Ds(e5, t2) });
|
|
2334
2821
|
}
|
|
2335
|
-
var
|
|
2336
|
-
function
|
|
2822
|
+
var ks = Uo(`@wix/site-service-business-logger`);
|
|
2823
|
+
function As(e5) {
|
|
2337
2824
|
return { evid: 32, src: 16, endpoint: ``, params: e5 };
|
|
2338
2825
|
}
|
|
2339
|
-
var
|
|
2340
|
-
var
|
|
2341
|
-
function
|
|
2342
|
-
let t2 = e5.searchParams.get(
|
|
2826
|
+
var js = Lo(`@wix/site-service-url`);
|
|
2827
|
+
var Ms = `appSectionParams`;
|
|
2828
|
+
function Ns(e5) {
|
|
2829
|
+
let t2 = e5.searchParams.get(Ms);
|
|
2343
2830
|
if (t2 === null) return e5;
|
|
2344
2831
|
let n2 = new URL(e5);
|
|
2345
|
-
n2.searchParams.delete(
|
|
2346
|
-
for (let [e6, r2] of Object.entries(
|
|
2832
|
+
n2.searchParams.delete(Ms);
|
|
2833
|
+
for (let [e6, r2] of Object.entries(Ps(t2))) typeof r2 == `string` && !n2.searchParams.has(e6) && n2.searchParams.set(e6, r2);
|
|
2347
2834
|
return n2;
|
|
2348
2835
|
}
|
|
2349
|
-
function
|
|
2836
|
+
function Ps(e5) {
|
|
2350
2837
|
try {
|
|
2351
2838
|
let t2 = JSON.parse(e5);
|
|
2352
2839
|
return t2 && typeof t2 == `object` && !Array.isArray(t2) ? t2 : {};
|
|
@@ -2354,16 +2841,16 @@ function Qi(e5) {
|
|
|
2354
2841
|
return {};
|
|
2355
2842
|
}
|
|
2356
2843
|
}
|
|
2357
|
-
var
|
|
2358
|
-
var
|
|
2844
|
+
var Fs = `bookings-uou:url-change`;
|
|
2845
|
+
var Is = (e5) => {
|
|
2359
2846
|
let t2 = new URL(e5);
|
|
2360
2847
|
return t2.searchParams.sort(), t2.href;
|
|
2361
2848
|
};
|
|
2362
|
-
function
|
|
2849
|
+
function Ls(e5, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
2363
2850
|
let r2 = globalThis.window;
|
|
2364
2851
|
if (!r2?.history) return;
|
|
2365
2852
|
let i2 = new URL(r2.location.href);
|
|
2366
|
-
if (
|
|
2853
|
+
if (Is(i2) === Is(e5)) return;
|
|
2367
2854
|
let a2 = { scrollY: r2.scrollY };
|
|
2368
2855
|
if (n2) r2.history.replaceState(a2, ``, e5.href);
|
|
2369
2856
|
else {
|
|
@@ -2374,84 +2861,84 @@ function ea(e5, { disableScrollToTop: t2, skipHistory: n2 } = {}) {
|
|
|
2374
2861
|
return;
|
|
2375
2862
|
}
|
|
2376
2863
|
}
|
|
2377
|
-
r2.dispatchEvent(new Event(
|
|
2864
|
+
r2.dispatchEvent(new Event(Fs));
|
|
2378
2865
|
}
|
|
2379
|
-
function
|
|
2866
|
+
function Rs(e5) {
|
|
2380
2867
|
let t2 = globalThis.window;
|
|
2381
|
-
return t2 ? (t2.addEventListener(
|
|
2382
|
-
t2.removeEventListener(
|
|
2868
|
+
return t2 ? (t2.addEventListener(Fs, e5), t2.addEventListener(`popstate`, e5), () => {
|
|
2869
|
+
t2.removeEventListener(Fs, e5), t2.removeEventListener(`popstate`, e5);
|
|
2383
2870
|
}) : () => {
|
|
2384
2871
|
};
|
|
2385
2872
|
}
|
|
2386
|
-
var
|
|
2873
|
+
var zs = (e5) => {
|
|
2387
2874
|
try {
|
|
2388
2875
|
return decodeURIComponent(e5);
|
|
2389
2876
|
} catch {
|
|
2390
2877
|
return e5;
|
|
2391
2878
|
}
|
|
2392
2879
|
};
|
|
2393
|
-
function
|
|
2880
|
+
function Bs(e5, t2) {
|
|
2394
2881
|
let n2 = t2 ? new URL(t2).pathname : `/`;
|
|
2395
|
-
return `./${
|
|
2882
|
+
return `./${zs(new URL(e5).pathname.replace(n2, ``).replace(/^\/|\/$/g, ``))}`;
|
|
2396
2883
|
}
|
|
2397
|
-
function
|
|
2398
|
-
let e5 = (0, import_services_manager_react.useService)(
|
|
2399
|
-
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () =>
|
|
2884
|
+
function Vs() {
|
|
2885
|
+
let e5 = (0, import_services_manager_react.useService)(js), t2 = (0, import_react.useCallback)(() => e5.currentUrl, [e5]), n2 = (0, import_react.useSyncExternalStore)(Rs, t2, t2), i2 = (0, import_react.useMemo)(() => Ns(new URL(n2)), [n2]), a2 = e5.siteUrl.replace(/\/$/, ``);
|
|
2886
|
+
return { pathname: i2.pathname, search: i2.search, searchParams: i2.searchParams, href: i2.href, getParsedUrl: () => Ns(new URL(e5.currentUrl)), getRelativeUrl: () => Bs(e5.currentUrl, a2), getExternalBaseUrl: () => a2, pushUrl: Ls };
|
|
2400
2887
|
}
|
|
2401
|
-
var
|
|
2888
|
+
var Hs = function(e5) {
|
|
2402
2889
|
return e5.BOOK_ONLINE = `bookingsBookOnline`, e5.SERVICE_PAGE = `bookingsServicePage`, e5.CALENDAR_PAGE = `bookingsCalendar`, e5.FORM_PAGE = `bookingsForm`, e5;
|
|
2403
2890
|
}({});
|
|
2404
|
-
var
|
|
2405
|
-
|
|
2406
|
-
var
|
|
2407
|
-
var
|
|
2408
|
-
let { reportBi: t2 } = (0, import_services_manager_react.useService)(
|
|
2891
|
+
var Us = { SERVICES: `services_context`, SERVICE: `service_context`, TIME_SLOTS: `time_slots_context`, BOOKING_CHECKOUT: `booking_checkout_context`, CATEGORIES: `categories_context`, LOCATIONS: `locations_context`, SERVICE_ADD_ONS: `service_addons_context`, PREFERENCES: `preferences_context` };
|
|
2892
|
+
Hs.BOOK_ONLINE;
|
|
2893
|
+
var Ws = `new_bookings_server`;
|
|
2894
|
+
var Gs = (e5) => {
|
|
2895
|
+
let { reportBi: t2 } = (0, import_services_manager_react.useService)(ks);
|
|
2409
2896
|
return (0, import_react.useCallback)((n2) => {
|
|
2410
|
-
t2({ widget_name: e5, bookingsPlatform:
|
|
2897
|
+
t2({ widget_name: e5, bookingsPlatform: Ws, is_over_editor: false, ...n2.params, src: n2.src, evid: n2.evid }, { endpoint: n2.endpoint });
|
|
2411
2898
|
}, [t2, e5]);
|
|
2412
2899
|
};
|
|
2413
|
-
var
|
|
2414
|
-
let n2 =
|
|
2900
|
+
var Ks = (e5, t2 = true) => {
|
|
2901
|
+
let n2 = Gs(e5), { getParsedUrl: r2 } = Vs(), i2 = (0, import_react.useRef)(false);
|
|
2415
2902
|
(0, import_react.useEffect)(() => {
|
|
2416
|
-
t2 && !i2.current && (i2.current = true, n2(
|
|
2903
|
+
t2 && !i2.current && (i2.current = true, n2(As({ referralInfo: r2().searchParams.get(aa.referral) ?? void 0 })));
|
|
2417
2904
|
}, [t2, n2, r2]);
|
|
2418
2905
|
};
|
|
2419
|
-
var
|
|
2420
|
-
var
|
|
2421
|
-
var
|
|
2422
|
-
var
|
|
2423
|
-
function
|
|
2424
|
-
let e5 = (0, import_react.useContext)(
|
|
2425
|
-
if (!e5) throw Error(
|
|
2906
|
+
var qs = Po({ addOnGroups: Jo, hasError: false });
|
|
2907
|
+
var Js = (e5) => ({ addOnGroups: e5, hasError: false });
|
|
2908
|
+
var Ys = () => ({ addOnGroups: Jo, hasError: true });
|
|
2909
|
+
var Xs = (0, import_react.createContext)(null);
|
|
2910
|
+
function Zs() {
|
|
2911
|
+
let e5 = (0, import_react.useContext)(Xs);
|
|
2912
|
+
if (!e5) throw Error(Xo);
|
|
2426
2913
|
return e5;
|
|
2427
2914
|
}
|
|
2428
|
-
function
|
|
2429
|
-
let { addOnGroups: l2, hasError: u2 } =
|
|
2915
|
+
function Qs({ addOnsPromise: e5, isLoading: t2, pickedAddOns: n2, forwardToggleAddOn: i2, forwardSetAddOnQuantity: a2, children: c2 }) {
|
|
2916
|
+
let { addOnGroups: l2, hasError: u2 } = No(e5), d2 = (0, import_react.useMemo)(() => U(l2, n2), [l2, n2]), p2 = (0, import_react.useMemo)(() => na(l2, d2), [l2, d2]), m2 = (0, import_react.useRef)({ source: n2, picks: n2 });
|
|
2430
2917
|
m2.current.source !== n2 && (m2.current = { source: n2, picks: n2 });
|
|
2431
2918
|
let h2 = (e6) => {
|
|
2432
2919
|
let t3 = m2.current;
|
|
2433
|
-
t3.picks =
|
|
2920
|
+
t3.picks = W(e6({ serviceId: ``, addOns: t3.picks }));
|
|
2434
2921
|
}, g2 = (0, import_react.useCallback)(() => {
|
|
2435
|
-
let e6 = m2.current, t3 =
|
|
2922
|
+
let e6 = m2.current, t3 = U(l2, e6.picks);
|
|
2436
2923
|
return e6.picks.filter((e7) => !t3.includes(e7)).forEach((e7) => a2(e7.id, 0)), e6.picks = t3, t3;
|
|
2437
2924
|
}, [l2, a2]), _2 = (0, import_react.useCallback)((e6) => {
|
|
2438
|
-
let n3 =
|
|
2439
|
-
!t2 &&
|
|
2925
|
+
let n3 = U(l2, m2.current.picks);
|
|
2926
|
+
!t2 && ra(l2, n3, e6) && (g2(), i2(e6), h2((t3) => sa(t3, e6)));
|
|
2440
2927
|
}, [t2, l2, g2, i2]), v2 = (0, import_react.useCallback)((e6, n3) => {
|
|
2441
|
-
let r2 = t2 ? null :
|
|
2928
|
+
let r2 = t2 ? null : $i(l2, e6);
|
|
2442
2929
|
if (!r2) return;
|
|
2443
|
-
let i3 =
|
|
2444
|
-
s2 === o2 || o2 === 0 && !
|
|
2930
|
+
let i3 = U(l2, m2.current.picks), o2 = i3.find((t3) => t3.id === e6)?.quantity ?? 0, s2 = ia(r2, n3);
|
|
2931
|
+
s2 === o2 || o2 === 0 && !ra(l2, i3, e6) || (g2(), a2(e6, s2), h2((t3) => ca(t3, e6, s2)));
|
|
2445
2932
|
}, [t2, l2, g2, a2]), y2 = (0, import_react.useMemo)(() => ({ addOnGroups: p2, selected: d2, isLoading: t2, hasError: u2, toggleAddOn: _2, setAddOnQuantity: v2 }), [p2, d2, t2, u2, _2, v2]);
|
|
2446
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2933
|
+
return (0, import_jsx_runtime.jsx)(Xs.Provider, { value: y2, children: c2 });
|
|
2447
2934
|
}
|
|
2448
|
-
function
|
|
2935
|
+
function $s({ children: e5 }) {
|
|
2449
2936
|
let { service: n2, serviceId: r2, hasAddOns: i2, locale: a2, isLoading: s2, bookingsSettingsLoading: c2, selection: u2, toggleAddOn: d2, setAddOnQuantity: p2 } = (0, import_service.useServiceContext)();
|
|
2450
|
-
|
|
2451
|
-
let m2 = (0, import_react.useMemo)(() =>
|
|
2452
|
-
return (0, import_jsx_runtime.jsx)(
|
|
2937
|
+
Ks(Us.SERVICE_ADD_ONS, !s2 && !c2);
|
|
2938
|
+
let m2 = (0, import_react.useMemo)(() => W(u2), [u2]), h2 = Vo(), g2 = qo(), _2 = n2 && i2 && r2 ? r2 : null, v2 = (0, import_react.useMemo)(() => _2 ? Io(Os({ serviceId: _2, locale: a2, language: g2, warmupData: h2 }), Js, Ys) : qs, [_2, a2, g2]), y2 = !_2 && !!s2;
|
|
2939
|
+
return (0, import_jsx_runtime.jsx)(Mo, { fallback: (0, import_jsx_runtime.jsx)($o, { children: e5 }), feature: Oo.serviceAddOns, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Qo, { children: e5 }), children: (0, import_jsx_runtime.jsx)(Qs, { addOnsPromise: v2, isLoading: y2, pickedAddOns: m2, forwardToggleAddOn: d2, forwardSetAddOnQuantity: p2, children: e5 }) }) });
|
|
2453
2940
|
}
|
|
2454
|
-
var
|
|
2941
|
+
var ec = Qi(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);
|
|
2455
2942
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2456
2943
|
0 && (module.exports = {
|
|
2457
2944
|
ServiceAddOnsContextProvider,
|