@getmicdrop/venue-calendar 4.2.2 → 4.2.3

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.
Files changed (98) hide show
  1. package/dist/{ArrowLeftIcon-DQ-h5PcH.js → ArrowLeftIcon-CxZXP_IT.js} +1 -1
  2. package/dist/{Badge-M6qZyfTF.js → Badge-Bv_MT-Vt.js} +10 -9
  3. package/dist/BlockPlaceholder-HZ6Coko5.js +52 -0
  4. package/dist/Button-C4uFgl7L.js +2141 -0
  5. package/dist/{Calendar-BX22svpz.js → Calendar-BKefLfIt.js} +292 -290
  6. package/dist/CalendarFoundryView-tDmFCrJ3.js +22292 -0
  7. package/dist/{CalendarIcon-DR197Ioz.js → CalendarIcon-CLGR_zlO.js} +1 -1
  8. package/dist/{CartView-B2VtVvZM.js → CartView-CHFlfWS9.js} +651 -644
  9. package/dist/{Checkout-BTqfjvDp.js → Checkout-C-A4t1eE.js} +92 -91
  10. package/dist/Checkout-CRX7dcRr.js +1807 -0
  11. package/dist/{CheckoutTimer-Cng5tcGO.js → CheckoutTimer-d3KUbevy.js} +5 -5
  12. package/dist/{ChevronDownIcon-C_RiK-BW.js → ChevronDownIcon-YtBeSqjf.js} +1 -1
  13. package/dist/{ClockIcon-BOJENuPq.js → ClockIcon-a9tJQ5El.js} +1 -1
  14. package/dist/{CloseIcon-Rc7tpX2a.js → CloseIcon-DSURK5co.js} +1 -1
  15. package/dist/CloseOutline-qpVa62mu.js +13 -0
  16. package/dist/{CollectionView-A1zP8yz5.js → CollectionView-BiBMllyw.js} +13 -12
  17. package/dist/CropImage-B0tj2_uN.js +404 -0
  18. package/dist/Event-1ZJVzqFN.js +3034 -0
  19. package/dist/{EventPage-hxrPKPhm.js → EventPage-C7K2yA4v.js} +168 -167
  20. package/dist/{Heading-B7VYbbfJ.js → Heading-Dfo3bjyn.js} +4 -3
  21. package/dist/Image-B3cEndLZ.js +87 -0
  22. package/dist/Input-DkYIFK4J.js +487 -0
  23. package/dist/{MailIcon-rxvK4Wga.js → MailIcon-DIrQpcGo.js} +1 -1
  24. package/dist/{Modal-BVD2O8hd.js → Modal-DrA1swbF.js} +2 -2
  25. package/dist/{ModalFooter-CfboEe1M.js → ModalFooter-r1NQNG9P.js} +59 -57
  26. package/dist/{PasswordInput-BAlq2j97.js → PasswordInput-DB4qa7kS.js} +4 -4
  27. package/dist/{ScarcityBadge-h7ygRD_C.js → ScarcityBadge-BJOm7_Ho.js} +4 -4
  28. package/dist/{SeriesPage-D-cwUNZM.js → SeriesPage-JVmqUSax.js} +5 -5
  29. package/dist/{Spinner-ChTN7t75.js → Spinner-BwiDys7C.js} +3 -3
  30. package/dist/{Success-CIAX5zmz.js → Success-DAE6gPZM.js} +77 -76
  31. package/dist/{TagIcon-V0qMu9wS.js → TagIcon-CrTNd8qE.js} +1 -1
  32. package/dist/{ViewTicketsEmbed-By-IcUJZ.js → ViewTicketsEmbed-Zx-mvP2p.js} +60 -59
  33. package/dist/{WarningCircleIcon-D32h6VDr.js → WarningCircleIcon-C5-op3Cy.js} +1 -1
  34. package/dist/{WarningTriIcon-BPDrCiKU.js → WarningTriIcon-BxIQn7c2.js} +1 -1
  35. package/dist/{__SKIP_PATHS__-DirqE5Xe.js → __SKIP_PATHS__-DyyiXBgB.js} +1 -1
  36. package/dist/api/types.d.ts +528 -528
  37. package/dist/{browser-25hnscei.js → browser-Um8Y6K99.js} +7 -7
  38. package/dist/{colors-5ifWyP6H.js → colors-MuuDk6KF.js} +30 -29
  39. package/dist/{constants-Dcj3kgZE.js → constants-CqrJv6nM.js} +73 -73
  40. package/dist/{copyToClipboard-CNxFW3ni.js → copyToClipboard-CTS9Wtmo.js} +1 -1
  41. package/dist/{createI18n-08XGDh1_.js → createI18n-DBUVdZra.js} +1 -1
  42. package/dist/{event-Cp5D4ctZ.js → event-BrptLro8.js} +1 -1
  43. package/dist/{event-transform-DSuEpMxr.js → event-transform-jFmHl0Qp.js} +4 -4
  44. package/dist/{eventStatusStream-CIZVH5Lp.js → eventStatusStream-D04pcbuu.js} +2 -2
  45. package/dist/{allowlist-BiUmz2AF.js → href-C8WGnROy.js} +21 -4
  46. package/dist/{i18n-CEeBd5Hi.js → i18n-CcJmTGJP.js} +11 -11
  47. package/dist/imageOptimizer-CB3wKJU8.js +47 -0
  48. package/dist/{labels-CtyfffZI.js → labels-Q4CaHsVM.js} +1 -1
  49. package/dist/{modalManager.svelte-BH-QJm9M.js → modalManager.svelte-qcVxl7C5.js} +2 -2
  50. package/dist/{order-totals-hcdvbJvw.js → order-totals-BImtvmoh.js} +15 -13
  51. package/dist/{orders-tzTe2hNM.js → orders-C8kt6c-E.js} +20 -19
  52. package/dist/{Input-W-QE9nWi.js → phoneUtils-FnBDCqO0.js} +694 -1132
  53. package/dist/{pixels-7kl8Fcjl.js → pixels-MEc7WYiV.js} +8 -7
  54. package/dist/{promo-BrMcoTYh.js → promo-DtLZRskK.js} +3 -3
  55. package/dist/{serverTotals-CpRaEe9K.js → serverTotals-BO126TTd.js} +1 -1
  56. package/dist/{shareCopyFeedback.svelte-DsyhrfiP.js → shareCopyFeedback.svelte-Dko8NIbm.js} +25 -25
  57. package/dist/{showcase-state-options-B2XfybZq.js → showcase-state-options-BoJxiEsg.js} +1 -1
  58. package/dist/sortable.esm--ZtTTTPp.js +1451 -0
  59. package/dist/timezones-C5l0SSHK.js +2030 -0
  60. package/dist/{to-event-card-props-VPne8W4I.js → to-event-card-props-BAHzloEA.js} +24 -23
  61. package/dist/{utils-DJVlBMbw.js → utils-Ts4-U13Y.js} +3 -3
  62. package/dist/venue-calendar.css +1 -1
  63. package/dist/venue-calendar.es.js +200 -199
  64. package/dist/venue-calendar.iife.js +63 -62
  65. package/dist/venue-calendar.umd.js +60 -59
  66. package/dist/z-index-B0Vk_Mp1.js +27 -0
  67. package/package.json +220 -220
  68. package/dist/BlockPlaceholder-IOcqxTx2.js +0 -62
  69. package/dist/CalendarFoundryView-Ct39xn0Q.js +0 -23561
  70. package/dist/Checkout-CXcjQfbc.js +0 -1805
  71. package/dist/Event-C_0lUZvV.js +0 -3040
  72. package/dist/Image-DBJAfLYe.js +0 -81
  73. package/dist/cancel-Cq2Q8qW7.js +0 -59
  74. package/dist/timezones-Cq1mLtfM.js +0 -4170
  75. /package/dist/locales/{4.2.2 → 4.2.3}/flow/de.js +0 -0
  76. /package/dist/locales/{4.2.2 → 4.2.3}/flow/es.js +0 -0
  77. /package/dist/locales/{4.2.2 → 4.2.3}/flow/fr.js +0 -0
  78. /package/dist/locales/{4.2.2 → 4.2.3}/flow/id.js +0 -0
  79. /package/dist/locales/{4.2.2 → 4.2.3}/flow/it.js +0 -0
  80. /package/dist/locales/{4.2.2 → 4.2.3}/flow/ja.js +0 -0
  81. /package/dist/locales/{4.2.2 → 4.2.3}/flow/ko.js +0 -0
  82. /package/dist/locales/{4.2.2 → 4.2.3}/flow/nl.js +0 -0
  83. /package/dist/locales/{4.2.2 → 4.2.3}/flow/pl.js +0 -0
  84. /package/dist/locales/{4.2.2 → 4.2.3}/flow/pt-br.js +0 -0
  85. /package/dist/locales/{4.2.2 → 4.2.3}/flow/tr.js +0 -0
  86. /package/dist/locales/{4.2.2 → 4.2.3}/flow/zh.js +0 -0
  87. /package/dist/locales/{4.2.2 → 4.2.3}/main/de.js +0 -0
  88. /package/dist/locales/{4.2.2 → 4.2.3}/main/es.js +0 -0
  89. /package/dist/locales/{4.2.2 → 4.2.3}/main/fr.js +0 -0
  90. /package/dist/locales/{4.2.2 → 4.2.3}/main/id.js +0 -0
  91. /package/dist/locales/{4.2.2 → 4.2.3}/main/it.js +0 -0
  92. /package/dist/locales/{4.2.2 → 4.2.3}/main/ja.js +0 -0
  93. /package/dist/locales/{4.2.2 → 4.2.3}/main/ko.js +0 -0
  94. /package/dist/locales/{4.2.2 → 4.2.3}/main/nl.js +0 -0
  95. /package/dist/locales/{4.2.2 → 4.2.3}/main/pl.js +0 -0
  96. /package/dist/locales/{4.2.2 → 4.2.3}/main/pt-br.js +0 -0
  97. /package/dist/locales/{4.2.2 → 4.2.3}/main/tr.js +0 -0
  98. /package/dist/locales/{4.2.2 → 4.2.3}/main/zh.js +0 -0
