@seatlayer/js 0.110.0 → 0.111.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 +7 -1
- package/dist/{hostedCheckout-NA3IEXE4.js → hostedCheckout-2JDHIDPG.js} +2 -2
- package/dist/index.cjs +23 -23
- package/dist/index.d.cts +172 -6
- package/dist/index.d.ts +172 -6
- package/dist/index.js +21 -21
- package/dist/pickerSalesClose-Y7RUQ2MY.js +11 -0
- package/package.json +2 -2
- package/dist/pickerSalesClose-2APTQFVA.js +0 -11
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
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(n){return n===void 0||n===""||n===!1||Array.isArray(n)&&!n.length}function He(n,u,s,g){if(Be(s))return u?"required":null;let a=v=>!!g?.some(K=>K.id===v);if(n==="number")return typeof s=="number"&&Number.isFinite(s)?null:"invalid";if(n==="checkbox")return s===!0?null:"invalid";if(n==="select")return a(s)?null:"invalid";if(n==="multiselect")return Array.isArray(s)&&s.length<=50&&s.every(a)?null:"invalid";if(typeof s!="string")return"invalid";if(n==="phone")return De.test(s)?null:"invalid";if(s.length>500)return"too_long";if(n==="email")return qe.test(s)?null:"invalid";if(n==="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(n,u,s){let g=document.createElement(n);return u&&(g.className=u),s!==void 0&&(g.textContent=s),g}function we(n,u){let s=n?.[u];return s==="optional"||s==="required"?s:"off"}var Ye={name:"name",email:"email",phone:"tel"},Qe=5;function ze(n){let{form:u,t:s,idPrefix:g}=n,a=(u?.questions??[]).filter(t=>t&&!t.archived).sort((t,o)=>t.position-o.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=[...n.tickets],S=!0,se=!1,U=new Map,pe=(t,o)=>o===void 0?t:`${t}|${o}`,D=[],ge=0,L=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,o)=>o==="required"?s("picker.bookingForm.required","This is required."):o==="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,o)=>{t.error.textContent=o?Q(t.kind,o):"",t.error.hidden=!o;let c=t.kind==="multiselect"||t.control.closest(".sl-hco-chips")?t.control.closest("fieldset")??t.control:t.control;o?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,o)=>{let c=y("span",void 0,t);if(o)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,o)=>{let c=`${g}-bf${ge++}`,b=pe(o.key,o.ticketKey),l=U.get(b),h=y("div","sl-hco-field"),d=o.help?y("p","sl-hco-help",o.help):null;d&&(d.id=`${c}-h`);let k=y("p","sl-hco-ferr");k.id=`${c}-e`,k.hidden=!0;let E=x=>{x.setAttribute("aria-describedby",d?`${d.id} ${k.id}`:k.id),o.required&&x.tagName!=="FIELDSET"&&x.setAttribute("aria-required","true")},w=o.kind==="select"&&(o.options??[]).length<=Qe,N;if(o.kind==="checkbox"||o.kind==="multiselect"||w){let x=o.kind==="checkbox"?null:y("fieldset",w?"sl-hco-group sl-hco-chips":"sl-hco-group"),m=x?o.options??[]:[{id:"",label:o.label}];if(x){w&&x.setAttribute("role","radiogroup");let _=y("legend");_.appendChild(J(o.label,o.required)),x.appendChild(_),d&&x.appendChild(d),E(x)}let M=x?y("div","sl-hco-choices"):null,C=m.map((_,O)=>{let de=y("label",w?"sl-hco-chip":"sl-hco-check"),F=y("input");F.type=w?"radio":"checkbox",F.value=_.id,w&&(F.name=c),x?(O===0&&(F.id=c),F.checked=w?l===_.id:Array.isArray(l)&&l.includes(_.id)):(F.id=c,F.checked=l===!0,E(F));let xe=x?y("span",void 0,_.label):J(o.label,o.required);return de.append(F,xe),(M??h).appendChild(de),F});x&&M?(x.appendChild(M),h.appendChild(x)):d&&h.appendChild(d),N={...o,control:C[0]??x??h,error:k,read:w?()=>C.find(_=>_.checked)?.value??"":x?()=>C.filter(_=>_.checked).map(_=>_.value):()=>!!C[0]?.checked}}else{let x=y("label","sl-hco-label");x.appendChild(J(o.label,o.required)),x.htmlFor=c;let m;if(o.kind==="textarea")m=y("textarea","sl-hco-input"),m.rows=3,m.maxLength=500;else if(o.kind==="select"){m=y("select","sl-hco-input"),m.appendChild(new Option(s("picker.bookingForm.choose","Choose\u2026"),""));for(let C of o.options??[])m.appendChild(new Option(C.label,C.id))}else m=y("input","sl-hco-input"),m.type=Ue[o.kind]??"text",o.kind==="number"?(m.step="any",m.inputMode="decimal"):o.kind!=="date"&&(m.maxLength=o.kind==="phone"?20:500),o.autocomplete&&(m.autocomplete=o.autocomplete);m.id=c,typeof l=="string"?m.value=l:typeof l=="number"&&(m.value=String(l)),E(m),h.append(x,...d?[d]:[],m);let M=m;N={...o,control:m,error:k,read:()=>{let C=M.value.trim();return o.kind!=="number"?C:M.validity?.badInput?Number.NaN:C===""?void 0:Number(C)}}}h.appendChild(k);let ce=()=>{let x=N.read();x===void 0?U.delete(b):U.set(b,x),G(N,null)};return h.addEventListener("input",ce),h.addEventListener("change",ce),t.appendChild(h),D.push(N),N},te=(t,o,c)=>j(t,{key:`question:${o.id}`,...c!==void 0?{ticketKey:c}:{},kind:o.type,label:o.label,required:!!o.required,help:o.helpText,options:o.options}),fe=(t,o,c,b)=>{let l=Ne.find(([h])=>h===c);return j(t,{key:c,ticketKey:o.key,kind:l[1],label:s(l[2],l[3]),required:we(u,c)==="required",autocomplete:b===0&&S?Ye[l[1]]:"off"})},$=(t,o,c="sl-hco-link")=>{let b=y("button",c,t);return b.type="button",b.addEventListener("click",o),b},ke=t=>y("h3","sl-hco-h",t),ae=()=>y("section","sl-hco-sec"),V=t=>{if(!t&&I[0]){let c=n.buyer();for(let[b,l]of T){let h=c[l];h&&U.set(pe(b,I[0].key),h)}se=!0}S=t;for(let[,c]of T)n.buyerError?.(c,null);A(),(t?P.querySelector(".sl-hco-you .sl-hco-link"):P.querySelector(".sl-hco-block input"))?.focus()};function A(){D=[],L.replaceChildren(),P.replaceChildren();let t=I[0],o=I.length===1&&S;if(z&&o&&t){for(let[d,k]of v)k==="phone"&&fe(L,t,d,0);T.length&&L.appendChild($(s("checkout.forSomeoneElse","Ticket for someone else?"),()=>V(!1)))}let c=z&&!o&&(!ie||se||le||!S);if(z&&!o&&!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,E)=>{let w=y("fieldset","sl-hco-block"),N=y("legend","sl-hco-legend",k.title||s("picker.bookingForm.ticket","Ticket {number}",{number:E+1}));w.appendChild(N);let ce=E===0&&S&&T.length>0;if(ce){let M=n.buyer(),C=y("p","sl-hco-you"),_=M.name||M.email;C.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:N.textContent??""})),C.appendChild(O),w.appendChild(C)}else E===0&&!S&&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,E);m!==w&&w.appendChild(m);for(let M of K)te(w,M,k.key);d.appendChild(w)}),P.appendChild(d)}let l=[...z&&o&&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:E}of h)te(d,k,E);P.appendChild(d)}P.appendChild(Y)}let le=!1;A();let W=()=>{if(!I[0]||!S)return null;let o=n.buyer(),c=null;for(let[b,l]of T){let h=He(l,we(u,b)==="required",o[l]),d=n.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,o)=>t.compareDocumentPosition(o)&4?-1:1;return{details:L,element:P,validate(){let t=[],o=W();o&&t.push(o);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,o=[],c=I[0];if(c&&S){let l=n.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:"))o.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}:{},...o.length?{answers:o}:{}}},showServerErrors(t){let o=(Array.isArray(t)?t:[]).filter(l=>!!l&&typeof l.key=="string");if(z){let l=!1;for(let h of o)typeof h.ticketKey=="string"&&!I.some(d=>d.key===h.ticketKey)&&(I.push({key:h.ticketKey}),l=!0);le=o.some(h=>typeof h.ticketKey=="string"),(l||le)&&A()}let c=[],b=I[0];for(let l of o){let h=l.key==="attendeeName"?"name":l.key==="attendeeEmail"?"email":null;if(h&&S&&b&&l.ticketKey===b.key&&T.some(([,d])=>d===h)){let d=n.buyerError?.(h,Q(h,Le.includes(l.code)?l.code:"invalid"));d&&c.push(d)}}for(let l of D){let h=o.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(n,u){try{window.sessionStorage.setItem(Xe,JSON.stringify({orderId:n,...u?{eventKey:u}:{},storedAt:Date.now()}))}catch{}}var Ge=`
|
|
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
2
|
/* Three rows: a header naming the event with the hold's countdown, a body that
|
|
3
3
|
scrolls, and a footer that never does, so the total and the one primary
|
|
4
4
|
button are always on screen however long the organizer's form is. On a
|
|
@@ -180,4 +180,4 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
|
|
|
180
180
|
.sl-hco-order:not([data-open]) .sl-hco-order-full{display:none}
|
|
181
181
|
.sl-hco-order{padding-top:0}
|
|
182
182
|
}
|
|
183
|
-
`;function Je(){if(typeof document>"u"||document.getElementById(Ie))return;let n=document.createElement("style");n.id=Ie,n.textContent=Ge,document.head.appendChild(n)}function Ze(n,u){let s=`${u} ${u===1?"seat is":"seats are"} held for a limited time.`;return n==="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."}:n==="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(n){if(!n||typeof n!="object")return!1;let u=n;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(n,u=Math.random){let s=n?.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(n){return`${(typeof n?.notice=="string"?n.notice.trim():"")||(()=>{let g=n?.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(n,u){if(n==="maintenance_mode")return it(u);switch(n){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(n,u,s){let g=document.createElement(n);return u&&(g.className=u),s!==void 0&&(g.textContent=s),g}var Ke="http://www.w3.org/2000/svg";function re(n,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 n){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(n){let u=Math.max(0,Math.ceil(n/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(n){Je();let u=!0,s=!1,g=null,a=(e,r,p)=>{let f=n.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(),n.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 S=`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",n.event?.name?.trim()||a("checkout.title","Checkout"));D.id=S;let ge=i("p","sl-hco-sub",n.event?.detail?.trim()??"");ge.hidden=!ge.textContent,pe.append(D,ge);let L=i("span","sl-hco-timer");L.setAttribute("role","timer");let P=i("span");P.setAttribute("aria-hidden","true"),L.append(re([...ee.clock],14),P),L.hidden=!0,se.append(U,pe,L),v.setAttribute("aria-labelledby",S);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(),L.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(),L.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 n.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,n.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(n.state.kind==="unavailable"){let e=Ze(n.state.reason,n.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)),n.root.appendChild(v),r.focus(),{destroy:z}}if(n.state.kind==="resume")return n.root.appendChild(v),ae(n.state.orderId),{destroy:z};let{order:A,bookingForm:le}=n.state,W=n.state.free===!0,me=e=>W?a("checkout.free","Free"):n.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})),o=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,o),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:`${S}-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}),E=k.input;E.required=!0,E.inputMode="email";let w=d({id:`${S}-name`,label:a("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:a("checkout.namePlaceholder","Your name"),optional:!0}),N=w.input;le?.attendeeName==="required"&&(w.optional.previousSibling?.remove(),w.optional.remove(),N.setAttribute("aria-required","true"));let x=()=>/.+@.+\..+/.test(E.value.trim()),m=ze({form:le,tickets:A.tickets??[],idPrefix:S,t:a,buyer:()=>({name:N.value.trim(),email:E.value.trim()}),buyerError:(e,r)=>((e==="name"?w:k).setError(r),e==="name"?N:E)}),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 C=i("fieldset","sl-hco-fields");C.append(V,M,...m.element?[m.element]:[]);let _=j(C),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},F=i("p","sl-hco-alert is-warn");F.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,F,xe,oe,ye,Ce));let _e=null,Fe=()=>{let e=A.expiresAt-Date.now(),r=at(e);P.textContent=r,L.setAttribute("aria-label",a("checkout.heldFor","Seats held for {time}",{time:r}));let p=e<=st;L.classList.toggle("is-warn",p),F.hidden=!p||!O.hidden,p&&(F.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=F.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(),L.hidden=!1,Fe(),g=setInterval(Fe,1e3))},ve=!1,$e=async()=>{if(!ve){ve=!0,O.hidden=!0,C.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:E.value.trim(),...N.value.trim()?{buyerName:N.value.trim()}:{},...m.payload(),bookingFormVersion:1},r=0,p;for(;;)try{p=await n.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,n.eventKey),R(),L.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){n.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.")),E.focus();return}if(!p){de(a("bookingForm.fixErrors","Some details need attention before you continue."));return}$e()});let Ee=()=>{D.textContent=n.event?.name?.trim()||a("checkout.title","Checkout"),O.hidden=!0,O.textContent="",ve=!1,C.disabled=!1,oe.disabled=!1,oe.textContent=Ae,ye.textContent="",G(!0),Q(h),Pe()};return Ee(),n.root.appendChild(v),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&E.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};
|
|
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};
|