@getmicdrop/venue-calendar 4.3.51 → 4.3.53
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-BVz8rVy-.js → ArrowLeftIcon-BLnCtSTd.js} +1 -1
- package/dist/{Badge-n7TfNjln.js → Badge-LGtxYPTv.js} +9 -8
- package/dist/{BlockPlaceholder-BMor_G7G.js → BlockPlaceholder-BhPJo2P8.js} +2 -2
- package/dist/Button-D8b2gDS8.js +177 -0
- package/dist/{Button-klwKgfhG.js → Button-DZ_ZJIeL.js} +66 -119
- package/dist/{Calendar-c-VQOPhK.js → Calendar-D1d210pe.js} +292 -338
- package/dist/{CalendarFoundryView-Bq547Oiz.js → CalendarFoundryView-CEEJ8nkK.js} +6528 -7811
- package/dist/{CalendarIcon-B1zQMDYt.js → CalendarIcon-CLbs06CG.js} +1 -1
- package/dist/CartView-BN-EnU8O.js +2293 -0
- package/dist/ChartBlock-CQuNi0uN.js +1190 -0
- package/dist/Checkout-BLfHdJ4t.js +1832 -0
- package/dist/{Checkout-pjUaSvU6.js → Checkout-dBGyhMQD.js} +66 -65
- package/dist/{CheckoutTimer-DjYTRwVK.js → CheckoutTimer-DnHjYAv-.js} +5 -4
- package/dist/{ChevronDownIcon-8-uVEhg0.js → ChevronDownIcon-BIGPSika.js} +1 -1
- package/dist/{ClockIcon-CubuxycE.js → ClockIcon-D5mFK2c-.js} +1 -1
- package/dist/{CloseIcon-pz6eBxlB.js → CloseIcon-Bf4yqVV0.js} +1 -1
- package/dist/{CollectionView-CWwhiJHK.js → CollectionView-H_aMs6Zm.js} +12 -11
- package/dist/{CropImage-BFtvLjTE.js → CropImage-BFJ61OWR.js} +52 -51
- package/dist/EmptyState-Dak003WV.js +53 -0
- package/dist/{Event-Cj5-V360.js → Event-BYW026V7.js} +317 -313
- package/dist/{EventPage-Gh0QX1Wk.js → EventPage-DqTynzsn.js} +173 -171
- package/dist/Grid-kuP6V0GW.js +89 -0
- package/dist/{Heading-D6bWtGZA.js → Heading-BFFV1cuP.js} +4 -3
- package/dist/{Input-B0S168FA.js → Input-BlLlXJhw.js} +57 -57
- package/dist/{MailIcon-B4iLV34K.js → MailIcon-BO5Ou19Y.js} +1 -1
- package/dist/{Modal-DZ8fudB4.js → Modal-JNeuI7zx.js} +2 -2
- package/dist/{ModalFooter-T1gpnywp.js → ModalFooter-CZYeaLby.js} +66 -65
- package/dist/{ModalHeader-DkKpWKcG.js → ModalHeader-BNxKfIP7.js} +2 -2
- package/dist/{PasswordInput-Dd_mQxbp.js → PasswordInput-DaJbFgg5.js} +2 -2
- package/dist/{RecommendationsRail-D7NWOEEf.js → RecommendationsRail-DBadchEC.js} +17 -15
- package/dist/{ScarcityBadge--Rh62z2D.js → ScarcityBadge-Bi5eRig2.js} +4 -4
- package/dist/{SeriesPage-Dx0PFJkE.js → SeriesPage-DnArOhpy.js} +4 -4
- package/dist/{Spinner-D8dOJe6O.js → Spinner-UI821bAt.js} +2 -2
- package/dist/{Success-Fj5TXPWu.js → Success-BKfN0O0W.js} +43 -42
- package/dist/{TagIcon-DVXKjStU.js → TagIcon-BWLYSGkG.js} +1 -1
- package/dist/{Textarea-D24kYZAW.js → Textarea-CdxxGwCO.js} +6 -6
- package/dist/{ViewTicketsEmbed-DByaBHeq.js → ViewTicketsEmbed-saRT7Ac-.js} +47 -46
- package/dist/{WarningCircleIcon-CbNmDN5r.js → WarningCircleIcon-CyE_Th8p.js} +1 -1
- package/dist/{WarningTriIcon-CZPGuEl3.js → WarningTriIcon-D1jwyRhA.js} +1 -1
- package/dist/action-test-id-DYsZDRVM.js +145 -0
- package/dist/api/gift-cards.d.ts +11 -2
- package/dist/{api-Cbbszsig.js → api-CAGahqGT.js} +21 -20
- package/dist/{copyToClipboard-DfqOeS1-.js → copyToClipboard-NTWYm45i.js} +1 -1
- package/dist/{createErrorGate.svelte-Ct8gFqvn.js → createErrorGate.svelte-B1UBm7Je.js} +1 -1
- package/dist/{de-DdgY9gjK.js → de-Cx6vl1bo.js} +1 -1
- package/dist/{defaultLabels-C7rJdC-m.js → defaultLabels-CAOGfi3n.js} +431 -605
- package/dist/{defaults-DBpwynsR.js → defaults-CPjpHdep.js} +2 -2
- package/dist/{event-B4F3zifd.js → event-BoPSP9Wq.js} +1 -1
- package/dist/{event-transform-rUtOP2f0.js → event-transform-tDqIHrb0.js} +5 -4
- package/dist/{eventStatusStream-CeFdF0pM.js → eventStatusStream-Cw6cAXYK.js} +2 -2
- package/dist/{href-C_CnchY7.js → href-DUImPiNg.js} +3 -3
- package/dist/{i18n-CEpacwpz.js → i18n-DvVKV8xP.js} +55 -54
- package/dist/i18n-urZE8FDd.js +28 -0
- package/dist/{id-DLwaroVD.js → id-KAEn4B4Q.js} +1 -1
- package/dist/{imageOptimizer-Cf0BbZJ7.js → imageOptimizer-Bz54wwZL.js} +40 -39
- package/dist/{it-CB7RtPbU.js → it-CQcRIzL4.js} +1 -1
- package/dist/{it-BzBtirlA.js → it-DmnGZl3R.js} +2 -2
- package/dist/{ja-Bg0GgXOg.js → ja-BrzmyaoG.js} +1 -1
- package/dist/keyboard-WUqlYI2l.js +55 -0
- package/dist/{ko-CTS9jPS0.js → ko-DY6ctJAC.js} +1 -1
- package/dist/locales/4.3.53/flow/it.js +1 -0
- package/dist/locales/4.3.53/main/de.js +1 -0
- package/dist/locales/4.3.53/main/id.js +1 -0
- package/dist/locales/4.3.53/main/it.js +1 -0
- package/dist/locales/{4.3.51 → 4.3.53}/main/ja.js +1 -1
- package/dist/locales/4.3.53/main/ko.js +1 -0
- package/dist/locales/4.3.53/main/pt-br.js +1 -0
- package/dist/locales/4.3.53/main/zh.js +1 -0
- package/dist/{order-totals-c3zn-HDr.js → order-totals-2arQgl1W.js} +4 -4
- package/dist/{orders-DZbxfNI9.js → orders-DKH_Ff_F.js} +22 -21
- package/dist/{pixels-CoXwcqE_.js → pixels-CoTj8WW9.js} +3 -3
- package/dist/{promo-X_5x9P0A.js → promo-77n6yQJ5.js} +3 -3
- package/dist/{pt-br-QgRkwqJk.js → pt-br-COrMoRiG.js} +1 -1
- package/dist/{scarcity-Do5MrSwn.js → scarcity-CSQqP7r6.js} +105 -104
- package/dist/seo/HostSeoController.d.ts +92 -1
- package/dist/seo/seo.cjs +1 -1
- package/dist/seo/seo.mjs +39 -6
- package/dist/seo/types.d.ts +13 -0
- package/dist/{serverTotals-6RxxdfwU.js → serverTotals-CygpqxZO.js} +8 -8
- package/dist/{showcase-state-options-nn-CiCd1.js → showcase-state-options-BSIYaeAC.js} +1 -1
- package/dist/{to-event-card-props-DwRTJ3x9.js → to-event-card-props-CcTZVm_k.js} +101 -186
- package/dist/types/index.d.ts +8 -0
- package/dist/{utils--rXGNV9Z.js → utils-CPYwV5uR.js} +3 -3
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +1507 -1423
- package/dist/venue-calendar.iife.js +37 -74
- package/dist/venue-calendar.umd.js +51 -51
- package/dist/{zh-CWmj934h.js → zh-Mf1aD1Qu.js} +1 -1
- package/package.json +220 -220
- package/dist/CartView-hWsZGkVQ.js +0 -2292
- package/dist/Checkout-BwxyqHY_.js +0 -1831
- package/dist/i18n-iYGbHTiH.js +0 -28
- package/dist/locales/4.3.51/flow/it.js +0 -1
- package/dist/locales/4.3.51/main/de.js +0 -1
- package/dist/locales/4.3.51/main/id.js +0 -1
- package/dist/locales/4.3.51/main/it.js +0 -1
- package/dist/locales/4.3.51/main/ko.js +0 -1
- package/dist/locales/4.3.51/main/pt-br.js +0 -1
- package/dist/locales/4.3.51/main/zh.js +0 -1
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/de.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/es.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/fr.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/id.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/ja.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/ko.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/nl.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/pl.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/tr.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/flow/zh.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/main/es.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/main/fr.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/main/nl.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/main/pl.js +0 -0
- /package/dist/locales/{4.3.51 → 4.3.53}/main/tr.js +0 -0
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
import { HostSeoControllerOptions } from './types';
|
|
1
|
+
import { EventTicketInput, HostSeoControllerOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* One show, as the listing hands it over.
|
|
4
|
+
*
|
|
5
|
+
* It used to be id/name/slug/startDateTime/image, because the ItemList it fed
|
|
6
|
+
* published nothing but a position and a URL. Everything below the image is
|
|
7
|
+
* what `buildEventJsonLd` needs to describe a show to a search engine — the
|
|
8
|
+
* end time, whether it is cancelled, what it costs, where it is. Every field
|
|
9
|
+
* is optional: an event that cannot be described falls back to a bare
|
|
10
|
+
* `ListItem` with a URL on it, exactly as before.
|
|
11
|
+
*/
|
|
2
12
|
interface ListingEvent {
|
|
3
13
|
id: number | string;
|
|
4
14
|
name: string;
|
|
5
15
|
slug?: string;
|
|
6
16
|
startDateTime?: string;
|
|
17
|
+
endDateTime?: string;
|
|
7
18
|
image?: string;
|
|
19
|
+
status?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
eventSummary?: string;
|
|
22
|
+
availableTickets?: EventTicketInput[];
|
|
23
|
+
/** The show's own zone, when it differs from the venue's. */
|
|
24
|
+
timeZone?: string;
|
|
8
25
|
}
|
|
9
26
|
interface VenueData {
|
|
10
27
|
name: string;
|
|
@@ -30,6 +47,15 @@ export declare class HostSeoController {
|
|
|
30
47
|
private _venueAddress;
|
|
31
48
|
private _venueTimeZone;
|
|
32
49
|
private _baseUrl;
|
|
50
|
+
/**
|
|
51
|
+
* Origin of the Micdrop site that server-renders `/e/{id}-{slug}`.
|
|
52
|
+
*
|
|
53
|
+
* This is the ONLY per-show URL in existence that a search engine can index:
|
|
54
|
+
* the host page has exactly one URL however many shows the widget draws on
|
|
55
|
+
* it. Empty means "not configured" — the structured data then points back at
|
|
56
|
+
* the host page and the shows are, for indexing purposes, invisible.
|
|
57
|
+
*/
|
|
58
|
+
private _publicSiteOrigin;
|
|
33
59
|
private _originals;
|
|
34
60
|
private _originalsSaved;
|
|
35
61
|
private _events;
|
|
@@ -38,11 +64,76 @@ export declare class HostSeoController {
|
|
|
38
64
|
private _injectJsonLd;
|
|
39
65
|
private _setMeta;
|
|
40
66
|
private _setCanonical;
|
|
67
|
+
/**
|
|
68
|
+
* The canonical for the "one show open" state: the host page's own.
|
|
69
|
+
*
|
|
70
|
+
* A page that already declares a canonical keeps it untouched — the host
|
|
71
|
+
* knows its own address better than we do (params it strips, a www variant it
|
|
72
|
+
* has settled on). One that declares none gets its bare address, never a
|
|
73
|
+
* query-string variant of it: the `?e={id}-{slug}` shape this replaces was a
|
|
74
|
+
* distinct URL to a crawler that RENDERED THE LISTING while the canonical
|
|
75
|
+
* claimed it was a show, which is the worst of the available answers.
|
|
76
|
+
*/
|
|
77
|
+
private _setEntityCanonical;
|
|
41
78
|
private _removeAllInjected;
|
|
42
79
|
private _restoreOriginals;
|
|
43
80
|
private _restoreMetaProperty;
|
|
44
81
|
private _restoreMetaName;
|
|
82
|
+
/**
|
|
83
|
+
* The canonical, server-rendered Micdrop page for one show:
|
|
84
|
+
* `{publicSiteOrigin}/e/{id}-{slug}`.
|
|
85
|
+
*
|
|
86
|
+
* This is what "a real link to a show" has to mean for a script embed. A
|
|
87
|
+
* search engine indexes URLs, and the host page has ONE — a link that only
|
|
88
|
+
* changes the host page's query string or fragment adds no show to any index,
|
|
89
|
+
* whatever it renders. `/e/{id}-{slug}` is a micdrop-frontend route that
|
|
90
|
+
* server-renders the show, so it is both crawlable without JavaScript and the
|
|
91
|
+
* page a buyer can finish an order on.
|
|
92
|
+
*
|
|
93
|
+
* Falls back to the in-place deep link when no public site origin is
|
|
94
|
+
* configured — a wrong origin would publish 404s, which is worse than
|
|
95
|
+
* publishing the host page.
|
|
96
|
+
*/
|
|
97
|
+
private _showPageUrl;
|
|
98
|
+
/**
|
|
99
|
+
* The host-page URL that re-opens this entity in place: `{host page}#{id}-{slug}`.
|
|
100
|
+
*
|
|
101
|
+
* THE HASH, NOT A QUERY PARAM, AND THAT IS THE WHOLE OF THIS FUNCTION. Every
|
|
102
|
+
* URL this controller published used to be `{host page}?e={id}-{slug}` (or
|
|
103
|
+
* `?s=` / `?c=`), and the embed does not read `?e=`: `parseDeepLink` in
|
|
104
|
+
* VenueCalendar.js reads `window.location.hash`, and `WidgetUrlManager`
|
|
105
|
+
* writes it. The only place `?e=` is handled at all is the hosted SvelteKit
|
|
106
|
+
* app's `routes/+page.svelte`, which is a different origin from any venue's
|
|
107
|
+
* site. So the canonical URL, the `og:url` and every ItemList entry named a
|
|
108
|
+
* URL that opened the LISTING — never the show it claimed to be.
|
|
109
|
+
*/
|
|
110
|
+
private _entityDeepLink;
|
|
111
|
+
/**
|
|
112
|
+
* ItemList for the listing, with each show's own structured data nested in
|
|
113
|
+
* its ListItem.
|
|
114
|
+
*
|
|
115
|
+
* It used to publish a position and a URL per show and nothing else, which
|
|
116
|
+
* told a search engine that N things exist and not one fact about any of
|
|
117
|
+
* them. Each item now carries the full `Event` object — name, start, venue,
|
|
118
|
+
* postal address, offers, image — through the same builder the entity view
|
|
119
|
+
* and micdrop-frontend's own hosted site pages use, so the listing and the
|
|
120
|
+
* show page cannot describe the same show differently.
|
|
121
|
+
*
|
|
122
|
+
* An event `buildEventJsonLd` refuses (no name, no start, no venue name)
|
|
123
|
+
* degrades to the bare `ListItem` + `url` shape rather than emitting a
|
|
124
|
+
* half-built Event: an incomplete Event is a structured-data error, an
|
|
125
|
+
* unadorned ListItem is merely quiet.
|
|
126
|
+
*/
|
|
45
127
|
private _buildItemList;
|
|
128
|
+
/**
|
|
129
|
+
* The URL for the entity the visitor has open: the canonical Micdrop show
|
|
130
|
+
* page when one exists, so `og:url` and `<link rel="canonical">` name a page
|
|
131
|
+
* that actually renders this show rather than the host page's listing.
|
|
132
|
+
*
|
|
133
|
+
* Series and collections have no `/e/` page of their own, so they keep the
|
|
134
|
+
* in-place deep link — a link that reopens them where the visitor is, which
|
|
135
|
+
* is at least true.
|
|
136
|
+
*/
|
|
46
137
|
private _buildEntityUrl;
|
|
47
138
|
/**
|
|
48
139
|
* Called when events finish loading from the API.
|
package/dist/seo/seo.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(){return`America/Los_Angeles`}var t=/<\/(?:p|div|h[1-6]|li|ul|ol|blockquote|tr)>/gi,n=/<br\s*\/?>/gi,r=/<[^>]*>/g,i={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`,"'":`'`," ":` `};function a(e){return e.replace(/&#x([0-9a-f]+);/gi,(e,t)=>o(parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>o(Number(t))).replace(/&[a-z0-9]+;/gi,e=>i[e.toLowerCase()]??e)}function o(e){return Number.isFinite(e)&&e>0&&e<=1114111?String.fromCodePoint(e):``}function s(e,i){if(!e)return``;let o=String(e).replace(n,` `).replace(t,` `).replace(r,``);if(o=a(o).replace(/\s+/g,` `).trim(),i&&i>0&&o.length>i){let e=o.slice(0,i),t=e.lastIndexOf(` `);o=(t>40?e.slice(0,t):e).trimEnd()+`…`}return o}function c(){return new Date}var l=class extends Error{constructor(e,t,n={}){super(e),this.name=`AppError`,this.code=t,this.status=n.status??500,this.details=n.details,this.timestamp=c(),this.recoverable=n.recoverable??!0,this.cause=n.cause,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,code:this.code,message:this.message,status:this.status,details:this.details,timestamp:this.timestamp.toISOString(),recoverable:this.recoverable,stack:this.stack,cause:this.cause?.message}}getUserMessage(e){return this.message}isRetryable(){return this.recoverable}},u=class extends l{constructor(e,t,n={}){super(e,t,{status:422,recoverable:!1,...n}),this.name=`ValueGuardError`}},d=class extends u{constructor(e,t,n){super(e,t,{details:n}),this.name=`DateTimeError`}},f;(function(e){e.INVALID_TIMEZONE=`INVALID_TIMEZONE`,e.INVALID_ISO_STRING=`INVALID_ISO_STRING`,e.INVALID_DATE=`INVALID_DATE`,e.INVALID_TIME=`INVALID_TIME`,e.MISSING_TIMEZONE=`MISSING_TIMEZONE`,e.PARSE_ERROR=`PARSE_ERROR`})(f||={});function p(e,t,n,r=0,i=0,a=0){let o=new Date(Date.UTC(e,t-1,n,r,i,a));return e>=0&&e<=99&&o.setUTCFullYear(e),o}var m=/^(\d{4})-(\d{2})-(\d{2})(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2}))?$/,h=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/;function g(e,t,n){let r=p(e,t,n);return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}var _=/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))? ?([+-])(\d{2}):?(\d{2})(?: [A-Za-z][A-Za-z0-9_/+-]*)?(?: m=[+-][\d.]+)?$/,v=p(1,1,1).getTime();function y(e){let t=m.exec(e);if(t){let[,n,r,i]=t;return{iso:e,year:+n,month:+r,day:+i}}let n=_.exec(e);if(n){let[,e,t,r,i,a,o,s,c,l,u]=n;return{iso:`${e}-${t}-${r}T${i}:${a}:${o}${s?`.${s.slice(0,3).padEnd(3,`0`)}`:``}${c}${l}:${u}`,year:+e,month:+t,day:+r}}return null}function b(e){if(typeof e==`number`){if(!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e!=`string`)return null;let t=y(e.trim());if(!t||!g(t.year,t.month,t.day))return null;let n=new Date(t.iso);return Number.isNaN(n.getTime())?null:n}function x(e){let t=b(e);return t!==null&&t.getTime()===v}function S(e,t){if(e.getTime()===v)throw new d(`toInstant: ${JSON.stringify(t)} is the backend's UNSET marker (Go's zero time.Time), not a moment — the field was never filled in. toInstant is the REQUIRED-timestamp door, so an unset value here is a bug: returning the year-1 instant it names would sort this row ahead of every real date and answer "yes" to "has this started?". If the field is allowed to be unset, read it with toInstantOrNull (null), ask isAbsentTimestamp why it is missing, and order it with compareWireInstants.`,f.INVALID_ISO_STRING,{value:t})}function C(e,t){if(!(e instanceof Date)||Number.isNaN(e.getTime()))throw new d(`${t} must be a valid Date`,f.INVALID_DATE,{value:e})}function w(e,t){return C(e,`compareInstants(a)`),C(t,`compareInstants(b)`),e.getTime()-t.getTime()}function T(e){if(typeof e==`number`){if(!Number.isFinite(e))throw new d(`toInstant: epoch milliseconds must be a finite number, got ${e}`,f.INVALID_DATE,{value:e});let t=new Date(e);return C(t,`toInstant(value)`),S(t,e),t}if(typeof e!=`string`||e.trim()===``)throw new d(`toInstant: a UTC ISO timestamp or epoch ms is required, got ${JSON.stringify(e)}`,typeof e==`string`?f.INVALID_ISO_STRING:f.INVALID_DATE,{value:e});let t=y(e);if(!t)throw h.test(e)?new d(`toInstant: ${JSON.stringify(e)} carries a time but no timezone, so it is not an instant — it would resolve on the viewer's clock and land on a different calendar day for a viewer in Los Angeles than one in London. Send a UTC wire timestamp (2026-06-09T20:00:00Z) or an explicit offset (2026-06-09T13:00:00-07:00). If this is a local wall-clock value, it belongs in datetime/local or parseLocalToUTC(value, timezone), not here.`,f.MISSING_TIMEZONE,{value:e}):new d(`toInstant: not an ISO-8601 timestamp: ${JSON.stringify(e)}`,f.INVALID_ISO_STRING,{value:e});let{year:n,month:r,day:i}=t;if(!g(n,r,i))throw new d(`toInstant: ${n}-${r}-${i} is not a real calendar date: ${JSON.stringify(e)}`,f.INVALID_ISO_STRING,{value:e});let a=new Date(t.iso);if(Number.isNaN(a.getTime()))throw new d(`toInstant: ISO-8601 shaped but not a real instant: ${JSON.stringify(e)}`,f.INVALID_ISO_STRING,{value:e});return S(a,e),a}function E(e){if(e==null||typeof e==`string`&&e.trim()===``||x(e))return null;try{return T(e)}catch{return null}}function D(e){return Math.round((e+2**-52)*100)/100}function O(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function k(e){let t=O(e?.price);return t===null?null:t===0?0:D(t+(O(e?.fee)??0))}var A={VISIBLE:0,HIDDEN:1,PROMO_ONLY:2};function j(e){return e.replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/&/g,`\\u0026`)}function M(t,n){if(!t)return null;let r=new Date(t);if(isNaN(r.getTime()))return null;let i={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZoneName:`shortOffset`},a;try{a=new Intl.DateTimeFormat(`en-US`,{...i,timeZone:n})}catch{a=new Intl.DateTimeFormat(`en-US`,{...i,timeZone:e()})}let o=a.formatToParts(r),s=e=>o.find(t=>t.type===e)?.value||``,c=s(`year`),l=s(`month`),u=s(`day`),d=s(`hour`),f=s(`minute`),p=s(`second`),m=s(`timeZoneName`),h=`+00:00`;if(m){let e=m.match(/GMT([+-])(\d+)(?::(\d+))?/);e&&(h=`${e[1]}${e[2].padStart(2,`0`)}:${e[3]||`00`}`)}return`${c}-${l}-${u}T${d}:${f}:${p}${h}`}function N(e){if(!e)return null;let t=e.split(`,`).map(e=>e.trim());if(t.length<2)return{"@type":`PostalAddress`,streetAddress:e,addressCountry:`US`};let n=t[t.length-1].match(/^([A-Z]{2})\s+(\d{5}(?:-\d{4})?)$/);return n&&t.length>=3?{"@type":`PostalAddress`,streetAddress:t.slice(0,-2).join(`, `),addressLocality:t[t.length-2],addressRegion:n[1],postalCode:n[2],addressCountry:`US`}:{"@type":`PostalAddress`,streetAddress:t[0],addressLocality:t.slice(1).join(`, `),addressCountry:`US`}}function P(e,t){if(e&&(e.city||e.state||e.postalCode)){let t={"@type":`PostalAddress`};return e.address&&(t.streetAddress=e.address),e.city&&(t.addressLocality=e.city),e.state&&(t.addressRegion=e.state),e.postalCode&&(t.postalCode=e.postalCode),t.addressCountry=e.country||`US`,t}return N(e&&e.address||t||null)}function F(e){if(!e)return`https://schema.org/EventScheduled`;let t=e.toLowerCase();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`}function I(e){if((e.remainingCapacity??e.quantityRemaining??e.quantity)===0||e.soldOut)return`https://schema.org/SoldOut`;let t=c(),n=E(e.salesBegin||e.salesStart||e.saleBegin||e.onSaleStart),r=E(e.salesEnd||e.saleEnd||e.onSaleEnd);return n&&w(n,t)>0?`https://schema.org/PreOrder`:r&&w(r,t)<0?`https://schema.org/SoldOut`:`https://schema.org/InStock`}function L(e,t,n,r={}){return e===t?{"@type":`Offer`,price:e,priceCurrency:`USD`,availability:n,...r}:{"@type":`AggregateOffer`,lowPrice:e,highPrice:t,priceCurrency:`USD`,availability:n,...r}}function R(e,t){if(!e||e.length===0)return null;let n=e.filter(e=>{let t=(e.visibility??0)<A.HIDDEN,n=e.salesChannel!==2;return t&&n});if(n.length===0)return null;let r=n.map(e=>k({price:e.price,fee:e.fee})).filter(e=>e!=null);if(r.length===0)return null;let i=Math.min(...r),a=Math.max(...r),o=n[0];return L(i,a,I(o),{url:t||void 0,validFrom:o?.salesBegin||o?.salesStart||void 0})}function z(e){if(!e||e.length===0)return null;let t=e.filter(e=>{let t=e.acceptedState===2,n=!e.shouldBeHidden,r=e.RosterPerformer?.User?.performerProfile,i=r?.firstName||r?.lastName||r?.displayName;return t&&n&&i});return t.length===0?null:t.map(e=>{let t=e.RosterPerformer?.User?.performerProfile;return{"@type":`PerformingGroup`,name:t?.displayName||[t?.firstName,t?.lastName].filter(Boolean).join(` `)}})}function B(t){let{event:n,venue:r,venueTimeZone:i=e(),eventUrl:a,organizer:o}=t;if(!n)return null;let c=M(n.startDateTime,i);if(!n.name||!c||!r?.name)return null;let l=P(r,r?.googleLocationNameCache),u={"@type":`Place`,name:r.name};l&&(u.address=l);let d={"@context":`https://schema.org`,"@type":`Event`,name:n.name,startDate:c,eventStatus:F(n.status),eventAttendanceMode:`https://schema.org/OfflineEventAttendanceMode`,location:u},f=M(n.endDateTime,i);f&&(d.endDate=f);let p=s(n.description)||n.eventSummary;p&&(d.description=p);let m=n.image||n.coverImage||n.ShowImage;m&&(d.image=[m]);let h=R(n.availableTickets,a);h&&(d.offers=h);let g=z(n.performers);if(g&&g.length>0&&(d.performer=g),o?.name){let e={"@type":`Organization`,name:o.name};o.url&&(e.url=o.url),d.organizer=e}return a&&(d.url=a),d}function V(e){switch(e){case`available`:return`https://schema.org/InStock`;case`sold_out`:return`https://schema.org/SoldOut`;case`coming_soon`:return`https://schema.org/PreOrder`;case`ended`:return`https://schema.org/SoldOut`;default:return`https://schema.org/InStock`}}function H(e,t){if(!e||e.length===0)return null;let n=e.filter(e=>e.status!==`sold_out`&&e.status!==`ended`);if(n.length===0){let t=e.map(e=>e.price).filter(e=>!isNaN(e));return t.length===0?null:L(Math.min(...t),Math.max(...t),`https://schema.org/SoldOut`)}let r=n.map(e=>e.price).filter(e=>!isNaN(e));return r.length===0?null:L(Math.min(...r),Math.max(...r),V(n[0].status))}function U(e){let{series:t,baseEventUrl:n}=e;if(!t.title||!t.occurrences||t.occurrences.length===0||!t.venue?.name)return null;let r=P(t.venue,t.venue.googleLocationNameCache),i={"@type":`Place`,name:t.venue.name};r&&(i.address=r);let a={"@context":`https://schema.org`,"@type":`EventSeries`,name:t.title,location:i},o=s(t.description)||t.eventSummary;o&&(a.description=o),t.image&&(a.image=[t.image]);let c=t.performers?.filter(e=>e.displayName);c&&c.length>0&&(a.performer=c.map(e=>({"@type":`PerformingGroup`,name:e.displayName})));let l=[];for(let e of t.occurrences){let r=M(e.startDateTime,t.timeZone);if(!r)continue;let a={"@type":`Event`,name:e.title,startDate:r,eventStatus:F(e.status),location:i};n&&(a[`@id`]=`${n}/${e.id}-${e.slug}`);let o=M(e.endDateTime,t.timeZone);o&&(a.endDate=o);let s=H(e.tickets,e.status);s&&(a.offers=s),l.push(a)}return l.length===0?null:(a.subEvent=l,a)}function W(e){let{collection:t,baseEventUrl:n}=e;if(!t.collectionTitle||!t.events||t.events.length===0)return null;let r=[];for(let e of t.events){if(!e.title)continue;let t={"@type":`ListItem`,position:r.length+1,name:e.title};n&&(t.url=e.slug?`${n}/${e.id}-${e.slug}`:`${n}/${e.id}`),r.push(t)}if(r.length===0)return null;let i={"@context":`https://schema.org`,"@type":`CollectionPage`,name:t.collectionTitle},a=s(t.description)||t.summary;return a&&(i.description=a),t.coverImage&&(i.image=[t.coverImage]),i.mainEntity={"@type":`ItemList`,numberOfItems:r.length,itemListElement:r},i}var G=70;function K(e){return e.normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,G).replace(/-+$/g,``)}var q=class t{static _activeInstance=null;static shared(e){let n=t._activeInstance;return n?(n._holders+=1,n):new t(e)}_state=`idle`;_holders=1;_venueName;_venueAddress;_venueTimeZone;_baseUrl;_originals=null;_originalsSaved=!1;_events=[];constructor(n){typeof document>`u`||(t._activeInstance&&t._activeInstance!==this&&t._activeInstance._teardown(),this._venueName=n.venueName,this._venueAddress=n.venueAddress,this._venueTimeZone=n.venueTimeZone||e(),this._baseUrl=n.baseUrl||window.location.origin+window.location.pathname,this._saveOriginals(),t._activeInstance=this)}_saveOriginals(){if(this._originalsSaved)return;let e=document.querySelector(`link[rel="canonical"]`),t=document.querySelector(`meta[property="og:title"]`),n=document.querySelector(`meta[property="og:description"]`),r=document.querySelector(`meta[property="og:image"]`),i=document.querySelector(`meta[property="og:url"]`),a=document.querySelector(`meta[property="og:type"]`),o=document.querySelector(`meta[name="description"]`);this._originals={title:document.title,canonicalHref:e?.getAttribute(`href`)??null,ogTitle:t?.getAttribute(`content`)??null,ogDescription:n?.getAttribute(`content`)??null,ogImage:r?.getAttribute(`content`)??null,ogUrl:i?.getAttribute(`content`)??null,ogType:a?.getAttribute(`content`)??null,metaDescription:o?.getAttribute(`content`)??null},this._originalsSaved=!0}_injectJsonLd(e){if(typeof document>`u`)return;document.querySelectorAll(`script[data-micdrop="jsonld"]`).forEach(e=>e.remove());let t=document.createElement(`script`);t.setAttribute(`type`,`application/ld+json`),t.setAttribute(`data-micdrop`,`jsonld`),t.textContent=JSON.stringify(e),document.head.appendChild(t)}_setMeta(e,t){if(!(typeof document>`u`)){if(e.startsWith(`og:`)){let n=document.querySelector(`meta[property="${e}"]`);n?n.setAttribute(`content`,t):(n=document.createElement(`meta`),n.setAttribute(`property`,e),n.setAttribute(`content`,t),n.setAttribute(`data-micdrop`,`og`),document.head.appendChild(n))}else{let n=document.querySelector(`meta[name="${e}"]`);n?n.setAttribute(`content`,t):(n=document.createElement(`meta`),n.setAttribute(`name`,e),n.setAttribute(`content`,t),n.setAttribute(`data-micdrop`,`meta`),document.head.appendChild(n))}}}_setCanonical(e){if(typeof document>`u`)return;let t=document.querySelector(`link[rel="canonical"]`);t?t.setAttribute(`href`,e):(t=document.createElement(`link`),t.setAttribute(`rel`,`canonical`),t.setAttribute(`href`,e),t.setAttribute(`data-micdrop`,`canonical`),document.head.appendChild(t))}_removeAllInjected(){typeof document>`u`||document.querySelectorAll(`[data-micdrop]`).forEach(e=>e.remove())}_restoreOriginals(){if(!(typeof document>`u`||!this._originals)){if(document.title=this._originals.title,this._originals.canonicalHref!==null){let e=document.querySelector(`link[rel="canonical"]`);e&&e.setAttribute(`href`,this._originals.canonicalHref)}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}}_restoreMetaProperty(e,t){let n=document.querySelector(`meta[property="${e}"]`);t!==null&&n?n.setAttribute(`content`,t):t===null&&n?.hasAttribute(`data-micdrop`)&&n.remove()}_restoreMetaName(e,t){let n=document.querySelector(`meta[name="${e}"]`);t!==null&&n?n.setAttribute(`content`,t):t===null&&n?.hasAttribute(`data-micdrop`)&&n.remove()}_buildItemList(e){return{"@context":`https://schema.org`,"@type":`ItemList`,itemListElement:e.map((e,t)=>{let n=e.slug||K(e.name||``);return{"@type":`ListItem`,position:t+1,url:`${this._baseUrl}?e=${e.id}-${n}`}})}}_buildEntityUrl(e,t,n){let r=e===`event`?`e`:e===`series`?`s`:`c`;return`${this._baseUrl}?${r}=${t}-${n}`}onEventsLoaded(e,t){if(typeof document>`u`||this._state===`destroyed`)return;if(t){this._venueName=t.name||this._venueName,this._venueAddress=t.address||t.googleLocationNameCache||this._venueAddress;let e=t.timeZone||t.timezone;e&&(this._venueTimeZone=e)}this._events=e;let n=this._buildItemList(e);this._injectJsonLd(n),this._state=`listing`}onEntitySelected(e,t,n){if(typeof document>`u`||this._state===`destroyed`)return;if(this._saveOriginals(),n){this._venueName=n.name||this._venueName,this._venueAddress=n.address||n.googleLocationNameCache||this._venueAddress;let e=n.timeZone||n.timezone;e&&(this._venueTimeZone=e)}let r=null,i=``,a=``,o=``,c=``,l=``;if(e===`event`){let e=t.slug||K(t.name||``);l=this._buildEntityUrl(`event`,t.id||t.eventID||``,e),r=B({event:t,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},venueTimeZone:this._venueTimeZone,eventUrl:l}),i=t.name||``,a=t.description||``,o=t.eventSummary||``,c=t.image||t.coverImage||t.ShowImage||``}else if(e===`series`){let e=t.slug||K(t.title||``);l=this._buildEntityUrl(`series`,t.id||``,e),r=U({series:{...t,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},timeZone:this._venueTimeZone},baseEventUrl:l}),i=t.title||``,a=t.description||``,o=t.eventSummary||``,c=t.image||``}else if(e===`collection`){let e=t.slug||K(t.collectionTitle||``);l=this._buildEntityUrl(`collection`,t.id||``,e),r=W({collection:t,baseEventUrl:l,defaultTimeZone:this._venueTimeZone}),i=t.collectionTitle||``,a=t.description||``,o=t.summary||``,c=t.coverImage||``}r&&this._injectJsonLd(r),l&&this._setCanonical(l),i&&this._setMeta(`og:title`,i);let u=s(a,160)||s(o,160);u?this._setMeta(`og:description`,u):this._restoreMetaProperty(`og:description`,this._originals?.ogDescription??null),c&&this._setMeta(`og:image`,c),l&&this._setMeta(`og:url`,l),this._setMeta(`og:type`,`website`),this._setMeta(`twitter:card`,`summary_large_image`),u?this._setMeta(`description`,u):this._restoreMetaName(`description`,this._originals?.metaDescription??null),i&&(document.title=`${i} | ${this._venueName}`),this._state=`entity`}onBackToListing(){if(!(typeof document>`u`)&&this._state!==`destroyed`){if(this._restoreOriginals(),this._removeAllInjected(),this._events.length>0){let e=this._buildItemList(this._events);this._injectJsonLd(e)}this._saveOriginals(),this._state=`listing`}}destroy(){if(this._holders>1){--this._holders;return}this._teardown()}_teardown(){typeof document>`u`||this._state!==`destroyed`&&(this._removeAllInjected(),this._restoreOriginals(),t._activeInstance===this&&(t._activeInstance=null),this._state=`destroyed`)}};exports.HostSeoController=q,exports.buildCollectionJsonLd=W,exports.buildEventJsonLd=B,exports.buildOffers=R,exports.buildPerformers=z,exports.buildPostalAddress=P,exports.buildSeriesJsonLd=U,exports.escapeJsonLdForScript=j,exports.formatDateTimeWithOffset=M,exports.getEventStatus=F,exports.getTicketAvailability=I,exports.parseAddressToPostal=N;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(){return`America/Los_Angeles`}var t=/<\/(?:p|div|h[1-6]|li|ul|ol|blockquote|tr)>/gi,n=/<br\s*\/?>/gi,r=/<[^>]*>/g,i={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`,"'":`'`," ":` `};function a(e){return e.replace(/&#x([0-9a-f]+);/gi,(e,t)=>o(parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>o(Number(t))).replace(/&[a-z0-9]+;/gi,e=>i[e.toLowerCase()]??e)}function o(e){return Number.isFinite(e)&&e>0&&e<=1114111?String.fromCodePoint(e):``}function s(e,i){if(!e)return``;let o=String(e).replace(n,` `).replace(t,` `).replace(r,``);if(o=a(o).replace(/\s+/g,` `).trim(),i&&i>0&&o.length>i){let e=o.slice(0,i),t=e.lastIndexOf(` `);o=(t>40?e.slice(0,t):e).trimEnd()+`…`}return o}function c(){return new Date}var l=class extends Error{constructor(e,t,n={}){super(e),this.name=`AppError`,this.code=t,this.status=n.status??500,this.details=n.details,this.timestamp=c(),this.recoverable=n.recoverable??!0,this.cause=n.cause,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,code:this.code,message:this.message,status:this.status,details:this.details,timestamp:this.timestamp.toISOString(),recoverable:this.recoverable,stack:this.stack,cause:this.cause?.message}}getUserMessage(e){return this.message}isRetryable(){return this.recoverable}},u=class extends l{constructor(e,t,n={}){super(e,t,{status:422,recoverable:!1,...n}),this.name=`ValueGuardError`}},d=class extends u{constructor(e,t,n){super(e,t,{details:n}),this.name=`DateTimeError`}},f;(function(e){e.INVALID_TIMEZONE=`INVALID_TIMEZONE`,e.INVALID_ISO_STRING=`INVALID_ISO_STRING`,e.INVALID_DATE=`INVALID_DATE`,e.INVALID_TIME=`INVALID_TIME`,e.MISSING_TIMEZONE=`MISSING_TIMEZONE`,e.PARSE_ERROR=`PARSE_ERROR`})(f||={});function p(e,t,n,r=0,i=0,a=0){let o=new Date(Date.UTC(e,t-1,n,r,i,a));return e>=0&&e<=99&&o.setUTCFullYear(e),o}var m=/^(\d{4})-(\d{2})-(\d{2})(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2}))?$/,h=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/;function g(e,t,n){let r=p(e,t,n);return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}var _=/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))? ?([+-])(\d{2}):?(\d{2})(?: [A-Za-z][A-Za-z0-9_/+-]*)?(?: m=[+-][\d.]+)?$/,v=p(1,1,1).getTime();function y(e){let t=m.exec(e);if(t){let[,n,r,i]=t;return{iso:e,year:+n,month:+r,day:+i}}let n=_.exec(e);if(n){let[,e,t,r,i,a,o,s,c,l,u]=n;return{iso:`${e}-${t}-${r}T${i}:${a}:${o}${s?`.${s.slice(0,3).padEnd(3,`0`)}`:``}${c}${l}:${u}`,year:+e,month:+t,day:+r}}return null}function b(e){if(typeof e==`number`){if(!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e!=`string`)return null;let t=y(e.trim());if(!t||!g(t.year,t.month,t.day))return null;let n=new Date(t.iso);return Number.isNaN(n.getTime())?null:n}function x(e){let t=b(e);return t!==null&&t.getTime()===v}function S(e,t){if(e.getTime()===v)throw new d(`toInstant: ${JSON.stringify(t)} is the backend's UNSET marker (Go's zero time.Time), not a moment — the field was never filled in. toInstant is the REQUIRED-timestamp door, so an unset value here is a bug: returning the year-1 instant it names would sort this row ahead of every real date and answer "yes" to "has this started?". If the field is allowed to be unset, read it with toInstantOrNull (null), ask isAbsentTimestamp why it is missing, and order it with compareWireInstants.`,f.INVALID_ISO_STRING,{value:t})}function C(e,t){if(!(e instanceof Date)||Number.isNaN(e.getTime()))throw new d(`${t} must be a valid Date`,f.INVALID_DATE,{value:e})}function w(e,t){return C(e,`compareInstants(a)`),C(t,`compareInstants(b)`),e.getTime()-t.getTime()}function T(e){if(typeof e==`number`){if(!Number.isFinite(e))throw new d(`toInstant: epoch milliseconds must be a finite number, got ${e}`,f.INVALID_DATE,{value:e});let t=new Date(e);return C(t,`toInstant(value)`),S(t,e),t}if(typeof e!=`string`||e.trim()===``)throw new d(`toInstant: a UTC ISO timestamp or epoch ms is required, got ${JSON.stringify(e)}`,typeof e==`string`?f.INVALID_ISO_STRING:f.INVALID_DATE,{value:e});let t=y(e);if(!t)throw h.test(e)?new d(`toInstant: ${JSON.stringify(e)} carries a time but no timezone, so it is not an instant — it would resolve on the viewer's clock and land on a different calendar day for a viewer in Los Angeles than one in London. Send a UTC wire timestamp (2026-06-09T20:00:00Z) or an explicit offset (2026-06-09T13:00:00-07:00). If this is a local wall-clock value, it belongs in datetime/local or parseLocalToUTC(value, timezone), not here.`,f.MISSING_TIMEZONE,{value:e}):new d(`toInstant: not an ISO-8601 timestamp: ${JSON.stringify(e)}`,f.INVALID_ISO_STRING,{value:e});let{year:n,month:r,day:i}=t;if(!g(n,r,i))throw new d(`toInstant: ${n}-${r}-${i} is not a real calendar date: ${JSON.stringify(e)}`,f.INVALID_ISO_STRING,{value:e});let a=new Date(t.iso);if(Number.isNaN(a.getTime()))throw new d(`toInstant: ISO-8601 shaped but not a real instant: ${JSON.stringify(e)}`,f.INVALID_ISO_STRING,{value:e});return S(a,e),a}function E(e){if(e==null||typeof e==`string`&&e.trim()===``||x(e))return null;try{return T(e)}catch{return null}}function D(e){return Math.round((e+2**-52)*100)/100}function O(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function k(e){let t=O(e?.price);return t===null?null:t===0?0:D(t+(O(e?.fee)??0))}var A={VISIBLE:0,HIDDEN:1,PROMO_ONLY:2};function j(e){return e.replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/&/g,`\\u0026`)}function M(t,n){if(!t)return null;let r=new Date(t);if(isNaN(r.getTime()))return null;let i={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1,timeZoneName:`shortOffset`},a;try{a=new Intl.DateTimeFormat(`en-US`,{...i,timeZone:n})}catch{a=new Intl.DateTimeFormat(`en-US`,{...i,timeZone:e()})}let o=a.formatToParts(r),s=e=>o.find(t=>t.type===e)?.value||``,c=s(`year`),l=s(`month`),u=s(`day`),d=s(`hour`),f=s(`minute`),p=s(`second`),m=s(`timeZoneName`),h=`+00:00`;if(m){let e=m.match(/GMT([+-])(\d+)(?::(\d+))?/);e&&(h=`${e[1]}${e[2].padStart(2,`0`)}:${e[3]||`00`}`)}return`${c}-${l}-${u}T${d}:${f}:${p}${h}`}function N(e){if(!e)return null;let t=e.split(`,`).map(e=>e.trim());if(t.length<2)return{"@type":`PostalAddress`,streetAddress:e,addressCountry:`US`};let n=t[t.length-1].match(/^([A-Z]{2})\s+(\d{5}(?:-\d{4})?)$/);return n&&t.length>=3?{"@type":`PostalAddress`,streetAddress:t.slice(0,-2).join(`, `),addressLocality:t[t.length-2],addressRegion:n[1],postalCode:n[2],addressCountry:`US`}:{"@type":`PostalAddress`,streetAddress:t[0],addressLocality:t.slice(1).join(`, `),addressCountry:`US`}}function P(e,t){if(e&&(e.city||e.state||e.postalCode)){let t={"@type":`PostalAddress`};return e.address&&(t.streetAddress=e.address),e.city&&(t.addressLocality=e.city),e.state&&(t.addressRegion=e.state),e.postalCode&&(t.postalCode=e.postalCode),t.addressCountry=e.country||`US`,t}return N(e&&e.address||t||null)}function F(e){if(!e)return`https://schema.org/EventScheduled`;let t=e.toLowerCase();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`}function I(e){if((e.remainingCapacity??e.quantityRemaining??e.quantity)===0||e.soldOut)return`https://schema.org/SoldOut`;let t=c(),n=E(e.salesBegin||e.salesStart||e.saleBegin||e.onSaleStart),r=E(e.salesEnd||e.saleEnd||e.onSaleEnd);return n&&w(n,t)>0?`https://schema.org/PreOrder`:r&&w(r,t)<0?`https://schema.org/SoldOut`:`https://schema.org/InStock`}function L(e,t,n,r={}){return e===t?{"@type":`Offer`,price:e,priceCurrency:`USD`,availability:n,...r}:{"@type":`AggregateOffer`,lowPrice:e,highPrice:t,priceCurrency:`USD`,availability:n,...r}}function R(e,t){if(!e||e.length===0)return null;let n=e.filter(e=>{let t=(e.visibility??0)<A.HIDDEN,n=e.salesChannel!==2;return t&&n});if(n.length===0)return null;let r=n.map(e=>k({price:e.price,fee:e.fee})).filter(e=>e!=null);if(r.length===0)return null;let i=Math.min(...r),a=Math.max(...r),o=n[0];return L(i,a,I(o),{url:t||void 0,validFrom:o?.salesBegin||o?.salesStart||void 0})}function z(e){if(!e||e.length===0)return null;let t=e.filter(e=>{let t=e.acceptedState===2,n=!e.shouldBeHidden,r=e.RosterPerformer?.User?.performerProfile,i=r?.firstName||r?.lastName||r?.displayName;return t&&n&&i});return t.length===0?null:t.map(e=>{let t=e.RosterPerformer?.User?.performerProfile;return{"@type":`PerformingGroup`,name:t?.displayName||[t?.firstName,t?.lastName].filter(Boolean).join(` `)}})}function B(t){let{event:n,venue:r,venueTimeZone:i=e(),eventUrl:a,organizer:o}=t;if(!n)return null;let c=M(n.startDateTime,i);if(!n.name||!c||!r?.name)return null;let l=P(r,r?.googleLocationNameCache),u={"@type":`Place`,name:r.name};l&&(u.address=l);let d={"@context":`https://schema.org`,"@type":`Event`,name:n.name,startDate:c,eventStatus:F(n.status),eventAttendanceMode:`https://schema.org/OfflineEventAttendanceMode`,location:u},f=M(n.endDateTime,i);f&&(d.endDate=f);let p=s(n.description)||n.eventSummary;p&&(d.description=p);let m=n.image||n.coverImage||n.ShowImage;m&&(d.image=[m]);let h=R(n.availableTickets,a);h&&(d.offers=h);let g=z(n.performers);if(g&&g.length>0&&(d.performer=g),o?.name){let e={"@type":`Organization`,name:o.name};o.url&&(e.url=o.url),d.organizer=e}return a&&(d.url=a),d}function V(e){switch(e){case`available`:return`https://schema.org/InStock`;case`sold_out`:return`https://schema.org/SoldOut`;case`coming_soon`:return`https://schema.org/PreOrder`;case`ended`:return`https://schema.org/SoldOut`;default:return`https://schema.org/InStock`}}function H(e,t){if(!e||e.length===0)return null;let n=e.filter(e=>e.status!==`sold_out`&&e.status!==`ended`);if(n.length===0){let t=e.map(e=>e.price).filter(e=>!isNaN(e));return t.length===0?null:L(Math.min(...t),Math.max(...t),`https://schema.org/SoldOut`)}let r=n.map(e=>e.price).filter(e=>!isNaN(e));return r.length===0?null:L(Math.min(...r),Math.max(...r),V(n[0].status))}function U(e){let{series:t,baseEventUrl:n}=e;if(!t.title||!t.occurrences||t.occurrences.length===0||!t.venue?.name)return null;let r=P(t.venue,t.venue.googleLocationNameCache),i={"@type":`Place`,name:t.venue.name};r&&(i.address=r);let a={"@context":`https://schema.org`,"@type":`EventSeries`,name:t.title,location:i},o=s(t.description)||t.eventSummary;o&&(a.description=o),t.image&&(a.image=[t.image]);let c=t.performers?.filter(e=>e.displayName);c&&c.length>0&&(a.performer=c.map(e=>({"@type":`PerformingGroup`,name:e.displayName})));let l=[];for(let e of t.occurrences){let r=M(e.startDateTime,t.timeZone);if(!r)continue;let a={"@type":`Event`,name:e.title,startDate:r,eventStatus:F(e.status),location:i};n&&(a[`@id`]=`${n}/${e.id}-${e.slug}`);let o=M(e.endDateTime,t.timeZone);o&&(a.endDate=o);let s=H(e.tickets,e.status);s&&(a.offers=s),l.push(a)}return l.length===0?null:(a.subEvent=l,a)}function W(e){let{collection:t,baseEventUrl:n}=e;if(!t.collectionTitle||!t.events||t.events.length===0)return null;let r=[];for(let e of t.events){if(!e.title)continue;let t={"@type":`ListItem`,position:r.length+1,name:e.title};n&&(t.url=e.slug?`${n}/${e.id}-${e.slug}`:`${n}/${e.id}`),r.push(t)}if(r.length===0)return null;let i={"@context":`https://schema.org`,"@type":`CollectionPage`,name:t.collectionTitle},a=s(t.description)||t.summary;return a&&(i.description=a),t.coverImage&&(i.image=[t.coverImage]),i.mainEntity={"@type":`ItemList`,numberOfItems:r.length,itemListElement:r},i}var G=70;function K(e){return e.normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,G).replace(/-+$/g,``)}var q=class t{static _activeInstance=null;static shared(e){let n=t._activeInstance;return n?(n._holders+=1,n):new t(e)}_state=`idle`;_holders=1;_venueName;_venueAddress;_venueTimeZone;_baseUrl;_publicSiteOrigin;_originals=null;_originalsSaved=!1;_events=[];constructor(n){typeof document>`u`||(t._activeInstance&&t._activeInstance!==this&&t._activeInstance._teardown(),this._venueName=n.venueName,this._venueAddress=n.venueAddress,this._venueTimeZone=n.venueTimeZone||e(),this._baseUrl=n.baseUrl||window.location.origin+window.location.pathname,this._publicSiteOrigin=(n.publicSiteOrigin||``).replace(/\/+$/,``),this._saveOriginals(),t._activeInstance=this)}_saveOriginals(){if(this._originalsSaved)return;let e=document.querySelector(`link[rel="canonical"]`),t=document.querySelector(`meta[property="og:title"]`),n=document.querySelector(`meta[property="og:description"]`),r=document.querySelector(`meta[property="og:image"]`),i=document.querySelector(`meta[property="og:url"]`),a=document.querySelector(`meta[property="og:type"]`),o=document.querySelector(`meta[name="description"]`);this._originals={title:document.title,canonicalHref:e?.getAttribute(`href`)??null,ogTitle:t?.getAttribute(`content`)??null,ogDescription:n?.getAttribute(`content`)??null,ogImage:r?.getAttribute(`content`)??null,ogUrl:i?.getAttribute(`content`)??null,ogType:a?.getAttribute(`content`)??null,metaDescription:o?.getAttribute(`content`)??null},this._originalsSaved=!0}_injectJsonLd(e){if(typeof document>`u`)return;document.querySelectorAll(`script[data-micdrop="jsonld"]`).forEach(e=>e.remove());let t=document.createElement(`script`);t.setAttribute(`type`,`application/ld+json`),t.setAttribute(`data-micdrop`,`jsonld`),t.textContent=JSON.stringify(e),document.head.appendChild(t)}_setMeta(e,t){if(!(typeof document>`u`)){if(e.startsWith(`og:`)){let n=document.querySelector(`meta[property="${e}"]`);n?n.setAttribute(`content`,t):(n=document.createElement(`meta`),n.setAttribute(`property`,e),n.setAttribute(`content`,t),n.setAttribute(`data-micdrop`,`og`),document.head.appendChild(n))}else{let n=document.querySelector(`meta[name="${e}"]`);n?n.setAttribute(`content`,t):(n=document.createElement(`meta`),n.setAttribute(`name`,e),n.setAttribute(`content`,t),n.setAttribute(`data-micdrop`,`meta`),document.head.appendChild(n))}}}_setCanonical(e){if(typeof document>`u`)return;let t=document.querySelector(`link[rel="canonical"]`);t?t.setAttribute(`href`,e):(t=document.createElement(`link`),t.setAttribute(`rel`,`canonical`),t.setAttribute(`href`,e),t.setAttribute(`data-micdrop`,`canonical`),document.head.appendChild(t))}_setEntityCanonical(){this._originals?.canonicalHref||this._setCanonical(this._baseUrl)}_removeAllInjected(){typeof document>`u`||document.querySelectorAll(`[data-micdrop]`).forEach(e=>e.remove())}_restoreOriginals(){if(!(typeof document>`u`||!this._originals)){if(document.title=this._originals.title,this._originals.canonicalHref!==null){let e=document.querySelector(`link[rel="canonical"]`);e&&e.setAttribute(`href`,this._originals.canonicalHref)}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}}_restoreMetaProperty(e,t){let n=document.querySelector(`meta[property="${e}"]`);t!==null&&n?n.setAttribute(`content`,t):t===null&&n?.hasAttribute(`data-micdrop`)&&n.remove()}_restoreMetaName(e,t){let n=document.querySelector(`meta[name="${e}"]`);t!==null&&n?n.setAttribute(`content`,t):t===null&&n?.hasAttribute(`data-micdrop`)&&n.remove()}_showPageUrl(e,t){return this._publicSiteOrigin?t?`${this._publicSiteOrigin}/e/${e}-${t}`:`${this._publicSiteOrigin}/e/${e}`:this._entityDeepLink(e,t)}_entityDeepLink(e,t){return`${this._baseUrl}#${e}${t?`-${t}`:``}`}_buildItemList(e){return{"@context":`https://schema.org`,"@type":`ItemList`,itemListElement:e.map((e,t)=>{let n=e.slug||K(e.name||``),r=this._showPageUrl(e.id,n),i=B({event:{name:e.name,startDateTime:e.startDateTime||``,endDateTime:e.endDateTime,status:e.status,description:e.description,eventSummary:e.eventSummary,image:e.image,availableTickets:e.availableTickets},venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},venueTimeZone:e.timeZone||this._venueTimeZone,eventUrl:r});if(!i)return{"@type":`ListItem`,position:t+1,url:r};let{"@context":a,...o}=i;return{"@type":`ListItem`,position:t+1,url:r,item:o}})}}_buildEntityUrl(e,t,n){return e===`event`?this._showPageUrl(t,n):this._entityDeepLink(t,n)}onEventsLoaded(e,t){if(typeof document>`u`||this._state===`destroyed`)return;if(t){this._venueName=t.name||this._venueName,this._venueAddress=t.address||t.googleLocationNameCache||this._venueAddress;let e=t.timeZone||t.timezone;e&&(this._venueTimeZone=e)}this._events=e;let n=this._buildItemList(e);this._injectJsonLd(n),this._state=`listing`}onEntitySelected(e,t,n){if(typeof document>`u`||this._state===`destroyed`)return;if(this._saveOriginals(),n){this._venueName=n.name||this._venueName,this._venueAddress=n.address||n.googleLocationNameCache||this._venueAddress;let e=n.timeZone||n.timezone;e&&(this._venueTimeZone=e)}let r=null,i=``,a=``,o=``,c=``,l=``;if(e===`event`){let e=t.slug||K(t.name||``);l=this._buildEntityUrl(`event`,t.id||t.eventID||``,e),r=B({event:t,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},venueTimeZone:this._venueTimeZone,eventUrl:l}),i=t.name||``,a=t.description||``,o=t.eventSummary||``,c=t.image||t.coverImage||t.ShowImage||``}else if(e===`series`){let e=t.slug||K(t.title||``);l=this._buildEntityUrl(`series`,t.id||``,e),r=U({series:{...t,venue:{name:this._venueName,googleLocationNameCache:this._venueAddress},timeZone:this._venueTimeZone},baseEventUrl:l}),i=t.title||``,a=t.description||``,o=t.eventSummary||``,c=t.image||``}else if(e===`collection`){let e=t.slug||K(t.collectionTitle||``);l=this._buildEntityUrl(`collection`,t.id||``,e),r=W({collection:t,baseEventUrl:l,defaultTimeZone:this._venueTimeZone}),i=t.collectionTitle||``,a=t.description||``,o=t.summary||``,c=t.coverImage||``}r&&this._injectJsonLd(r),this._setEntityCanonical(),i&&this._setMeta(`og:title`,i);let u=s(a,160)||s(o,160);u?this._setMeta(`og:description`,u):this._restoreMetaProperty(`og:description`,this._originals?.ogDescription??null),c&&this._setMeta(`og:image`,c),l&&this._setMeta(`og:url`,l),this._setMeta(`og:type`,`website`),this._setMeta(`twitter:card`,`summary_large_image`),u?this._setMeta(`description`,u):this._restoreMetaName(`description`,this._originals?.metaDescription??null),i&&(document.title=`${i} | ${this._venueName}`),this._state=`entity`}onBackToListing(){if(!(typeof document>`u`)&&this._state!==`destroyed`){if(this._restoreOriginals(),this._removeAllInjected(),this._events.length>0){let e=this._buildItemList(this._events);this._injectJsonLd(e)}this._saveOriginals(),this._state=`listing`}}destroy(){if(this._holders>1){--this._holders;return}this._teardown()}_teardown(){typeof document>`u`||this._state!==`destroyed`&&(this._removeAllInjected(),this._restoreOriginals(),t._activeInstance===this&&(t._activeInstance=null),this._state=`destroyed`)}};exports.HostSeoController=q,exports.buildCollectionJsonLd=W,exports.buildEventJsonLd=B,exports.buildOffers=R,exports.buildPerformers=z,exports.buildPostalAddress=P,exports.buildSeriesJsonLd=U,exports.escapeJsonLdForScript=j,exports.formatDateTimeWithOffset=M,exports.getEventStatus=F,exports.getTicketAvailability=I,exports.parseAddressToPostal=N;
|
package/dist/seo/seo.mjs
CHANGED
|
@@ -452,11 +452,12 @@ var q = class t {
|
|
|
452
452
|
_venueAddress;
|
|
453
453
|
_venueTimeZone;
|
|
454
454
|
_baseUrl;
|
|
455
|
+
_publicSiteOrigin;
|
|
455
456
|
_originals = null;
|
|
456
457
|
_originalsSaved = !1;
|
|
457
458
|
_events = [];
|
|
458
459
|
constructor(n) {
|
|
459
|
-
typeof document > "u" || (t._activeInstance && t._activeInstance !== this && t._activeInstance._teardown(), this._venueName = n.venueName, this._venueAddress = n.venueAddress, this._venueTimeZone = n.venueTimeZone || e(), this._baseUrl = n.baseUrl || window.location.origin + window.location.pathname, this._saveOriginals(), t._activeInstance = this);
|
|
460
|
+
typeof document > "u" || (t._activeInstance && t._activeInstance !== this && t._activeInstance._teardown(), this._venueName = n.venueName, this._venueAddress = n.venueAddress, this._venueTimeZone = n.venueTimeZone || e(), this._baseUrl = n.baseUrl || window.location.origin + window.location.pathname, this._publicSiteOrigin = (n.publicSiteOrigin || "").replace(/\/+$/, ""), this._saveOriginals(), t._activeInstance = this);
|
|
460
461
|
}
|
|
461
462
|
_saveOriginals() {
|
|
462
463
|
if (this._originalsSaved) return;
|
|
@@ -494,6 +495,9 @@ var q = class t {
|
|
|
494
495
|
let t = document.querySelector("link[rel=\"canonical\"]");
|
|
495
496
|
t ? t.setAttribute("href", e) : (t = document.createElement("link"), t.setAttribute("rel", "canonical"), t.setAttribute("href", e), t.setAttribute("data-micdrop", "canonical"), document.head.appendChild(t));
|
|
496
497
|
}
|
|
498
|
+
_setEntityCanonical() {
|
|
499
|
+
this._originals?.canonicalHref || this._setCanonical(this._baseUrl);
|
|
500
|
+
}
|
|
497
501
|
_removeAllInjected() {
|
|
498
502
|
typeof document > "u" || document.querySelectorAll("[data-micdrop]").forEach((e) => e.remove());
|
|
499
503
|
}
|
|
@@ -514,23 +518,52 @@ var q = class t {
|
|
|
514
518
|
let n = document.querySelector(`meta[name="${e}"]`);
|
|
515
519
|
t !== null && n ? n.setAttribute("content", t) : t === null && n?.hasAttribute("data-micdrop") && n.remove();
|
|
516
520
|
}
|
|
521
|
+
_showPageUrl(e, t) {
|
|
522
|
+
return this._publicSiteOrigin ? t ? `${this._publicSiteOrigin}/e/${e}-${t}` : `${this._publicSiteOrigin}/e/${e}` : this._entityDeepLink(e, t);
|
|
523
|
+
}
|
|
524
|
+
_entityDeepLink(e, t) {
|
|
525
|
+
return `${this._baseUrl}#${e}${t ? `-${t}` : ""}`;
|
|
526
|
+
}
|
|
517
527
|
_buildItemList(e) {
|
|
518
528
|
return {
|
|
519
529
|
"@context": "https://schema.org",
|
|
520
530
|
"@type": "ItemList",
|
|
521
531
|
itemListElement: e.map((e, t) => {
|
|
522
|
-
let n = e.slug || K(e.name || "")
|
|
532
|
+
let n = e.slug || K(e.name || ""), r = this._showPageUrl(e.id, n), i = B({
|
|
533
|
+
event: {
|
|
534
|
+
name: e.name,
|
|
535
|
+
startDateTime: e.startDateTime || "",
|
|
536
|
+
endDateTime: e.endDateTime,
|
|
537
|
+
status: e.status,
|
|
538
|
+
description: e.description,
|
|
539
|
+
eventSummary: e.eventSummary,
|
|
540
|
+
image: e.image,
|
|
541
|
+
availableTickets: e.availableTickets
|
|
542
|
+
},
|
|
543
|
+
venue: {
|
|
544
|
+
name: this._venueName,
|
|
545
|
+
googleLocationNameCache: this._venueAddress
|
|
546
|
+
},
|
|
547
|
+
venueTimeZone: e.timeZone || this._venueTimeZone,
|
|
548
|
+
eventUrl: r
|
|
549
|
+
});
|
|
550
|
+
if (!i) return {
|
|
551
|
+
"@type": "ListItem",
|
|
552
|
+
position: t + 1,
|
|
553
|
+
url: r
|
|
554
|
+
};
|
|
555
|
+
let { "@context": a, ...o } = i;
|
|
523
556
|
return {
|
|
524
557
|
"@type": "ListItem",
|
|
525
558
|
position: t + 1,
|
|
526
|
-
url:
|
|
559
|
+
url: r,
|
|
560
|
+
item: o
|
|
527
561
|
};
|
|
528
562
|
})
|
|
529
563
|
};
|
|
530
564
|
}
|
|
531
565
|
_buildEntityUrl(e, t, n) {
|
|
532
|
-
|
|
533
|
-
return `${this._baseUrl}?${r}=${t}-${n}`;
|
|
566
|
+
return e === "event" ? this._showPageUrl(t, n) : this._entityDeepLink(t, n);
|
|
534
567
|
}
|
|
535
568
|
onEventsLoaded(e, t) {
|
|
536
569
|
if (typeof document > "u" || this._state === "destroyed") return;
|
|
@@ -583,7 +616,7 @@ var q = class t {
|
|
|
583
616
|
defaultTimeZone: this._venueTimeZone
|
|
584
617
|
}), i = t.collectionTitle || "", a = t.description || "", o = t.summary || "", c = t.coverImage || "";
|
|
585
618
|
}
|
|
586
|
-
r && this._injectJsonLd(r),
|
|
619
|
+
r && this._injectJsonLd(r), this._setEntityCanonical(), i && this._setMeta("og:title", i);
|
|
587
620
|
let u = s(a, 160) || s(o, 160);
|
|
588
621
|
u ? this._setMeta("og:description", u) : this._restoreMetaProperty("og:description", this._originals?.ogDescription ?? null), c && this._setMeta("og:image", c), l && this._setMeta("og:url", l), this._setMeta("og:type", "website"), this._setMeta("twitter:card", "summary_large_image"), u ? this._setMeta("description", u) : this._restoreMetaName("description", this._originals?.metaDescription ?? null), i && (document.title = `${i} | ${this._venueName}`), this._state = "entity";
|
|
589
622
|
}
|
package/dist/seo/types.d.ts
CHANGED
|
@@ -111,6 +111,19 @@ export interface HostSeoControllerOptions {
|
|
|
111
111
|
venueTimeZone?: string;
|
|
112
112
|
/** Base URL for canonical links, e.g., "https://comedy-club.com/shows" (defaults to current page URL without query params) */
|
|
113
113
|
baseUrl?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Origin of the Micdrop site that server-renders `/e/{id}-{slug}`, e.g.
|
|
116
|
+
* "https://get-micdrop.com". Trailing slashes are stripped.
|
|
117
|
+
*
|
|
118
|
+
* This is what makes the injected structured data crawlable. A host page has
|
|
119
|
+
* ONE URL however many shows the widget draws on it, so without a per-show
|
|
120
|
+
* address the whole listing is a single URL to a search engine. `/e/{id}-{slug}`
|
|
121
|
+
* is the only per-show page that exists and server-renders.
|
|
122
|
+
*
|
|
123
|
+
* Unset falls back to the host page's in-place deep link — today's behaviour,
|
|
124
|
+
* and the right degradation: a guessed origin would publish 404s.
|
|
125
|
+
*/
|
|
126
|
+
publicSiteOrigin?: string;
|
|
114
127
|
}
|
|
115
128
|
/** What buildCollectionJsonLd expects. */
|
|
116
129
|
export interface CollectionJsonLdInput {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as e, k as t } from "./defaultLabels-CAOGfi3n.js";
|
|
2
2
|
//#region node_modules/zod/v4/core/core.js
|
|
3
3
|
var n;
|
|
4
4
|
function r(e, t, n) {
|
|
@@ -686,15 +686,15 @@ var Q = /* @__PURE__ */ Z(/* @__PURE__ */ X(/* @__PURE__ */ J()), /* @__PURE__ *
|
|
|
686
686
|
function De(n) {
|
|
687
687
|
let r = Ee.safeParse(n);
|
|
688
688
|
if (!r.success) return null;
|
|
689
|
-
let i = r.data, a = i.stripe_amount ?? i.amount_total, o = e(
|
|
689
|
+
let i = r.data, a = i.stripe_amount ?? i.amount_total, o = t(e(a));
|
|
690
690
|
return {
|
|
691
|
-
subtotal: e(
|
|
692
|
-
fees: e(
|
|
693
|
-
cardProcessing: e(
|
|
694
|
-
taxes: e(
|
|
691
|
+
subtotal: t(e(i.subtotal + i.discount)),
|
|
692
|
+
fees: t(e(i.service_fee + i.card_processing + i.venue_kickback)),
|
|
693
|
+
cardProcessing: t(e(i.card_processing)),
|
|
694
|
+
taxes: t(e(i.tax_amount_exclusive ?? i.tax)),
|
|
695
695
|
total: o,
|
|
696
|
-
promoDiscount: e(
|
|
697
|
-
giftCardAmount: e(
|
|
696
|
+
promoDiscount: t(e(i.discount)),
|
|
697
|
+
giftCardAmount: t(e(i.gift_card_amount)),
|
|
698
698
|
stripeAmount: o,
|
|
699
699
|
currency: i.currency ? String(i.currency).toUpperCase() : "USD"
|
|
700
700
|
};
|