@@ -1,14 +1,14 @@
1
- import { I as e, k as t, w as n } from "./timezones-Cq1mLtfM.js";
2
- import { t as r } from "./ClockIcon-BOJENuPq.js";
1
+ import { E as e, m as t, y as n } from "./timezones-C5l0SSHK.js";
2
+ import { t as r } from "./ClockIcon-a9tJQ5El.js";
3
3
  import { t as i } from "./Text-CqjLjIF8.js";
4
- import { t as a } from "./labels-CtyfffZI.js";
4
+ import { t as a } from "./labels-Q4CaHsVM.js";
5
5
  import "svelte/internal/disclose-version";
6
6
  import * as o from "svelte/internal/client";
7
7
  //#region src/lib/utils/event-ended.ts
8
8
  function s(r, i = e()) {
9
9
  if (!r) return !1;
10
- let a = t(r.endDateTime || r.startDateTime);
11
- return a ? n(a, i) < 0 : !1;
10
+ let a = n(r.endDateTime || r.startDateTime);
11
+ return a ? t(a, i) < 0 : !1;
12
12
  }
13
13
  //#endregion
14
14
  //#region src/lib/public-calendar-flow/CheckoutTimer.svelte
@@ -1,4 +1,4 @@
1
- import { J as e } from "./constants-Dcj3kgZE.js";
1
+ import { J as e } from "./constants-CqrJv6nM.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/ChevronDownIcon.svelte
@@ -1,4 +1,4 @@
1
- import { J as e } from "./constants-Dcj3kgZE.js";
1
+ import { J as e } from "./constants-CqrJv6nM.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/phosphor/ClockIcon.svelte
@@ -1,4 +1,4 @@
1
- import { J as e } from "./constants-Dcj3kgZE.js";
1
+ import { J as e } from "./constants-CqrJv6nM.js";
2
2
  import "svelte/internal/disclose-version";
