@getmicdrop/venue-calendar 4.0.109 → 4.0.111

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 (110) hide show
  1. package/dist/CartView-DiSdmuA_.js +2475 -0
  2. package/dist/CartView-DiSdmuA_.js.map +1 -0
  3. package/dist/{Checkout-CMEf_qnp.js → Checkout-DBaNrRya.js} +323 -333
  4. package/dist/Checkout-DBaNrRya.js.map +1 -0
  5. package/dist/{Checkout-Chki2df_.js → Checkout-DwJr030c.js} +206 -205
  6. package/dist/Checkout-DwJr030c.js.map +1 -0
  7. package/dist/{CheckoutTimer-BAaY_60w.js → CheckoutTimer-DPFVh7QG.js} +5 -5
  8. package/dist/{CheckoutTimer-BAaY_60w.js.map → CheckoutTimer-DPFVh7QG.js.map} +1 -1
  9. package/dist/{ClockIcon-Dbbj_qur.js → ClockIcon-BoEIfS3d.js} +2 -2
  10. package/dist/{ClockIcon-Dbbj_qur.js.map → ClockIcon-BoEIfS3d.js.map} +1 -1
  11. package/dist/{CollectionView-RM30YPOJ.js → CollectionView-DM3WLpLu.js} +78 -77
  12. package/dist/CollectionView-DM3WLpLu.js.map +1 -0
  13. package/dist/{Event-kdxMa6OT.js → Event-DymZpajQ.js} +659 -657
  14. package/dist/Event-DymZpajQ.js.map +1 -0
  15. package/dist/{EventPage-BRBByBHe.js → EventPage-D7GG_BWH.js} +300 -306
  16. package/dist/EventPage-D7GG_BWH.js.map +1 -0
  17. package/dist/{Heading-CSDFD80h.js → Heading-C8oOcA05.js} +2 -2
  18. package/dist/{Heading-CSDFD80h.js.map → Heading-C8oOcA05.js.map} +1 -1
  19. package/dist/{ScarcityBadge-B0ca48su.js → ScarcityBadge-BqJHRkab.js} +11 -11
  20. package/dist/{ScarcityBadge-B0ca48su.js.map → ScarcityBadge-BqJHRkab.js.map} +1 -1
  21. package/dist/SeriesPage-DsJ9zGPQ.js +34 -0
  22. package/dist/SeriesPage-DsJ9zGPQ.js.map +1 -0
  23. package/dist/{Spinner--TOwvv9A.js → Spinner-DPzuHWU6.js} +2 -2
  24. package/dist/{Spinner--TOwvv9A.js.map → Spinner-DPzuHWU6.js.map} +1 -1
  25. package/dist/Success-C0D_INAc.js +896 -0
  26. package/dist/Success-C0D_INAc.js.map +1 -0
  27. package/dist/{Text-WLl_ELy9.js → Text-DOd8068v.js} +19 -19
  28. package/dist/Text-DOd8068v.js.map +1 -0
  29. package/dist/VenueCalendar-B809Hecp.js +16467 -0
  30. package/dist/VenueCalendar-B809Hecp.js.map +1 -0
  31. package/dist/{ViewTicketsEmbed-BOukxQIF.js → ViewTicketsEmbed-BPMp4JM0.js} +86 -85
  32. package/dist/{ViewTicketsEmbed-BOukxQIF.js.map → ViewTicketsEmbed-BPMp4JM0.js.map} +1 -1
  33. package/dist/__SKIP_PATHS__-BtJ0tS93.js +10 -0
  34. package/dist/__SKIP_PATHS__-BtJ0tS93.js.map +1 -0
  35. package/dist/{labels-DXGieQXs.js → labels-wFEhrJkb.js} +154 -149
  36. package/dist/labels-wFEhrJkb.js.map +1 -0
  37. package/dist/{modalManager.svelte-Dbd1xgTQ.js → modalManager.svelte-DjiZPIja.js} +2 -2
  38. package/dist/{modalManager.svelte-Dbd1xgTQ.js.map → modalManager.svelte-DjiZPIja.js.map} +1 -1
  39. package/dist/navigation--gZASiSa.js +19 -0
  40. package/dist/navigation--gZASiSa.js.map +1 -0
  41. package/dist/{promo-oWi_MKmY.js → promo-DK6Hxogl.js} +2 -2
  42. package/dist/{promo-oWi_MKmY.js.map → promo-DK6Hxogl.js.map} +1 -1
  43. package/dist/{showcase-state-options-DJJdjxvZ.js → showcase-state-options-BuPnUf0V.js} +21 -21
  44. package/dist/showcase-state-options-BuPnUf0V.js.map +1 -0
  45. package/dist/{transform-Bgqwj9i-.js → transform-C6LCkao6.js} +81 -77
  46. package/dist/transform-C6LCkao6.js.map +1 -0
  47. package/dist/types/index.d.ts +18 -14
  48. package/dist/utm-DYGTGbVA.js +288 -0
  49. package/dist/utm-DYGTGbVA.js.map +1 -0
  50. package/dist/venue-calendar.css +1 -1
  51. package/dist/venue-calendar.es.js +2 -2
  52. package/dist/venue-calendar.iife.js +50 -50
  53. package/dist/venue-calendar.iife.js.map +1 -1
  54. package/dist/venue-calendar.umd.js +45 -45
  55. package/dist/venue-calendar.umd.js.map +1 -1
  56. package/package.json +199 -199
  57. package/dist/CartView-C3N5pw89.js +0 -2381
  58. package/dist/CartView-C3N5pw89.js.map +0 -1
  59. package/dist/Checkout-CMEf_qnp.js.map +0 -1
  60. package/dist/Checkout-Chki2df_.js.map +0 -1
  61. package/dist/CollectionView-RM30YPOJ.js.map +0 -1
  62. package/dist/Event-kdxMa6OT.js.map +0 -1
  63. package/dist/EventPage-BRBByBHe.js.map +0 -1
  64. package/dist/SeriesPage-CczfbUKO.js +0 -33
  65. package/dist/SeriesPage-CczfbUKO.js.map +0 -1
  66. package/dist/Success-DIWUGUPs.js +0 -886
  67. package/dist/Success-DIWUGUPs.js.map +0 -1
  68. package/dist/Text-WLl_ELy9.js.map +0 -1
  69. package/dist/VenueCalendar-CU5N9klc.js +0 -16579
  70. package/dist/VenueCalendar-CU5N9klc.js.map +0 -1
  71. package/dist/api/api/client.d.ts +0 -17
  72. package/dist/api/api/cta.d.ts +0 -34
  73. package/dist/api/api/events.d.ts +0 -183
  74. package/dist/api/api/gift-cards.d.ts +0 -108
  75. package/dist/api/api/index.d.ts +0 -46
  76. package/dist/api/api/orders.d.ts +0 -149
  77. package/dist/api/api/promo.d.ts +0 -45
  78. package/dist/api/api/result.d.ts +0 -78
  79. package/dist/api/api/route-manifest.d.ts +0 -179
  80. package/dist/api/api/transformers/address.d.ts +0 -18
  81. package/dist/api/api/transformers/cart.d.ts +0 -19
  82. package/dist/api/api/transformers/collection.d.ts +0 -12
  83. package/dist/api/api/transformers/event.d.ts +0 -173
  84. package/dist/api/api/transformers/giftCard.d.ts +0 -11
  85. package/dist/api/api/transformers/index.d.ts +0 -27
  86. package/dist/api/api/transformers/order.d.ts +0 -44
  87. package/dist/api/api/transformers/performer.d.ts +0 -8
  88. package/dist/api/api/transformers/series.d.ts +0 -12
  89. package/dist/api/api/transformers/venue.d.ts +0 -39
  90. package/dist/api/api/venues.d.ts +0 -33
  91. package/dist/api/api/waitlist.d.ts +0 -49
  92. package/dist/api/api.cjs +0 -2
  93. package/dist/api/api.cjs.map +0 -1
  94. package/dist/api/api.mjs +0 -1299
  95. package/dist/api/api.mjs.map +0 -1
  96. package/dist/api/types.d.ts +0 -483
  97. package/dist/labels-DXGieQXs.js.map +0 -1
  98. package/dist/seo/HostSeoController.d.ts +0 -68
  99. package/dist/seo/buildCollectionJsonLd.d.ts +0 -8
  100. package/dist/seo/buildEventJsonLd.d.ts +0 -9
  101. package/dist/seo/buildSeriesJsonLd.d.ts +0 -6
  102. package/dist/seo/helpers.d.ts +0 -88
  103. package/dist/seo/index.d.ts +0 -10
  104. package/dist/seo/seo.cjs +0 -2
  105. package/dist/seo/seo.cjs.map +0 -1
  106. package/dist/seo/seo.mjs +0 -541
  107. package/dist/seo/seo.mjs.map +0 -1
  108. package/dist/seo/types.d.ts +0 -150
  109. package/dist/showcase-state-options-DJJdjxvZ.js.map +0 -1
  110. package/dist/transform-Bgqwj9i-.js.map +0 -1
