@ticketlayer/elements 0.3.3 → 1.0.0
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/README.md +3 -2
- package/dist/cjs/{index-BpfoKd9Q.js → index-DanPUX0s.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/ticket-selector-BYVL13k_.js +3623 -0
- package/dist/cjs/ticketlayer-elements.cjs.js +2 -2
- package/dist/cjs/tl-buy-modal.cjs.entry.js +4 -4
- package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +89 -71
- package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +62 -31
- package/dist/cjs/tl-cart-badge.cjs.entry.js +75 -62
- package/dist/cjs/tl-cart-drawer.cjs.entry.js +52 -24
- package/dist/cjs/tl-cart.cjs.entry.js +72 -98
- package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +52 -30
- package/dist/cjs/tl-event-card.cjs.entry.js +44 -105
- package/dist/cjs/tl-event-list.cjs.entry.js +73 -36
- package/dist/cjs/tl-login.cjs.entry.js +75 -141
- package/dist/cjs/tl-my-orders.cjs.entry.js +53 -92
- package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +205 -641
- package/dist/cjs/tl-order-confirmation.cjs.entry.js +72 -105
- package/dist/cjs/tl-order-tickets_2.cjs.entry.js +50 -76
- package/dist/cjs/tl-promo-code.cjs.entry.js +51 -47
- package/dist/cjs/tl-seat-map.cjs.entry.js +4 -4
- package/dist/cjs/web-query-Ce73jB4k.js +16 -0
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +12 -19
- package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +2 -2
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +41 -4
- package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +105 -76
- package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +2 -2
- package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +73 -30
- package/dist/collection/components/tl-cart/tl-cart.css +52 -51
- package/dist/collection/components/tl-cart/tl-cart.js +82 -101
- package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +11 -11
- package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +62 -62
- package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +6 -6
- package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +56 -24
- package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +2 -2
- package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +61 -29
- package/dist/collection/components/tl-event-card/event-card-adapter.js +11 -23
- package/dist/collection/components/tl-event-card/tl-event-card.css +22 -22
- package/dist/collection/components/tl-event-card/tl-event-card.js +51 -84
- package/dist/collection/components/tl-event-list/tl-event-list.css +17 -17
- package/dist/collection/components/tl-event-list/tl-event-list.js +82 -38
- package/dist/collection/components/tl-login/tl-login.css +26 -26
- package/dist/collection/components/tl-login/tl-login.js +83 -147
- package/dist/collection/components/tl-my-orders/tl-my-orders.css +40 -40
- package/dist/collection/components/tl-my-orders/tl-my-orders.js +58 -96
- package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +54 -65
- package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +137 -516
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +38 -38
- package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +81 -113
- package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +9 -9
- package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +57 -92
- package/dist/collection/components/tl-promo-code/tl-promo-code.css +25 -25
- package/dist/collection/components/tl-promo-code/tl-promo-code.js +55 -50
- package/dist/collection/components/tl-seat-map/tl-seat-map.css +10 -10
- package/dist/collection/components/tl-seat-map/tl-seat-map.js +2 -2
- package/dist/collection/components/tl-ticket/tl-ticket.css +13 -13
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +74 -49
- package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +95 -135
- package/dist/collection/utils/cart-totals.js +9 -0
- package/dist/collection/utils/order-summary.js +15 -99
- package/dist/collection/utils/testing/deep-text.js +29 -0
- package/dist/collection/utils/testing/fixtures.js +290 -0
- package/dist/collection/utils/testing/mock-sdk.js +13 -2
- package/dist/collection/utils/web-query.js +12 -0
- package/dist/collection/utils/web-storage.js +22 -0
- package/dist/components/ticket-selector.js +1 -0
- package/dist/components/tl-buy-modal.js +1 -1
- package/dist/components/tl-buy-tickets-button.js +1 -1
- package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
- package/dist/components/tl-cart-badge.js +1 -1
- package/dist/components/tl-cart-drawer.js +1 -1
- package/dist/components/tl-cart2.js +1 -1
- package/dist/components/tl-checkout-wrapper2.js +1 -1
- package/dist/components/tl-event-card2.js +1 -1
- package/dist/components/tl-event-list.js +1 -1
- package/dist/components/tl-login2.js +1 -1
- package/dist/components/tl-my-orders.js +1 -1
- package/dist/components/tl-occurrence-selector2.js +1 -1
- package/dist/components/tl-order-confirmation.js +1 -1
- package/dist/components/tl-order-tickets2.js +1 -1
- package/dist/components/tl-promo-code.js +1 -1
- package/dist/components/tl-seat-map.js +1 -1
- package/dist/components/tl-ticket-selector2.js +1 -1
- package/dist/components/tl-ticket2.js +1 -1
- package/dist/components/web-query.js +1 -0
- package/dist/elements.docs.json +36 -36
- package/dist/esm/{index-CNX8hZa8.js → index-imfxp765.js} +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/ticket-selector-BwChnHVC.js +3606 -0
- package/dist/esm/ticketlayer-elements.js +3 -3
- package/dist/esm/tl-buy-modal.entry.js +4 -4
- package/dist/esm/tl-buy-tickets-button.entry.js +90 -72
- package/dist/esm/tl-buy-tickets-wrapper.entry.js +63 -32
- package/dist/esm/tl-cart-badge.entry.js +76 -63
- package/dist/esm/tl-cart-drawer.entry.js +53 -25
- package/dist/esm/tl-cart.entry.js +73 -99
- package/dist/esm/tl-checkout-wrapper.entry.js +53 -31
- package/dist/esm/tl-event-card.entry.js +45 -106
- package/dist/esm/tl-event-list.entry.js +74 -37
- package/dist/esm/tl-login.entry.js +76 -142
- package/dist/esm/tl-my-orders.entry.js +54 -93
- package/dist/esm/tl-occurrence-selector_2.entry.js +206 -642
- package/dist/esm/tl-order-confirmation.entry.js +73 -106
- package/dist/esm/tl-order-tickets_2.entry.js +51 -77
- package/dist/esm/tl-promo-code.entry.js +52 -48
- package/dist/esm/tl-seat-map.entry.js +4 -4
- package/dist/esm/web-query-Bdbb2lk5.js +14 -0
- package/dist/ticketlayer-elements/index.esm.js +1 -1
- package/dist/ticketlayer-elements/p-45923d2c.entry.js +1 -0
- package/dist/ticketlayer-elements/p-492adc77.entry.js +1 -0
- package/dist/ticketlayer-elements/p-4cfc9e53.entry.js +1 -0
- package/dist/ticketlayer-elements/p-5135630e.entry.js +1 -0
- package/dist/ticketlayer-elements/p-5bbce3b5.entry.js +1 -0
- package/dist/ticketlayer-elements/p-7d547721.entry.js +1 -0
- package/dist/ticketlayer-elements/p-7fe7b6ba.entry.js +1 -0
- package/dist/ticketlayer-elements/p-8122f0c1.entry.js +1 -0
- package/dist/ticketlayer-elements/p-98d40869.entry.js +1 -0
- package/dist/ticketlayer-elements/p-Bdbb2lk5.js +1 -0
- package/dist/ticketlayer-elements/p-BwChnHVC.js +1 -0
- package/dist/ticketlayer-elements/p-abec290a.entry.js +1 -0
- package/dist/ticketlayer-elements/p-ac79a3f6.entry.js +1 -0
- package/dist/ticketlayer-elements/p-d01f4429.entry.js +1 -0
- package/dist/ticketlayer-elements/p-d7ffaf46.entry.js +1 -0
- package/dist/ticketlayer-elements/p-e7170f3c.entry.js +1 -0
- package/dist/ticketlayer-elements/p-e787e862.entry.js +1 -0
- package/dist/ticketlayer-elements/p-f1ff931f.entry.js +1 -0
- package/dist/ticketlayer-elements/p-imfxp765.js +3 -0
- package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
- package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
- package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +40 -8
- package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +20 -1
- package/dist/types/components/tl-cart/tl-cart.d.ts +40 -32
- package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +22 -7
- package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +28 -5
- package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +18 -1
- package/dist/types/components/tl-event-card/event-card-adapter.d.ts +9 -20
- package/dist/types/components/tl-event-card/tl-event-card.d.ts +25 -28
- package/dist/types/components/tl-event-list/tl-event-list.d.ts +46 -6
- package/dist/types/components/tl-login/tl-login.d.ts +68 -22
- package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +30 -12
- package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +73 -161
- package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +48 -15
- package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +29 -31
- package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +28 -10
- package/dist/types/components/tl-ticket/tl-ticket.d.ts +2 -11
- package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +61 -32
- package/dist/types/components.d.ts +302 -62
- package/dist/types/utils/cart-totals.d.ts +10 -0
- package/dist/types/utils/order-summary.d.ts +16 -65
- package/dist/types/utils/testing/deep-text.d.ts +13 -0
- package/dist/types/utils/testing/fixtures.d.ts +225 -0
- package/dist/types/utils/testing/mock-sdk.d.ts +14 -1
- package/dist/types/utils/web-query.d.ts +18 -0
- package/dist/types/utils/web-storage.d.ts +16 -0
- package/elements.catalogue.json +676 -55
- package/package.json +14 -6
- package/dist/cjs/order-summary-ZMkJ5bez.js +0 -116
- package/dist/components/order-summary.js +0 -1
- package/dist/esm/order-summary-BGekdjN9.js +0 -103
- package/dist/ticketlayer-elements/p-0b1d16f8.entry.js +0 -1
- package/dist/ticketlayer-elements/p-1471f6d8.entry.js +0 -1
- package/dist/ticketlayer-elements/p-1c51cbc1.entry.js +0 -1
- package/dist/ticketlayer-elements/p-5169f68b.entry.js +0 -1
- package/dist/ticketlayer-elements/p-895ba1f3.entry.js +0 -1
- package/dist/ticketlayer-elements/p-8d5722e1.entry.js +0 -1
- package/dist/ticketlayer-elements/p-917d8e09.entry.js +0 -1
- package/dist/ticketlayer-elements/p-9629029a.entry.js +0 -1
- package/dist/ticketlayer-elements/p-BGekdjN9.js +0 -1
- package/dist/ticketlayer-elements/p-CNX8hZa8.js +0 -3
- package/dist/ticketlayer-elements/p-a22714d0.entry.js +0 -1
- package/dist/ticketlayer-elements/p-bf73044b.entry.js +0 -1
- package/dist/ticketlayer-elements/p-e02079fa.entry.js +0 -1
- package/dist/ticketlayer-elements/p-e04ace15.entry.js +0 -1
- package/dist/ticketlayer-elements/p-e6fab1d5.entry.js +0 -1
- package/dist/ticketlayer-elements/p-f826b753.entry.js +0 -1
- package/dist/ticketlayer-elements/p-fa639d88.entry.js +0 -1
- package/dist/ticketlayer-elements/p-fbaca948.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-imfxp765.js';
|
|
2
|
+
export { s as setNonce } from './index-imfxp765.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Browser v4.45.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["tl-my-orders",[[1,"tl-my-orders",{"emptyMessage":[1,"empty-message"],"columns":[2],"
|
|
19
|
+
return bootstrapLazy([["tl-my-orders",[[1,"tl-my-orders",{"emptyMessage":[1,"empty-message"],"columns":[2],"view":[32]},null,{"emptyMessage":[{"syncProps":0}],"columns":[{"syncProps":0}]}]]],["tl-buy-modal",[[1,"tl-buy-modal",{"eventId":[1,"event-id"],"occurrenceId":[1,"occurrence-id"],"step":[32],"eventName":[32],"imageUrl":[32],"venueLabel":[32],"dateSummary":[32],"selectedOccurrenceId":[32],"occurrenceCount":[32],"occurrenceLabel":[32],"error":[32]}]]],["tl-order-confirmation",[[1,"tl-order-confirmation",{"orderId":[1,"order-id"],"customerEmail":[1,"customer-email"],"showTickets":[4,"show-tickets"],"columns":[2],"view":[32]},null,{"orderId":[{"watchOrderId":0}],"customerEmail":[{"syncProps":0}],"showTickets":[{"syncProps":0}],"columns":[{"syncProps":0}]}]]],["tl-cart-drawer",[[1,"tl-cart-drawer",{"side":[1],"heading":[1],"open":[1028],"view":[32]},null,{"side":[{"syncProps":0}],"heading":[{"syncProps":0}],"open":[{"onOpenProp":0}]}]]],["tl-event-card",[[1,"tl-event-card",{"event":[16],"eventId":[1,"event-id"],"view":[32]},null,{"event":[{"syncProps":0}],"eventId":[{"watchEventId":0}]}]]],["tl-event-list",[[1,"tl-event-list",{"limit":[2],"category":[1],"columns":[2],"view":[32]},null,{"limit":[{"watchFiltersChange":0}],"category":[{"watchFiltersChange":0}],"columns":[{"syncProps":0}]}]]],["tl-buy-tickets-button",[[1,"tl-buy-tickets-button",{"eventId":[1,"event-id"],"occurrenceId":[1,"occurrence-id"],"state":[1],"label":[1],"variant":[1],"size":[1],"fullWidth":[4,"full-width"],"price":[2],"currency":[1],"pricePrefix":[1,"price-prefix"],"disabled":[4],"isHovered":[32],"view":[32]},null,{"eventId":[{"syncProps":0}],"occurrenceId":[{"syncProps":0}],"state":[{"syncProps":0}],"label":[{"syncProps":0}],"variant":[{"syncProps":0}],"size":[{"syncProps":0}],"fullWidth":[{"syncProps":0}],"price":[{"syncProps":0}],"currency":[{"syncProps":0}],"pricePrefix":[{"syncProps":0}],"disabled":[{"syncProps":0}]}]]],["tl-buy-tickets-wrapper",[[260,"tl-buy-tickets-wrapper",{"eventId":[1,"event-id"],"occurrenceId":[1,"occurrence-id"],"disabled":[4],"view":[32]},null,{"eventId":[{"syncProps":0}],"occurrenceId":[{"syncProps":0}],"disabled":[{"syncProps":0}]}]]],["tl-cart-badge",[[1,"tl-cart-badge",{"showEmpty":[4,"show-empty"],"icon":[1],"size":[1],"badgeOnly":[4,"badge-only"],"view":[32]},null,{"showEmpty":[{"syncProps":0}],"icon":[{"syncProps":0}],"size":[{"syncProps":0}],"badgeOnly":[{"syncProps":0}]}]]],["tl-checkout-wrapper",[[260,"tl-checkout-wrapper",{"disabled":[4],"view":[32]},null,{"disabled":[{"syncProps":0}]}]]],["tl-promo-code",[[1,"tl-promo-code",{"placeholder":[1],"buttonLabel":[1,"button-label"],"view":[32]},null,{"placeholder":[{"syncProps":0}],"buttonLabel":[{"syncProps":0}]}]]],["tl-seat-map",[[1,"tl-seat-map",{"occurrenceId":[1,"occurrence-id"],"hboUrl":[1,"hbo-url"],"apiUrl":[1,"api-url"],"height":[1],"width":[1],"isReady":[32],"isLoading":[32],"error":[32],"seatsInCart":[32]},null,{"occurrenceId":[{"watchOccurrenceId":0}]}]]],["tl-cart",[[1,"tl-cart",{"showCheckoutButton":[4,"show-checkout-button"],"checkoutLabel":[1,"checkout-label"],"showRemoveButtons":[4,"show-remove-buttons"],"compact":[4],"view":[32]},null,{"showCheckoutButton":[{"syncProps":0}],"checkoutLabel":[{"syncProps":0}],"showRemoveButtons":[{"syncProps":0}],"compact":[{"syncProps":0}]}]]],["tl-login",[[1,"tl-login",{"heading":[1],"allowCodeEntry":[4,"allow-code-entry"],"view":[32]},null,{"heading":[{"syncProps":0}],"allowCodeEntry":[{"syncProps":0}]}]]],["tl-occurrence-selector_2",[[1,"tl-occurrence-selector",{"eventId":[1,"event-id"],"displayMode":[1,"display-mode"],"orientation":[1],"theme":[16],"view":[32]},null,{"eventId":[{"watchSubject":0}],"displayMode":[{"syncProps":0}],"orientation":[{"syncProps":0}],"theme":[{"syncProps":0}]}],[1,"tl-ticket-selector",{"eventId":[1,"event-id"],"occurrenceId":[1,"occurrence-id"],"showButton":[4,"show-button"],"buttonLabel":[1,"button-label"],"view":[32]},null,{"eventId":[{"watchPropsChange":0}],"occurrenceId":[{"watchPropsChange":0}],"showButton":[{"syncProps":0}],"buttonLabel":[{"syncProps":0}]}]]],["tl-order-tickets_2",[[1,"tl-order-tickets",{"orderId":[1,"order-id"],"columns":[2],"view":[32]},null,{"orderId":[{"watchOrder":0}],"columns":[{"syncProps":0}]}],[1,"tl-ticket",{"ticket":[16],"orderId":[1,"order-id"],"qrSvg":[32],"downloading":[32]},null,{"ticket":[{"generateQr":0}]}]]]], options);
|
|
20
20
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-imfxp765.js';
|
|
2
2
|
import { w as whenSDK, g as getSDK } from './sdk-connector-CqhvfyKV.js';
|
|
3
3
|
|
|
4
|
-
const tlBuyModalCss = () => `:host{--_bg:var(--tl-background
|
|
4
|
+
const tlBuyModalCss = () => `:host{--_bg:var(--tl-background);--_fg:var(--tl-foreground);--_muted:var(--tl-muted);--_muted-fg:var(--tl-muted-foreground);--_border:var(--tl-border);--_primary:var(--tl-primary);--_primary-fg:var(--tl-primary-foreground);--_radius:var(--tl-radius-lg);--_font:var(--tl-font-family);font-family:var(--_font)}.overlay{position:fixed;inset:0;z-index:2147483646;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px;background:rgba(8, 8, 16, 0.6);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);animation:tl-fade 0.18s ease-out}.panel{width:100%;max-width:460px;max-height:86vh;display:flex;flex-direction:column;overflow:hidden;background:var(--_bg);color:var(--_fg);border:1px solid var(--_border);border-radius:var(--_radius);box-shadow:0 24px 64px rgba(0, 0, 0, 0.45);animation:tl-rise 0.22s cubic-bezier(0.16, 1, 0.3, 1);transition:max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1)}.panel--wide{max-width:720px}.powered-by{width:100%;max-width:460px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 4px;font-size:12px;font-weight:500;color:rgba(255, 255, 255, 0.78);animation:tl-fade 0.3s ease-out}.powered-by a{color:inherit;text-decoration:none;opacity:0.85;transition:opacity 0.15s ease}.powered-by a:hover{opacity:1}.powered-by .pb-links{display:flex;gap:16px;align-items:center}.powered-by .pb-brand{display:inline-flex;align-items:center;gap:6px;opacity:0.92}.powered-by .pb-brand svg{display:block}.powered-by .pb-pre{opacity:0.7}.powered-by .pb-word{font-weight:700;letter-spacing:0.01em}.panel-header{display:flex;align-items:center;gap:14px;padding:16px 18px;border-bottom:1px solid var(--_border)}.event-thumb{flex:none;width:56px;height:56px;border-radius:12px;background-size:cover;background-position:center;background-color:var(--_muted);border:1px solid var(--_border)}.titles{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}.event-meta{margin:0;font-size:0.8rem;color:var(--_muted-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kicker{font-size:0.72rem;font-weight:600;letter-spacing:0.08em;text-transform:uppercase;color:var(--_primary)}.event-name{margin:0;font-size:1.18rem;font-weight:700;line-height:1.25;color:var(--_fg);overflow:hidden;text-overflow:ellipsis}.close-btn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:0;border-radius:999px;background:var(--_muted);color:var(--_muted-fg);cursor:pointer;transition:color 0.15s, background 0.15s}.close-btn:hover{color:var(--_fg)}.close-btn svg{width:16px;height:16px}.panel-body{padding:18px 22px 22px;overflow-y:auto}.state-msg{display:flex;align-items:center;justify-content:center;gap:10px;padding:40px 0;color:var(--_muted-fg)}.state-msg.error{color:#b91c1c}.spinner{width:16px;height:16px;border:2px solid var(--_border);border-top-color:var(--_primary);border-radius:999px;animation:tl-spin 0.7s linear infinite}.tickets-step{display:flex;flex-direction:column;gap:6px}.back-link{align-self:flex-start;padding:0;border:0;background:none;color:var(--_primary);font-size:0.85rem;font-weight:500;cursor:pointer}.back-link:hover{text-decoration:underline}.occ-label{margin:2px 0 8px;font-size:0.9rem;font-weight:600;color:var(--_fg)}.done-step{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:16px 0 4px}.done-mark{font-size:2.4rem;line-height:1;margin-bottom:6px}.done-title{margin:0;font-size:1.1rem;font-weight:700;color:var(--_fg)}.done-sub{margin:0 0 14px;font-size:0.9rem;color:var(--_muted-fg)}.primary-btn{width:100%;padding:13px;border:0;border-radius:var(--tl-radius-md);background:var(--_primary);color:var(--_primary-fg);font-size:0.98rem;font-weight:600;cursor:pointer;transition:opacity 0.15s}.primary-btn:hover{opacity:0.9}.ghost-btn{width:100%;margin-top:8px;padding:12px;border:1px solid var(--_border);border-radius:var(--tl-radius-md);background:transparent;color:var(--_fg);font-size:0.95rem;font-weight:500;cursor:pointer;transition:background 0.15s}.ghost-btn:hover{background:var(--_muted)}@keyframes tl-fade{from{opacity:0}}@keyframes tl-rise{from{opacity:0;transform:translateY(12px) scale(0.98)}}@keyframes tl-spin{to{transform:rotate(360deg)}}`;
|
|
5
5
|
|
|
6
6
|
const TlBuyModal = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -114,10 +114,10 @@ const TlBuyModal = class {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
|
-
return (h(Host, { key: '
|
|
117
|
+
return (h(Host, { key: 'f28be761216b4a84904c1e325dc34d848625db14' }, h("div", { key: '0f36708a6b52d19ee987b211588e759aaf82ac03', class: "overlay", onClick: (e) => {
|
|
118
118
|
if (e.target === e.currentTarget)
|
|
119
119
|
this.close();
|
|
120
|
-
} }, h("div", { key: '
|
|
120
|
+
} }, h("div", { key: '0b2bc062c89e8b821763e163bdedc44047571390', class: { panel: true, 'panel--wide': this.step === 'occurrence' }, role: "dialog", "aria-modal": "true", "aria-label": this.eventName }, h("header", { key: 'c9e3cc54615dace1842ceed226acff23ed0dc0d3', class: "panel-header" }, this.imageUrl && (h("div", { key: '18ffd6168344f65231fa40252361b03ac65ae91a', class: "event-thumb", style: { backgroundImage: `url(${this.imageUrl})` } })), h("div", { key: '4ccbf9a0477948bcb4202310f80cceb1d6e5ad0f', class: "titles" }, h("span", { key: '1a72eb71baaf9eff16aabc5d20c22b02e9b5cc99', class: "kicker" }, this.stepKicker()), h("h2", { key: 'f7dbc184bb016652c1ffe2fe24a551207f226942', class: "event-name" }, this.eventName), this.venueLabel && h("p", { key: 'db7ebd34f688b36b5610aa6adf0d8ab766f00ac2', class: "event-meta" }, this.venueLabel), this.dateSummary && h("p", { key: '00812c8b7b9abf85343f3d6bda433251468da1d9', class: "event-meta" }, this.dateSummary)), h("button", { key: 'e3f7252979794959d6e5070d549010567c0aa349', class: "close-btn", "aria-label": "Close", onClick: this.close }, h("svg", { key: 'd692c47bb8c614b41e19866c5fe4a65b0e083686', viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'cbb9a7bd3ce4ed2685a781729110bccd36b425a9', d: "M6 6l12 12M18 6L6 18", "stroke-linecap": "round" })))), h("div", { key: 'c14af096c9e1cfd9bcead143c1b8a106a4b28018', class: "panel-body" }, this.step === 'loading' && (h("div", { key: '108d1073d572f841f1945147a787b8bdea66cfba', class: "state-msg" }, h("span", { key: '27c2b7473c6edb14ade3b7104f728136c0a2b052', class: "spinner" }), " Loading\u2026")), this.step === 'error' && h("div", { key: '0e3f927f626d51dffc30bb7da7093b6a7cd90a2a', class: "state-msg error" }, this.error), this.step === 'occurrence' && (h("tl-occurrence-selector", { key: 'bfab02d294de3eb1bce39d3e39c21f450b474c99', eventId: this.eventId, onTlSelect: this.handleOccurrenceSelect })), this.step === 'tickets' && this.selectedOccurrenceId && (h("div", { key: '109be73c93b0b604b435cbbd540d5dd5c48eacfe', class: "tickets-step" }, this.occurrenceCount > 1 && (h("button", { key: '2769d896476487e1412ac37309cd2e162b4bd275', class: "back-link", onClick: this.backToDates }, "\u2190 Change date")), this.occurrenceLabel && h("p", { key: '0c709ed8ba75b9e13a141ae755353fc694532935', class: "occ-label" }, this.occurrenceLabel), h("tl-ticket-selector", { key: 'cdf66533a591e89dc265532a2578c30327fd06c8', eventId: this.eventId, occurrenceId: this.selectedOccurrenceId, onTlAddToCart: this.handleAdded }))), this.step === 'done' && (h("div", { key: '6c4b294a4b9412e643a230f4064d15a587f79383', class: "done-step" }, h("div", { key: 'ba0e663e731402192675db509c886c2ce6a2418b', class: "done-mark" }, "\uD83C\uDF9F\uFE0F"), h("p", { key: '8d0f07758d3978080177a99e580f59fbcfefb611', class: "done-title" }, "Added to your cart"), h("p", { key: 'bbf4bd073f021a2f516f91528311d494c40faa85', class: "done-sub" }, "Held for you while you check out."), h("button", { key: '71c90ad945ced314321d964795beed8301c989ac', class: "primary-btn", onClick: this.goCheckout }, "Go to checkout"), h("button", { key: 'b37ad6f8adeb1edb7c786b33974b845c31b963f2', class: "ghost-btn", onClick: this.close }, "Keep browsing"))))), h("div", { key: '5a175094620f6837ae91a5a394f16c79df94c859', class: "powered-by" }, h("div", { key: '63c095dc7e954042c5fb36ccd8ca92a33d7b6632', class: "pb-links" }, h("a", { key: '875fa14d6218853b96d4d817a243701b228b20f0', href: "https://ticketlayer.com/privacy", target: "_blank", rel: "noopener noreferrer" }, "Privacy Policy"), h("a", { key: '7de77189ecd8277acade45437819b4fa9ef2002b', href: "https://ticketlayer.com/report-abuse", target: "_blank", rel: "noopener noreferrer" }, "Report Abuse")), h("a", { key: '5f62bbe303398e9ad09703fbd706953502f441a1', class: "pb-brand", href: "https://ticketlayer.com", target: "_blank", rel: "noopener noreferrer" }, h("span", { key: '0101948057126320d180a452870eade9f540b119', class: "pb-pre" }, "Powered by"), h("svg", { key: 'c93e4184b3bd8bbb89b5909ec886b22d22322bb1', width: "14", height: "14", viewBox: "0 0 50 50", fill: "none", "aria-hidden": "true" }, h("g", { key: '5461e514631e1cb670e974b47ecc144e1a62e7a3', transform: "matrix(0.0129 0 0 -0.0129 25.4752 25.4752)" }, h("path", { key: 'af6f137d33f09ef4befb9a4b31834d6d2f04ab3d', fill: "currentColor", transform: "translate(-1781.5, -1759.4003)", d: "M 41 2973 c 1 -285 5 -734 9 -998 c 7 -444 9 -488 30 -580 c 81 -364 235 -634 512 -900 c 135 -130 263 -220 423 -299 c 156 -77 249 -109 409 -143 c 110 -23 142 -25 354 -24 c 230 1 310 8 427 37 c 241 60 453 162 640 309 c 82 64 252 234 317 315 c 210 264 340 604 355 926 l 6 121 l -69 6 c -86 8 -706 9 -755 1 l -36 -6 l -21 -125 c -34 -191 -98 -317 -236 -462 c -111 -115 -249 -198 -396 -238 c -98 -27 -356 -24 -463 5 c -100 27 -183 69 -273 137 c -226 173 -353 409 -354 660 c 0 44 -5 120 -10 169 c -6 49 -8 91 -6 94 c 3 3 65 -22 138 -55 c 140 -64 251 -103 358 -127 c 71 -17 295 -46 347 -46 l 33 0 l 0 434 l 0 434 l -67 7 c -147 14 -269 56 -393 133 c -222 139 -378 393 -397 648 l -6 71 l -75 7 c -41 3 -239 6 -439 6 l -363 0 l 1 -517 z" }))), h("span", { key: 'd4f15a3fb911e2f78eb203fdd5079d3119ee9803', class: "pb-word" }, "ticketlayer"))))));
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
TlBuyModal.style = tlBuyModalCss();
|
|
@@ -1,35 +1,9 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-imfxp765.js';
|
|
2
|
+
import { w as whenSDK, g as getSDK } from './sdk-connector-CqhvfyKV.js';
|
|
3
|
+
import { c as createElement, b as buyTicketsButtonCore } from './ticket-selector-BwChnHVC.js';
|
|
3
4
|
|
|
4
|
-
const tlBuyTicketsButtonCss = () => `:host{display:inline-block;font-family:var(--tl-font-family
|
|
5
|
+
const tlBuyTicketsButtonCss = () => `:host{display:inline-block;font-family:var(--tl-font-family)}:host(.full-width){display:block;width:100%}:host(.full-width) .buy-button{width:100%}.state-available{--button-color:var(--tl-primary);--button-hover-color:color-mix(in srgb, var(--tl-primary) 90%, black);--button-foreground:var(--tl-primary-foreground)}.state-sold-out{--button-color:var(--tl-error);--button-hover-color:color-mix(in srgb, var(--tl-error) 90%, black);--button-foreground:var(--tl-error-foreground)}.state-waitlist{--button-color:var(--tl-info);--button-hover-color:color-mix(in srgb, var(--tl-info) 90%, black);--button-foreground:var(--tl-info-foreground)}.state-coming-soon{--button-color:var(--tl-warning);--button-hover-color:color-mix(in srgb, var(--tl-warning) 90%, black);--button-foreground:var(--tl-warning-foreground)}.buy-button{display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;font-weight:600;border:none;cursor:pointer;text-decoration:none;outline:none;transition:all 0.2s ease;white-space:nowrap}.buy-button.variant-primary{background:var(--button-color);color:var(--button-foreground)}.buy-button.variant-secondary{background:color-mix(in srgb, var(--button-color) 15%, transparent);color:var(--button-color)}.buy-button.variant-outline{background:transparent;color:var(--button-color);border:2px solid var(--button-color)}.buy-button.size-sm{padding:0.5rem 1rem;font-size:0.875rem;border-radius:var(--tl-radius-sm)}.buy-button.size-md{padding:0.75rem 1.5rem;font-size:1rem;border-radius:var(--tl-radius-md)}.buy-button.size-lg{padding:1rem 2rem;font-size:1.125rem;border-radius:var(--tl-radius-lg);min-height:51px}.buy-button.hovered:not(.disabled){opacity:0.9;transform:translateY(-1px)}.buy-button.hovered.variant-primary{background:var(--button-hover-color)}.buy-button.disabled{opacity:0.7;cursor:not-allowed}.icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.icon svg{width:1em;height:1em}.label{flex-shrink:0}.price{display:inline-flex;align-items:center;gap:0.25rem;margin-left:0.5rem;white-space:nowrap;opacity:0.9}.price-prefix{opacity:0.7}.price-value{font-weight:700}`;
|
|
5
6
|
|
|
6
|
-
// State configurations
|
|
7
|
-
const STATE_CONFIGS = {
|
|
8
|
-
available: {
|
|
9
|
-
defaultLabel: 'Buy Tickets',
|
|
10
|
-
color: 'var(--tl-primary, #e64b12)',
|
|
11
|
-
hoverColor: 'var(--tl-primary, #d4440f)',
|
|
12
|
-
foreground: 'var(--tl-primary-foreground, #ffffff)',
|
|
13
|
-
},
|
|
14
|
-
soldOut: {
|
|
15
|
-
defaultLabel: 'Sold Out',
|
|
16
|
-
color: '#dc2626',
|
|
17
|
-
hoverColor: '#b91c1c',
|
|
18
|
-
foreground: '#ffffff',
|
|
19
|
-
},
|
|
20
|
-
waitlist: {
|
|
21
|
-
defaultLabel: 'Join Waitlist',
|
|
22
|
-
color: '#2563eb',
|
|
23
|
-
hoverColor: '#1d4ed8',
|
|
24
|
-
foreground: '#ffffff',
|
|
25
|
-
},
|
|
26
|
-
comingSoon: {
|
|
27
|
-
defaultLabel: 'On Sale Soon',
|
|
28
|
-
color: '#d97706',
|
|
29
|
-
hoverColor: '#b45309',
|
|
30
|
-
foreground: '#ffffff',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
7
|
const TlBuyTicketsButton = class {
|
|
34
8
|
constructor(hostRef) {
|
|
35
9
|
registerInstance(this, hostRef);
|
|
@@ -51,65 +25,74 @@ const TlBuyTicketsButton = class {
|
|
|
51
25
|
// -------------------------------------------------------------------------
|
|
52
26
|
// State
|
|
53
27
|
// -------------------------------------------------------------------------
|
|
28
|
+
/**
|
|
29
|
+
* Whether the pointer is over the button. A pointer is not a fact every
|
|
30
|
+
* runtime has, so this stays here for the same reason the key handling
|
|
31
|
+
* does: the core knows nothing of mice.
|
|
32
|
+
*/
|
|
54
33
|
this.isHovered = false;
|
|
55
34
|
// -------------------------------------------------------------------------
|
|
56
|
-
//
|
|
35
|
+
// The core
|
|
57
36
|
// -------------------------------------------------------------------------
|
|
37
|
+
this.element = createElement(buyTicketsButtonCore, {
|
|
38
|
+
client: () => getSDK(),
|
|
39
|
+
clientReady: () => whenSDK(),
|
|
40
|
+
emit: (event, detail) => this.forward(event, detail),
|
|
41
|
+
});
|
|
42
|
+
/** The core's whole view. Assigning it is what makes Stencil re-render. */
|
|
43
|
+
this.view = this.element.view;
|
|
58
44
|
this.handleClick = () => {
|
|
59
|
-
|
|
60
|
-
if (this.disabled || this.state === 'soldOut' || this.state === 'comingSoon') {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
// Emit click event
|
|
64
|
-
this.tlClick.emit({ eventId: this.eventId, occurrenceId: this.occurrenceId });
|
|
65
|
-
// Open modal via SDK if available
|
|
66
|
-
if (hasSDK()) {
|
|
67
|
-
try {
|
|
68
|
-
const sdk = getSDK();
|
|
69
|
-
sdk.event(this.eventId).openModal({
|
|
70
|
-
occurrenceId: this.occurrenceId,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
console.error('[tl-buy-tickets-button] Failed to open modal:', err);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
45
|
+
this.element.actions.activate();
|
|
77
46
|
};
|
|
78
47
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
48
|
+
syncProps() {
|
|
49
|
+
this.element.setProps({
|
|
50
|
+
eventId: this.eventId,
|
|
51
|
+
occurrenceId: this.occurrenceId,
|
|
52
|
+
state: this.state,
|
|
53
|
+
label: this.label,
|
|
54
|
+
variant: this.variant,
|
|
55
|
+
size: this.size,
|
|
56
|
+
fullWidth: this.fullWidth,
|
|
57
|
+
price: this.price,
|
|
84
58
|
currency: this.currency,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
})
|
|
59
|
+
pricePrefix: this.pricePrefix,
|
|
60
|
+
disabled: this.disabled,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
connectedCallback() {
|
|
64
|
+
this.syncProps();
|
|
65
|
+
this.unsubscribe ?? (this.unsubscribe = this.element.subscribe((view) => {
|
|
66
|
+
this.view = view;
|
|
67
|
+
}));
|
|
68
|
+
this.view = this.element.view;
|
|
69
|
+
// This core has nothing to do on mount, and is mounted anyway: a harness
|
|
70
|
+
// calls mount() unconditionally and pairs it with its teardown (TKT-197).
|
|
71
|
+
this.teardown = this.element.mount();
|
|
88
72
|
}
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
disconnectedCallback() {
|
|
74
|
+
this.teardown?.();
|
|
75
|
+
this.teardown = undefined;
|
|
76
|
+
this.unsubscribe?.();
|
|
77
|
+
this.unsubscribe = undefined;
|
|
91
78
|
}
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
forward(event, detail) {
|
|
80
|
+
if (event === 'tlClick')
|
|
81
|
+
this.tlClick.emit(detail);
|
|
94
82
|
}
|
|
95
83
|
// -------------------------------------------------------------------------
|
|
96
84
|
// Render
|
|
97
85
|
// -------------------------------------------------------------------------
|
|
98
86
|
render() {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const isInteractive = this.isInteractive();
|
|
102
|
-
return (h(Host, { key: '10c8c36d12223afcfd13c9807c2ef6b0f4c34266', class: { 'full-width': this.fullWidth } }, h("button", { key: 'c7f6a39a837c90ced0176b5d017687afabf99a5a', type: "button", class: {
|
|
87
|
+
const { interactive, buttonLabel, stateClass, priceLabel } = this.view.derived;
|
|
88
|
+
return (h(Host, { key: '6d5dddb3fc486c5a877a3718fecbee80a648b274', class: { 'full-width': this.fullWidth } }, h("button", { key: '88f7f0688fb42e97eb2ce352f316b2a085c3bab5', type: "button", class: {
|
|
103
89
|
'buy-button': true,
|
|
90
|
+
[stateClass]: true,
|
|
104
91
|
[`variant-${this.variant}`]: true,
|
|
105
92
|
[`size-${this.size}`]: true,
|
|
106
|
-
'disabled': !
|
|
107
|
-
'hovered': this.isHovered &&
|
|
108
|
-
},
|
|
109
|
-
'--button-color': config.color,
|
|
110
|
-
'--button-hover-color': config.hoverColor,
|
|
111
|
-
'--button-foreground': config.foreground,
|
|
112
|
-
}, disabled: !isInteractive, onClick: this.handleClick, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false) }, h("span", { key: 'e2bc1edc9fbd2a9c81da8cc3293170b1c4275125', class: "icon" }, this.state === 'soldOut' && this.renderSoldOutIcon(), this.state === 'waitlist' && this.renderWaitlistIcon(), this.state === 'comingSoon' && this.renderComingSoonIcon(), this.state === 'available' && this.renderTicketIcon()), h("span", { key: '8371c85dcc24c5ac040744edefe80618421025ef', class: "label" }, buttonLabel), this.price !== undefined && (h("span", { key: 'c02cb5b646ade8866deafb9b3e698115abec5708', class: "price" }, h("span", { key: 'cb0ab272460115a5edebd674362c83711735a70d', class: "price-prefix" }, this.pricePrefix), h("span", { key: 'e28ba56d3928076b624513de95682351f3e0d92b', class: "price-value" }, this.formatPrice(this.price)))))));
|
|
93
|
+
'disabled': !interactive,
|
|
94
|
+
'hovered': this.isHovered && interactive,
|
|
95
|
+
}, disabled: !interactive, onClick: this.handleClick, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false) }, h("span", { key: 'e88c2f05c7bc782d08d78fc8ab53b213ab3c833f', class: "icon" }, this.state === 'soldOut' && this.renderSoldOutIcon(), this.state === 'waitlist' && this.renderWaitlistIcon(), this.state === 'comingSoon' && this.renderComingSoonIcon(), this.state === 'available' && this.renderTicketIcon()), h("span", { key: '7290a58779e884886f26e64c405fd319811613a1', class: "label" }, buttonLabel), priceLabel !== null && (h("span", { key: 'bdf3bcdbfa29d4799f7a64bc0072a4c06c09c393', class: "price" }, h("span", { key: '32b075fc6793ef21e9a2cd188058992f95c10680', class: "price-prefix" }, this.pricePrefix), h("span", { key: 'ff3805b660b2af72a94fabc315507ce063ff02d2', class: "price-value" }, priceLabel))))));
|
|
113
96
|
}
|
|
114
97
|
renderTicketIcon() {
|
|
115
98
|
return (h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z" }), h("path", { d: "M13 5v2" }), h("path", { d: "M13 17v2" }), h("path", { d: "M13 11v2" })));
|
|
@@ -123,6 +106,41 @@ const TlBuyTicketsButton = class {
|
|
|
123
106
|
renderComingSoonIcon() {
|
|
124
107
|
return (h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M12 2v4" }), h("path", { d: "m16.2 7.8 2.9-2.9" }), h("path", { d: "M18 12h4" }), h("path", { d: "m16.2 16.2 2.9 2.9" }), h("path", { d: "M12 18v4" }), h("path", { d: "m4.9 19.1 2.9-2.9" }), h("path", { d: "M2 12h4" }), h("path", { d: "m4.9 4.9 2.9 2.9" })));
|
|
125
108
|
}
|
|
109
|
+
static get watchers() { return {
|
|
110
|
+
"eventId": [{
|
|
111
|
+
"syncProps": 0
|
|
112
|
+
}],
|
|
113
|
+
"occurrenceId": [{
|
|
114
|
+
"syncProps": 0
|
|
115
|
+
}],
|
|
116
|
+
"state": [{
|
|
117
|
+
"syncProps": 0
|
|
118
|
+
}],
|
|
119
|
+
"label": [{
|
|
120
|
+
"syncProps": 0
|
|
121
|
+
}],
|
|
122
|
+
"variant": [{
|
|
123
|
+
"syncProps": 0
|
|
124
|
+
}],
|
|
125
|
+
"size": [{
|
|
126
|
+
"syncProps": 0
|
|
127
|
+
}],
|
|
128
|
+
"fullWidth": [{
|
|
129
|
+
"syncProps": 0
|
|
130
|
+
}],
|
|
131
|
+
"price": [{
|
|
132
|
+
"syncProps": 0
|
|
133
|
+
}],
|
|
134
|
+
"currency": [{
|
|
135
|
+
"syncProps": 0
|
|
136
|
+
}],
|
|
137
|
+
"pricePrefix": [{
|
|
138
|
+
"syncProps": 0
|
|
139
|
+
}],
|
|
140
|
+
"disabled": [{
|
|
141
|
+
"syncProps": 0
|
|
142
|
+
}]
|
|
143
|
+
}; }
|
|
126
144
|
};
|
|
127
145
|
TlBuyTicketsButton.style = tlBuyTicketsButtonCss();
|
|
128
146
|
|
|
@@ -1,55 +1,86 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-imfxp765.js';
|
|
2
|
+
import { w as whenSDK, g as getSDK } from './sdk-connector-CqhvfyKV.js';
|
|
3
|
+
import { c as createElement, j as buyTicketsWrapperCore } from './ticket-selector-BwChnHVC.js';
|
|
3
4
|
|
|
4
|
-
const tlBuyTicketsWrapperCss = () => `tl-buy-tickets-wrapper,.tl-buy-tickets-wrapper{display:inline-block;cursor:pointer}tl-buy-tickets-wrapper:focus,.tl-buy-tickets-wrapper:focus{outline:2px solid var(--tl-ring
|
|
5
|
+
const tlBuyTicketsWrapperCss = () => `tl-buy-tickets-wrapper,.tl-buy-tickets-wrapper{display:inline-block;cursor:pointer}tl-buy-tickets-wrapper:focus,.tl-buy-tickets-wrapper:focus{outline:2px solid var(--tl-ring);outline-offset:2px;border-radius:var(--tl-radius-sm)}tl-buy-tickets-wrapper[disabled],tl-buy-tickets-wrapper.tl-buy-tickets-wrapper--disabled,.tl-buy-tickets-wrapper--disabled{cursor:not-allowed;opacity:0.5}`;
|
|
5
6
|
|
|
6
7
|
const TlBuyTicketsWrapper = class {
|
|
7
8
|
constructor(hostRef) {
|
|
8
9
|
registerInstance(this, hostRef);
|
|
9
|
-
this.tlComplete = createEvent(this, "
|
|
10
|
-
this.tlError = createEvent(this, "
|
|
11
|
-
this.tlClose = createEvent(this, "
|
|
10
|
+
this.tlComplete = createEvent(this, "tlComplete");
|
|
11
|
+
this.tlError = createEvent(this, "tlError");
|
|
12
|
+
this.tlClose = createEvent(this, "tlClose");
|
|
12
13
|
/**
|
|
13
14
|
* Whether the wrapper is disabled
|
|
14
15
|
*/
|
|
15
16
|
this.disabled = false;
|
|
17
|
+
this.element = createElement(buyTicketsWrapperCore, {
|
|
18
|
+
client: () => getSDK(),
|
|
19
|
+
clientReady: () => whenSDK(),
|
|
20
|
+
emit: (event, detail) => this.forward(event, detail),
|
|
21
|
+
});
|
|
22
|
+
/** The core's whole view. Assigning it is what makes Stencil re-render. */
|
|
23
|
+
this.view = this.element.view;
|
|
16
24
|
this.handleClick = () => {
|
|
17
|
-
|
|
18
|
-
return;
|
|
19
|
-
if (!hasSDK()) {
|
|
20
|
-
console.error('[tl-buy-tickets-wrapper] SDK not initialized. Call setSDK(ticketlayer) first.');
|
|
21
|
-
this.tlError.emit({ message: 'SDK not initialized' });
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const sdk = getSDK();
|
|
25
|
-
// Open the modal via SDK
|
|
26
|
-
sdk.event(this.eventId).openModal({
|
|
27
|
-
occurrenceId: this.occurrenceId,
|
|
28
|
-
onComplete: (order) => {
|
|
29
|
-
this.tlComplete.emit(order);
|
|
30
|
-
},
|
|
31
|
-
onError: (err) => {
|
|
32
|
-
this.tlError.emit({ message: err.message });
|
|
33
|
-
},
|
|
34
|
-
onClose: () => {
|
|
35
|
-
this.tlClose.emit();
|
|
36
|
-
},
|
|
37
|
-
});
|
|
25
|
+
this.element.actions.activate();
|
|
38
26
|
};
|
|
27
|
+
/** Enter and Space are a press on the web. The core knows nothing of keys. */
|
|
39
28
|
this.handleKeyDown = (e) => {
|
|
40
29
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
41
30
|
e.preventDefault();
|
|
42
|
-
this.
|
|
31
|
+
this.element.actions.activate();
|
|
43
32
|
}
|
|
44
33
|
};
|
|
45
34
|
}
|
|
35
|
+
syncProps() {
|
|
36
|
+
this.element.setProps({
|
|
37
|
+
eventId: this.eventId,
|
|
38
|
+
occurrenceId: this.occurrenceId,
|
|
39
|
+
disabled: this.disabled,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
this.syncProps();
|
|
44
|
+
this.unsubscribe ?? (this.unsubscribe = this.element.subscribe((view) => {
|
|
45
|
+
this.view = view;
|
|
46
|
+
}));
|
|
47
|
+
this.view = this.element.view;
|
|
48
|
+
// This core has nothing to do on mount, and is mounted anyway: a harness
|
|
49
|
+
// calls mount() unconditionally and pairs it with its teardown (TKT-197).
|
|
50
|
+
this.teardown = this.element.mount();
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
this.teardown?.();
|
|
54
|
+
this.teardown = undefined;
|
|
55
|
+
this.unsubscribe?.();
|
|
56
|
+
this.unsubscribe = undefined;
|
|
57
|
+
}
|
|
58
|
+
forward(event, detail) {
|
|
59
|
+
if (event === 'tlComplete')
|
|
60
|
+
this.tlComplete.emit(detail);
|
|
61
|
+
else if (event === 'tlError')
|
|
62
|
+
this.tlError.emit(detail);
|
|
63
|
+
else if (event === 'tlClose')
|
|
64
|
+
this.tlClose.emit();
|
|
65
|
+
}
|
|
46
66
|
render() {
|
|
47
|
-
|
|
67
|
+
const { interactive } = this.view.derived;
|
|
68
|
+
return (h(Host, { key: '14e91259c1401322f969d43bb16b6d3f20327c65', class: {
|
|
48
69
|
'tl-buy-tickets-wrapper': true,
|
|
49
|
-
'tl-buy-tickets-wrapper--disabled':
|
|
50
|
-
}, onClick: this.handleClick, onKeyDown: this.handleKeyDown, role: "button", tabindex:
|
|
70
|
+
'tl-buy-tickets-wrapper--disabled': !interactive,
|
|
71
|
+
}, onClick: this.handleClick, onKeyDown: this.handleKeyDown, role: "button", tabindex: interactive ? 0 : -1, "aria-disabled": interactive ? null : 'true' }, h("slot", { key: '3fb33786e09f5ecdf20ff0ea8e7336ccfc43b216' })));
|
|
51
72
|
}
|
|
52
|
-
get
|
|
73
|
+
static get watchers() { return {
|
|
74
|
+
"eventId": [{
|
|
75
|
+
"syncProps": 0
|
|
76
|
+
}],
|
|
77
|
+
"occurrenceId": [{
|
|
78
|
+
"syncProps": 0
|
|
79
|
+
}],
|
|
80
|
+
"disabled": [{
|
|
81
|
+
"syncProps": 0
|
|
82
|
+
}]
|
|
83
|
+
}; }
|
|
53
84
|
};
|
|
54
85
|
TlBuyTicketsWrapper.style = tlBuyTicketsWrapperCss();
|
|
55
86
|
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
2
|
-
import { w as whenSDK } from './sdk-connector-CqhvfyKV.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-imfxp765.js';
|
|
2
|
+
import { w as whenSDK, g as getSDK } from './sdk-connector-CqhvfyKV.js';
|
|
3
|
+
import { c as createElement, g as cartBadgeCore } from './ticket-selector-BwChnHVC.js';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
+
const webStorage = {
|
|
6
|
+
get(key) {
|
|
7
|
+
if (typeof window === 'undefined')
|
|
8
|
+
return null;
|
|
9
|
+
try {
|
|
10
|
+
return window.localStorage.getItem(key);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
set(key, value) {
|
|
17
|
+
if (typeof window === 'undefined')
|
|
18
|
+
return;
|
|
19
|
+
try {
|
|
20
|
+
window.localStorage.setItem(key, value);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// localStorage may be unavailable.
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const tlCartBadgeCss = () => `:host{display:inline-block}.cart-badge{position:relative;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:var(--tl-spacing-2);border-radius:var(--tl-radius-md);color:var(--tl-color-foreground);transition:background-color 0.2s, transform 0.15s}.cart-badge:hover{background-color:var(--tl-color-muted)}.cart-badge:active{transform:scale(0.95)}.cart-badge:focus-visible{outline:2px solid var(--tl-color-primary);outline-offset:2px}.size-sm{padding:var(--tl-spacing-1)}.size-sm .icon-svg,.size-sm .icon-text{width:18px;height:18px;font-size:18px}.size-md .icon-svg,.size-md .icon-text{width:24px;height:24px;font-size:24px}.size-lg{padding:var(--tl-spacing-3)}.size-lg .icon-svg,.size-lg .icon-text{width:32px;height:32px;font-size:32px}.icon-svg{width:24px;height:24px;stroke-width:2}.icon-text{line-height:1}.badge-count{position:absolute;top:0;right:0;transform:translate(30%, -30%);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background-color:var(--tl-color-primary);color:var(--tl-color-primary-foreground);font-size:11px;font-weight:600;font-family:var(--tl-font-family);display:flex;align-items:center;justify-content:center;line-height:1;box-shadow:0 1px 3px rgba(0, 0, 0, 0.2)}.size-sm .badge-count{min-width:16px;height:16px;font-size:10px;padding:0 4px}.size-lg .badge-count{min-width:22px;height:22px;font-size:13px;padding:0 6px}.badge-only{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background-color:rgba(255, 255, 255, 0.3);color:inherit;font-size:12px;font-weight:600;font-family:var(--tl-font-family);line-height:1}.badge-only.size-sm{min-width:18px;height:18px;font-size:11px;padding:0 5px}.badge-only.size-lg{min-width:22px;height:22px;font-size:13px;padding:0 7px}`;
|
|
5
29
|
|
|
6
|
-
// Storage key for persisted cart count
|
|
7
|
-
const CART_COUNT_KEY = 'tl_cart_count';
|
|
8
30
|
const TlCartBadge = class {
|
|
9
31
|
constructor(hostRef) {
|
|
10
32
|
registerInstance(this, hostRef);
|
|
@@ -21,66 +43,44 @@ const TlCartBadge = class {
|
|
|
21
43
|
* Badge only mode - only shows the count bubble, no icon or button
|
|
22
44
|
*/
|
|
23
45
|
this.badgeOnly = false;
|
|
24
|
-
this.
|
|
46
|
+
this.element = createElement(cartBadgeCore, {
|
|
47
|
+
client: () => getSDK(),
|
|
48
|
+
clientReady: () => whenSDK(),
|
|
49
|
+
storage: webStorage,
|
|
50
|
+
emit: (event, detail) => this.forward(event, detail),
|
|
51
|
+
});
|
|
52
|
+
/** The core's whole view. Assigning it is what makes Stencil re-render. */
|
|
53
|
+
this.view = this.element.view;
|
|
25
54
|
this.handleClick = () => {
|
|
26
|
-
this.
|
|
55
|
+
this.element.actions.click();
|
|
27
56
|
};
|
|
28
57
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
58
|
+
syncProps() {
|
|
59
|
+
this.element.setProps({
|
|
60
|
+
showEmpty: this.showEmpty,
|
|
61
|
+
icon: this.icon,
|
|
62
|
+
size: this.size,
|
|
63
|
+
badgeOnly: this.badgeOnly,
|
|
64
|
+
});
|
|
32
65
|
}
|
|
33
|
-
|
|
34
|
-
this.
|
|
66
|
+
connectedCallback() {
|
|
67
|
+
this.syncProps();
|
|
68
|
+
this.unsubscribe ?? (this.unsubscribe = this.element.subscribe((view) => {
|
|
69
|
+
this.view = view;
|
|
70
|
+
}));
|
|
71
|
+
this.view = this.element.view;
|
|
72
|
+
this.teardown = this.element.mount();
|
|
35
73
|
}
|
|
74
|
+
/** Off screen: the mount's teardown is what drops the cart subscription. */
|
|
36
75
|
disconnectedCallback() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
76
|
+
this.teardown?.();
|
|
77
|
+
this.teardown = undefined;
|
|
78
|
+
this.unsubscribe?.();
|
|
79
|
+
this.unsubscribe = undefined;
|
|
40
80
|
}
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
const stored = localStorage.getItem(CART_COUNT_KEY);
|
|
46
|
-
return stored ? parseInt(stored, 10) || 0 : 0;
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
return 0;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
persistCartCount(count) {
|
|
53
|
-
if (typeof window === 'undefined')
|
|
54
|
-
return;
|
|
55
|
-
try {
|
|
56
|
-
localStorage.setItem(CART_COUNT_KEY, count.toString());
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
// localStorage may be unavailable
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async subscribeToCartUpdates() {
|
|
63
|
-
const sdk = await whenSDK().catch(() => null);
|
|
64
|
-
if (!sdk)
|
|
65
|
-
return;
|
|
66
|
-
const cartManager = sdk.getCartManager?.();
|
|
67
|
-
if (!cartManager)
|
|
68
|
-
return;
|
|
69
|
-
// Subscribe to cart updates
|
|
70
|
-
this.unsubscribe = cartManager.on?.('cart:updated', (cart) => {
|
|
71
|
-
const newCount = cart?.itemCount || 0;
|
|
72
|
-
console.log('[tl-cart-badge] Cart updated:', newCount);
|
|
73
|
-
this.itemCount = newCount;
|
|
74
|
-
this.persistCartCount(newCount);
|
|
75
|
-
});
|
|
76
|
-
// Load initial cart
|
|
77
|
-
cartManager.get?.().then((cart) => {
|
|
78
|
-
const newCount = cart?.itemCount || 0;
|
|
79
|
-
this.itemCount = newCount;
|
|
80
|
-
this.persistCartCount(newCount);
|
|
81
|
-
}).catch(() => {
|
|
82
|
-
// Cart may not exist yet - keep persisted value
|
|
83
|
-
});
|
|
81
|
+
forward(event, detail) {
|
|
82
|
+
if (event === 'tlClick')
|
|
83
|
+
this.tlClick.emit(detail);
|
|
84
84
|
}
|
|
85
85
|
renderIcon() {
|
|
86
86
|
if (this.icon) {
|
|
@@ -89,18 +89,31 @@ const TlCartBadge = class {
|
|
|
89
89
|
return (h("svg", { class: "icon-svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z" })));
|
|
90
90
|
}
|
|
91
91
|
render() {
|
|
92
|
-
const
|
|
93
|
-
const displayCount = this.itemCount > 99 ? '99+' : this.itemCount.toString();
|
|
92
|
+
const { derived } = this.view;
|
|
94
93
|
// Badge only mode - just show the count bubble
|
|
95
94
|
if (this.badgeOnly) {
|
|
96
|
-
if (
|
|
95
|
+
if (derived.renderNothing) {
|
|
97
96
|
return null;
|
|
98
97
|
}
|
|
99
|
-
return
|
|
98
|
+
return h("span", { class: `badge-only ${derived.sizeClass}` }, derived.displayCount);
|
|
100
99
|
}
|
|
101
100
|
// Full mode with icon and badge
|
|
102
|
-
return (h("button", { class: `cart-badge
|
|
101
|
+
return (h("button", { class: `cart-badge ${derived.sizeClass}`, onClick: this.handleClick, "aria-label": derived.ariaLabel }, this.renderIcon(), derived.showBadge && h("span", { class: "badge-count" }, derived.displayCount)));
|
|
103
102
|
}
|
|
103
|
+
static get watchers() { return {
|
|
104
|
+
"showEmpty": [{
|
|
105
|
+
"syncProps": 0
|
|
106
|
+
}],
|
|
107
|
+
"icon": [{
|
|
108
|
+
"syncProps": 0
|
|
109
|
+
}],
|
|
110
|
+
"size": [{
|
|
111
|
+
"syncProps": 0
|
|
112
|
+
}],
|
|
113
|
+
"badgeOnly": [{
|
|
114
|
+
"syncProps": 0
|
|
115
|
+
}]
|
|
116
|
+
}; }
|
|
104
117
|
};
|
|
105
118
|
TlCartBadge.style = tlCartBadgeCss();
|
|
106
119
|
|