3
3
  import * as t from "svelte/internal/client";
4
4
  //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/CalendarOutline.svelte
@@ -0,0 +1,13 @@
1
+ import "svelte/internal/disclose-version";
2
+ import * as e from "svelte/internal/client";
3
+ //#region node_modules/@getmicdrop/svelte-components/dist/primitives/Icons/CloseOutline.svelte
4
+ var t = e.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=\"M6 18L18 6M6 6l12 12\"></path></svg>");
5
+ function n(n, r) {
6
+ let i = e.prop(r, "size", 3, "24"), a = e.prop(r, "color", 3, "currentColor"), o = e.prop(r, "class", 3, "");
7
+ var s = t();
8
+ e.template_effect(() => {
9
+ e.set_class(s, 0, e.clsx(o())), e.set_attribute(s, "width", i()), e.set_attribute(s, "height", i()), e.set_attribute(s, "stroke", a());
10
+ }), e.append(n, s);
11
+ }
12
+ //#endregion
13
+ export { n as t };
@@ -1,11 +1,12 @@
1
- import { r as e, tt as t } from "./timezones-Cq1mLtfM.js";
2
- import { t as n } from "./Event-C_0lUZvV.js";
3
- import { y as r } from "./constants-Dcj3kgZE.js";
4
- import { r as i } from "./shareCopyFeedback.svelte-DsyhrfiP.js";
5
- import { n as a } from "./ScarcityBadge-h7ygRD_C.js";
6
- import { t as o } from "./__SKIP_PATHS__-DirqE5Xe.js";
7
- import { t as s } from "./PasswordInput-BAlq2j97.js";
8
- import { _ as c } from "./colors-5ifWyP6H.js";
1
+ import { x as e } from "./Button-C4uFgl7L.js";
2
+ import { r as t } from "./timezones-C5l0SSHK.js";
3
+ import { t as n } from "./Event-1ZJVzqFN.js";
4
+ import { y as r } from "./constants-CqrJv6nM.js";
5
+ import { r as i } from "./shareCopyFeedback.svelte-Dko8NIbm.js";
6
+ import { n as a } from "./ScarcityBadge-BJOm7_Ho.js";
7
+ import { t as o } from "./__SKIP_PATHS__-DyyiXBgB.js";
8
+ import { t as s } from "./PasswordInput-DB4qa7kS.js";
9
+ import { _ as c } from "./colors-MuuDk6KF.js";
9
10
  import { i as l, n as u, t as d } from "./gate-password-cache-oOcDm9Ki.js";