package/dist/seo/seo.mjs DELETED
@@ -1,541 +0,0 @@
1
- function A() {
2
- return "America/Los_Angeles";
3
- }
4
- const $ = /<\/(?:p|div|h[1-6]|li|ul|ol|blockquote|tr)>/gi, O = /<br\s*\/?>/gi, P = /<[^>]*>/g, C = {
5
- "&amp;": "&",
6
- "&lt;": "<",
7
- "&gt;": ">",
8
- "&quot;": '"',
9
- "&#39;": "'",
10
- "&apos;": "'",
11
- "&nbsp;": " "
12
- };
13
- function M(i) {
14
- return i.replace(/&#x([0-9a-f]+);/gi, (t, e) => N(parseInt(e, 16))).replace(/&#(\d+);/g, (t, e) => N(Number(e))).replace(/&[a-z0-9]+;/gi, (t) => C[t.toLowerCase()] ?? t);
15
- }
16
- function N(i) {
17
- return Number.isFinite(i) && i > 0 && i <= 1114111 ? String.fromCodePoint(i) : "";
18
- }
19
- function y(i, t) {
20
- if (!i)
21
- return "";
22
- let e = String(i).replace(O, " ").replace($, " ").replace(P, "");
23
- if (e = M(e).replace(/\s+/g, " ").trim(), t && t > 0 && e.length > t) {
24
- const n = e.slice(0, t), s = n.lastIndexOf(" ");
25
- e = (s > 40 ? n.slice(0, s) : n).trimEnd() + "…";
26
- }
27
- return e;
28
- }
29
- function U() {
30
- return /* @__PURE__ */ new Date();
31
- }
32
- function H(i) {
33
- return i.replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026");
34
- }
35
- function v(i, t) {
36
- if (!i) return null;
37
- const e = new Date(i);
38
- if (isNaN(e.getTime())) return null;
39
- const n = {
40
- year: "numeric",
41
- month: "2-digit",
42
- day: "2-digit",
43
- hour: "2-digit",
44
- minute: "2-digit",
45
- second: "2-digit",
46
- hour12: !1,
47
- timeZoneName: "shortOffset"
48
- };
49
- let s;
50
- try {
51
- s = new Intl.DateTimeFormat("en-US", { ...n, timeZone: t });
52
- } catch {
53
- s = new Intl.DateTimeFormat("en-US", {
54
- ...n,
55
- timeZone: A()
56
- });
57
- }
58
- const o = s.formatToParts(e), a = (d) => o.find((b) => b.type === d)?.value || "", l = a("year"), u = a("month"), r = a("day"), m = a("hour"), c = a("minute"), h = a("second"), g = a("timeZoneName");
59
- let p = "+00:00";
60
- if (g) {
61
- const d = g.match(/GMT([+-])(\d+)(?::(\d+))?/);
62
- if (d) {
63
- const b = d[1], L = d[2].padStart(2, "0"), D = d[3] || "00";
64
- p = `${b}${L}:${D}`;
65
- }
66
- }
67
- return `${l}-${u}-${r}T${m}:${c}:${h}${p}`;
68
- }
69
- function Z(i) {
70
- if (!i) return null;
71
- const t = i.split(",").map((s) => s.trim());
72
- if (t.length < 2)
73
- return {
74
- "@type": "PostalAddress",
75
- streetAddress: i,
76
- addressCountry: "US"
77
- };
78
- const n = t[t.length - 1].match(/^([A-Z]{2})\s+(\d{5}(?:-\d{4})?)$/);
79
- return n && t.length >= 3 ? {
80
- "@type": "PostalAddress",
81
- streetAddress: t.slice(0, -2).join(", "),
82
- addressLocality: t[t.length - 2],
83
- addressRegion: n[1],
84
- postalCode: n[2],
85
- addressCountry: "US"
86
- } : {
87
- "@type": "PostalAddress",
88
- streetAddress: t[0],
89
- addressLocality: t.slice(1).join(", "),
90
- addressCountry: "US"
91
- };
92
- }
93
- function T(i, t) {
94
- if (i && (i.city || i.state || i.postalCode)) {
95
- const e = { "@type": "PostalAddress" };
96
- return i.address && (e.streetAddress = i.address), i.city && (e.addressLocality = i.city), i.state && (e.addressRegion = i.state), i.postalCode && (e.postalCode = i.postalCode), e.addressCountry = i.country || "US", e;
97
- }
98
- return Z(i && i.address || t || null);
99
- }
100
- function I(i) {
101
- if (!i) return "https://schema.org/EventScheduled";
102
- const t = i.toLowerCase();
103
- return t === "cancelled" || t === "canceled" ? "https://schema.org/EventCancelled" : t === "postponed" ? "https://schema.org/EventPostponed" : t === "rescheduled" ? "https://schema.org/EventRescheduled" : "https://schema.org/EventScheduled";
104
- }
105
- function w(i) {
106
- if ((i.remainingCapacity ?? i.quantityRemaining ?? i.quantity) === 0 || i.soldOut)
107
- return "https://schema.org/SoldOut";
108
- const e = U(), n = i.salesBegin || i.salesStart || i.saleBegin || i.onSaleStart, s = i.salesEnd || i.saleEnd || i.onSaleEnd;
109
- return n && new Date(n) > e ? "https://schema.org/PreOrder" : s && new Date(s) < e ? "https://schema.org/SoldOut" : "https://schema.org/InStock";
110
- }
111
- function S(i, t, e, n = {}) {
112
- return i !== t ? {
113
- "@type": "AggregateOffer",
114
- lowPrice: i,
115
- highPrice: t,
116
- priceCurrency: "USD",
117
- availability: e,
118
- ...n
119
- } : {
120
- "@type": "Offer",
121
- price: i,
122
- priceCurrency: "USD",
123
- availability: e,
124
- ...n
125
- };
126
- }
127
- function q(i, t) {
128
- if (!i || i.length === 0) return null;
129
- const e = i.filter((l) => {
130
- const u = l.visibility ?? 0, r = u === 0 || u === 1, m = l.salesChannel !== 2;
131
- return r && m;
132
- });
133
- if (e.length === 0) return null;
134
- const n = e.map((l) => parseFloat(String(l.price ?? 0))).filter((l) => !isNaN(l));
135
- if (n.length === 0) return null;
136
- const s = Math.min(...n), o = Math.max(...n), a = e[0];
137
- return S(
138
- s,
139
- o,
140
- w(a),
141
- {
142
- url: t || void 0,
143
- validFrom: a?.salesBegin || a?.salesStart || void 0
144
- }
145
- );
146
- }
147
- function j(i) {
148
- if (!i || i.length === 0) return null;
149
- const t = i.filter((e) => {
150
- const n = e.acceptedState === 2, s = !e.shouldBeHidden, o = e.RosterPerformer?.User?.performerProfile, a = o?.firstName || o?.lastName || o?.displayName;
151
- return n && s && a;
152
- });
153
- return t.length === 0 ? null : t.map((e) => {
154
- const n = e.RosterPerformer?.User?.performerProfile;
155
- return {
156
- "@type": "PerformingGroup",
157
- name: n?.displayName || [n?.firstName, n?.lastName].filter(Boolean).join(" ")
158
- };
159
- });
160
- }
161
- function z(i) {
162
- const {
163
- event: t,
164
- venue: e,
165
- venueTimeZone: n = A(),
166
- eventUrl: s,
167
- organizer: o
168
- } = i;
169
- if (!t) return null;
170
- const a = v(
171
- t.startDateTime,
172
- n
173
- );
174
- if (!t.name || !a || !e?.name)
175
- return null;
176
- const l = T(
177
- e,
178
- e?.googleLocationNameCache
179
- ), u = {
180
- "@type": "Place",
181
- name: e.name
182
- };
183
- l && (u.address = l);
184
- const r = {
185
- "@context": "https://schema.org",
186
- "@type": "Event",
187
- name: t.name,
188
- startDate: a,
189
- eventStatus: I(t.status),
190
- eventAttendanceMode: "https://schema.org/OfflineEventAttendanceMode",
191
- location: u
192
- }, m = v(t.endDateTime, n);
193
- m && (r.endDate = m);
194
- const c = y(t.description) || t.eventSummary;
195
- c && (r.description = c);
196
- const h = t.image || t.coverImage || t.ShowImage;
197
- h && (r.image = [h]);
198
- const g = q(t.availableTickets, s);
199
- g && (r.offers = g);
200
- const p = j(t.performers);
201
- if (p && p.length > 0 && (r.performer = p), o?.name) {
202
- const d = {
203
- "@type": "Organization",
204
- name: o.name
205
- };
206
- o.url && (d.url = o.url), r.organizer = d;
207
- }
208
- return s && (r.url = s), r;
209
- }
210
- function x(i) {
211
- switch (i) {
212
- case "available":
213
- return "https://schema.org/InStock";
214
- case "sold_out":
215
- return "https://schema.org/SoldOut";
216
- case "coming_soon":
217
- return "https://schema.org/PreOrder";
218
- case "ended":
219
- return "https://schema.org/SoldOut";
220
- default:
221
- return "https://schema.org/InStock";
222
- }
223
- }
224
- function B(i, t) {
225
- if (!i || i.length === 0) return null;
226
- const e = i.filter(
227
- (s) => s.status !== "sold_out" && s.status !== "ended"
228
- );
229
- if (e.length === 0) {
230
- const s = i.map((o) => o.price).filter((o) => !isNaN(o));
231
- return s.length === 0 ? null : S(
232
- Math.min(...s),
233
- Math.max(...s),
234
- "https://schema.org/SoldOut"
235
- );
236
- }
237
- const n = e.map((s) => s.price).filter((s) => !isNaN(s));
238
- return n.length === 0 ? null : S(
239
- Math.min(...n),
240
- Math.max(...n),
241
- x(e[0].status)
242
- );
243
- }
244
- function J(i) {
245
- const { series: t, baseEventUrl: e } = i;
246
- if (!t.title || !t.occurrences || t.occurrences.length === 0 || !t.venue?.name) return null;
247
- const n = T(
248
- t.venue,
249
- t.venue.googleLocationNameCache
250
- ), s = {
251
- "@type": "Place",
252
- name: t.venue.name
253
- };
254
- n && (s.address = n);
255
- const o = {
256
- "@context": "https://schema.org",
257
- "@type": "EventSeries",
258
- name: t.title,
259
- location: s
260
- }, a = y(t.description) || t.eventSummary;
261
- a && (o.description = a), t.image && (o.image = [t.image]);
262
- const l = t.performers?.filter((r) => r.displayName);
263
- l && l.length > 0 && (o.performer = l.map((r) => ({
264
- "@type": "PerformingGroup",
265
- name: r.displayName
266
- })));
267
- const u = [];
268
- for (const r of t.occurrences) {
269
- const m = v(
270
- r.startDateTime,
271
- t.timeZone
272
- );
273
- if (!m) continue;
274
- const c = {
275
- "@type": "Event",
276
- name: r.title,
277
- startDate: m,
278
- eventStatus: I(r.status),
279
- location: s
280
- };
281
- e && (c["@id"] = `${e}/${r.id}-${r.slug}`);
282
- const h = v(r.endDateTime, t.timeZone);
283
- h && (c.endDate = h);
284
- const g = B(r.tickets, r.status);
285
- g && (c.offers = g), u.push(c);
286
- }
287
- return u.length === 0 ? null : (o.subEvent = u, o);
288
- }
289
- function F(i) {
290
- const { collection: t, baseEventUrl: e } = i;
291
- if (!t.collectionTitle || !t.events || t.events.length === 0) return null;
292
- const n = [];
293
- for (const a of t.events) {
294
- if (!a.title) continue;
295
- const l = {
296
- "@type": "ListItem",
297
- position: n.length + 1,
298
- name: a.title
299
- };
300
- e && (l.url = a.slug ? `${e}/${a.id}-${a.slug}` : `${e}/${a.id}`), n.push(l);
301
- }
302
- if (n.length === 0) return null;
303
- const s = {
304
- "@context": "https://schema.org",
305
- "@type": "CollectionPage",
306
- name: t.collectionTitle
307
- }, o = y(t.description) || t.summary;
308
- return o && (s.description = o), t.coverImage && (s.image = [t.coverImage]), s.mainEntity = {
309
- "@type": "ItemList",
310
- numberOfItems: n.length,
311
- itemListElement: n
312
- }, s;
313
- }
314
- const R = 70;
315
- function G(i) {
316
- return i.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, R).replace(/-+$/g, "");
317
- }
318
- function _(i) {
319
- return i ? G(i) : "";
320
- }
321
- const f = class f {
322
- constructor(t) {
323
- this._state = "idle", this._originals = null, this._originalsSaved = !1, this._events = [], !(typeof document > "u") && (f._activeInstance && f._activeInstance !== this && f._activeInstance.destroy(), this._venueName = t.venueName, this._venueAddress = t.venueAddress, this._venueTimeZone = t.venueTimeZone || A(), this._baseUrl = t.baseUrl || window.location.origin + window.location.pathname, this._saveOriginals(), f._activeInstance = this);
324
- }
325
- // ---------------------------------------------------------------------------
326
- // Private helpers
327
- // ---------------------------------------------------------------------------
328
- _saveOriginals() {
329
- if (this._originalsSaved) return;
330
- const t = document.querySelector(
331
- 'link[rel="canonical"]'
332
- ), e = document.querySelector(
333
- 'meta[property="og:title"]'
334
- ), n = document.querySelector(
335
- 'meta[property="og:description"]'
336
- ), s = document.querySelector(
337
- 'meta[property="og:image"]'
338
- ), o = document.querySelector(
339
- 'meta[property="og:url"]'
340
- ), a = document.querySelector(
341
- 'meta[property="og:type"]'
342
- ), l = document.querySelector(
343
- 'meta[name="description"]'
344
- );
345
- this._originals = {
346
- title: document.title,
347
- canonicalHref: t?.getAttribute("href") ?? null,
348
- ogTitle: e?.getAttribute("content") ?? null,
349
- ogDescription: n?.getAttribute("content") ?? null,
350
- ogImage: s?.getAttribute("content") ?? null,
351
- ogUrl: o?.getAttribute("content") ?? null,
352
- ogType: a?.getAttribute("content") ?? null,
353
- metaDescription: l?.getAttribute("content") ?? null
354
- }, this._originalsSaved = !0;
355
- }
356
- _injectJsonLd(t) {
357
- if (typeof document > "u") return;
358
- document.querySelectorAll('script[data-micdrop="jsonld"]').forEach((n) => n.remove());
359
- const e = document.createElement("script");
360
- e.setAttribute("type", "application/ld+json"), e.setAttribute("data-micdrop", "jsonld"), e.textContent = JSON.stringify(t), document.head.appendChild(e);
361
- }
362
- _setMeta(t, e) {
363
- if (!(typeof document > "u"))
364
- if (t.startsWith("og:")) {
365
- let n = document.querySelector(
366
- `meta[property="${t}"]`
367
- );
368
- n ? n.setAttribute("content", e) : (n = document.createElement("meta"), n.setAttribute("property", t), n.setAttribute("content", e), n.setAttribute("data-micdrop", "og"), document.head.appendChild(n));
369
- } else {
370
- let n = document.querySelector(
371
- `meta[name="${t}"]`
372
- );
373
- n ? n.setAttribute("content", e) : (n = document.createElement("meta"), n.setAttribute("name", t), n.setAttribute("content", e), n.setAttribute("data-micdrop", "meta"), document.head.appendChild(n));
374
- }
375
- }
376
- _setCanonical(t) {
377
- if (typeof document > "u") return;
378
- let e = document.querySelector(
379
- 'link[rel="canonical"]'
380
- );
381
- e ? e.setAttribute("href", t) : (e = document.createElement("link"), e.setAttribute("rel", "canonical"), e.setAttribute("href", t), e.setAttribute("data-micdrop", "canonical"), document.head.appendChild(e));
382
- }
383
- _removeAllInjected() {
384
- typeof document > "u" || document.querySelectorAll("[data-micdrop]").forEach((t) => t.remove());
385
- }
386
- _restoreOriginals() {
387
- if (!(typeof document > "u" || !this._originals)) {
388
- if (document.title = this._originals.title, this._originals.canonicalHref !== null) {
389
- const t = document.querySelector(
390
- 'link[rel="canonical"]'
391
- );
392
- t && t.setAttribute("href", this._originals.canonicalHref);
393
- }
394
- this._restoreMetaProperty("og:title", this._originals.ogTitle), this._restoreMetaProperty("og:description", this._originals.ogDescription), this._restoreMetaProperty("og:image", this._originals.ogImage), this._restoreMetaProperty("og:url", this._originals.ogUrl), this._restoreMetaProperty("og:type", this._originals.ogType), this._restoreMetaName("description", this._originals.metaDescription), this._originalsSaved = !1;
395
- }
396
- }
397
- _restoreMetaProperty(t, e) {
398
- const n = document.querySelector(
399
- `meta[property="${t}"]`
400
- );
401
- e !== null && n ? n.setAttribute("content", e) : e === null && n?.hasAttribute("data-micdrop") && n.remove();
402
- }
403
- _restoreMetaName(t, e) {
404
- const n = document.querySelector(
405
- `meta[name="${t}"]`
406
- );
407
- e !== null && n ? n.setAttribute("content", e) : e === null && n?.hasAttribute("data-micdrop") && n.remove();
408
- }
409
- _buildItemList(t) {
410
- return {
411
- "@context": "https://schema.org",
412
- "@type": "ItemList",
413
- itemListElement: t.map((e, n) => {
414
- const s = e.slug || _(e.name);
415
- return {
416
- "@type": "ListItem",
417
- position: n + 1,
418
- url: `${this._baseUrl}?e=${e.id}-${s}`
419
- };
420
- })
421
- };
422
- }
423
- _buildEntityUrl(t, e, n) {
424
- const s = t === "event" ? "e" : t === "series" ? "s" : "c";
425
- return `${this._baseUrl}?${s}=${e}-${n}`;
426
- }
427
- // ---------------------------------------------------------------------------
428
- // Public API
429
- // ---------------------------------------------------------------------------
430
- /**
431
- * Called when events finish loading from the API.
432
- * Injects an ItemList JSON-LD for the listing. Does not modify OG/canonical/title.
433
- */
434
- onEventsLoaded(t, e) {
435
- if (typeof document > "u" || this._state === "destroyed") return;
436
- if (e) {
437
- this._venueName = e.name || this._venueName, this._venueAddress = e.address || e.googleLocationNameCache || this._venueAddress;
438
- const s = e.timeZone || e.timezone;
439
- s && (this._venueTimeZone = s);
440
- }
441
- this._events = t;
442
- const n = this._buildItemList(t);
443
- this._injectJsonLd(n), this._state = "listing";
444
- }
445
- /**
446
- * Called when the user selects an event, series, or collection.
447
- * Replaces ItemList JSON-LD with entity-specific JSON-LD and updates
448
- * all head tags (canonical, OG, meta description, title).
449
- */
450
- onEntitySelected(t, e, n) {
451
- if (typeof document > "u" || this._state === "destroyed") return;
452
- if (this._saveOriginals(), n) {
453
- this._venueName = n.name || this._venueName, this._venueAddress = n.address || n.googleLocationNameCache || this._venueAddress;
454
- const c = n.timeZone || n.timezone;
455
- c && (this._venueTimeZone = c);
456
- }
457
- let s = null, o = "", a = "", l = "", u = "", r = "";
458
- if (t === "event") {
459
- const c = e.slug || _(e.name || "");
460
- r = this._buildEntityUrl(
461
- "event",
462
- e.id || e.eventID || "",
463
- c
464
- ), s = z({
465
- event: e,
466
- venue: {
467
- name: this._venueName,
468
- googleLocationNameCache: this._venueAddress
469
- },
470
- venueTimeZone: this._venueTimeZone,
471
- eventUrl: r
472
- }), o = e.name || "", a = e.description || "", l = e.eventSummary || "", u = e.image || e.coverImage || e.ShowImage || "";
473
- } else if (t === "series") {
474
- const c = e.slug || _(e.title || "");
475
- r = this._buildEntityUrl("series", e.id || "", c), s = J({
476
- series: {
477
- ...e,
478
- venue: {
479
- name: this._venueName,
480
- googleLocationNameCache: this._venueAddress
481
- },
482
- timeZone: this._venueTimeZone
483
- },
484
- baseEventUrl: r
485
- }), o = e.title || "", a = e.description || "", l = e.eventSummary || "", u = e.image || "";
486
- } else if (t === "collection") {
487
- const c = e.slug || _(e.collectionTitle || "");
488
- r = this._buildEntityUrl("collection", e.id || "", c), s = F({
489
- collection: e,
490
- baseEventUrl: r,
491
- defaultTimeZone: this._venueTimeZone
492
- }), o = e.collectionTitle || "", a = e.description || "", l = e.summary || "", u = e.coverImage || "";
493
- }
494
- s && this._injectJsonLd(s), r && this._setCanonical(r), o && this._setMeta("og:title", o);
495
- const m = y(a, 160) || y(l, 160);
496
- m ? this._setMeta("og:description", m) : this._restoreMetaProperty(
497
- "og:description",
498
- this._originals?.ogDescription ?? null
499
- ), u && this._setMeta("og:image", u), r && this._setMeta("og:url", r), this._setMeta("og:type", "website"), this._setMeta("twitter:card", "summary_large_image"), m ? this._setMeta("description", m) : this._restoreMetaName(
500
- "description",
501
- this._originals?.metaDescription ?? null
502
- ), o && (document.title = `${o} | ${this._venueName}`), this._state = "entity";
503
- }
504
- /**
505
- * Called when the user navigates back to the event listing.
506
- * Restores original head elements and re-injects ItemList JSON-LD.
507
- */
508
- onBackToListing() {
509
- if (!(typeof document > "u") && this._state !== "destroyed") {
510
- if (this._restoreOriginals(), this._removeAllInjected(), this._events.length > 0) {
511
- const t = this._buildItemList(this._events);
512
- this._injectJsonLd(t);
513
- }
514
- this._saveOriginals(), this._state = "listing";
515
- }
516
- }
517
- /**
518
- * Called when the widget is destroyed. Removes all injected elements
519
- * and restores originals. Clears the static active instance.
520
- */
521
- destroy() {
522
- typeof document > "u" || this._state !== "destroyed" && (this._removeAllInjected(), this._restoreOriginals(), f._activeInstance === this && (f._activeInstance = null), this._state = "destroyed");
523
- }
524
- };
525
- f._activeInstance = null;
526
- let E = f;
527
- export {
528
- E as HostSeoController,
529
- F as buildCollectionJsonLd,
530
- z as buildEventJsonLd,
531
- q as buildOffers,
532
- j as buildPerformers,
533
- T as buildPostalAddress,
534
- J as buildSeriesJsonLd,
535
- H as escapeJsonLdForScript,
536
- v as formatDateTimeWithOffset,
537
- I as getEventStatus,
538
- w as getTicketAvailability,
539
- Z as parseAddressToPostal
540
- };
541
- //# sourceMappingURL=seo.mjs.map