@seatlayer/js 0.109.2 → 0.110.1
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 +47 -6
- package/dist/channelsMode-DS6TLE4L.js +1 -0
- package/dist/chunk-3FEGZ5HA.js +1 -0
- package/dist/{chunk-T57HSGPG.js → chunk-3IZZM7EV.js} +1 -1
- package/dist/chunk-7I563G2N.js +1 -0
- package/dist/{chunk-DO536AZM.js → chunk-ECM3ZZET.js} +1 -1
- package/dist/chunk-JDMJI3WC.js +1 -0
- package/dist/{chunk-HHV7F37Y.js → chunk-JS5WH7YG.js} +1 -1
- package/dist/hostedCheckout-2JDHIDPG.js +183 -0
- package/dist/index.cjs +129 -54
- package/dist/index.d.cts +462 -120
- package/dist/index.d.ts +462 -120
- package/dist/index.js +128 -51
- package/dist/manager.cjs +186 -186
- package/dist/manager.js +2 -2
- package/dist/{managerExtras-4NVAPHFZ.js → managerExtras-XQSDPEQ7.js} +1 -1
- package/dist/{pickerSalesClose-AVOFKQPC.js → pickerSalesClose-2APTQFVA.js} +1 -1
- package/package.json +2 -2
- package/dist/channelsMode-JF2EUOZY.js +0 -1
- package/dist/chunk-OSZ7DOEH.js +0 -1
- package/dist/chunk-U2Z2AGRX.js +0 -1
- package/dist/chunk-UBFNMA7U.js +0 -1
- package/dist/hostedCheckout-XSQ7ISQC.js +0 -185
package/README.md
CHANGED
|
@@ -40,7 +40,11 @@ runtime with the framework's own component, props, and lifecycle around it.
|
|
|
40
40
|
|
|
41
41
|
- A browser DOM. Give the container a definite height; the chart sizes itself
|
|
42
42
|
to its container, not to the viewport.
|
|
43
|
-
- No framework
|
|
43
|
+
- No framework is required.
|
|
44
|
+
- The npm package needs a bundler. Its ES modules import `@seatlayer/core` by
|
|
45
|
+
name, so a page can't load them straight from `node_modules`. Vite, webpack,
|
|
46
|
+
esbuild, Rollup and the frameworks' own builds all work. A page with no build
|
|
47
|
+
step loads the hosted bundle instead (below).
|
|
44
48
|
|
|
45
49
|
## Install
|
|
46
50
|
|
|
@@ -48,6 +52,8 @@ runtime with the framework's own component, props, and lifecycle around it.
|
|
|
48
52
|
npm install @seatlayer/js
|
|
49
53
|
```
|
|
50
54
|
|
|
55
|
+
Import it from your bundled code (`import { SeatPicker } from '@seatlayer/js'`).
|
|
56
|
+
|
|
51
57
|
No build tool? Load the hosted bundle instead — it exposes a `seatlayer`
|
|
52
58
|
global. Pin an exact version in production; the major alias always redirects to
|
|
53
59
|
the newest release in that line. `seatlayer-buyer.js` is the widget on its own;
|
|
@@ -192,11 +198,10 @@ host that handles none of them still shows the buyer something true.
|
|
|
192
198
|
### Package prices and hosted Season checkout
|
|
193
199
|
|
|
194
200
|
`GET /pub/seasons/:key/prices` returns per-category package prices in minor
|
|
195
|
-
units. When it does,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
platform confirms the price" wording stays exactly as it was.
|
|
201
|
+
units. When it does, the picker's own cart shows each seat's package price
|
|
202
|
+
("$480 for all 8 dates" on the seat card), the type each seat is sold as when
|
|
203
|
+
`priceTypes` offers a choice, and the package total for every date. With no
|
|
204
|
+
server prices the cart shows no amounts, and your checkout prices the package.
|
|
200
205
|
|
|
201
206
|
`checkout` chooses who takes the money:
|
|
202
207
|
|
|
@@ -218,6 +223,42 @@ complete. `returnUrl` follows the same rules as the Event picker's: the
|
|
|
218
223
|
organizer's declared embed domains decide whether it is honoured, so supplying
|
|
219
224
|
one cannot authorize it.
|
|
220
225
|
|
|
226
|
+
### Adult, child and other price types
|
|
227
|
+
|
|
228
|
+
A package can price each category once per price type: `adult`, `child`,
|
|
229
|
+
`concession`, `senior` and `student`. List the types this picker sells and each
|
|
230
|
+
seat card in the cart offers the types the package prices for that seat's
|
|
231
|
+
category, at that type's price, before the hold:
|
|
232
|
+
|
|
233
|
+
```js
|
|
234
|
+
const picker = new SeasonPicker({
|
|
235
|
+
container: '#season',
|
|
236
|
+
season: 'sea_2027',
|
|
237
|
+
priceTypes: ['adult', 'child'],
|
|
238
|
+
onContinue: (handoff) => continueOnYourServer(handoff.seats),
|
|
239
|
+
// handoff.seats: [{ label: 'A-1', priceTypeKey: 'adult' }, { label: 'A-2', priceTypeKey: 'child' }]
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Or name the types yourself; a label left out is adult.
|
|
243
|
+
await picker.holdSameSeat(['A-1', 'A-2'], 'sop_checkout_1185', { 'A-2': 'child' });
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
The hold sends `selections[].priceTypeKey` for each non-adult seat. A type the
|
|
247
|
+
package does not price for that seat is refused with a `SeasonApiError` coded
|
|
248
|
+
`price_type_not_offered`, and nothing is held. Without `priceTypes` (or with
|
|
249
|
+
`['adult']`) every seat is adult and the hold is sent as before. The
|
|
250
|
+
types offered come from `GET /pub/seasons/:key/prices`, so a Season with no
|
|
251
|
+
public prices offers none and holds adult unless `holdSameSeat` names a type.
|
|
252
|
+
Best Available takes no type, so its seats are adult.
|
|
253
|
+
|
|
254
|
+
### Layout
|
|
255
|
+
|
|
256
|
+
A `SeasonPicker` draws in the event picker's own layout and fills its
|
|
257
|
+
container: the map with its controls, the cart as a side panel on a wide
|
|
258
|
+
container and a bottom sheet on a narrow one, and 3D in the same space. The
|
|
259
|
+
package lines are in that cart. Size the container as you would for
|
|
260
|
+
`SeatPicker`; the hosted season page gives it the window under its header.
|
|
261
|
+
|
|
221
262
|
The framework-agnostic JavaScript `SeasonPicker` is also wrapped by
|
|
222
263
|
`@seatlayer/react`, `@seatlayer/vue`, and `@seatlayer/angular` `0.72.0` and
|
|
223
264
|
newer. React Native, Flutter, iOS, and Android do not expose a Season bridge
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as a,Q as b,R as c}from"./chunk-ECM3ZZET.js";import"./chunk-3IZZM7EV.js";import"./chunk-3FEGZ5HA.js";import"./chunk-7I563G2N.js";export{b as CHANNELS_CSS,c as ChannelsMode,a as bucketRowsHtml};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{relativeLuminance255 as y,rgb255ToHex as E}from"@seatlayer/core/core/color";function c(e){if(!e)return null;let n=e.trim().toLowerCase();if(n==="white")return{r:255,g:255,b:255};if(n==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(n)?.[1];if(t){let s=t.length<=4?[...t].map(o=>`${o}${o}`).join(""):t;return{r:Number.parseInt(s.slice(0,2),16),g:Number.parseInt(s.slice(2,4),16),b:Number.parseInt(s.slice(4,6),16)}}let r=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(n);return r?{r:Math.max(0,Math.min(255,Number(r[1]))),g:Math.max(0,Math.min(255,Number(r[2]))),b:Math.max(0,Math.min(255,Number(r[3])))}:null}function m(e){return y([e.r,e.g,e.b])}function i(e,n){let t=c(e),r=c(n);if(!t||!r)return null;let s=Math.max(m(t),m(r)),o=Math.min(m(t),m(r));return(s+.05)/(o+.05)}function l(e,n="#172033",t="#eef1f8"){return(i(n,e)??0)>=(i(t,e)??0)?n:t}function R(e){return E(e.r,e.g,e.b)}function h(e,n,t){let r=c(e),s=c(n);if(!r||!s)return null;let o=Math.max(0,Math.min(1,t));return R({r:r.r*o+s.r*(1-o),g:r.g*o+s.g*(1-o),b:r.b*o+s.b*(1-o)})}var g="#d8a425",I=.18;function x(e,n){let t=h(g,n,I)??n;if((i(g,t)??0)>=4.5)return g;for(let r=.15;r<=1;r+=.05){let s=h(g,e,1-r);if(s&&(i(s,t)??0)>=4.5)return s}return l(t)}function M(e,n,t,r){if((i(e,t)??4.5)>=4.5&&(i(e,r)??4.5)>=4.5)return e;if(!c(e)||!c(n))return n;for(let s=.15;s<=1;s+=.05){let o=h(e,n,1-s);if(o&&(i(o,t)??0)>=4.5&&(i(o,r)??0)>=4.5)return o}return n}function k(e){return{"--sl-chrome":e?"#d6dce6":"#556278","--sl-chrome-line":e?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var P=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function S(e,n){let t=n??e["--sl-bg"],r=c(t)?l(t)==="#172033":!1,s=c(e["--sl-bg"])?l(e["--sl-bg"])==="#172033":!1;if(r===s)return null;let o=r?"#ffffff":"#1a2234",a=l(t),u=e["--sl-accent"];return{"--sl-bg":t,"--sl-surface":o,"--sl-text":a,"--sl-muted":r?"#667085":"#a5aec2","--sl-line":r?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":M(u,a,t,o),...k(r),"--sl-warn-text":x(a,o)}}var L="#f7f8fb",T={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function N(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function _(e){if(e)return e==="auto"?N()?"dark":"light":e}function H(e,n=e?.mode){if(e?.map)return e.map;let t=_(n);return t?{background:T[t].map}:null}function A(e){let n;try{n=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!n)return()=>{};let t=r=>e(r.matches);return typeof n.addEventListener=="function"?n.addEventListener("change",t):n.addListener?.(t),()=>{typeof n.removeEventListener=="function"?n.removeEventListener("change",t):n.removeListener?.(t)}}function K(e,n,t,r){let s=t?T[t]:null,o=n?.background??s?.background??e?.background??L,a=c(o)?l(o)==="#172033":!1,u=n?.surface??s?.surface??(a?"#ffffff":"#1a2234"),C=r&&/^#[0-9a-f]{6}$/i.test(r)?r:void 0,f=n?.accent??e?.accent??C??"#f4b740",b=e?.accentInk,v=n?.accentInk??(b&&(i(b,f)??4.5)>=4.5?b:l(f,"#1a1200","#ffffff")),d=s?void 0:e?.textColor,p=n?.text??s?.text??(d&&(i(d,o)??4.5)>=4.5&&(i(d,u)??4.5)>=4.5?d:l(o));return{"--sl-accent":f,"--sl-accent-ink":v,"--sl-accent-text":M(f,p,o,u),"--sl-warn-text":x(p,u),"--sl-bg":o,"--sl-surface":u,"--sl-text":p,"--sl-muted":n?.muted??s?.muted??(a?"#667085":"#a5aec2"),"--sl-line":n?.line??s?.line??(a?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...k(a),"--sl-scrim-ink":a?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":n?.fontFamily??e?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${n?.radius??14}px`}}export{P as a,S as b,T as c,_ as d,H as e,A as f,K as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i}from"./chunk-
|
|
1
|
+
import{c as i}from"./chunk-3FEGZ5HA.js";function m(t){t.querySelectorAll("select:not([data-themed])").forEach(e=>{e.dataset.themed="true";let n=document.createElement("details");n.className="slm-themed-picker";let r=document.createElement("summary"),l=document.createElement("div");l.className="slm-themed-options";let d=e.getAttribute("aria-label")||Array.from(e.labels??[]).map(o=>o.textContent).join(" ")||"Choose option";r.setAttribute("aria-label",d.trim()),n.append(r,l),e.after(n),e.hidden=!0;let s=()=>{r.textContent=e.selectedOptions[0]?.textContent??"Choose\u2026",r.setAttribute("aria-disabled",String(e.disabled)),l.replaceChildren(...Array.from(e.options).map(o=>{let a=document.createElement("button");return a.type="button",a.textContent=o.textContent,a.setAttribute("aria-label",o.textContent??""),a.disabled=e.disabled||o.disabled,a.setAttribute("aria-pressed",String(o.selected)),a.onclick=()=>{e.value=o.value,n.open=!1,s(),r.focus(),e.dispatchEvent(new Event("change",{bubbles:!0})),s()},a}))};s(),e.addEventListener("change",s),r.onclick=o=>{if(e.disabled){o.preventDefault();return}s(),t.querySelectorAll(".slm-themed-picker").forEach(a=>{a!==n&&(a.open=!1)})},n.addEventListener("focusout",o=>{n.contains(o.relatedTarget)||(n.open=!1)}),n.addEventListener("keydown",o=>{if(o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),n.open=!1,r.focus()),o.key==="ArrowDown"||o.key==="ArrowUp"){if(e.disabled)return;o.preventDefault(),n.open=!0;let a=Array.from(l.querySelectorAll("button:not(:disabled)")),c=a.indexOf(document.activeElement);a[(c+(o.key==="ArrowDown"?1:a.length-1)+a.length)%a.length]?.focus()}})})}function f(t){t.querySelectorAll('input[type="date"],input[type="datetime-local"],input[type="time"]').forEach(e=>{e.dataset.slmPicker!=="1"&&(e.dataset.slmPicker="1",e.addEventListener("click",()=>{if(!(e.disabled||e.readOnly))try{e.showPicker?.()}catch{}}))})}import{formatMoney as u}from"@seatlayer/core";function h(t){return t?t.mode:"open"}function y(t,e,n){switch(t){case"open":return null;case"hidden":return{mode:"hidden",labels:e};case"closed":return{mode:"closed",labels:e};case"timed":return{mode:"timed",revealAt:n?.revealAt??Date.now()+36e5,labels:e};case"threshold":return{mode:"threshold",thresholdPct:n?.thresholdPct??80,labels:e}}}function E(t){if(typeof t=="string"){let e=document.querySelector(t);if(!e)throw new Error(`seatmanager: container "${t}" not found`);return e}if(!(t instanceof HTMLElement))throw new Error("seatmanager: container must be a CSS selector or an HTMLElement");return t}function S(t){if(!t.startsWith("mse_"))throw new Error("seatmanager: token must be a short-lived event-scoped mse_ grant minted by your backend; tenant secret keys are unsupported in browsers")}function k(t){return t==="blocked"?"not_for_sale":t}var M={free:"#6e7bff",booked:"#9ca3af",held:"#f4b740",blocked:"#475569"};function T(t,e){let n=t??{},r=e?i[e]:null,l=e==="light";return{"--slm-bg":n.background??r?.background??"#0e1017","--slm-surface":r?.surface??"#181b24","--slm-text":r?.text??"#eef1f7","--slm-muted":r?.muted??"#8b93a7","--slm-line":r?.line??"rgba(255,255,255,.09)","--slm-tint":l?"rgba(23,32,51,.05)":"rgba(255,255,255,.035)","--slm-tint-strong":l?"rgba(23,32,51,.09)":"rgba(255,255,255,.07)","--slm-accent":n.accent??(l?"#4654c8":"#6e7bff"),"--slm-accent-ink":n.accentInk??"#ffffff","--slm-font":"-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif","--slm-radius":"14px"}}function A(t){return t?i[t].map:null}function x(t,e){let n=Math.max(0,Math.round((e-t)/1e3));if(n<5)return"just now";if(n<60)return`${n}s ago`;let r=Math.round(n/60);return r<60?`${r}m ago`:`${Math.round(r/60)}h ago`}function v(t,e){return u(t,e,{maximumFractionDigits:0,fallback:(n,r)=>`${r} ${Math.round(n).toLocaleString()}`})}function R(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export{m as a,f as b,h as c,y as d,E as e,S as f,k as g,M as h,T as i,A as j,x as k,v as l,R as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=a=>{throw TypeError(a)};var e=(a,b,c)=>b.has(a)||f("Cannot "+c);var h=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),j=(a,b,c)=>b.has(a)?f("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),i=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c),k=(a,b,c)=>(e(a,b,"access private method"),c);var l=(a,b,c,d)=>({set _(g){i(a,b,g,c)},get _(){return h(a,b,d)}});export{h as a,j as b,i as c,k as d,l as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ne,m as S}from"./chunk-
|
|
1
|
+
import{a as ne,m as S}from"./chunk-3IZZM7EV.js";var ie={tag:'<path d="M3.5 12.2V4.5a1 1 0 0 1 1-1h7.7l8.3 8.3a1.4 1.4 0 0 1 0 2l-6.3 6.3a1.4 1.4 0 0 1-2 0z"/><circle cx="8" cy="8" r="1.6"/>',ban:'<circle cx="12" cy="12" r="8.5"/><path d="M6 6l12 12"/>',cursor:'<path d="M5 3.5l13 7-5.6 1.6L10 18z"/>',box:'<rect x="4" y="4" width="16" height="16" rx="2" stroke-dasharray="3 2.4"/>',search:'<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/>',alert:'<path d="M12 3.8l9.3 16.2H2.7z"/><path d="M12 10v4.5M12 17.3v.2"/>',check:'<path d="M5 12.5l4.5 4.5L19 7.5"/>',eye:'<path d="M2.5 12s3.5-6.5 9.5-6.5 9.5 6.5 9.5 6.5-3.5 6.5-9.5 6.5S2.5 12 2.5 12z"/><circle cx="12" cy="12" r="3"/>',bookmark:'<path d="M6.5 3.5h11v17l-5.5-4-5.5 4z"/>',layers:'<path d="M12 3.5l8.5 4.5L12 12.5 3.5 8z"/><path d="M3.5 12L12 16.5 20.5 12"/><path d="M3.5 16L12 20.5 20.5 16"/>',table:'<circle cx="12" cy="12" r="5"/><circle cx="12" cy="3.5" r="1.6"/><circle cx="12" cy="20.5" r="1.6"/><circle cx="3.5" cy="12" r="1.6"/><circle cx="20.5" cy="12" r="1.6"/>',clock:'<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>',lock:'<rect x="5" y="10.5" width="14" height="10" rx="2"/><path d="M8 10.5V7.5a4 4 0 0 1 8 0v3"/>',info:'<circle cx="12" cy="12" r="8.5"/><path d="M12 11v5.5M12 7.6v.2"/>',user:'<circle cx="12" cy="8" r="3.8"/><path d="M4.5 20.5a7.5 7.5 0 0 1 15 0"/>',bolt:'<path d="M13 3L5 13.5h6l-1 7.5 8-10.5h-6z"/>',star:'<path d="M12 3.8l2.5 5.2 5.7.8-4.1 4 1 5.6L12 16.8l-5.1 2.6 1-5.6-4.1-4 5.7-.8z"/>',seat:'<path d="M7 11V6.5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2V11"/><path d="M5 11h14v4H5z"/><path d="M7 15v4.5M17 15v4.5"/>',gauge:'<path d="M4 16a8 8 0 1 1 16 0"/><path d="M12 16l4-5"/>',bell:'<path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z"/><path d="M10 20.5a2 2 0 0 0 4 0"/>',undo:'<path d="M8.5 5L4 9.5 8.5 14"/><path d="M4 9.5h10a6 6 0 0 1 0 12h-3"/>',plus:'<path d="M12 5v14M5 12h14"/>',palette:'<path d="M12 3.5a8.5 8.5 0 1 0 0 17c1.2 0 1.8-.8 1.8-1.7 0-1.3-1-1.6-1-2.8 0-1 .8-1.7 1.8-1.7h2.2a3.7 3.7 0 0 0 3.7-3.7C20.5 6.4 16.7 3.5 12 3.5z"/><circle cx="7.8" cy="11" r="1.2"/><circle cx="10.5" cy="7.3" r="1.2"/><circle cx="15" cy="7.6" r="1.2"/>',x:'<path d="M6 6l12 12M18 6L6 18"/>',ticket:'<path d="M3.5 8.5V6a1 1 0 0 1 1-1h15a1 1 0 0 1 1 1v2.5a2.5 2.5 0 0 0 0 5V16a1 1 0 0 1-1 1h-15a1 1 0 0 1-1-1v-2.5a2.5 2.5 0 0 0 0-5z"/><path d="M14 5.5v11" stroke-dasharray="1.6 2"/>',history:'<path d="M4 12a8 8 0 1 0 2.3-5.6"/><path d="M4 4.5v3.5h3.5"/><path d="M12 8v4.2l2.8 1.8"/>',spark:'<path d="M12 3.5l1.8 5 5 1.8-5 1.8-1.8 5-1.8-5-5-1.8 5-1.8z"/><path d="M18.5 15.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z"/>',lasso:'<ellipse cx="12" cy="9.5" rx="8" ry="5.5" stroke-dasharray="3 2.4"/><path d="M8.5 14.5c-1.5 1.2-1.6 3.4.2 4.2 1.4.6 2.8-.3 2.8-1.7"/>',hand:'<path d="M8 13V6a2 2 0 0 1 4 0v6-8a2 2 0 0 1 4 0v8-6a2 2 0 0 1 4 0v10c0 4-3 6-7 6-3 0-5-2-7-5l-3-4a2 2 0 0 1 3-2l2 2Z"/>',fit:'<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>',route:'<circle cx="6" cy="6" r="2.2"/><circle cx="18" cy="18" r="2.2"/><path d="M8.2 6H15a3 3 0 0 1 0 6H9a3 3 0 0 0 0 6h6.8"/>'};function M(i,e,t=30){let n=Math.round(t*.58);return`<span class="slm-plate" style="width:${t}px;height:${t}px;background:color-mix(in srgb,${e} 15%,transparent)"><svg width="${n}" height="${n}" viewBox="0 0 24 24" fill="none" stroke="${e}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ie[i]??""}</svg></span>`}var yt={booked:["seat","#8a94a6"],free:["seat","#22a06b"],held:["clock","#d99a0b"],blocked:["ban","#d64545"],reserved:["bookmark","#c026d3"]};function B(i,e="currentColor",t=16){return`<svg width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="${e}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ie[i]??""}</svg>`}function ae(i){return`<div class="slm-railhead slm-taskhead">${M(i.glyph,i.hue)}<p class="slm-eyebrow">${S(i.title)}</p>${i.badge?`<span class="slm-scope event">${S(i.badge)}</span>`:""}</div><p class="slm-hint">${i.purpose}${i.how?` <button type="button" class="slm-howlink" data-how="${i.how}">How it works \u203A</button>`:""}</p>`}function kt(){return'<div class="slm-selcard" data-ref="selcard" aria-live="polite"></div>'}function oe(){return typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"\u2318K":"Ctrl K"}function wt(){return oe().replace("\u2318","\u2318 ").split(" ").map(i=>`<kbd>${i}</kbd>`).join("")}function se(){return typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches}var Oe=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"\u2318Z":"Ctrl Z",_e='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>',qe=[["cursor","#d99a0b","Click a seat","or anywhere near it"],["box","#d99a0b","Drag on the map","to draw a box"],["search","#4c6fff","Search",", then Enter"]],Ne=[["cursor","#d99a0b","Tap a seat","or anywhere near it"],["box","#d99a0b","Press and hold, then drag","to draw a box"],["search","#4c6fff","Find","a seat, row or section"]];function xt(i,e){if(i.classList.toggle("empty",e.count===0),!e.count){i.innerHTML=`<div class="slm-selcount"><b>0</b> seats selected</div><div class="slm-ways">${(se()?Ne:qe).map(([n,s,a,o])=>`<span>${M(n,s,26)}<span><b>${a}</b>${n==="search"&&!se()?oe():""}${o}</span></span>`).join("")}${e.saved?`<button type="button" class="slm-savedrow" data-saved-list>${M("star","#d99a0b",26)}<span><b>Saved selections</b>${e.saved.toLocaleString()} on this event</span>${_e}</button>`:""}</div>`;return}let t=e.count===1?"seat":"seats";i.innerHTML=`<div class="slm-selcount"><b>${e.count.toLocaleString()}</b> ${t} selected<button type="button" class="slm-linkbtn" data-sel-clear>Clear</button></div><p class="slm-selwhere">${S(e.where)}</p><div class="slm-selparts">${e.parts.map(n=>`<span class="tone-${n.tone}">${S(n.label)}</span>`).join("")}${e.types.map(n=>`<span class="type"><i style="background:${S(n.color)}"></i>${S(n.label)}${n.count==null?"":` ${n.count.toLocaleString()}`}</span>`).join("")}</div>`+(e.stale?`<p class="slm-selstale">${M("alert","#b45309",20)}${S(e.stale)}</p>`:"")+`<div class="slm-selbtns">${e.canSimilar?`<span class="slm-simwrap"><button type="button" class="slm-btn ghost" data-sel-similar aria-haspopup="menu" aria-expanded="false">${B("spark","#d99a0b")}Select similar</button></span>`:""}<button type="button" class="slm-btn ghost" data-sel-undo title="Undo the last change to the selection (${Oe})"${e.canUndo?"":" disabled"}>${B("undo","#64748b")}Undo</button>${e.canSave?`<button type="button" class="slm-btn ghost slm-selsave" data-sel-save>${B("star","#d99a0b")}Save</button>`:""}</div>`}function Ue(i){return i.length?i.length===1?`row ${i[0]}`:i.length<=4?`rows ${i[0]}\u2013${i[i.length-1]}`:`${i.length} rows`:""}function St(i){if(!i.length)return"";if(i.length===1){let t=Ue(i[0].rows);return t?`${i[0].label} \xB7 ${t}`:i[0].label}let e=i.slice(0,2).map(t=>t.label).join(", ");return`${i.length} sections: ${e}${i.length>2?"\u2026":""}`}function v(i,e,t,n){return`<div class="slm-panelalert ${i}" role="${i==="error"?"alert":"status"}">${B(n??(i==="ok"?"check":"alert"),"currentColor",18)}<span><b>${S(e)}</b>${S(t)}</span></div>`}function Ct(i){return`<div class="slm-railfoot" data-ref="${i}"><button type="button" class="slm-btn" data-foot-action></button><button type="button" class="slm-linkbtn" data-foot-secondary hidden></button><p class="slm-note" data-foot-note></p></div>`}function $t(i,e){let t=i.querySelector("[data-foot-action]"),n=i.querySelector("[data-foot-note]");t&&(t.textContent=e.label,t.disabled=!!e.disabled||!!e.busy,t.classList.toggle("danger",!!e.danger),t.classList.toggle("busy",!!e.busy),t.setAttribute("aria-busy",String(!!e.busy)));let s=i.querySelector("[data-foot-secondary]");s&&(s.hidden=!e.secondary,s.innerHTML=e.secondary?`${e.look?B("undo","currentColor",14):""}${S(e.secondary)}`:"",s.disabled=!!e.busy),n&&(n.textContent=e.note??"",n.hidden=!e.note),i.classList.toggle("done",e.look==="done"),i.classList.toggle("settle",e.look==="settle")}function Ve(i,e){if(!i.labels.length)return"Nothing found";let t=[];i.sections&&t.push(`${i.sections.toLocaleString()} section${i.sections===1?"":"s"}`),i.rows&&t.push(`${i.rows.toLocaleString()} row${i.rows===1?"":"s"}`);let n=`${i.labels.length.toLocaleString()} seat${i.labels.length===1?"":"s"} found`,s=t.length?`${t.join(" \xB7 ")} \xB7 ${n}`:n;return e?`${s} \xB7 Enter to ${e==="frame"?"show":"select"}`:s}function Fe(i={}){return`
|
|
2
2
|
<div class="slm-find${i.compact?" slm-find-bar":""}" data-ch-find>
|
|
3
3
|
<input type="search" class="slm-input" data-ch-find-input placeholder="Find seat, row or section" aria-label="Find seat, row or section" autocomplete="off"${i.compact?' aria-keyshortcuts="/"':""}>
|
|
4
4
|
<span class="slm-find-count" data-ch-find-count role="status"></span>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function C(p){return p.focusedSection!==null?p.deeperThanSectionFrame===!1?"venue":"section":p.atVenueFit!==void 0?p.atVenueFit?"none":"venue":p.seatsRevealed?"venue":"none"}import{pointInPolygon as M,t as u}from"@seatlayer/core";import{createMinimapTransform as y,minimapPointToWorld as x,minimapViewportPlan as w}from"@seatlayer/core/picker/minimapGeometry";function S(p){let e={inactive:0,available:1,selected:2},i=new Map;for(let n of p){let o=i.get(n.id);(!o||e[n.state]>e[o])&&i.set(n.id,n.state)}let t={selected:0,available:0,inactive:0};for(let n of i.values())t[n]+=1;return t}function k(p,e){return p.x<=e.x&&p.y<=e.y&&p.x+p.width>=e.x+e.width&&p.y+p.height>=e.y+e.height}function L(p,e){let i=new g(p);return i.build(e),i}var g=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let t=document.createElement("button");t.type="button",t.className="sl-minimap-toggle",t.setAttribute("aria-label",u("picker.openVenueMap")),t.setAttribute("aria-expanded","false"),t.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(t),this.miniToggle=t;let n=document.createElement("div");n.className="sl-minimap",n.setAttribute("role","group");let o=document.createElement("div");o.className="sl-minimap-bar";let h=document.createElement("span");h.className="sl-minimap-label";let s=document.createElement("span");s.className="sl-minimap-key",s.setAttribute("aria-label",u("picker.minimapStateKey")),s.append(...[["focused","picker.minimapStateFocused"],["selected","picker.minimapStateSelected"],["","picker.minimapStateAvailable"],["inactive","picker.minimapStateInactive"]].map(([a,f])=>{let m=document.createElement("i");return a&&(m.className=a),m.title=u(f),m}));let r=document.createElement("button");r.type="button",r.className="sl-minimap-close",r.setAttribute("aria-label",u("picker.closeVenueMap")),r.textContent="\xD7",o.append(h,s,r);let l=document.createElement("canvas");l.tabIndex=0,l.setAttribute("role","application"),l.setAttribute("aria-label",u("picker.venueMapLabel")),n.append(o,l),e.appendChild(n),this.miniWrap=n,this.miniLabel=h,this.miniCanvas=l;let d=document.createElement("canvas");this.miniBase=d,t.addEventListener("click",()=>{let a=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=a,this.setMinimapOpen(!a)}),r.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),l.addEventListener("click",a=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(a)}),l.addEventListener("pointerdown",a=>this.minimapPointerDown(a)),l.addEventListener("pointermove",a=>this.minimapPointerMove(a)),l.addEventListener("pointerup",a=>this.minimapPointerUp(a)),l.addEventListener("pointercancel",a=>this.minimapPointerUp(a)),l.addEventListener("keydown",a=>this.minimapKeydown(a)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,i=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),i&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,i=this.miniBase,t=this.host.controller.getViewport()?.bounds;if(!e||!i||!t||!(t.width>0&&t.height>0))return;let n=196,o=146,h=6,s=t.width/Math.max(1,t.height),r=n,l=Math.round(n/s);l>o&&(l=o,r=Math.round(o*s)),r=Math.max(64,r),l=Math.max(48,l);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(r*d),e.height=Math.round(l*d),e.style.width=`${r}px`,e.style.height=`${l}px`,i.width=e.width,i.height=e.height,this.miniTf=y(t,e.width,e.height,d,h)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),i=this.host.controller.isFloorOverview()?u("picker.allFloors"):e.find(r=>r.id===this.host.controller.getActiveFloorId())?.name??u("picker.venueOverview"),t=this.host.controller.getMinimapSnapshot().sections,o=t.find(r=>r.active)?.label??this.host.focusedSectionLabel(),h=o?`${i} \xB7 ${o}`:i;this.miniLabel.textContent=h;let s=u("picker.venueMapSummary",S(t));this.miniWrap.setAttribute("aria-label",t.length?`${h}. ${s}`:h),this.miniCanvas?.setAttribute("aria-label",t.length?`${h}. ${s} ${u("picker.venueMapPanSections")}`:`${h}. ${u("picker.venueMapPanEmpty")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,i=this.miniTf;if(!e||!i)return;let t=e.getContext("2d");if(!t)return;t.clearRect(0,0,e.width,e.height);let n=a=>a*i.scale+i.offX,o=a=>a*i.scale+i.offY,h=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",s=this.host.cssVar("--sl-muted")||"#8b93a7",r=this.host.cssVar("--sl-accent")||"#6e7bff",l=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let a of d.sections){if(a.outline.length<3)continue;t.beginPath(),a.outline.forEach((m,c)=>c===0?t.moveTo(n(m.x),o(m.y)):t.lineTo(n(m.x),o(m.y))),t.closePath();let f=a.paint;if(t.globalAlpha=a.state==="inactive"?.5:.92,f?t.fillStyle=f.fill:(t.globalAlpha=a.state==="inactive"?.18:a.state==="selected"?.72:.34,t.fillStyle=a.state==="inactive"?s:a.state==="selected"?r:l),t.fill(),t.globalAlpha=.82,t.lineWidth=Math.max(1,i.dpr),t.strokeStyle=f?.stroke||h,t.stroke(),a.owned){t.globalAlpha=1,t.lineWidth=Math.max(2,i.dpr*1.5),t.strokeStyle=r,t.stroke();let m=a.outline.reduce((c,v)=>({x:c.x+v.x,y:c.y+v.y}),{x:0,y:0});t.beginPath(),t.arc(n(m.x/a.outline.length),o(m.y/a.outline.length),Math.max(1.5,i.dpr*1.6),0,Math.PI*2),t.fillStyle=r,t.fill(),t.beginPath(),a.outline.forEach((c,v)=>v===0?t.moveTo(n(c.x),o(c.y)):t.lineTo(n(c.x),o(c.y))),t.closePath()}a.active&&(t.globalAlpha=1,t.lineJoin="round",t.lineWidth=Math.max(4,i.dpr*3.5),t.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",t.stroke(),t.lineWidth=Math.max(2,i.dpr*1.75),t.strokeStyle=r,t.stroke())}if(t.globalAlpha=1,!d.sections.length){let a=Math.max(1,i.dpr),f=new Map,m=c=>{let v=f.get(c);if(v)return v;let b=this.host.tint?.(c)||l;return f.set(c,b),b};for(let c of d.seats)t.globalAlpha=c.state==="inactive"?.22:.78,t.fillStyle=c.state==="inactive"?s:c.state==="selected"?r:m(c.categoryKey),t.beginPath(),t.arc(n(c.x),o(c.y),a,0,Math.PI*2),t.fill();t.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,i=this.miniBase,t=this.miniTf;if(!e||!i||!t)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height),n.drawImage(i,0,0);let o=this.host.controller.getViewport();if(!o)return;let h=k(o.visible,o.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",h),h)return;let s=w(o.visible,t,e.width,e.height,Math.max(2,t.dpr*2)),r=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";n.save(),n.globalAlpha=.1,n.fillStyle=r,n.fillRect(s.raw.x,s.raw.y,s.raw.width,s.raw.height),n.globalAlpha=.9,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.25),n.strokeStyle=l,n.strokeRect(s.raw.x,s.raw.y,s.raw.width,s.raw.height),n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=r,n.strokeRect(s.raw.x,s.raw.y,s.raw.width,s.raw.height),s.clipped&&Object.values(s.clippedEdges).some(Boolean)&&(n.setLineDash([Math.max(3,t.dpr*3),Math.max(2,t.dpr*2)]),n.strokeRect(s.clipped.x,s.clipped.y,s.clipped.width,s.clipped.height)),n.restore()}minimapWorldPoint(e){let i=this.miniCanvas,t=this.miniTf;if(!i||!t)return null;let n=i.getBoundingClientRect(),o=(e.clientX-n.left)*(i.width/Math.max(1,n.width)),h=(e.clientY-n.top)*(i.height/Math.max(1,n.height));return{...x({x:o,y:h},t),px:o,py:h}}minimapPointerDown(e){let i=this.minimapWorldPoint(e),t=this.host.controller.getViewport()?.visible;!i||!t||!(i.x>=t.x&&i.x<=t.x+t.width&&i.y>=t.y&&i.y<=t.y+t.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:i.x-(t.x+t.width/2),offsetY:i.y-(t.y+t.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let i=this.miniDrag;if(!i||i.pointerId!==e.pointerId)return;let t=this.minimapWorldPoint(e);t&&(!i.moved&&Math.hypot(e.clientX-i.startX,e.clientY-i.startY)>2&&(i.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:t.x-i.offsetX,y:t.y-i.offsetY}),e.preventDefault())}minimapPointerUp(e){let i=this.miniDrag;!i||i.pointerId!==e.pointerId||(this.miniSuppressClick=i.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let i=this.host.controller.getViewport()?.visible;if(!i)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let t=e.key==="ArrowLeft"?-i.width*.2:e.key==="ArrowRight"?i.width*.2:0,n=e.key==="ArrowUp"?-i.height*.2:e.key==="ArrowDown"?i.height*.2:0;!t&&!n||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:i.x+i.width/2+t,y:i.y+i.height/2+n}),e.preventDefault())}minimapJump(e){let i=this.minimapWorldPoint(e);if(i){for(let t of this.host.controller.getMinimapSnapshot().sections)if(!(t.state==="inactive"||t.outline.length<3)&&M(i,t.outline)){this.host.controller.focusSection(t.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(i)}}};export{C as a,L as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-3IZZM7EV.js";function b(t,r,s,n={}){let i=n.previous?null:document.activeElement??null;n.previous?.scrim.remove();let e=document.createElement("div");e.className="slm-ch-scrim",e.innerHTML=`<div class="slm-ch-dialog" role="dialog" aria-modal="true"
|
|
2
2
|
aria-labelledby="slm-ch-dlg-title" tabindex="-1">${r}</div>`,t.appendChild(e);let o=e.firstElementChild,d=!1,c={scrim:e,dialog:o,close:({restoreFocus:a=!0}={})=>{d||(d=!0,e.remove(),a&&(i?.isConnected&&t.contains(i)?i:t).focus?.({preventScroll:!0}),n.onClose?.())}};return o.querySelectorAll("[data-ch-close]").forEach(a=>{a.addEventListener("click",()=>c.close())}),e.addEventListener("keydown",a=>{if(a.key==="Escape"){a.stopPropagation(),c.close();return}if(a.key!=="Tab")return;let m=[...o.querySelectorAll('summary,button:not([disabled]),select:not([hidden]),input,textarea,a[href],[tabindex]:not([tabindex="-1"])')];if(!m.length)return;let u=m[0],p=m[m.length-1];a.shiftKey&&document.activeElement===u?(a.preventDefault(),p.focus()):!a.shiftKey&&document.activeElement===p&&(a.preventDefault(),u.focus())}),s(o),h(o),(o.querySelector("input,summary,button")??o).focus(),c}var v=`
|
|
3
3
|
.slm{--slm-ch-scrim:rgba(0,0,0,.58)}
|
|
4
4
|
.slm[data-theme=light]{--slm-ch-scrim:rgba(23,32,51,.42)}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import{a as Se}from"./chunk-ICMSBXRJ.js";import"./chunk-7I563G2N.js";var qe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,De=/^[0-9 +()-]{6,20}$/,Re=/^(\d{4})-(\d{2})-(\d{2})$/,Le=["required","invalid","too_long"],Ne=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],Ue={email:"email",phone:"tel",number:"number",date:"date"};function Be(o){return o===void 0||o===""||o===!1||Array.isArray(o)&&!o.length}function He(o,u,s,g){if(Be(s))return u?"required":null;let a=v=>!!g?.some(K=>K.id===v);if(o==="number")return typeof s=="number"&&Number.isFinite(s)?null:"invalid";if(o==="checkbox")return s===!0?null:"invalid";if(o==="select")return a(s)?null:"invalid";if(o==="multiselect")return Array.isArray(s)&&s.length<=50&&s.every(a)?null:"invalid";if(typeof s!="string")return"invalid";if(o==="phone")return De.test(s)?null:"invalid";if(s.length>500)return"too_long";if(o==="email")return qe.test(s)?null:"invalid";if(o==="date"){let v=Re.exec(s);if(!v)return"invalid";let[K,R,z]=[Number(v[1]),Number(v[2]),Number(v[3])],T=new Date(Date.UTC(K,R-1,z));return T.getUTCFullYear()===K&&T.getUTCMonth()===R-1&&T.getUTCDate()===z?null:"invalid"}return null}function y(o,u,s){let g=document.createElement(o);return u&&(g.className=u),s!==void 0&&(g.textContent=s),g}function we(o,u){let s=o?.[u];return s==="optional"||s==="required"?s:"off"}var Ye={name:"name",email:"email",phone:"tel"},Qe=5;function ze(o){let{form:u,t:s,idPrefix:g}=o,a=(u?.questions??[]).filter(t=>t&&!t.archived).sort((t,n)=>t.position-n.position),v=Ne.filter(([t])=>we(u,t)!=="off"),K=a.filter(t=>t.scope==="ticket"),R=a.filter(t=>t.scope!=="ticket"),z=v.length>0||K.length>0;if(!z&&!R.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let T=v.filter(([,t])=>t!=="phone"),ie=v.every(([t])=>we(u,t)!=="required")&&K.every(t=>!t.required),I=[...o.tickets],L=!0,se=!1,U=new Map,pe=(t,n)=>n===void 0?t:`${t}|${n}`,D=[],ge=0,N=y("div","sl-hco-bf sl-hco-bf-inline"),P=y("div","sl-hco-bf"),Y=y("p","sl-hco-alert is-error");Y.setAttribute("role","alert"),Y.hidden=!0;let Q=(t,n)=>n==="required"?s("picker.bookingForm.required","This is required."):n==="too_long"?s("picker.bookingForm.tooLong","This is too long."):t==="email"?s("picker.bookingForm.invalidEmail","Enter a valid email address."):t==="phone"?s("picker.bookingForm.invalidPhone","Enter a valid phone number."):s("picker.bookingForm.invalid","Check this answer."),G=(t,n)=>{t.error.textContent=n?Q(t.kind,n):"",t.error.hidden=!n;let c=t.kind==="multiselect"||t.control.closest(".sl-hco-chips")?t.control.closest("fieldset")??t.control:t.control;n?c.setAttribute("aria-invalid","true"):c.removeAttribute("aria-invalid"),t.control.closest(".sl-hco-block")?.classList.toggle("has-error",D.some(b=>b.ticketKey===t.ticketKey&&!b.error.hidden))},J=(t,n)=>{let c=y("span",void 0,t);if(n)return c;let b=y("span","sl-hco-label-row");return b.append(c," ",y("span","sl-hco-optional",s("checkout.optional","Optional"))),b},j=(t,n)=>{let c=`${g}-bf${ge++}`,b=pe(n.key,n.ticketKey),l=U.get(b),h=y("div","sl-hco-field"),d=n.help?y("p","sl-hco-help",n.help):null;d&&(d.id=`${c}-h`);let k=y("p","sl-hco-ferr");k.id=`${c}-e`,k.hidden=!0;let C=x=>{x.setAttribute("aria-describedby",d?`${d.id} ${k.id}`:k.id),n.required&&x.tagName!=="FIELDSET"&&x.setAttribute("aria-required","true")},w=n.kind==="select"&&(n.options??[]).length<=Qe,F;if(n.kind==="checkbox"||n.kind==="multiselect"||w){let x=n.kind==="checkbox"?null:y("fieldset",w?"sl-hco-group sl-hco-chips":"sl-hco-group"),m=x?n.options??[]:[{id:"",label:n.label}];if(x){w&&x.setAttribute("role","radiogroup");let _=y("legend");_.appendChild(J(n.label,n.required)),x.appendChild(_),d&&x.appendChild(d),C(x)}let M=x?y("div","sl-hco-choices"):null,E=m.map((_,O)=>{let de=y("label",w?"sl-hco-chip":"sl-hco-check"),S=y("input");S.type=w?"radio":"checkbox",S.value=_.id,w&&(S.name=c),x?(O===0&&(S.id=c),S.checked=w?l===_.id:Array.isArray(l)&&l.includes(_.id)):(S.id=c,S.checked=l===!0,C(S));let xe=x?y("span",void 0,_.label):J(n.label,n.required);return de.append(S,xe),(M??h).appendChild(de),S});x&&M?(x.appendChild(M),h.appendChild(x)):d&&h.appendChild(d),F={...n,control:E[0]??x??h,error:k,read:w?()=>E.find(_=>_.checked)?.value??"":x?()=>E.filter(_=>_.checked).map(_=>_.value):()=>!!E[0]?.checked}}else{let x=y("label","sl-hco-label");x.appendChild(J(n.label,n.required)),x.htmlFor=c;let m;if(n.kind==="textarea")m=y("textarea","sl-hco-input"),m.rows=3,m.maxLength=500;else if(n.kind==="select"){m=y("select","sl-hco-input"),m.appendChild(new Option(s("picker.bookingForm.choose","Choose\u2026"),""));for(let E of n.options??[])m.appendChild(new Option(E.label,E.id))}else m=y("input","sl-hco-input"),m.type=Ue[n.kind]??"text",n.kind==="number"?(m.step="any",m.inputMode="decimal"):n.kind!=="date"&&(m.maxLength=n.kind==="phone"?20:500),n.autocomplete&&(m.autocomplete=n.autocomplete);m.id=c,typeof l=="string"?m.value=l:typeof l=="number"&&(m.value=String(l)),C(m),h.append(x,...d?[d]:[],m);let M=m;F={...n,control:m,error:k,read:()=>{let E=M.value.trim();return n.kind!=="number"?E:M.validity?.badInput?Number.NaN:E===""?void 0:Number(E)}}}h.appendChild(k);let ce=()=>{let x=F.read();x===void 0?U.delete(b):U.set(b,x),G(F,null)};return h.addEventListener("input",ce),h.addEventListener("change",ce),t.appendChild(h),D.push(F),F},te=(t,n,c)=>j(t,{key:`question:${n.id}`,...c!==void 0?{ticketKey:c}:{},kind:n.type,label:n.label,required:!!n.required,help:n.helpText,options:n.options}),fe=(t,n,c,b)=>{let l=Ne.find(([h])=>h===c);return j(t,{key:c,ticketKey:n.key,kind:l[1],label:s(l[2],l[3]),required:we(u,c)==="required",autocomplete:b===0&&L?Ye[l[1]]:"off"})},$=(t,n,c="sl-hco-link")=>{let b=y("button",c,t);return b.type="button",b.addEventListener("click",n),b},ke=t=>y("h3","sl-hco-h",t),ae=()=>y("section","sl-hco-sec"),V=t=>{if(!t&&I[0]){let c=o.buyer();for(let[b,l]of T){let h=c[l];h&&U.set(pe(b,I[0].key),h)}se=!0}L=t;for(let[,c]of T)o.buyerError?.(c,null);A(),(t?P.querySelector(".sl-hco-you .sl-hco-link"):P.querySelector(".sl-hco-block input"))?.focus()};function A(){D=[],N.replaceChildren(),P.replaceChildren();let t=I[0],n=I.length===1&&L;if(z&&n&&t){for(let[d,k]of v)k==="phone"&&fe(N,t,d,0);T.length&&N.appendChild($(s("checkout.forSomeoneElse","Ticket for someone else?"),()=>V(!1)))}let c=z&&!n&&(!ie||se||le||!L);if(z&&!n&&!c){let d=ae(),k=$("",()=>{se=!0,A(),P.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");k.setAttribute("aria-expanded","false"),k.append(y("span","sl-hco-plus","+"),y("span",void 0,s("checkout.addNames","Add names for each ticket")),y("span","sl-hco-optional",s("checkout.optional","Optional"))),d.appendChild(k),P.appendChild(d)}if(c){let d=ae();d.appendChild(ke(s("bookingForm.ticketHolders","Ticket holders"))),I.forEach((k,C)=>{let w=y("fieldset","sl-hco-block"),F=y("legend","sl-hco-legend",k.title||s("picker.bookingForm.ticket","Ticket {number}",{number:C+1}));w.appendChild(F);let ce=C===0&&L&&T.length>0;if(ce){let M=o.buyer(),E=y("p","sl-hco-you"),_=M.name||M.email;E.append(y("span",void 0,_?s("checkout.holderYou","You \xB7 {name}",{name:_}):s("checkout.holderYouPlain","You")));let O=$(s("checkout.change","Change"),()=>V(!1));O.setAttribute("aria-label",s("checkout.changeHolder","Change the holder of {ticket}",{ticket:F.textContent??""})),E.appendChild(O),w.appendChild(E)}else C===0&&!L&&T.length>0&&w.appendChild($(s("picker.bookingForm.useMyDetails","Use my details"),()=>V(!0),"sl-hco-link sl-hco-use"));let x=v.filter(([,M])=>!(ce&&M!=="phone")),m=x.length>1?y("div","sl-hco-pair"):w;for(let[M]of x)fe(m,k,M,C);m!==w&&w.appendChild(m);for(let M of K)te(w,M,k.key);d.appendChild(w)}),P.appendChild(d)}let l=[...z&&n&&t?K.map(d=>({q:d,ticketKey:t.key})):[],...R.map(d=>({q:d,ticketKey:void 0}))],h=[...l.filter(({q:d})=>d.type!=="checkbox"),...l.filter(({q:d})=>d.type==="checkbox")];if(h.length){let d=ae();d.appendChild(ke(s("checkout.questions","A few questions")));for(let{q:k,ticketKey:C}of h)te(d,k,C);P.appendChild(d)}P.appendChild(Y)}let le=!1;A();let W=()=>{if(!I[0]||!L)return null;let n=o.buyer(),c=null;for(let[b,l]of T){let h=He(l,we(u,b)==="required",n[l]),d=o.buyerError?.(l,h?Q(l,h):null)??null;h&&!c&&(c=d)}return c},me=t=>(Y.textContent=t?s("picker.bookingForm.fix","Some details need attention."):"",Y.hidden=!t,t?.focus(),!!t),be=(t,n)=>t.compareDocumentPosition(n)&4?-1:1;return{details:N,element:P,validate(){let t=[],n=W();n&&t.push(n);for(let c of D){let b=He(c.kind,c.required,c.read(),c.options);G(c,b),b&&t.push(c.control)}return t.sort(be),!me(t[0]??null)},payload(){let t=new Map,n=[],c=I[0];if(c&&L){let l=o.buyer(),h={ticketKey:c.key};for(let[,d]of T){let k=l[d];k&&(h[d]=k)}(h.name||h.email)&&t.set(c.key,h)}for(let l of D){let h=l.read();if(!Be(h)){if(l.key.startsWith("question:"))n.push({questionId:l.key.slice(9),...l.ticketKey!==void 0?{ticketKey:l.ticketKey}:{},value:h});else if(l.ticketKey!==void 0){let d=t.get(l.ticketKey)??{ticketKey:l.ticketKey},k=l.key==="attendeeName"?"name":l.key==="attendeeEmail"?"email":"phone";d[k]=String(h),t.set(l.ticketKey,d)}}}let b=I.map(l=>t.get(l.key)).filter(l=>!!l);return{...b.length?{attendees:b}:{},...n.length?{answers:n}:{}}},showServerErrors(t){let n=(Array.isArray(t)?t:[]).filter(l=>!!l&&typeof l.key=="string");if(z){let l=!1;for(let h of n)typeof h.ticketKey=="string"&&!I.some(d=>d.key===h.ticketKey)&&(I.push({key:h.ticketKey}),l=!0);le=n.some(h=>typeof h.ticketKey=="string"),(l||le)&&A()}let c=[],b=I[0];for(let l of n){let h=l.key==="attendeeName"?"name":l.key==="attendeeEmail"?"email":null;if(h&&L&&b&&l.ticketKey===b.key&&T.some(([,d])=>d===h)){let d=o.buyerError?.(h,Q(h,Le.includes(l.code)?l.code:"invalid"));d&&c.push(d)}}for(let l of D){let h=n.find(k=>k.key===l.key&&(k.ticketKey??void 0)===(l.ticketKey??void 0)),d=h?Le.includes(h.code)?h.code:"invalid":null;G(l,d),d&&c.push(l.control)}return c.length?(c.sort(be),me(c[0])):(Y.textContent=s("picker.bookingForm.fix","Some details need attention."),Y.hidden=!1,!1)}}}var Ve=9e4,je=2e3,Ie="seatlayer-checkout-style",Xe="@seatlayer/pending-checkout/v1";function We(o,u){try{window.sessionStorage.setItem(Xe,JSON.stringify({orderId:o,...u?{eventKey:u}:{},storedAt:Date.now()}))}catch{}}var Ge=`
|
|
2
|
+
/* Three rows: a header naming the event with the hold's countdown, a body that
|
|
3
|
+
scrolls, and a footer that never does, so the total and the one primary
|
|
4
|
+
button are always on screen however long the organizer's form is. On a
|
|
5
|
+
phone-width widget the card is a bottom sheet.
|
|
6
|
+
--sl-safe-b is declared on .sl-picker, which this overlay lives inside, so it
|
|
7
|
+
inherits; it resolves to 0px in any host that is not inset. */
|
|
8
|
+
.sl-hco{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
|
|
9
|
+
padding:16px 16px calc(16px + var(--sl-safe-b,0px));
|
|
10
|
+
background:color-mix(in srgb, var(--sl-bg) 70%, transparent);backdrop-filter:blur(3px)}
|
|
11
|
+
.sl-hco-card{display:flex;flex-direction:column;width:100%;max-width:440px;max-height:100%;overflow:hidden;
|
|
12
|
+
background:var(--sl-surface);color:var(--sl-text);border:1px solid var(--sl-line);
|
|
13
|
+
border-radius:var(--sl-radius);box-shadow:0 18px 48px rgba(0,0,0,.28)}
|
|
14
|
+
.sl-hco-head{flex:none;display:flex;align-items:center;gap:10px;padding:12px 14px 10px 10px;border-bottom:1px solid var(--sl-line)}
|
|
15
|
+
.sl-hco-back-icon{flex:none;display:grid;place-items:center;width:36px;height:36px;padding:0;color:var(--sl-muted);
|
|
16
|
+
background:none;border:0;border-radius:calc(var(--sl-radius) * .5);cursor:pointer}
|
|
17
|
+
.sl-hco-back-icon:hover{background:color-mix(in srgb, var(--sl-text) 6%, transparent);color:var(--sl-text)}
|
|
18
|
+
.sl-hco-back-icon:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 1px var(--sl-accent),0 0 0 4px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
|
|
19
|
+
.sl-hco-htext{flex:1;min-width:0;padding-left:4px}
|
|
20
|
+
.sl-hco-title{margin:0;font-size:16px;font-weight:650;line-height:22px;letter-spacing:-.01em;
|
|
21
|
+
overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
22
|
+
.sl-hco-sub{margin:1px 0 0;font-size:12.5px;line-height:17px;color:var(--sl-muted);
|
|
23
|
+
overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
24
|
+
.sl-hco-timer{flex:none;display:inline-flex;align-items:center;gap:5px;padding:4px 9px;font-size:12.5px;font-weight:650;
|
|
25
|
+
font-variant-numeric:tabular-nums;color:var(--sl-muted);background:color-mix(in srgb, var(--sl-text) 6%, transparent);border-radius:999px}
|
|
26
|
+
.sl-hco-timer.is-warn{color:var(--sl-warn-text, #985a08);background:color-mix(in srgb, var(--sl-warn, #c97a0c) 16%, transparent)}
|
|
27
|
+
.sl-hco-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
|
|
28
|
+
.sl-hco-form{flex:1 1 auto;display:flex;flex-direction:column;min-height:0}
|
|
29
|
+
.sl-hco-body{flex:1 1 auto;min-height:0;padding:0 16px 16px;overflow-y:auto;overscroll-behavior:contain}
|
|
30
|
+
.sl-hco-fields{min-width:0;margin:0;padding:0;border:0}
|
|
31
|
+
.sl-hco-sec{padding-top:14px}
|
|
32
|
+
.sl-hco-body .sl-hco-sec{margin-top:14px;border-top:1px solid var(--sl-line)}
|
|
33
|
+
.sl-hco-body .sl-hco-sec:first-child,.sl-hco-fields>.sl-hco-sec:first-child{margin-top:0;border-top:0}
|
|
34
|
+
.sl-hco-h{margin:0 0 10px;padding:0;font-size:14px;font-weight:650;line-height:20px}
|
|
35
|
+
.sl-hco-lines{margin:0;padding:0;list-style:none}
|
|
36
|
+
.sl-hco-line{display:flex;justify-content:space-between;gap:12px;padding:7px 0;font-size:14px;line-height:20px}
|
|
37
|
+
.sl-hco-line+.sl-hco-line{border-top:1px dashed var(--sl-line)}
|
|
38
|
+
.sl-hco-line-text{display:flex;flex-direction:column;min-width:0}
|
|
39
|
+
.sl-hco-where{font-weight:600;overflow-wrap:anywhere}
|
|
40
|
+
.sl-hco-what{font-size:12.5px;line-height:18px;color:var(--sl-muted)}
|
|
41
|
+
.sl-hco-price{flex:none;font-weight:600;font-variant-numeric:tabular-nums}
|
|
42
|
+
.sl-hco-order-toggle{display:none}
|
|
43
|
+
.sl-hco-field{display:flex;flex-direction:column;min-width:0;margin:0 0 12px}
|
|
44
|
+
.sl-hco-label{display:block;margin:0 0 4px;font-size:13px;font-weight:600;line-height:20px}
|
|
45
|
+
.sl-hco-label-row{display:flex;justify-content:space-between;gap:8px;width:100%}
|
|
46
|
+
.sl-hco-optional{margin-left:auto;font-weight:450;color:var(--sl-muted)}
|
|
47
|
+
.sl-hco-help{margin:-2px 0 6px;font-size:12.5px;line-height:18px;color:var(--sl-muted)}
|
|
48
|
+
/* ONE FIELD LANGUAGE, shared with the picker panel (pickerStylesFields.ts):
|
|
49
|
+
rest is a hairline and a 1px inner shade, so the field reads sunk into the
|
|
50
|
+
card; hover steps the edge toward the ink; ANY focus (the buyer is typing)
|
|
51
|
+
is the accent edge plus a soft 3px accent halo, never a hard outline; an
|
|
52
|
+
invalid field is the same language in --sl-danger. The transparent outline
|
|
53
|
+
is what forced-colors mode paints, where box-shadow is dropped. */
|
|
54
|
+
.sl-hco-input{box-sizing:border-box;width:100%;min-height:44px;padding:10px 13px;font:inherit;font-size:15px;line-height:22px;color:var(--sl-text);
|
|
55
|
+
background-color:var(--sl-bg);border:1px solid var(--sl-line);border-radius:calc(var(--sl-radius) * .55);
|
|
56
|
+
box-shadow:inset 0 1px 2px rgb(0 0 0 / .08);
|
|
57
|
+
transition:border-color .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1),background-color .14s cubic-bezier(.2,0,0,1)}
|
|
58
|
+
.sl-hco-input::placeholder{color:var(--sl-muted);opacity:.8}
|
|
59
|
+
.sl-hco-input:hover:not(:focus):not(:disabled){border-color:color-mix(in srgb, var(--sl-text) 28%, var(--sl-line));
|
|
60
|
+
background-color:color-mix(in srgb, var(--sl-text) 2%, var(--sl-bg))}
|
|
61
|
+
.sl-hco-input:focus{outline:2px solid transparent;outline-offset:2px;border-color:var(--sl-accent);
|
|
62
|
+
box-shadow:inset 0 1px 2px rgb(0 0 0 / .08),0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
|
|
63
|
+
.sl-hco-input[aria-invalid="true"]{border-color:var(--sl-danger, #c0392b);
|
|
64
|
+
background-color:color-mix(in srgb, var(--sl-danger, #c0392b) 5%, var(--sl-bg))}
|
|
65
|
+
.sl-hco-input[aria-invalid="true"]:hover:not(:focus):not(:disabled){border-color:color-mix(in srgb, var(--sl-danger, #c0392b) 80%, var(--sl-text));
|
|
66
|
+
background-color:color-mix(in srgb, var(--sl-danger, #c0392b) 5%, var(--sl-bg))}
|
|
67
|
+
.sl-hco-input[aria-invalid="true"]:focus{border-color:var(--sl-danger, #c0392b);
|
|
68
|
+
box-shadow:inset 0 1px 2px rgb(0 0 0 / .08),0 0 0 3px color-mix(in srgb, var(--sl-danger, #c0392b) 22%, transparent)}
|
|
69
|
+
.sl-hco-input:disabled{color:var(--sl-muted);cursor:not-allowed;box-shadow:none;
|
|
70
|
+
background-color:color-mix(in srgb, var(--sl-line) 30%, var(--sl-surface))}
|
|
71
|
+
select.sl-hco-input{appearance:none;-webkit-appearance:none;padding-right:38px;cursor:pointer;
|
|
72
|
+
background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b93a1' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
73
|
+
background-repeat:no-repeat;background-position:right 14px center;background-size:10px 6px}
|
|
74
|
+
select.sl-hco-input:disabled{cursor:not-allowed}
|
|
75
|
+
textarea.sl-hco-input{min-height:76px;resize:vertical}
|
|
76
|
+
.sl-hco-ferr{margin:6px 0 0;font-size:12.5px;font-weight:550;line-height:18px;color:var(--sl-danger, #c0392b)}
|
|
77
|
+
.sl-hco-link{padding:2px 0;font:inherit;font-size:13px;font-weight:600;color:var(--sl-muted);background:none;border:0;
|
|
78
|
+
text-decoration:underline;text-underline-offset:2px;cursor:pointer;align-self:flex-start}
|
|
79
|
+
.sl-hco-link:hover{color:var(--sl-text)}
|
|
80
|
+
.sl-hco-link:focus-visible{outline:2px solid transparent;border-radius:4px;
|
|
81
|
+
box-shadow:0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
|
|
82
|
+
.sl-hco-disclosure:hover{color:var(--sl-text);border-color:color-mix(in srgb, var(--sl-text) 28%, var(--sl-line))}
|
|
83
|
+
.sl-hco-disclosure:focus-visible{outline:2px solid transparent;border-style:solid;border-color:var(--sl-accent);
|
|
84
|
+
box-shadow:0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
|
|
85
|
+
.sl-hco-bf-inline{display:flex;flex-direction:column}
|
|
86
|
+
.sl-hco-bf-inline>.sl-hco-link{margin:-4px 0 4px}
|
|
87
|
+
.sl-hco-block{counter-increment:sl-hco-ticket;min-width:0;margin:0 0 10px;padding:10px 12px 0;border:1px solid var(--sl-line);
|
|
88
|
+
border-radius:calc(var(--sl-radius) * .75)}
|
|
89
|
+
.sl-hco-sec:has(.sl-hco-block){counter-reset:sl-hco-ticket}
|
|
90
|
+
.sl-hco-block.has-error{border-color:var(--sl-danger, #c0392b)}
|
|
91
|
+
.sl-hco-legend{float:left;width:100%;display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:0;font-size:14px;font-weight:650}
|
|
92
|
+
.sl-hco-legend::before{content:counter(sl-hco-ticket);flex:none;display:grid;place-items:center;width:24px;height:24px;font-size:12px;
|
|
93
|
+
font-weight:700;color:var(--sl-muted);background:color-mix(in srgb, var(--sl-text) 6%, transparent);border-radius:50%}
|
|
94
|
+
.sl-hco-legend+*{clear:left}
|
|
95
|
+
.sl-hco-you{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-2px 0 10px;font-size:13.5px;line-height:20px;
|
|
96
|
+
color:var(--sl-muted)}
|
|
97
|
+
.sl-hco-use{display:block;margin:-4px 0 8px}
|
|
98
|
+
.sl-hco-pair{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
|
|
99
|
+
.sl-hco-disclosure{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:10px 12px;font:inherit;font-size:13.5px;
|
|
100
|
+
font-weight:600;color:var(--sl-muted);text-align:left;background:none;border:1px dashed var(--sl-line);
|
|
101
|
+
border-radius:calc(var(--sl-radius) * .75);cursor:pointer;
|
|
102
|
+
transition:border-color .14s cubic-bezier(.2,0,0,1),color .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1)}
|
|
103
|
+
.sl-hco-plus{font-size:16px;line-height:1}
|
|
104
|
+
.sl-hco-group{min-width:0;margin:0 0 12px;padding:0;border:0}
|
|
105
|
+
.sl-hco-group legend{width:100%;margin:0 0 5px;padding:0;font-size:13px;font-weight:600}
|
|
106
|
+
.sl-hco-group[aria-invalid="true"] legend{color:var(--sl-danger, #c0392b)}
|
|
107
|
+
.sl-hco-choices{display:flex;flex-direction:column}
|
|
108
|
+
.sl-hco-chips .sl-hco-choices{flex-direction:row;flex-wrap:wrap;gap:6px}
|
|
109
|
+
.sl-hco-chip{position:relative;display:inline-flex;align-items:center;min-height:36px;padding:7px 13px;font-size:14px;
|
|
110
|
+
border:1px solid var(--sl-line);border-radius:999px;background:var(--sl-bg);cursor:pointer;
|
|
111
|
+
transition:border-color .14s cubic-bezier(.2,0,0,1),background-color .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1)}
|
|
112
|
+
.sl-hco-chip:hover:not(:has(input:checked)){border-color:color-mix(in srgb, var(--sl-text) 28%, var(--sl-line))}
|
|
113
|
+
.sl-hco-chip input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
|
|
114
|
+
.sl-hco-chip:has(input:checked){color:var(--sl-accent-ink);background:var(--sl-accent);border-color:var(--sl-accent);font-weight:600}
|
|
115
|
+
.sl-hco-chip:has(input:focus-visible){outline:2px solid transparent;border-color:var(--sl-accent);
|
|
116
|
+
box-shadow:0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
|
|
117
|
+
.sl-hco-chips[aria-invalid="true"] .sl-hco-chip{border-color:var(--sl-danger, #c0392b)}
|
|
118
|
+
.sl-hco-check{display:flex;gap:8px;align-items:flex-start;margin:8px 0 0;font-size:14px;line-height:1.4;cursor:pointer}
|
|
119
|
+
.sl-hco-check input{flex:none;width:18px;height:18px;margin:1px 0 0;accent-color:var(--sl-accent)}
|
|
120
|
+
.sl-hco-check input:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 1px var(--sl-accent),0 0 0 4px color-mix(in srgb, var(--sl-accent) 24%, transparent);border-radius:4px}
|
|
121
|
+
.sl-hco-check .sl-hco-label-row{justify-content:flex-start}
|
|
122
|
+
.sl-hco-foot{position:relative;z-index:1;flex:none;padding:12px 16px 14px;background:var(--sl-surface);border-top:1px solid var(--sl-line)}
|
|
123
|
+
.sl-hco-alert{margin:0 0 10px;padding:9px 12px;font-size:13px;line-height:19px;border-radius:calc(var(--sl-radius) * .55)}
|
|
124
|
+
.sl-hco-alert b{display:block;font-weight:650}
|
|
125
|
+
.sl-hco-alert.is-error{color:var(--sl-danger, #c0392b);background:color-mix(in srgb, var(--sl-danger, #c0392b) 10%, transparent)}
|
|
126
|
+
.sl-hco-alert.is-warn{color:var(--sl-warn-text, #985a08);background:color-mix(in srgb, var(--sl-warn, #c97a0c) 16%, transparent)}
|
|
127
|
+
.sl-hco-body>.sl-hco-alert{margin:14px 0 0}
|
|
128
|
+
.sl-hco-total{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 10px;font-size:13px;color:var(--sl-muted)}
|
|
129
|
+
.sl-hco-total strong{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--sl-text)}
|
|
130
|
+
.sl-hco-pay{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;padding:12px;font:inherit;font-size:15.5px;
|
|
131
|
+
font-weight:650;color:var(--sl-accent-ink);background:var(--sl-accent);border:0;border-radius:calc(var(--sl-radius) * .6);cursor:pointer}
|
|
132
|
+
.sl-hco-pay{transition:filter .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1),transform .09s cubic-bezier(.2,0,0,1)}
|
|
133
|
+
.sl-hco-pay:not([disabled]):hover{filter:brightness(1.06)}
|
|
134
|
+
.sl-hco-pay:not([disabled]):active{transform:translateY(1px)}
|
|
135
|
+
/* The button is filled with the accent, so the ring stands off it on the
|
|
136
|
+
card's own surface \u2014 the same ring the picker's CTA wears. */
|
|
137
|
+
.sl-hco-pay:focus-visible{outline:2px solid transparent;outline-offset:2px;
|
|
138
|
+
box-shadow:0 0 0 2px var(--sl-surface),0 0 0 4px var(--sl-accent),0 0 0 7px color-mix(in srgb, var(--sl-accent) 18%, transparent)}
|
|
139
|
+
.sl-hco-pay[disabled]{opacity:.8;cursor:progress}
|
|
140
|
+
.sl-hco-trust{margin:9px 0 0;font-size:12px;line-height:17px;color:var(--sl-muted);text-align:center}
|
|
141
|
+
.sl-hco-trust svg{display:inline-block;margin:0 5px -1px 0}
|
|
142
|
+
.sl-hco-spin{display:inline-block;width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;
|
|
143
|
+
animation:sl-hco-spin .8s linear infinite}
|
|
144
|
+
@keyframes sl-hco-spin{to{transform:rotate(360deg)}}
|
|
145
|
+
@media (prefers-reduced-motion:reduce){.sl-hco-spin{animation-duration:2.4s}
|
|
146
|
+
.sl-hco-input,.sl-hco-chip,.sl-hco-disclosure,.sl-hco-pay{transition:none}
|
|
147
|
+
.sl-hco-pay:not([disabled]):active{transform:none}}
|
|
148
|
+
.sl-hco-back{width:100%;min-height:44px;margin-top:8px;padding:10px;font:inherit;font-size:14px;font-weight:600;color:var(--sl-muted);
|
|
149
|
+
background:none;border:0;cursor:pointer}
|
|
150
|
+
.sl-hco-ghost{margin:0;color:var(--sl-text);border:1px solid var(--sl-line);border-radius:calc(var(--sl-radius) * .6)}
|
|
151
|
+
.sl-hco-state{padding:28px 8px 12px;text-align:center}
|
|
152
|
+
.sl-hco-state-icon{display:grid;place-items:center;width:52px;height:52px;margin:0 auto 14px;border-radius:50%;color:var(--sl-muted);
|
|
153
|
+
background:color-mix(in srgb, var(--sl-text) 6%, transparent)}
|
|
154
|
+
.sl-hco-state-icon.is-warn{color:var(--sl-warn-text, #985a08);background:color-mix(in srgb, var(--sl-warn, #c97a0c) 16%, transparent)}
|
|
155
|
+
.sl-hco-state-icon.is-error{color:var(--sl-danger, #c0392b);background:color-mix(in srgb, var(--sl-danger, #c0392b) 10%, transparent)}
|
|
156
|
+
.sl-hco-state-icon .sl-hco-spin{width:22px;height:22px}
|
|
157
|
+
.sl-hco-state-title{margin:0 0 6px;font-size:18px;font-weight:650;line-height:24px}
|
|
158
|
+
.sl-hco-status{max-width:340px;margin:0 auto 6px;font-size:14px;line-height:1.55}
|
|
159
|
+
.sl-hco-state-note{margin:10px 0 0;font-size:12.5px;color:var(--sl-muted)}
|
|
160
|
+
.sl-hco-error{color:var(--sl-danger, #c0392b)}
|
|
161
|
+
.sl-hco-receipt{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:14px 0 0;font-size:13px;text-align:left}
|
|
162
|
+
.sl-hco-receipt dt{color:var(--sl-muted)}
|
|
163
|
+
.sl-hco-receipt dd{margin:0;text-align:right}
|
|
164
|
+
.sl-hco-ref{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}
|
|
165
|
+
.sl-hco-tickets{display:block;width:100%;margin-top:14px;padding:12px;font:inherit;font-size:15px;
|
|
166
|
+
font-weight:650;text-align:center;text-decoration:none;color:var(--sl-accent-ink);
|
|
167
|
+
background:var(--sl-accent);border-radius:calc(var(--sl-radius) * .55)}
|
|
168
|
+
/* Phones: a bottom sheet, the order folded to one line so the form and its
|
|
169
|
+
button fit the first screen. */
|
|
170
|
+
@media (max-width:560px){
|
|
171
|
+
.sl-hco{align-items:flex-end;padding:0}
|
|
172
|
+
.sl-hco-card{max-width:none;max-height:92%;border-radius:calc(var(--sl-radius) * 1.2) calc(var(--sl-radius) * 1.2) 0 0;border-bottom:0}
|
|
173
|
+
.sl-hco-foot{padding-bottom:calc(14px + var(--sl-safe-b,0px))}
|
|
174
|
+
.sl-hco-input{min-height:44px;font-size:16px}
|
|
175
|
+
.sl-hco-pair{grid-template-columns:1fr}
|
|
176
|
+
.sl-hco-order-toggle{display:flex;align-items:center;gap:10px;width:100%;margin:14px 0 0;padding:10px 12px;font:inherit;font-size:14px;
|
|
177
|
+
font-weight:600;color:var(--sl-text);text-align:left;background:color-mix(in srgb, var(--sl-text) 5%, transparent);border:0;
|
|
178
|
+
border-radius:calc(var(--sl-radius) * .6);cursor:pointer}
|
|
179
|
+
.sl-hco-order-toggle span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
180
|
+
.sl-hco-order:not([data-open]) .sl-hco-order-full{display:none}
|
|
181
|
+
.sl-hco-order{padding-top:0}
|
|
182
|
+
}
|
|
183
|
+
`;function Je(){if(typeof document>"u"||document.getElementById(Ie))return;let o=document.createElement("style");o.id=Ie,o.textContent=Ge,document.head.appendChild(o)}function Ze(o,u){let s=`${u} ${u===1?"seat is":"seats are"} held for a limited time.`;return o==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${s} The organiser isn\u2019t taking payment for this event here.`,detail:"Nothing has been charged. Check where you found this event for how to get tickets."}:o==="unavailable_for_event"?{title:"This event isn\u2019t taking payment yet",body:`${s} Online payment is not switched on for this event.`,detail:"Nothing has been charged. If you were sent here to pay, let the organiser know, only they can turn payment on for this event."}:{title:"Finish in the ticketing checkout",body:`${s} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}var et=3,tt=1,ot=400,nt=3e3;function Oe(o){if(!o||typeof o!="object")return!1;let u=o;return u.status!==503||u.code==="maintenance_mode"||u.reason==="maintenance_mode"?!1:u.code==="checkout_busy"||u.code==="database_busy"?!0:u.retryable===!0}function rt(o,u=Math.random){let s=o?.retryAfterS,g=typeof s=="number"&&Number.isFinite(s)&&s>=0?s:tt,a=Math.floor(Math.max(0,Math.min(1,u()))*ot);return Math.min(nt,g*1e3+a)}function it(o){return`${(typeof o?.notice=="string"?o.notice.trim():"")||(()=>{let g=o?.retryAfterS;if(typeof g!="number"||!Number.isFinite(g)||g<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let a=Math.max(1,Math.ceil(g/60));return`Booking is paused for maintenance. Please try again in about ${a} minute${a===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function he(o,u){if(o==="maintenance_mode")return it(u);switch(o){case"checkout_busy":case"database_busy":return u?.free?"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.";case"gateway_not_connected":case"payments_not_enabled_for_event":return"This event is not taking online payments. Contact the organiser to buy these seats.";case"provider_mismatch":return"This event\u2019s payment setup changed while you were choosing. Nothing was charged. Please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged. Please pick again.";case"checkout_already_started":return"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.";case"event_closed":return"Sales for this event have closed.";case"insufficient_hosted_credits":return"Ticket sales are temporarily paused while the organiser tops up their balance. Nothing was charged. Please try again later or contact the organiser.";case"gateway_currency_mismatch":case"unsupported_currency":case"mixed_currency_hold":case"price_unusable":return"These seats cannot be checked out right now because of a pricing configuration problem. Nothing was charged. Please contact the organiser.";case"provider_refused":return"The organiser\u2019s payment provider refused to start this payment. Nothing was charged. Please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";case"seats_unavailable":return"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.";case"booking_form_incomplete":return"The details this event asks for changed while you were choosing. Nothing was charged. Please go back and try again.";default:return"We could not start the payment. Nothing was charged. Please try again."}}function i(o,u,s){let g=document.createElement(o);return u&&(g.className=u),s!==void 0&&(g.textContent=s),g}var Ke="http://www.w3.org/2000/svg";function re(o,u=18,s="0 0 20 20"){let g=document.createElementNS(Ke,"svg");g.setAttribute("viewBox",s),g.setAttribute("width",String(u)),g.setAttribute("height",String(u)),g.setAttribute("fill","none"),g.setAttribute("stroke","currentColor"),g.setAttribute("stroke-width","1.8"),g.setAttribute("stroke-linecap","round"),g.setAttribute("stroke-linejoin","round"),g.setAttribute("aria-hidden","true"),g.setAttribute("focusable","false");for(let a of o){let v=document.createElementNS(Ke,"path");v.setAttribute("d",a),g.appendChild(v)}return g}var ee={back:["M12.5 4.5 7 10l5.5 5.5"],clock:["M10 2.8a7.2 7.2 0 1 1 0 14.4a7.2 7.2 0 1 1 0-14.4","M10 6.2V10l2.6 1.7"],down:["m5 7.5 5 5 5-5"],lock:["M4.2 8.8h7.6a1.4 1.4 0 0 1 1.4 1.4v4.4a1.4 1.4 0 0 1-1.4 1.4H4.2a1.4 1.4 0 0 1-1.4-1.4v-4.4a1.4 1.4 0 0 1 1.4-1.4z","M5.4 8.8V6.6a2.6 2.6 0 0 1 5.2 0v2.2"],hour:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7v5l3 2"],seat:["M6 11V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5M4 11h16v4H4zM6 15v4M18 15v4"],card:["M5 5.5h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2z","M3 10h18M7 15h3"],alert:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7.5v5.5M12 16.5v.1"]},st=12e4;function at(o){let u=Math.max(0,Math.ceil(o/1e3)),s=Math.floor(u/3600),g=Math.floor(u%3600/60),a=String(u%60).padStart(2,"0");return s>0?`${s}:${String(g).padStart(2,"0")}:${a}`:`${g}:${a}`}function ut(o){Je();let u=!0,s=!1,g=null,a=(e,r,p)=>{let f=o.t?.(e,p);return f&&f!==e?f:p?r.replace(/\{(\w+)\}/g,(H,B)=>B in p?String(p[B]):H):r},v=i("div","sl-hco");v.setAttribute("role","dialog"),v.setAttribute("aria-modal","true");let K=i("div","sl-hco-card");v.appendChild(K);let R=()=>{g&&clearInterval(g),g=null},z=()=>{u=!1,R(),v.remove(),document.removeEventListener("keydown",I,!0)},T=()=>{z(),o.onCancel()},ie=!0;function I(e){if(v.isConnected){if(e.key==="Tab"){let r=[...K.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(H=>H.offsetParent!==null||H===document.activeElement),p=r[0],f=r[r.length-1];if(!p||!f)return;e.shiftKey&&document.activeElement===p?(e.preventDefault(),f.focus()):!e.shiftKey&&document.activeElement===f&&(e.preventDefault(),p.focus());return}e.key==="Escape"&&(e.stopPropagation(),e.preventDefault(),ie&&T())}}document.addEventListener("keydown",I,!0);let L=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,se=i("header","sl-hco-head"),U=i("button","sl-hco-back-icon");U.type="button",U.setAttribute("aria-label",a("checkout.back","Back to seats")),U.appendChild(re([...ee.back])),U.addEventListener("click",()=>{ie&&T()});let pe=i("div","sl-hco-htext"),D=i("h2","sl-hco-title",o.event?.name?.trim()||a("checkout.title","Checkout"));D.id=L;let ge=i("p","sl-hco-sub",o.event?.detail?.trim()??"");ge.hidden=!ge.textContent,pe.append(D,ge);let N=i("span","sl-hco-timer");N.setAttribute("role","timer");let P=i("span");P.setAttribute("aria-hidden","true"),N.append(re([...ee.clock],14),P),N.hidden=!0,se.append(U,pe,N),v.setAttribute("aria-labelledby",L);let Y=i("p","sl-hco-sr");Y.setAttribute("aria-live","polite");let Q=(...e)=>{K.replaceChildren(se,Y,...e)},G=e=>{ie=e,U.hidden=!e},J=e=>{let r=i("div","sl-hco-state");r.setAttribute("role",e.alert?"alert":"status");let p=i("div",`sl-hco-state-icon is-${e.tone}`);return p.setAttribute("aria-hidden","true"),p.appendChild(e.icon),r.appendChild(p),e.title&&r.appendChild(i("h3","sl-hco-state-title",e.title)),e.text&&r.appendChild(i("p",`sl-hco-status${e.alert?" sl-hco-error":""}`,e.text)),e.note&&r.appendChild(i("p","sl-hco-state-note",e.note)),r},j=(...e)=>{let r=i("div","sl-hco-body");return r.append(...e),r},te=(...e)=>{let r=i("footer","sl-hco-foot");return r.append(...e),r},fe=()=>{let e=i("span","sl-hco-spin");return e.setAttribute("aria-hidden","true"),e},$=(e,r="error")=>{if(!u)return;R(),N.hidden=!0,G(!0);let p=i("button",r==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",r==="expired"?a("checkout.chooseAgain","Choose seats again"):r==="taken"?a("checkout.chooseOther","Choose other seats"):a("checkout.back","Back to seats"));if(p.type="button",p.addEventListener("click",T),r==="error"){let f=i("p","sl-hco-alert is-error sl-hco-status sl-hco-error",e);f.setAttribute("role","alert"),Q(j(...V?[V]:[],f),te(p))}else Q(j(J({tone:r==="expired"?"warn":"error",icon:re([...r==="expired"?ee.hour:ee.seat],24,"0 0 24 24"),title:r==="expired"?a("checkout.expiredTitle","Your seats were released"):a("checkout.takenTitle","Those seats were just taken"),text:e,alert:!1})),te(p));p.focus()},ke=(e,r)=>{u&&(R(),N.hidden=!0,G(!1),Q(j(J({tone:"neutral",icon:fe(),...r?{title:r}:{},text:e}))))},ae=async(e,r=!1)=>{ke(r?a("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let p=Date.now()+Ve;for(;u&&Date.now()<p;){try{let f=await o.orderStatus(e);if(!u)return;if(f.status==="confirmed"){s=!0,G(!1),D.textContent=a("checkout.confirmedTitle","Your tickets are confirmed");let H=i("p","sl-hco-status",`${f.seatCount} ${f.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),B=i("dl","sl-hco-receipt"),q=(f.tickets??[]).map(ne=>ne.displayLabel||ne.label);q.length&&B.append(i("dt",void 0,"Seats"),i("dd",void 0,q.join(", ")));let X=r||f.totalMinor===0;B.append(i("dt",void 0,X?a("checkout.price","Price"):a("checkout.paid","Paid")),i("dd",void 0,X?a("checkout.free","Free"):`${f.amountFormatted} ${f.currency}`),i("dt",void 0,a("checkout.order","Order")),i("dd","sl-hco-ref",f.orderId));let ue=i("button","sl-hco-back","Close");ue.type="button",ue.addEventListener("click",T);let Z=i("div","sl-hco-state");if(Z.append(H,B),f.ticketUrl){let ne=i("a","sl-hco-tickets",a("checkout.viewTickets","View tickets & QR codes"));ne.href=f.ticketUrl,ne.target="_blank",ne.rel="noreferrer",Z.appendChild(ne)}Z.appendChild(ue),Q(j(Z)),ie=!0,o.onConfirmed(f);return}if(f.status==="failed"||f.status==="expired"){f.status==="expired"?$("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):$("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(f=>setTimeout(f,je))}!u||s||$(r?"Still confirming your booking. Once it is confirmed, your tickets will arrive by email. Nothing was charged.":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.")},V=null;if(o.state.kind==="unavailable"){let e=Ze(o.state.reason,o.state.seatCount);D.textContent=e.title;let r=i("button","sl-hco-back sl-hco-ghost","Back to seat map");r.type="button",r.addEventListener("click",T);let p=i("p","sl-hco-label","Seats held");return Q(j(p,J({tone:"neutral",icon:re([...ee.seat],24,"0 0 24 24"),text:e.body,note:e.detail})),te(r)),o.root.appendChild(v),r.focus(),{destroy:z}}if(o.state.kind==="resume")return o.root.appendChild(v),ae(o.state.orderId),{destroy:z};let{order:A,bookingForm:le}=o.state,W=o.state.free===!0,me=e=>W?a("checkout.free","Free"):o.formatMoney(e,A.currency),be=me(A.total);V=i("section","sl-hco-sec sl-hco-order sl-hco-summary");let t=A.lines?.length?A.lines:A.labels.map(e=>({label:e,detail:null,amount:null})),n=t.length===1?[t[0].label,t[0].detail].filter(Boolean).join(" \xB7 "):`${A.tickets?.length||t.length} ${(A.tickets?.length||t.length)===1?"seat":"seats"}`,c=i("button","sl-hco-order-toggle");c.type="button",c.setAttribute("aria-expanded","false"),c.append(i("span",void 0,n),re([...ee.down])),c.addEventListener("click",()=>{let e=!V.hasAttribute("data-open");V.toggleAttribute("data-open",e),c.setAttribute("aria-expanded",String(e))});let b=i("div","sl-hco-order-full"),l=i("ul","sl-hco-lines sl-hco-seats");for(let e of t){let r=i("li","sl-hco-line sl-hco-seat"),p=i("span","sl-hco-line-text");p.appendChild(i("span","sl-hco-where",e.label)),e.detail&&p.appendChild(i("span","sl-hco-what",e.detail)),r.appendChild(p),typeof e.amount=="number"&&r.appendChild(i("span","sl-hco-price",me(e.amount))),l.appendChild(r)}b.append(i("h3","sl-hco-h",a("checkout.yourOrder","Your order")),l),V.append(c,b);let h=i("form","sl-hco-form");h.noValidate=!0;let d=e=>{let r=i("div","sl-hco-field"),p=i("label","sl-hco-label"),f=i("span","sl-hco-label-row");f.appendChild(i("span",void 0,e.label));let H=i("span","sl-hco-optional",a("checkout.optional","Optional"));e.optional&&f.append(" ",H),p.appendChild(f),p.htmlFor=e.id;let B=e.hint?i("p","sl-hco-help",e.hint):null;B&&(B.id=`${e.id}-h`);let q=i("input","sl-hco-input");q.type=e.type,q.id=e.id,q.autocomplete=e.autocomplete,q.placeholder=e.placeholder;let X=i("p","sl-hco-ferr");X.id=`${e.id}-e`,X.hidden=!0,q.setAttribute("aria-describedby",B?`${B.id} ${X.id}`:X.id),r.append(p,...B?[B]:[],q,X);let ue=Z=>{X.textContent=Z??"",X.hidden=!Z,Z?q.setAttribute("aria-invalid","true"):q.removeAttribute("aria-invalid")};return q.addEventListener("input",()=>ue(null)),{wrap:r,input:q,optional:H,setError:ue}},k=d({id:`${L}-email`,label:a("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:a("checkout.emailHint","Your tickets are sent here."),optional:!1}),C=k.input;C.required=!0,C.inputMode="email";let w=d({id:`${L}-name`,label:a("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:a("checkout.namePlaceholder","Your name"),optional:!0}),F=w.input;o.buyer?.email&&(C.value=o.buyer.email),o.buyer?.name&&(F.value=o.buyer.name),le?.attendeeName==="required"&&(w.optional.previousSibling?.remove(),w.optional.remove(),F.setAttribute("aria-required","true"));let x=()=>/.+@.+\..+/.test(C.value.trim()),m=ze({form:le,tickets:A.tickets??[],idPrefix:L,t:a,buyer:()=>({name:F.value.trim(),email:C.value.trim()}),buyerError:(e,r)=>((e==="name"?w:k).setError(r),e==="name"?F:C)}),M=i("section","sl-hco-sec");M.append(i("h3","sl-hco-h",a("checkout.yourDetails","Your details")),k.wrap,w.wrap,...m.details?.childNodes.length?[m.details]:[]);let E=i("fieldset","sl-hco-fields");E.append(V,M,...m.element?[m.element]:[]);let _=j(E),O=i("p","sl-hco-alert is-error sl-hco-status sl-hco-error");O.setAttribute("role","alert"),O.hidden=!0;let de=e=>{O.textContent=e,O.hidden=!1},S=i("p","sl-hco-alert is-warn");S.hidden=!0;let xe=i("div","sl-hco-total"),Te=A.tickets?.length||A.labels.length;xe.append(i("span",void 0,`${Te} ${Te===1?"seat":"seats"}`),i("strong",void 0,be));let Ae=W?a("checkout.confirmBooking","Confirm booking"):a("checkout.continue","Continue to payment"),oe=i("button","sl-hco-pay",Ae);oe.type="submit";let ye=i("p","sl-hco-sr");ye.setAttribute("role","status");let Me=e=>{oe.replaceChildren(fe(),e),ye.textContent=e},Ce=i("p","sl-hco-trust");W||Ce.appendChild(re([...ee.lock],12,"0 0 16 16")),Ce.append(W?a("checkout.freeTrust","Free booking. Nothing is charged."):a("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),h.append(_,te(O,S,xe,oe,ye,Ce));let _e=null,Fe=()=>{let e=A.expiresAt-Date.now(),r=at(e);P.textContent=r,N.setAttribute("aria-label",a("checkout.heldFor","Seats held for {time}",{time:r}));let p=e<=st;N.classList.toggle("is-warn",p),S.hidden=!p||!O.hidden,p&&(S.textContent=a("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:r}));let f=e<=3e4?30:p?120:null;f&&_e!==f&&(_e=f,Y.textContent=S.textContent),e<=0&&$(a("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:t.map(H=>H.label).join(", ")}),"expired")},Pe=()=>{Number.isFinite(A.expiresAt)&&(R(),N.hidden=!1,Fe(),g=setInterval(Fe,1e3))},ve=!1,$e=async()=>{if(!ve){ve=!0,O.hidden=!0,E.disabled=!0,oe.disabled=!0,Me(W?a("checkout.confirmingBooking","Confirming your booking\u2026"):a("checkout.opening","Opening secure payment\u2026"));try{let e={holdId:A.holdId,buyerEmail:C.value.trim(),...F.value.trim()?{buyerName:F.value.trim()}:{},...m.payload(),bookingFormVersion:1},r=0,p;for(;;)try{p=await o.startSession(e);break}catch(H){if(!u)return;if(r>=et||!Oe(H))throw H;if(r+=1,Me(W?a("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):a("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise(B=>setTimeout(B,rt(H))),!u)return}if(!u)return;if(p.status==="confirmed"){ae(p.orderId,!0);return}let f=Se(p.redirectUrl);if(f){We(p.orderId,o.eventKey),R(),N.hidden=!0,Q(j(J({tone:"neutral",icon:re([...ee.card],24,"0 0 24 24"),title:a("checkout.redirectTitle","Taking you to secure payment"),text:a("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:be}),note:a("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(f);return}$(he("gateway_unavailable"))}catch(e){o.onError?.(e);let r=e;if(r?.code==="booking_form_incomplete"&&m.element){Ee(),m.showServerErrors(r.fields);return}if(Oe(r)){Ee(),de(W?a("checkout.busyFailedBooking",he("checkout_busy",{free:!0})):a("checkout.busyFailedPayment",he("checkout_busy"))),oe.textContent=a("checkout.tryAgain","Try again");return}if(r?.code==="hold_not_active"||r?.code==="hold_not_found"){$(he(r.code),"expired");return}if(r?.code==="seats_unavailable"){$(a("checkout.seatsUnavailable",he(r.code)),"taken");return}$(he(r?.code,r))}}};h.addEventListener("submit",e=>{if(e.preventDefault(),ve)return;let r=x();k.setError(r?null:a("checkout.error.email","Enter an email like name@example.com."));let p=m.validate();if(!r){de(a("bookingForm.fixErrors","Some details need attention before you continue.")),C.focus();return}if(!p){de(a("bookingForm.fixErrors","Some details need attention before you continue."));return}$e()});let Ee=()=>{D.textContent=o.event?.name?.trim()||a("checkout.title","Checkout"),O.hidden=!0,O.textContent="",ve=!1,E.disabled=!1,oe.disabled=!1,oe.textContent=Ae,ye.textContent="",G(!0),Q(h),Pe()};return Ee(),o.root.appendChild(v),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&C.focus(),{destroy:z}}export{et as CHECKOUT_BUSY_MAX_RETRIES,rt as checkoutBusyDelayMs,he as errorCopy,at as formatHoldClock,Oe as isCheckoutBusy,ut as mountCheckout,Ze as unavailableCopy};
|