10
11
  import "svelte/internal/disclose-version";
11
12
  import * as f from "svelte/internal/client";
@@ -13,7 +14,7 @@ import { onDestroy as p, onMount as m } from "svelte";
13
14
  //#region src/components/Views/CollectionView.svelte
14
15
  var h = f.from_html("<div class=\"flex items-center justify-center py-12 text-center loading-container svelte-q4dz4y\"><p> </p></div>"), g = f.from_html("<div class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\"><div class=\"password-card rounded-lg p-8 max-w-sm w-full svelte-q4dz4y\"><h2 class=\"password-title type-heading mb-2 svelte-q4dz4y\"> </h2> <p class=\"password-description type-body mb-6 svelte-q4dz4y\"> </p> <form class=\"flex flex-col gap-3\"><!> <!></form></div></div>"), _ = f.from_html("<div class=\"flex flex-col items-center justify-center min-h-[50vh] text-center\"><p class=\"error-text svelte-q4dz4y\"> </p></div>");
15
16
  function v(v, y) {
16
- f.push(y, !0), t("CollectionView"), f.prop(y, "organizationId", 3, "");
17
+ f.push(y, !0), e("CollectionView"), f.prop(y, "organizationId", 3, "");
17
18
  let b = f.prop(y, "onNavigateToEvent", 3, void 0), x = f.prop(y, "password", 3, void 0);
18
19
  f.prop(y, "displayMode", 3, "gallery"), f.prop(y, "showViewSwitcher", 3, !0);
19
20
  let S = f.prop(y, "labels", 3, r), C = f.prop(y, "locale", 3, void 0), w = f.state(null), T = f.state(!0), E = f.state(null), D = f.state(!1), O = f.state(!1), k = f.state(""), A = f.state(!1), j = f.derived(() => f.get(w) ? i(f.get(w)) : null), M = 0;
@@ -69,7 +70,7 @@ function v(v, y) {
69
70
  var I = f.comment(), L = f.first_child(I), R = (e) => {
70
71
  var t = h(), n = f.child(t), r = f.child(n, !0);
71
72
  f.reset(n), f.reset(t), f.template_effect(() => f.set_text(r, S().loadingCollection || "Loading collection...")), f.append(e, t);
72
- }, z = (t) => {
73
+ }, z = (e) => {
73
74
  var n = g(), r = f.child(n), i = f.child(r), a = f.child(i, !0);
74
75
  f.reset(i);
75
76
  var o = f.sibling(i, 2), c = f.child(o, !0);
@@ -93,7 +94,7 @@ function v(v, y) {
93
94
  });
94
95
  }
95
96
  var d = f.sibling(u, 2);
96
- e(d, {
97
+ t(d, {
97
98
  variant: "default",
98
99
  type: "submit",
99
100
  children: (e, t) => {
@@ -104,7 +105,7 @@ function v(v, y) {
104
105
  $$slots: { default: !0 }
105
106
  }), f.reset(l), f.reset(r), f.reset(n), f.template_effect(() => {
106
107
  f.set_text(a, S().collectionPrivateTitle || "This collection is private"), f.set_text(c, S().collectionPrivateDescription || "Please enter the password to view this collection");
107
- }), f.event("submit", l, P), f.append(t, n);
108
+ }), f.event("submit", l, P), f.append(e, n);
108
109
  }, B = (e) => {
109
110
  var t = _(), n = f.child(t), r = f.child(n);
110
111
  f.reset(n), f.reset(t), f.template_effect(() => f.set_text(r, `${(S().errorPrefix || "Error:") ?? ""} ${f.get(E) ?? ""}`)), f.append(e, t);
@@ -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 };