@getmicdrop/venue-calendar 4.3.1 → 4.3.2
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/api/api.cjs +1 -0
- package/dist/api/api.mjs +1442 -0
- package/dist/api/client.d.ts +157 -0
- package/dist/api/cta.d.ts +50 -0
- package/dist/api/events.d.ts +202 -0
- package/dist/api/gift-cards.d.ts +119 -0
- package/dist/api/index.d.ts +46 -0
- package/dist/api/orders.d.ts +193 -0
- package/dist/api/promo.d.ts +45 -0
- package/dist/api/result.d.ts +78 -0
- package/dist/api/route-manifest.d.ts +206 -0
- package/dist/api/transformers/address.d.ts +18 -0
- package/dist/api/transformers/cart.d.ts +34 -0
- package/dist/api/transformers/collection.d.ts +12 -0
- package/dist/api/transformers/event.d.ts +177 -0
- package/dist/api/transformers/faq.d.ts +40 -0
- package/dist/api/transformers/giftCard.d.ts +11 -0
- package/dist/api/transformers/index.d.ts +27 -0
- package/dist/api/transformers/order.d.ts +44 -0
- package/dist/api/transformers/performer.d.ts +8 -0
- package/dist/api/transformers/series.d.ts +12 -0
- package/dist/api/transformers/venue.d.ts +65 -0
- package/dist/api/types.d.ts +554 -0
- package/dist/api/venues.d.ts +33 -0
- package/dist/api/waitlist.d.ts +77 -0
- package/dist/seo/HostSeoController.d.ts +68 -0
- package/dist/seo/buildCollectionJsonLd.d.ts +8 -0
- package/dist/seo/buildEventJsonLd.d.ts +9 -0
- package/dist/seo/buildSeriesJsonLd.d.ts +6 -0
- package/dist/seo/helpers.d.ts +88 -0
- package/dist/seo/index.d.ts +10 -0
- package/dist/seo/seo.cjs +1 -0
- package/dist/seo/seo.mjs +592 -0
- package/dist/seo/types.d.ts +156 -0
- package/dist/venue-calendar.es.js +1 -1
- package/dist/venue-calendar.iife.js +2 -2
- package/dist/venue-calendar.umd.js +1 -1
- package/package.json +1 -1
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/de.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/es.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/fr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/id.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/it.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/ja.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/ko.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/nl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/pl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/tr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/zh.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/de.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/es.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/fr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/id.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/it.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/ja.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/ko.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/nl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/pl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/pt-br.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/tr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/zh.js +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { HostSeoControllerOptions } from './types';
|
|
2
|
+
interface ListingEvent {
|
|
3
|
+
id: number | string;
|
|
4
|
+
name: string;
|
|
5
|
+
slug?: string;
|
|
6
|
+
startDateTime?: string;
|
|
7
|
+
image?: string;
|
|
8
|
+
}
|
|
9
|
+
interface VenueData {
|
|
10
|
+
name: string;
|
|
11
|
+
address?: string;
|
|
12
|
+
googleLocationNameCache?: string;
|
|
13
|
+
timeZone?: string;
|
|
14
|
+
timezone?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class HostSeoController {
|
|
17
|
+
/**
|
|
18
|
+
* Single active instance. A venue page that mounts >1 calendar embed
|
|
19
|
+
* (e.g. "upcoming shows" + "this weekend") will see the *later*
|
|
20
|
+
* controller take over `<head>` — the earlier one is destroyed.
|
|
21
|
+
*
|
|
22
|
+
* KNOWN LIMITATION: multi-embed pages cannot run two SEO controllers
|
|
23
|
+
* in parallel because they would both fight to own `<title>`/OG/etc.
|
|
24
|
+
* Pass `data-inject-seo="false"` on all but one embed to opt out.
|
|
25
|
+
*/
|
|
26
|
+
static _activeInstance: HostSeoController | null;
|
|
27
|
+
private _state;
|
|
28
|
+
private _venueName;
|
|
29
|
+
private _venueAddress;
|
|
30
|
+
private _venueTimeZone;
|
|
31
|
+
private _baseUrl;
|
|
32
|
+
private _originals;
|
|
33
|
+
private _originalsSaved;
|
|
34
|
+
private _events;
|
|
35
|
+
constructor(options: HostSeoControllerOptions);
|
|
36
|
+
private _saveOriginals;
|
|
37
|
+
private _injectJsonLd;
|
|
38
|
+
private _setMeta;
|
|
39
|
+
private _setCanonical;
|
|
40
|
+
private _removeAllInjected;
|
|
41
|
+
private _restoreOriginals;
|
|
42
|
+
private _restoreMetaProperty;
|
|
43
|
+
private _restoreMetaName;
|
|
44
|
+
private _buildItemList;
|
|
45
|
+
private _buildEntityUrl;
|
|
46
|
+
/**
|
|
47
|
+
* Called when events finish loading from the API.
|
|
48
|
+
* Injects an ItemList JSON-LD for the listing. Does not modify OG/canonical/title.
|
|
49
|
+
*/
|
|
50
|
+
onEventsLoaded(events: ListingEvent[], venue?: VenueData): void;
|
|
51
|
+
/**
|
|
52
|
+
* Called when the user selects an event, series, or collection.
|
|
53
|
+
* Replaces ItemList JSON-LD with entity-specific JSON-LD and updates
|
|
54
|
+
* all head tags (canonical, OG, meta description, title).
|
|
55
|
+
*/
|
|
56
|
+
onEntitySelected(type: 'event' | 'series' | 'collection', data: any, venue?: VenueData): void;
|
|
57
|
+
/**
|
|
58
|
+
* Called when the user navigates back to the event listing.
|
|
59
|
+
* Restores original head elements and re-injects ItemList JSON-LD.
|
|
60
|
+
*/
|
|
61
|
+
onBackToListing(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Called when the widget is destroyed. Removes all injected elements
|
|
64
|
+
* and restores originals. Clears the static active instance.
|
|
65
|
+
*/
|
|
66
|
+
destroy(): void;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CollectionJsonLdInput } from './types';
|
|
2
|
+
export interface BuildCollectionJsonLdOptions {
|
|
3
|
+
collection: CollectionJsonLdInput;
|
|
4
|
+
baseEventUrl?: string;
|
|
5
|
+
/** Accepted for API compatibility; the summary ItemList carries no dates. */
|
|
6
|
+
defaultTimeZone?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function buildCollectionJsonLd(options: BuildCollectionJsonLdOptions): Record<string, unknown> | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventJsonLdInput, VenueInput, OrganizerInput } from './types';
|
|
2
|
+
export interface BuildEventJsonLdOptions {
|
|
3
|
+
event: EventJsonLdInput;
|
|
4
|
+
venue: VenueInput;
|
|
5
|
+
venueTimeZone?: string;
|
|
6
|
+
eventUrl?: string;
|
|
7
|
+
organizer?: OrganizerInput;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildEventJsonLd(options: BuildEventJsonLdOptions): Record<string, unknown> | null;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { EventTicketInput, EventPerformerInput } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Escape a JSON string for safe embedding inside an inline
|
|
4
|
+
* <script type="application/ld+json"> element.
|
|
5
|
+
*
|
|
6
|
+
* JSON.stringify does NOT escape `<`, `>` or `&`, so a field value containing
|
|
7
|
+
* `</script><script>...` would break out of the script element and execute
|
|
8
|
+
* (stored XSS). Replacing those characters with their unicode escape sequences
|
|
9
|
+
* keeps the output valid JSON (parsers decode `<` back to `<`) while making
|
|
10
|
+
* it impossible to terminate the surrounding <script> tag.
|
|
11
|
+
*
|
|
12
|
+
* This is the standard JSON-LD-in-<script> hardening; the sibling
|
|
13
|
+
* HostSeoController avoids the issue entirely by using element.textContent.
|
|
14
|
+
*/
|
|
15
|
+
export declare function escapeJsonLdForScript(json: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Format datetime to ISO-8601 with timezone offset.
|
|
18
|
+
* Google requires: "2025-07-21T19:00:00-05:00"
|
|
19
|
+
*
|
|
20
|
+
* Extracted from EventStructuredData.svelte lines 25-68.
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatDateTimeWithOffset(isoString: string | null | undefined, tz: string): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Parse address string into PostalAddress components.
|
|
25
|
+
* Input: "7702 Santa Monica Blvd, West Hollywood, CA 90046"
|
|
26
|
+
* Output: { @type, streetAddress, addressLocality, addressRegion, postalCode, addressCountry }
|
|
27
|
+
*
|
|
28
|
+
* Extracted from EventStructuredData.svelte lines 75-111.
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseAddressToPostal(addressStr: string | null | undefined): Record<string, string> | null;
|
|
31
|
+
/**
|
|
32
|
+
* Structured postal-address parts, as the public resolve/series payloads now
|
|
33
|
+
* expose them: `address` is the STREET line, with city/state/postalCode/country
|
|
34
|
+
* as discrete fields (PublicVenueInfo / SeriesVenueDTO).
|
|
35
|
+
*/
|
|
36
|
+
export interface PostalAddressParts {
|
|
37
|
+
address?: string | null;
|
|
38
|
+
city?: string | null;
|
|
39
|
+
state?: string | null;
|
|
40
|
+
postalCode?: string | null;
|
|
41
|
+
country?: string | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build a schema.org PostalAddress, preferring discrete structured fields when
|
|
45
|
+
* any locality signal (city / state / postalCode) is present, and otherwise
|
|
46
|
+
* falling back to parsing a single comma-separated string (the street `address`
|
|
47
|
+
* field if it carries a full address, else `googleLocationNameCache`).
|
|
48
|
+
*
|
|
49
|
+
* Discrete fields are more reliable than string-splitting — Google requires a
|
|
50
|
+
* well-formed PostalAddress for Event rich-result eligibility (online-only
|
|
51
|
+
* events lost eligibility June 2025).
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildPostalAddress(parts: PostalAddressParts | null | undefined, fallback?: string | null): Record<string, string> | null;
|
|
54
|
+
/**
|
|
55
|
+
* Map event status to schema.org EventStatusType.
|
|
56
|
+
*
|
|
57
|
+
* Extracted from EventStructuredData.svelte lines 116-132.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getEventStatus(rawStatus: string | null | undefined): string;
|
|
60
|
+
/**
|
|
61
|
+
* Map ticket availability to schema.org ItemAvailability.
|
|
62
|
+
*
|
|
63
|
+
* Extracted from EventStructuredData.svelte lines 137-157.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getTicketAvailability(ticket: EventTicketInput): string;
|
|
66
|
+
/**
|
|
67
|
+
* Build a schema.org price-range offer from a low/high price and availability.
|
|
68
|
+
*
|
|
69
|
+
* The shared primitive behind every JSON-LD offer block: emit an AggregateOffer
|
|
70
|
+
* when the range spans two prices, or a single Offer when low === high. Any
|
|
71
|
+
* caller-specific fields (a buy `url`, a `validFrom` sales-start) ride along in
|
|
72
|
+
* `extra`, spread verbatim after the core fields so each caller reproduces its
|
|
73
|
+
* exact prior shape — the event builder passes url/validFrom, the series builder
|
|
74
|
+
* passes nothing.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildPriceRangeOffer(lowPrice: number, highPrice: number, availability: string, extra?: Record<string, unknown>): Record<string, unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* Build offers from available tickets.
|
|
79
|
+
*
|
|
80
|
+
* Extracted from EventStructuredData.svelte lines 162-208.
|
|
81
|
+
*/
|
|
82
|
+
export declare function buildOffers(tickets: EventTicketInput[] | null | undefined, url?: string): Record<string, unknown> | null;
|
|
83
|
+
/**
|
|
84
|
+
* Build performer array from event performers.
|
|
85
|
+
*
|
|
86
|
+
* Extracted from EventStructuredData.svelte lines 213-237.
|
|
87
|
+
*/
|
|
88
|
+
export declare function buildPerformers(performers: EventPerformerInput[] | null | undefined): Array<Record<string, string>> | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { buildEventJsonLd } from './buildEventJsonLd';
|
|
2
|
+
export { buildSeriesJsonLd } from './buildSeriesJsonLd';
|
|
3
|
+
export { buildCollectionJsonLd } from './buildCollectionJsonLd';
|
|
4
|
+
export { HostSeoController } from './HostSeoController';
|
|
5
|
+
export type { BuildEventJsonLdOptions } from './buildEventJsonLd';
|
|
6
|
+
export type { BuildSeriesJsonLdOptions } from './buildSeriesJsonLd';
|
|
7
|
+
export type { BuildCollectionJsonLdOptions } from './buildCollectionJsonLd';
|
|
8
|
+
export type { EventJsonLdInput, EventTicketInput, EventPerformerInput, VenueInput, OrganizerInput, SeriesJsonLdInput, CollectionJsonLdInput, HostSeoControllerOptions, } from './types';
|
|
9
|
+
export { formatDateTimeWithOffset, parseAddressToPostal, buildPostalAddress, getEventStatus, getTicketAvailability, buildOffers, buildPerformers, escapeJsonLdForScript, } from './helpers';
|
|
10
|
+
export type { PostalAddressParts } from './helpers';
|
package/dist/seo/seo.cjs
ADDED
|
@@ -0,0 +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))}function A(e){return e.replace(/</g,`\\u003c`).replace(/>/g,`\\u003e`).replace(/&/g,`\\u0026`)}function j(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 M(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 N(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 M(e&&e.address||t||null)}function P(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 F(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 I(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 L(e,t){if(!e||e.length===0)return null;let n=e.filter(e=>{let t=e.visibility??0,n=t===0||t===1,r=e.salesChannel!==2;return n&&r});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 I(i,a,F(o),{url:t||void 0,validFrom:o?.salesBegin||o?.salesStart||void 0})}function R(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 z(t){let{event:n,venue:r,venueTimeZone:i=e(),eventUrl:a,organizer:o}=t;if(!n)return null;let c=j(n.startDateTime,i);if(!n.name||!c||!r?.name)return null;let l=N(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:P(n.status),eventAttendanceMode:`https://schema.org/OfflineEventAttendanceMode`,location:u},f=j(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=L(n.availableTickets,a);h&&(d.offers=h);let g=R(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 B(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 V(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:I(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:I(Math.min(...r),Math.max(...r),B(n[0].status))}function H(e){let{series:t,baseEventUrl:n}=e;if(!t.title||!t.occurrences||t.occurrences.length===0||!t.venue?.name)return null;let r=N(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=j(e.startDateTime,t.timeZone);if(!r)continue;let a={"@type":`Event`,name:e.title,startDate:r,eventStatus:P(e.status),location:i};n&&(a[`@id`]=`${n}/${e.id}-${e.slug}`);let o=j(e.endDateTime,t.timeZone);o&&(a.endDate=o);let s=V(e.tickets,e.status);s&&(a.offers=s),l.push(a)}return l.length===0?null:(a.subEvent=l,a)}function U(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 W=70;function G(e){return e.normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,W).replace(/-+$/g,``)}var K=class t{static _activeInstance=null;_state=`idle`;_venueName;_venueAddress;_venueTimeZone;_baseUrl;_originals=null;_originalsSaved=!1;_events=[];constructor(n){typeof document>`u`||(t._activeInstance&&t._activeInstance!==this&&t._activeInstance.destroy(),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||G(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||G(t.name||``);l=this._buildEntityUrl(`event`,t.id||t.eventID||``,e),r=z({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||G(t.title||``);l=this._buildEntityUrl(`series`,t.id||``,e),r=H({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||G(t.collectionTitle||``);l=this._buildEntityUrl(`collection`,t.id||``,e),r=U({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(){typeof document>`u`||this._state!==`destroyed`&&(this._removeAllInjected(),this._restoreOriginals(),t._activeInstance===this&&(t._activeInstance=null),this._state=`destroyed`)}};exports.HostSeoController=K,exports.buildCollectionJsonLd=U,exports.buildEventJsonLd=z,exports.buildOffers=L,exports.buildPerformers=R,exports.buildPostalAddress=N,exports.buildSeriesJsonLd=H,exports.escapeJsonLdForScript=A,exports.formatDateTimeWithOffset=j,exports.getEventStatus=P,exports.getTicketAvailability=F,exports.parseAddressToPostal=M;
|