@getmicdrop/venue-calendar 4.2.2 → 4.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ArrowLeftIcon-DQ-h5PcH.js → ArrowLeftIcon-BGd-X_Qm.js} +1 -1
- package/dist/{Badge-M6qZyfTF.js → Badge-Bv_MT-Vt.js} +10 -9
- package/dist/BlockPlaceholder-Wl39H9Z7.js +52 -0
- package/dist/Button-C4uFgl7L.js +2141 -0
- package/dist/{Calendar-BX22svpz.js → Calendar-DafPX3k_.js} +292 -290
- package/dist/CalendarFoundryView-COkX5oQx.js +22292 -0
- package/dist/{CalendarIcon-DR197Ioz.js → CalendarIcon-CeQ1_FWq.js} +1 -1
- package/dist/{CartView-B2VtVvZM.js → CartView-nvVA8vWk.js} +651 -644
- package/dist/Checkout-BphC7gak.js +1807 -0
- package/dist/{Checkout-BTqfjvDp.js → Checkout-Ow2x8cNL.js} +92 -91
- package/dist/{CheckoutTimer-Cng5tcGO.js → CheckoutTimer-DJlt5M2b.js} +5 -5
- package/dist/{ChevronDownIcon-C_RiK-BW.js → ChevronDownIcon-y7oNyepp.js} +1 -1
- package/dist/{ClockIcon-BOJENuPq.js → ClockIcon-BGTz8dak.js} +1 -1
- package/dist/{CloseIcon-Rc7tpX2a.js → CloseIcon-C9SHeORJ.js} +1 -1
- package/dist/CloseOutline-qpVa62mu.js +13 -0
- package/dist/{CollectionView-A1zP8yz5.js → CollectionView-BAIlcuqO.js} +13 -12
- package/dist/CropImage-B0tj2_uN.js +404 -0
- package/dist/Event-CTaXLze_.js +3034 -0
- package/dist/{EventPage-hxrPKPhm.js → EventPage-LuA-aEYZ.js} +168 -167
- package/dist/{Heading-B7VYbbfJ.js → Heading-Dfo3bjyn.js} +4 -3
- package/dist/Image-B3cEndLZ.js +87 -0
- package/dist/Input-iXqece97.js +487 -0
- package/dist/{MailIcon-rxvK4Wga.js → MailIcon-xtNog-7h.js} +1 -1
- package/dist/{Modal-BVD2O8hd.js → Modal-CqzRblrN.js} +2 -2
- package/dist/{ModalFooter-CfboEe1M.js → ModalFooter-DHhBLDbO.js} +59 -57
- package/dist/{PasswordInput-BAlq2j97.js → PasswordInput-Czm5Pe_p.js} +4 -4
- package/dist/{ScarcityBadge-h7ygRD_C.js → ScarcityBadge-CdgQmt1D.js} +4 -4
- package/dist/{SeriesPage-D-cwUNZM.js → SeriesPage-DfCyV1ka.js} +5 -5
- package/dist/{Spinner-ChTN7t75.js → Spinner-BwiDys7C.js} +3 -3
- package/dist/{Success-CIAX5zmz.js → Success-CsYxRkLE.js} +81 -80
- package/dist/{TagIcon-V0qMu9wS.js → TagIcon-DJSTnymB.js} +1 -1
- package/dist/{ViewTicketsEmbed-By-IcUJZ.js → ViewTicketsEmbed-CKucKt-W.js} +67 -66
- package/dist/{WarningCircleIcon-D32h6VDr.js → WarningCircleIcon-BKSQbu7p.js} +1 -1
- package/dist/{WarningTriIcon-BPDrCiKU.js → WarningTriIcon-DgwTwlxe.js} +1 -1
- package/dist/{__SKIP_PATHS__-DirqE5Xe.js → __SKIP_PATHS__-BTbGfN80.js} +1 -1
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.mjs +187 -181
- package/dist/api/client.d.ts +16 -0
- package/dist/api/types.d.ts +528 -528
- package/dist/{browser-25hnscei.js → browser-Um8Y6K99.js} +7 -7
- package/dist/{colors-5ifWyP6H.js → colors-DeJAzg_q.js} +60 -59
- package/dist/{constants-Dcj3kgZE.js → constants-OTS1wmXZ.js} +76 -73
- package/dist/{copyToClipboard-CNxFW3ni.js → copyToClipboard-CRDdh3r8.js} +1 -1
- package/dist/{createI18n-08XGDh1_.js → createI18n-DBUVdZra.js} +1 -1
- package/dist/{event-Cp5D4ctZ.js → event-BrptLro8.js} +1 -1
- package/dist/{event-transform-DSuEpMxr.js → event-transform-BaJ7M1DL.js} +4 -4
- package/dist/{eventStatusStream-CIZVH5Lp.js → eventStatusStream-sq6uPnMe.js} +6 -6
- package/dist/{allowlist-BiUmz2AF.js → href-DJeJpcO9.js} +21 -4
- package/dist/{i18n-CEeBd5Hi.js → i18n-GzfxX0Ad.js} +11 -11
- package/dist/imageOptimizer-CB3wKJU8.js +47 -0
- package/dist/{labels-CtyfffZI.js → labels-CqodQmuY.js} +1 -1
- package/dist/{modalManager.svelte-BH-QJm9M.js → modalManager.svelte-OSPs3dSW.js} +2 -2
- package/dist/{order-totals-hcdvbJvw.js → order-totals-BAKL9cOB.js} +15 -13
- package/dist/{orders-tzTe2hNM.js → orders-NZP81zYT.js} +210 -198
- package/dist/{Input-W-QE9nWi.js → phoneUtils-BJeAIGYo.js} +694 -1132
- package/dist/{pixels-7kl8Fcjl.js → pixels-BBruZizp.js} +8 -7
- package/dist/{promo-BrMcoTYh.js → promo-DtLZRskK.js} +3 -3
- package/dist/{serverTotals-CpRaEe9K.js → serverTotals-BO126TTd.js} +1 -1
- package/dist/{shareCopyFeedback.svelte-DsyhrfiP.js → shareCopyFeedback.svelte-BRInK1hH.js} +25 -25
- package/dist/{showcase-state-options-B2XfybZq.js → showcase-state-options-BoJxiEsg.js} +1 -1
- package/dist/sortable.esm--ZtTTTPp.js +1451 -0
- package/dist/timezones-C5l0SSHK.js +2030 -0
- package/dist/{to-event-card-props-VPne8W4I.js → to-event-card-props-CO3aPBdH.js} +24 -23
- package/dist/{utils-DJVlBMbw.js → utils-C8GgxJMv.js} +30 -30
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +1291 -1151
- package/dist/venue-calendar.iife.js +63 -62
- package/dist/venue-calendar.umd.js +60 -59
- package/dist/z-index-B0Vk_Mp1.js +27 -0
- package/package.json +220 -220
- package/dist/BlockPlaceholder-IOcqxTx2.js +0 -62
- package/dist/CalendarFoundryView-Ct39xn0Q.js +0 -23561
- package/dist/Checkout-CXcjQfbc.js +0 -1805
- package/dist/Event-C_0lUZvV.js +0 -3040
- package/dist/Image-DBJAfLYe.js +0 -81
- package/dist/cancel-Cq2Q8qW7.js +0 -59
- package/dist/timezones-Cq1mLtfM.js +0 -4170
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/de.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/es.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/fr.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/id.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/it.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/ja.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/ko.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/nl.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/pl.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/tr.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/flow/zh.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/de.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/es.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/fr.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/id.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/it.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/ja.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/ko.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/nl.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/pl.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/pt-br.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/tr.js +0 -0
- /package/dist/locales/{4.2.2 → 4.2.4}/main/zh.js +0 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { C as e, b as t, t as n, v as r } from "./Button-C4uFgl7L.js";
|
|
2
|
+
import { t as i } from "./CloseOutline-qpVa62mu.js";
|
|
3
|
+
import { i as a, r as o, t as s } from "./imageOptimizer-CB3wKJU8.js";
|
|
4
|
+
import { t as c } from "./z-index-B0Vk_Mp1.js";
|
|
5
|
+
import "svelte/internal/disclose-version";
|
|
6
|
+
import * as l from "svelte/internal/client";
|
|
7
|
+
import { onDestroy as u, onMount as d } from "svelte";
|
|
8
|
+
//#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/MinusOutline.svelte
|
|
9
|
+
var f = l.from_svg("<svg aria-hidden=\"true\" fill=\"none\" stroke-width=\"2\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 12h-15\"></path></svg>");
|
|
10
|
+
function p(e, t) {
|
|
11
|
+
let n = l.prop(t, "size", 3, "24"), r = l.prop(t, "color", 3, "currentColor"), i = l.prop(t, "class", 3, "");
|
|
12
|
+
var a = f();
|
|
13
|
+
l.template_effect(() => {
|
|
14
|
+
l.set_class(a, 0, l.clsx(i())), l.set_attribute(a, "width", n()), l.set_attribute(a, "height", n()), l.set_attribute(a, "stroke", r());
|
|
15
|
+
}), l.append(e, a);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region node_modules/svelte-easy-crop/dist/helpers.js
|
|
19
|
+
function m(e, t, n) {
|
|
20
|
+
return e >= t * n ? {
|
|
21
|
+
width: t * n,
|
|
22
|
+
height: t
|
|
23
|
+
} : {
|
|
24
|
+
width: e,
|
|
25
|
+
height: e / n
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function h(e, t, n, r) {
|
|
29
|
+
return {
|
|
30
|
+
x: g(e.x, t.width, n.width, r),
|
|
31
|
+
y: g(e.y, t.height, n.height, r)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function g(e, t, n, r) {
|
|
35
|
+
let i = Math.abs(t * r / 2 - n / 2);
|
|
36
|
+
return Math.min(i, Math.max(e, -i));
|
|
37
|
+
}
|
|
38
|
+
function _(e, t) {
|
|
39
|
+
return Math.sqrt((e.y - t.y) ** 2 + (e.x - t.x) ** 2);
|
|
40
|
+
}
|
|
41
|
+
function v(e, t, n, r, i, a = !0) {
|
|
42
|
+
let o = a ? y : b, s = {
|
|
43
|
+
x: o(100, ((t.width - n.width / i) / 2 - e.x / i) / t.width * 100),
|
|
44
|
+
y: o(100, ((t.height - n.height / i) / 2 - e.y / i) / t.height * 100),
|
|
45
|
+
width: o(100, n.width / t.width * 100 / i),
|
|
46
|
+
height: o(100, n.height / t.height * 100 / i)
|
|
47
|
+
}, c = o(t.naturalWidth, s.width * t.naturalWidth / 100, !0), l = o(t.naturalHeight, s.height * t.naturalHeight / 100, !0), u = t.naturalWidth >= t.naturalHeight * r ? {
|
|
48
|
+
width: Math.round(l * r),
|
|
49
|
+
height: l
|
|
50
|
+
} : {
|
|
51
|
+
width: c,
|
|
52
|
+
height: Math.round(c / r)
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
croppedAreaPercentages: s,
|
|
56
|
+
croppedAreaPixels: {
|
|
57
|
+
...u,
|
|
58
|
+
x: o(t.naturalWidth - u.width, s.x * t.naturalWidth / 100, !0),
|
|
59
|
+
y: o(t.naturalHeight - u.height, s.y * t.naturalHeight / 100, !0)
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function y(e, t, n = !1) {
|
|
64
|
+
return Math.min(e, Math.max(0, n ? Math.round(t) : t));
|
|
65
|
+
}
|
|
66
|
+
function b(e, t) {
|
|
67
|
+
return t;
|
|
68
|
+
}
|
|
69
|
+
function x(e, t) {
|
|
70
|
+
return {
|
|
71
|
+
x: (t.x + e.x) / 2,
|
|
72
|
+
y: (t.y + e.y) / 2
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region node_modules/svelte-easy-crop/dist/Cropper.svelte
|
|
77
|
+
var S = l.from_html("<div data-testid=\"cropper\"></div>"), C = l.from_html("<div class=\"svelte-easy-crop-container svelte-1yetlj5\" role=\"button\" data-testid=\"container\"><img class=\"svelte-easy-crop-image svelte-1yetlj5\" alt=\"\"/> <!></div>");
|
|
78
|
+
function w(e, t) {
|
|
79
|
+
l.push(t, !0);
|
|
80
|
+
let n = l.prop(t, "crop", 31, () => l.proxy({
|
|
81
|
+
x: 0,
|
|
82
|
+
y: 0
|
|
83
|
+
})), r = l.prop(t, "zoom", 15, 1), i = l.prop(t, "minZoom", 11, 1), a = l.prop(t, "maxZoom", 11, 3), o = l.prop(t, "aspect", 3, 4 / 3), s = l.prop(t, "cropSize", 3, null), c = l.prop(t, "cropShape", 3, "rect"), f = l.prop(t, "showGrid", 3, !0), p = l.prop(t, "zoomSpeed", 3, 1), g = l.prop(t, "crossOrigin", 3, null), y = l.prop(t, "restrictPosition", 3, !0), b = l.prop(t, "tabindex", 3, void 0), w = l.state(null), T = l.state(l.proxy({
|
|
84
|
+
width: 0,
|
|
85
|
+
height: 0,
|
|
86
|
+
naturalWidth: 0,
|
|
87
|
+
naturalHeight: 0
|
|
88
|
+
})), E = l.state(null), D = l.state(null), O = l.state(null), k = l.state(l.proxy({
|
|
89
|
+
x: 0,
|
|
90
|
+
y: 0
|
|
91
|
+
})), A = l.state(l.proxy({
|
|
92
|
+
x: 0,
|
|
93
|
+
y: 0
|
|
94
|
+
})), j = l.state(0), M = l.state(null), N = l.state(null);
|
|
95
|
+
d(() => {
|
|
96
|
+
l.get(O) && l.get(O).complete && I(), l.get(E) && (l.get(E).addEventListener("gesturestart", P), l.get(E).addEventListener("gesturechange", P));
|
|
97
|
+
}), u(() => {
|
|
98
|
+
l.get(E) && (l.get(E).removeEventListener("gesturestart", P), l.get(E).removeEventListener("gesturechange", P)), F();
|
|
99
|
+
});
|
|
100
|
+
let P = (e) => e.preventDefault(), F = () => {
|
|
101
|
+
typeof document < "u" && (document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", q), document.removeEventListener("touchmove", W), document.removeEventListener("touchend", q));
|
|
102
|
+
}, I = () => {
|
|
103
|
+
R(), Z();
|
|
104
|
+
}, L = () => s() ? s().width / s().height : o(), R = () => {
|
|
105
|
+
l.get(O) && (l.set(T, {
|
|
106
|
+
width: l.get(O).width,
|
|
107
|
+
height: l.get(O).height,
|
|
108
|
+
naturalWidth: l.get(O).naturalWidth,
|
|
109
|
+
naturalHeight: l.get(O).naturalHeight
|
|
110
|
+
}, !0), l.set(w, s() ? s() : m(l.get(O).width, l.get(O).height, o()), !0)), l.get(E) && l.set(D, l.get(E).getBoundingClientRect(), !0);
|
|
111
|
+
}, z = (e) => ({
|
|
112
|
+
x: Number(e.clientX),
|
|
113
|
+
y: Number(e.clientY)
|
|
114
|
+
}), B = (e) => ({
|
|
115
|
+
x: Number(e.clientX),
|
|
116
|
+
y: Number(e.clientY)
|
|
117
|
+
}), V = (e) => {
|
|
118
|
+
e.preventDefault(), document.addEventListener("mousemove", H), document.addEventListener("mouseup", q), G(z(e));
|
|
119
|
+
}, H = (e) => K(z(e)), U = (e) => {
|
|
120
|
+
e.preventDefault(), document.addEventListener("touchmove", W, { passive: !1 }), document.addEventListener("touchend", q), e.touches.length === 2 ? J(e) : e.touches.length === 1 && G(B(e.touches[0]));
|
|
121
|
+
}, W = (e) => {
|
|
122
|
+
e.preventDefault(), e.touches.length === 2 ? ee(e) : e.touches.length === 1 && K(B(e.touches[0]));
|
|
123
|
+
}, G = ({ x: e, y: t }) => {
|
|
124
|
+
l.set(k, {
|
|
125
|
+
x: e,
|
|
126
|
+
y: t
|
|
127
|
+
}, !0), l.set(A, {
|
|
128
|
+
x: n().x,
|
|
129
|
+
y: n().y
|
|
130
|
+
}, !0);
|
|
131
|
+
}, K = ({ x: e, y: t }) => {
|
|
132
|
+
l.get(M) && window.cancelAnimationFrame(l.get(M)), l.set(M, window.requestAnimationFrame(() => {
|
|
133
|
+
if (e === void 0 || t === void 0 || !l.get(w)) return;
|
|
134
|
+
let i = e - l.get(k).x, a = t - l.get(k).y, o = {
|
|
135
|
+
x: l.get(A).x + i,
|
|
136
|
+
y: l.get(A).y + a
|
|
137
|
+
};
|
|
138
|
+
n(y() ? h(o, l.get(T), l.get(w), r()) : o);
|
|
139
|
+
}), !0);
|
|
140
|
+
}, q = () => {
|
|
141
|
+
F(), Z();
|
|
142
|
+
}, J = (e) => {
|
|
143
|
+
let t = B(e.touches[0]), n = B(e.touches[1]);
|
|
144
|
+
l.set(j, _(t, n), !0), G(x(t, n));
|
|
145
|
+
}, ee = (e) => {
|
|
146
|
+
let t = B(e.touches[0]), n = B(e.touches[1]), i = x(t, n);
|
|
147
|
+
K(i), l.get(N) && window.cancelAnimationFrame(l.get(N)), l.set(N, window.requestAnimationFrame(() => {
|
|
148
|
+
let e = _(t, n), a = r() * (e / l.get(j));
|
|
149
|
+
X(a, i), l.set(j, e, !0);
|
|
150
|
+
}), !0);
|
|
151
|
+
}, Y = (e) => {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
let t = z(e), n = r() - e.deltaY * p() / 200;
|
|
154
|
+
X(n, t);
|
|
155
|
+
}, te = ({ x: e, y: t }) => {
|
|
156
|
+
if (!l.get(D)) throw Error("The Cropper is not mounted");
|
|
157
|
+
return {
|
|
158
|
+
x: l.get(D).width / 2 - (e - l.get(D).left),
|
|
159
|
+
y: l.get(D).height / 2 - (t - l.get(D).top)
|
|
160
|
+
};
|
|
161
|
+
}, ne = ({ x: e, y: t }) => ({
|
|
162
|
+
x: (e + n().x) / r(),
|
|
163
|
+
y: (t + n().y) / r()
|
|
164
|
+
}), X = (e, t) => {
|
|
165
|
+
if (!l.get(w)) return;
|
|
166
|
+
let o = te(t), s = ne(o);
|
|
167
|
+
r(Math.min(a(), Math.max(e, i())));
|
|
168
|
+
let c = {
|
|
169
|
+
x: s.x * r() - o.x,
|
|
170
|
+
y: s.y * r() - o.y
|
|
171
|
+
};
|
|
172
|
+
n(y() ? h(c, l.get(T), l.get(w), r()) : c);
|
|
173
|
+
}, Z = () => {
|
|
174
|
+
if (!l.get(w) || l.get(w).width === 0) return;
|
|
175
|
+
let { croppedAreaPercentages: e, croppedAreaPixels: i } = v(y() ? h(n(), l.get(T), l.get(w), r()) : n(), l.get(T), l.get(w), L(), r(), y());
|
|
176
|
+
t.oncropcomplete?.({
|
|
177
|
+
percent: e,
|
|
178
|
+
pixels: i
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
l.user_effect(() => {
|
|
182
|
+
l.get(O) && l.set(w, s() ? s() : m(l.get(O).width, l.get(O).height, o()), !0);
|
|
183
|
+
}), l.user_effect(() => {
|
|
184
|
+
r() && Z();
|
|
185
|
+
});
|
|
186
|
+
let re = (e) => {
|
|
187
|
+
l.user_effect(() => (e.addEventListener("touchstart", U), e.addEventListener("mousedown", V), e.addEventListener("wheel", Y, { passive: !1 }), () => {
|
|
188
|
+
e.removeEventListener("touchstart", U), e.removeEventListener("mousedown", V), e.removeEventListener("wheel", Y);
|
|
189
|
+
}));
|
|
190
|
+
};
|
|
191
|
+
var Q = C();
|
|
192
|
+
l.event("resize", l.window, R);
|
|
193
|
+
var $ = l.child(Q);
|
|
194
|
+
l.bind_this($, (e) => l.set(O, e), () => l.get(O));
|
|
195
|
+
var ie = l.sibling($, 2), ae = (e) => {
|
|
196
|
+
var t = S();
|
|
197
|
+
let n;
|
|
198
|
+
l.template_effect(() => {
|
|
199
|
+
n = l.set_class(t, 1, "svelte-easy-crop-area svelte-1yetlj5", null, n, {
|
|
200
|
+
"svelte-easy-crop-round": c() === "round",
|
|
201
|
+
"svelte-easy-crop-grid": f()
|
|
202
|
+
}), l.set_style(t, `width: ${l.get(w).width ?? ""}px; height: ${l.get(w).height ?? ""}px;`);
|
|
203
|
+
}), l.append(e, t);
|
|
204
|
+
};
|
|
205
|
+
l.if(ie, (e) => {
|
|
206
|
+
l.get(w) && e(ae);
|
|
207
|
+
}), l.reset(Q), l.bind_this(Q, (e) => l.set(E, e), () => l.get(E)), l.action(Q, (e) => re?.(e)), l.template_effect(() => {
|
|
208
|
+
l.set_attribute(Q, "tabindex", b()), l.set_attribute($, "src", t.image), l.set_style($, `transform: translate(${n().x ?? ""}px, ${n().y ?? ""}px) scale(${r() ?? ""});`), l.set_attribute($, "crossorigin", g());
|
|
209
|
+
}), l.event("load", $, I), l.replay_events($), l.append(e, Q), l.pop();
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region node_modules/svelte-easy-crop/dist/index.js
|
|
213
|
+
var T = w, E = l.from_html("<div class=\"absolute inset-0 flex items-center justify-center bg-bg-tertiary z-sticky\"><span> </span></div>"), D = l.from_html("<div class=\"fixed inset-0 flex items-center justify-center overflow-y-auto overflow-x-hidden bg-bg-primary/50 p-4\" role=\"presentation\"><div class=\"relative w-full max-w-lg max-h-full\"><div class=\"relative bg-card rounded-lg shadow-xl\"><div class=\"flex items-center justify-between p-4 border-b border-border rounded-t-lg\"><h3> </h3> <!></div> <div class=\"p-4 md:p-6 space-y-4\"><div class=\"relative w-full aspect-square sm:aspect-[4/3] max-h-80 sm:max-h-96 bg-bg-secondary rounded-lg overflow-hidden\"><!> <!></div> <p> </p> <div class=\"flex items-center justify-center gap-3 max-w-xs mx-auto\"><!> <input type=\"range\" min=\"1\" max=\"3\" step=\"0.1\" class=\"flex-1 w-full h-2 bg-bg-tertiary rounded-lg appearance-none cursor-pointer accent-primary\" data-purpose=\"ui-only\"/> <!></div></div> <div class=\"flex items-center justify-end gap-3 p-4 border-t border-border rounded-b-lg\"><!> <!></div></div></div></div>");
|
|
214
|
+
function O(u, d) {
|
|
215
|
+
l.push(d, !0);
|
|
216
|
+
let f = {
|
|
217
|
+
cropImageTitle: "Crop image",
|
|
218
|
+
loading: "Loading...",
|
|
219
|
+
dragToPosition: "Drag to position. Pinch or use slider to zoom.",
|
|
220
|
+
cancel: "Cancel",
|
|
221
|
+
uploading: "Uploading...",
|
|
222
|
+
save: "Save",
|
|
223
|
+
closeModal: "Close modal",
|
|
224
|
+
zoomOut: "Zoom out",
|
|
225
|
+
zoomIn: "Zoom in",
|
|
226
|
+
zoomLevel: "Zoom level"
|
|
227
|
+
}, m = l.prop(d, "showModal", 15, !1), h = l.prop(d, "imageSrc", 15, ""), g = l.prop(d, "isUploadingImage", 3, !1), _ = l.prop(d, "labels", 19, () => ({}));
|
|
228
|
+
d.onSave && !d.onsave && t("CropImage: prop \"onSave\" is deprecated. Use \"onsave\" instead."), d.onCancel && !d.oncancel && t("CropImage: prop \"onCancel\" is deprecated. Use \"oncancel\" instead.");
|
|
229
|
+
let v = l.derived(() => d.onsave ?? d.onSave ?? (() => {})), y = l.derived(() => d.oncancel ?? d.onCancel ?? (() => {})), b = l.derived(() => e(f, _())), x = l.state(l.proxy({
|
|
230
|
+
x: 0,
|
|
231
|
+
y: 0
|
|
232
|
+
})), S = l.state(1), C = l.state(null), w = l.state(!0), O = l.state(!1);
|
|
233
|
+
l.user_effect(() => {
|
|
234
|
+
m() && h() && (l.set(x, {
|
|
235
|
+
x: 0,
|
|
236
|
+
y: 0
|
|
237
|
+
}, !0), l.set(S, 1), l.set(C, null), l.set(w, !0), l.set(O, !1));
|
|
238
|
+
});
|
|
239
|
+
function k(e) {
|
|
240
|
+
l.set(C, e.pixels, !0), l.set(w, !1);
|
|
241
|
+
}
|
|
242
|
+
async function A() {
|
|
243
|
+
if (!l.get(C) || l.get(O)) return;
|
|
244
|
+
l.set(O, !0);
|
|
245
|
+
let e = await M(h(), l.get(C));
|
|
246
|
+
l.get(v)(e);
|
|
247
|
+
}
|
|
248
|
+
function j() {
|
|
249
|
+
m(!1), h(""), l.set(x, {
|
|
250
|
+
x: 0,
|
|
251
|
+
y: 0
|
|
252
|
+
}, !0), l.set(S, 1), l.set(C, null), l.set(O, !1), l.get(y)();
|
|
253
|
+
}
|
|
254
|
+
async function M(e, t) {
|
|
255
|
+
let n = await s(e), r = document.createElement("canvas"), i = r.getContext("2d"), a = 1e3;
|
|
256
|
+
r.width = a, r.height = a, i.imageSmoothingEnabled = !0, i.imageSmoothingQuality = "high", i.drawImage(n, t.x, t.y, t.width, t.height, 0, 0, a, a);
|
|
257
|
+
let c = o(), l = c ? "image/webp" : "image/jpeg", u = c ? .8 : .85, d = c ? "webp" : "jpg";
|
|
258
|
+
return new Promise((e) => {
|
|
259
|
+
r.toBlob((t) => {
|
|
260
|
+
e(new File([t], `cropped-image.${d}`, { type: l }));
|
|
261
|
+
}, l, u);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
var N = l.comment();
|
|
265
|
+
l.event("keydown", l.window, (e) => {
|
|
266
|
+
m() && e.key === "Escape" && (e.preventDefault(), j());
|
|
267
|
+
});
|
|
268
|
+
var P = l.first_child(N), F = (e) => {
|
|
269
|
+
var t = D();
|
|
270
|
+
let o;
|
|
271
|
+
var s = l.child(t), u = l.child(s), d = l.child(u), f = l.child(d), m = l.child(f, !0);
|
|
272
|
+
l.reset(f);
|
|
273
|
+
var _ = l.sibling(f, 2);
|
|
274
|
+
n(_, {
|
|
275
|
+
variant: "icon",
|
|
276
|
+
size: "sm",
|
|
277
|
+
onclick: j,
|
|
278
|
+
get "aria-label"() {
|
|
279
|
+
return l.get(b).closeModal;
|
|
280
|
+
},
|
|
281
|
+
children: (e, t) => {
|
|
282
|
+
i(e, { class: "w-3 h-3" });
|
|
283
|
+
},
|
|
284
|
+
$$slots: { default: !0 }
|
|
285
|
+
}), l.reset(d);
|
|
286
|
+
var v = l.sibling(d, 2), y = l.child(v), C = l.child(y), M = (e) => {
|
|
287
|
+
var t = E(), n = l.child(t), i = l.child(n, !0);
|
|
288
|
+
l.reset(n), l.reset(t), l.template_effect(() => {
|
|
289
|
+
l.set_class(n, 1, l.clsx(r.smMuted)), l.set_text(i, l.get(b).loading);
|
|
290
|
+
}), l.append(e, t);
|
|
291
|
+
};
|
|
292
|
+
l.if(C, (e) => {
|
|
293
|
+
l.get(w) && e(M);
|
|
294
|
+
}), T(l.sibling(C, 2), {
|
|
295
|
+
get image() {
|
|
296
|
+
return h();
|
|
297
|
+
},
|
|
298
|
+
aspect: 1,
|
|
299
|
+
minZoom: 1,
|
|
300
|
+
maxZoom: 3,
|
|
301
|
+
showGrid: !0,
|
|
302
|
+
oncropcomplete: k,
|
|
303
|
+
get crop() {
|
|
304
|
+
return l.get(x);
|
|
305
|
+
},
|
|
306
|
+
set crop(e) {
|
|
307
|
+
l.set(x, e, !0);
|
|
308
|
+
},
|
|
309
|
+
get zoom() {
|
|
310
|
+
return l.get(S);
|
|
311
|
+
},
|
|
312
|
+
set zoom(e) {
|
|
313
|
+
l.set(S, e, !0);
|
|
314
|
+
}
|
|
315
|
+
}), l.reset(y);
|
|
316
|
+
var N = l.sibling(y, 2), P = l.child(N, !0);
|
|
317
|
+
l.reset(N);
|
|
318
|
+
var F = l.sibling(N, 2), I = l.child(F);
|
|
319
|
+
n(I, {
|
|
320
|
+
variant: "outline",
|
|
321
|
+
size: "sm",
|
|
322
|
+
class: "rounded-full! w-9! h-9! p-0! shrink-0",
|
|
323
|
+
onclick: () => l.set(S, Math.max(1, l.get(S) - .2), !0),
|
|
324
|
+
get "aria-label"() {
|
|
325
|
+
return l.get(b).zoomOut;
|
|
326
|
+
},
|
|
327
|
+
children: (e, t) => {
|
|
328
|
+
p(e, { class: "w-4 h-4" });
|
|
329
|
+
},
|
|
330
|
+
$$slots: { default: !0 }
|
|
331
|
+
});
|
|
332
|
+
var L = l.sibling(I, 2);
|
|
333
|
+
l.remove_input_defaults(L);
|
|
334
|
+
var R = l.sibling(L, 2);
|
|
335
|
+
n(R, {
|
|
336
|
+
variant: "outline",
|
|
337
|
+
size: "sm",
|
|
338
|
+
class: "rounded-full! w-9! h-9! p-0! shrink-0",
|
|
339
|
+
onclick: () => l.set(S, Math.min(3, l.get(S) + .2), !0),
|
|
340
|
+
get "aria-label"() {
|
|
341
|
+
return l.get(b).zoomIn;
|
|
342
|
+
},
|
|
343
|
+
children: (e, t) => {
|
|
344
|
+
a(e, { class: "w-4 h-4" });
|
|
345
|
+
},
|
|
346
|
+
$$slots: { default: !0 }
|
|
347
|
+
}), l.reset(F), l.reset(v);
|
|
348
|
+
var z = l.sibling(v, 2), B = l.child(z);
|
|
349
|
+
{
|
|
350
|
+
let e = l.derived(() => l.get(O) || g());
|
|
351
|
+
n(B, {
|
|
352
|
+
type: "button",
|
|
353
|
+
variant: "alternative",
|
|
354
|
+
size: "md",
|
|
355
|
+
onclick: j,
|
|
356
|
+
get disabled() {
|
|
357
|
+
return l.get(e);
|
|
358
|
+
},
|
|
359
|
+
children: (e, t) => {
|
|
360
|
+
l.next();
|
|
361
|
+
var n = l.text();
|
|
362
|
+
l.template_effect(() => l.set_text(n, l.get(b).cancel)), l.append(e, n);
|
|
363
|
+
},
|
|
364
|
+
$$slots: { default: !0 }
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
var V = l.sibling(B, 2);
|
|
368
|
+
{
|
|
369
|
+
let e = l.derived(() => l.get(w) || l.get(O) || g());
|
|
370
|
+
n(V, {
|
|
371
|
+
type: "button",
|
|
372
|
+
size: "md",
|
|
373
|
+
onclick: A,
|
|
374
|
+
get disabled() {
|
|
375
|
+
return l.get(e);
|
|
376
|
+
},
|
|
377
|
+
children: (e, t) => {
|
|
378
|
+
var n = l.comment(), r = l.first_child(n), i = (e) => {
|
|
379
|
+
var t = l.text();
|
|
380
|
+
l.template_effect(() => l.set_text(t, l.get(b).uploading)), l.append(e, t);
|
|
381
|
+
}, a = (e) => {
|
|
382
|
+
var t = l.text();
|
|
383
|
+
l.template_effect(() => l.set_text(t, l.get(b).save)), l.append(e, t);
|
|
384
|
+
};
|
|
385
|
+
l.if(r, (e) => {
|
|
386
|
+
l.get(O) || g() ? e(i) : e(a, -1);
|
|
387
|
+
}), l.append(e, n);
|
|
388
|
+
},
|
|
389
|
+
$$slots: { default: !0 }
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
l.reset(z), l.reset(u), l.reset(s), l.reset(t), l.template_effect(() => {
|
|
393
|
+
o = l.set_style(t, "", o, { "z-index": c.modal }), l.set_class(f, 1, l.clsx(r.h2)), l.set_text(m, l.get(b).cropImageTitle), l.set_class(N, 1, `${r.smMuted} text-center`), l.set_text(P, l.get(b).dragToPosition), l.set_attribute(L, "aria-label", l.get(b).zoomLevel);
|
|
394
|
+
}), l.delegated("click", t, (e) => {
|
|
395
|
+
e.target === e.currentTarget && j();
|
|
396
|
+
}), l.bind_value(L, () => l.get(S), (e) => l.set(S, e)), l.append(e, t);
|
|
397
|
+
};
|
|
398
|
+
l.if(P, (e) => {
|
|
399
|
+
m() && e(F);
|
|
400
|
+
}), l.append(u, N), l.pop();
|
|
401
|
+
}
|
|
402
|
+
l.delegate(["click"]);
|
|
403
|
+
//#endregion
|
|
404
|
+
export { O as default };
|