@seatlayer/js 0.111.0 → 0.113.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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ku=Object.create;var no=Object.defineProperty;var Su=Object.getOwnPropertyDescriptor;var Tu=Object.getOwnPropertyNames;var Eu=Object.getPrototypeOf,Cu=Object.prototype.hasOwnProperty;var va=n=>{throw TypeError(n)};var io=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var Ur=(n,e)=>{for(var t in e)no(n,t,{get:e[t],enumerable:!0})},wa=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Tu(e))!Cu.call(n,o)&&o!==t&&no(n,o,{get:()=>e[o],enumerable:!(i=Su(e,o))||i.enumerable});return n};var xa=(n,e,t)=>(t=n!=null?ku(Eu(n)):{},wa(e||!n||!n.__esModule?no(t,"default",{value:n,enumerable:!0}):t,n)),Au=n=>wa(no({},"__esModule",{value:!0}),n);var qr=(n,e,t)=>e.has(n)||va("Cannot "+t);var h=(n,e,t)=>(qr(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?va("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),x=(n,e,t,i)=>(qr(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),w=(n,e,t)=>(qr(n,e,"access private method"),t);var ka=(n,e,t,i)=>({set _(o){x(n,e,o,t)},get _(){return h(n,e,i)}});function so(n){if(typeof n!="string"||!n)return null;try{let{protocol:e,hostname:t}=new URL(n);if(e==="https:"||e==="http:"&&(t==="localhost"||t==="127.0.0.1"))return n}catch{}return null}var Wr=io(()=>{"use strict"});function Va(n){return n===void 0||n===""||n===!1||Array.isArray(n)&&!n.length}function Ba(n,e,t,i){if(Va(t))return e?"required":null;let o=r=>!!i?.some(s=>s.id===r);if(n==="number")return typeof t=="number"&&Number.isFinite(t)?null:"invalid";if(n==="checkbox")return t===!0?null:"invalid";if(n==="select")return o(t)?null:"invalid";if(n==="multiselect")return Array.isArray(t)&&t.length<=50&&t.every(o)?null:"invalid";if(typeof t!="string")return"invalid";if(n==="phone")return lm.test(t)?null:"invalid";if(t.length>500)return"too_long";if(n==="email")return am.test(t)?null:"invalid";if(n==="date"){let r=cm.exec(t);if(!r)return"invalid";let[s,a,l]=[Number(r[1]),Number(r[2]),Number(r[3])],c=new Date(Date.UTC(s,a-1,l));return c.getUTCFullYear()===s&&c.getUTCMonth()===a-1&&c.getUTCDate()===l?null:"invalid"}return null}function le(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function ao(n,e){let t=n?.[e];return t==="optional"||t==="required"?t:"off"}function $a(n){let{form:e,t,idPrefix:i}=n,o=(e?.questions??[]).filter(S=>S&&!S.archived).sort((S,P)=>S.position-P.position),r=Fa.filter(([S])=>ao(e,S)!=="off"),s=o.filter(S=>S.scope==="ticket"),a=o.filter(S=>S.scope!=="ticket"),l=r.length>0||s.length>0;if(!l&&!a.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let c=r.filter(([,S])=>S!=="phone"),d=r.every(([S])=>ao(e,S)!=="required")&&s.every(S=>!S.required),p=[...n.tickets],m=!0,u=!1,f=new Map,b=(S,P)=>P===void 0?S:`${S}|${P}`,T=[],C=0,k=le("div","sl-hco-bf sl-hco-bf-inline"),E=le("div","sl-hco-bf"),L=le("p","sl-hco-alert is-error");L.setAttribute("role","alert"),L.hidden=!0;let Q=(S,P)=>P==="required"?t("picker.bookingForm.required","This is required."):P==="too_long"?t("picker.bookingForm.tooLong","This is too long."):S==="email"?t("picker.bookingForm.invalidEmail","Enter a valid email address."):S==="phone"?t("picker.bookingForm.invalidPhone","Enter a valid phone number."):t("picker.bookingForm.invalid","Check this answer."),D=(S,P)=>{S.error.textContent=P?Q(S.kind,P):"",S.error.hidden=!P;let B=S.kind==="multiselect"||S.control.closest(".sl-hco-chips")?S.control.closest("fieldset")??S.control:S.control;P?B.setAttribute("aria-invalid","true"):B.removeAttribute("aria-invalid"),S.control.closest(".sl-hco-block")?.classList.toggle("has-error",T.some(ee=>ee.ticketKey===S.ticketKey&&!ee.error.hidden))},g=(S,P)=>{let B=le("span",void 0,S);if(P)return B;let ee=le("span","sl-hco-label-row");return ee.append(B," ",le("span","sl-hco-optional",t("checkout.optional","Optional"))),ee},R=(S,P)=>{let B=`${i}-bf${C++}`,ee=b(P.key,P.ticketKey),K=f.get(ee),U=le("div","sl-hco-field"),G=P.help?le("p","sl-hco-help",P.help):null;G&&(G.id=`${B}-h`);let oe=le("p","sl-hco-ferr");oe.id=`${B}-e`,oe.hidden=!0;let ke=ae=>{ae.setAttribute("aria-describedby",G?`${G.id} ${oe.id}`:oe.id),P.required&&ae.tagName!=="FIELDSET"&&ae.setAttribute("aria-required","true")},be=P.kind==="select"&&(P.options??[]).length<=hm,Ie;if(P.kind==="checkbox"||P.kind==="multiselect"||be){let ae=P.kind==="checkbox"?null:le("fieldset",be?"sl-hco-group sl-hco-chips":"sl-hco-group"),ie=ae?P.options??[]:[{id:"",label:P.label}];if(ae){be&&ae.setAttribute("role","radiogroup");let Ae=le("legend");Ae.appendChild(g(P.label,P.required)),ae.appendChild(Ae),G&&ae.appendChild(G),ke(ae)}let Ce=ae?le("div","sl-hco-choices"):null,Se=ie.map((Ae,Ge)=>{let Mn=le("label",be?"sl-hco-chip":"sl-hco-check"),Oe=le("input");Oe.type=be?"radio":"checkbox",Oe.value=Ae.id,be&&(Oe.name=B),ae?(Ge===0&&(Oe.id=B),Oe.checked=be?K===Ae.id:Array.isArray(K)&&K.includes(Ae.id)):(Oe.id=B,Oe.checked=K===!0,ke(Oe));let Ji=ae?le("span",void 0,Ae.label):g(P.label,P.required);return Mn.append(Oe,Ji),(Ce??U).appendChild(Mn),Oe});ae&&Ce?(ae.appendChild(Ce),U.appendChild(ae)):G&&U.appendChild(G),Ie={...P,control:Se[0]??ae??U,error:oe,read:be?()=>Se.find(Ae=>Ae.checked)?.value??"":ae?()=>Se.filter(Ae=>Ae.checked).map(Ae=>Ae.value):()=>!!Se[0]?.checked}}else{let ae=le("label","sl-hco-label");ae.appendChild(g(P.label,P.required)),ae.htmlFor=B;let ie;if(P.kind==="textarea")ie=le("textarea","sl-hco-input"),ie.rows=3,ie.maxLength=500;else if(P.kind==="select"){ie=le("select","sl-hco-input"),ie.appendChild(new Option(t("picker.bookingForm.choose","Choose\u2026"),""));for(let Se of P.options??[])ie.appendChild(new Option(Se.label,Se.id))}else ie=le("input","sl-hco-input"),ie.type=dm[P.kind]??"text",P.kind==="number"?(ie.step="any",ie.inputMode="decimal"):P.kind!=="date"&&(ie.maxLength=P.kind==="phone"?20:500),P.autocomplete&&(ie.autocomplete=P.autocomplete);ie.id=B,typeof K=="string"?ie.value=K:typeof K=="number"&&(ie.value=String(K)),ke(ie),U.append(ae,...G?[G]:[],ie);let Ce=ie;Ie={...P,control:ie,error:oe,read:()=>{let Se=Ce.value.trim();return P.kind!=="number"?Se:Ce.validity?.badInput?Number.NaN:Se===""?void 0:Number(Se)}}}U.appendChild(oe);let Pn=()=>{let ae=Ie.read();ae===void 0?f.delete(ee):f.set(ee,ae),D(Ie,null)};return U.addEventListener("input",Pn),U.addEventListener("change",Pn),S.appendChild(U),T.push(Ie),Ie},_=(S,P,B)=>R(S,{key:`question:${P.id}`,...B!==void 0?{ticketKey:B}:{},kind:P.type,label:P.label,required:!!P.required,help:P.helpText,options:P.options}),V=(S,P,B,ee)=>{let K=Fa.find(([U])=>U===B);return R(S,{key:B,ticketKey:P.key,kind:K[1],label:t(K[2],K[3]),required:ao(e,B)==="required",autocomplete:ee===0&&m?pm[K[1]]:"off"})},z=(S,P,B="sl-hco-link")=>{let ee=le("button",B,S);return ee.type="button",ee.addEventListener("click",P),ee},F=S=>le("h3","sl-hco-h",S),ne=()=>le("section","sl-hco-sec"),J=S=>{if(!S&&p[0]){let B=n.buyer();for(let[ee,K]of c){let U=B[K];U&&f.set(b(ee,p[0].key),U)}u=!0}m=S;for(let[,B]of c)n.buyerError?.(B,null);X(),(S?E.querySelector(".sl-hco-you .sl-hco-link"):E.querySelector(".sl-hco-block input"))?.focus()};function X(){T=[],k.replaceChildren(),E.replaceChildren();let S=p[0],P=p.length===1&&m;if(l&&P&&S){for(let[G,oe]of r)oe==="phone"&&V(k,S,G,0);c.length&&k.appendChild(z(t("checkout.forSomeoneElse","Ticket for someone else?"),()=>J(!1)))}let B=l&&!P&&(!d||u||xe||!m);if(l&&!P&&!B){let G=ne(),oe=z("",()=>{u=!0,X(),E.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");oe.setAttribute("aria-expanded","false"),oe.append(le("span","sl-hco-plus","+"),le("span",void 0,t("checkout.addNames","Add names for each ticket")),le("span","sl-hco-optional",t("checkout.optional","Optional"))),G.appendChild(oe),E.appendChild(G)}if(B){let G=ne();G.appendChild(F(t("bookingForm.ticketHolders","Ticket holders"))),p.forEach((oe,ke)=>{let be=le("fieldset","sl-hco-block"),Ie=le("legend","sl-hco-legend",oe.title||t("picker.bookingForm.ticket","Ticket {number}",{number:ke+1}));be.appendChild(Ie);let Pn=ke===0&&m&&c.length>0;if(Pn){let Ce=n.buyer(),Se=le("p","sl-hco-you"),Ae=Ce.name||Ce.email;Se.append(le("span",void 0,Ae?t("checkout.holderYou","You \xB7 {name}",{name:Ae}):t("checkout.holderYouPlain","You")));let Ge=z(t("checkout.change","Change"),()=>J(!1));Ge.setAttribute("aria-label",t("checkout.changeHolder","Change the holder of {ticket}",{ticket:Ie.textContent??""})),Se.appendChild(Ge),be.appendChild(Se)}else ke===0&&!m&&c.length>0&&be.appendChild(z(t("picker.bookingForm.useMyDetails","Use my details"),()=>J(!0),"sl-hco-link sl-hco-use"));let ae=r.filter(([,Ce])=>!(Pn&&Ce!=="phone")),ie=ae.length>1?le("div","sl-hco-pair"):be;for(let[Ce]of ae)V(ie,oe,Ce,ke);ie!==be&&be.appendChild(ie);for(let Ce of s)_(be,Ce,oe.key);G.appendChild(be)}),E.appendChild(G)}let K=[...l&&P&&S?s.map(G=>({q:G,ticketKey:S.key})):[],...a.map(G=>({q:G,ticketKey:void 0}))],U=[...K.filter(({q:G})=>G.type!=="checkbox"),...K.filter(({q:G})=>G.type==="checkbox")];if(U.length){let G=ne();G.appendChild(F(t("checkout.questions","A few questions")));for(let{q:oe,ticketKey:ke}of U)_(G,oe,ke);E.appendChild(G)}E.appendChild(L)}let xe=!1;X();let ge=()=>{if(!p[0]||!m)return null;let P=n.buyer(),B=null;for(let[ee,K]of c){let U=Ba(K,ao(e,ee)==="required",P[K]),G=n.buyerError?.(K,U?Q(K,U):null)??null;U&&!B&&(B=G)}return B},Ee=S=>(L.textContent=S?t("picker.bookingForm.fix","Some details need attention."):"",L.hidden=!S,S?.focus(),!!S),Ke=(S,P)=>S.compareDocumentPosition(P)&4?-1:1;return{details:k,element:E,validate(){let S=[],P=ge();P&&S.push(P);for(let B of T){let ee=Ba(B.kind,B.required,B.read(),B.options);D(B,ee),ee&&S.push(B.control)}return S.sort(Ke),!Ee(S[0]??null)},payload(){let S=new Map,P=[],B=p[0];if(B&&m){let K=n.buyer(),U={ticketKey:B.key};for(let[,G]of c){let oe=K[G];oe&&(U[G]=oe)}(U.name||U.email)&&S.set(B.key,U)}for(let K of T){let U=K.read();if(!Va(U)){if(K.key.startsWith("question:"))P.push({questionId:K.key.slice(9),...K.ticketKey!==void 0?{ticketKey:K.ticketKey}:{},value:U});else if(K.ticketKey!==void 0){let G=S.get(K.ticketKey)??{ticketKey:K.ticketKey},oe=K.key==="attendeeName"?"name":K.key==="attendeeEmail"?"email":"phone";G[oe]=String(U),S.set(K.ticketKey,G)}}}let ee=p.map(K=>S.get(K.key)).filter(K=>!!K);return{...ee.length?{attendees:ee}:{},...P.length?{answers:P}:{}}},showServerErrors(S){let P=(Array.isArray(S)?S:[]).filter(K=>!!K&&typeof K.key=="string");if(l){let K=!1;for(let U of P)typeof U.ticketKey=="string"&&!p.some(G=>G.key===U.ticketKey)&&(p.push({key:U.ticketKey}),K=!0);xe=P.some(U=>typeof U.ticketKey=="string"),(K||xe)&&X()}let B=[],ee=p[0];for(let K of P){let U=K.key==="attendeeName"?"name":K.key==="attendeeEmail"?"email":null;if(U&&m&&ee&&K.ticketKey===ee.key&&c.some(([,G])=>G===U)){let G=n.buyerError?.(U,Q(U,Da.includes(K.code)?K.code:"invalid"));G&&B.push(G)}}for(let K of T){let U=P.find(oe=>oe.key===K.key&&(oe.ticketKey??void 0)===(K.ticketKey??void 0)),G=U?Da.includes(U.code)?U.code:"invalid":null;D(K,G),G&&B.push(K.control)}return B.length?(B.sort(Ke),Ee(B[0])):(L.textContent=t("picker.bookingForm.fix","Some details need attention."),L.hidden=!1,!1)}}}var am,lm,cm,Da,Fa,dm,pm,hm,za=io(()=>{"use strict";am=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,lm=/^[0-9 +()-]{6,20}$/,cm=/^(\d{4})-(\d{2})-(\d{2})$/,Da=["required","invalid","too_long"],Fa=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],dm={email:"email",phone:"tel",number:"number",date:"date"};pm={name:"name",email:"email",phone:"tel"},hm=5});var Ya={};Ur(Ya,{CHECKOUT_BUSY_MAX_RETRIES:()=>Ua,checkoutBusyDelayMs:()=>qa,errorCopy:()=>nn,formatHoldClock:()=>Wa,isCheckoutBusy:()=>Yr,mountCheckout:()=>Tm,unavailableCopy:()=>Ga});function gm(n,e){try{window.sessionStorage.setItem(fm,JSON.stringify({orderId:n,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function ym(){if(typeof document>"u"||document.getElementById(ja))return;let n=document.createElement("style");n.id=ja,n.textContent=bm,document.head.appendChild(n)}function Ga(n,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return n==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${t} 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:`${t} 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:`${t} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}function Yr(n){if(!n||typeof n!="object")return!1;let e=n;return e.status!==503||e.code==="maintenance_mode"||e.reason==="maintenance_mode"?!1:e.code==="checkout_busy"||e.code==="database_busy"?!0:e.retryable===!0}function qa(n,e=Math.random){let t=n?.retryAfterS,i=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:vm,o=Math.floor(Math.max(0,Math.min(1,e()))*wm);return Math.min(xm,i*1e3+o)}function km(n){return`${(typeof n?.notice=="string"?n.notice.trim():"")||(()=>{let i=n?.retryAfterS;if(typeof i!="number"||!Number.isFinite(i)||i<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let o=Math.max(1,Math.ceil(i/60));return`Booking is paused for maintenance. Please try again in about ${o} minute${o===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function nn(n,e){if(n==="maintenance_mode")return km(e);switch(n){case"checkout_busy":case"database_busy":return e?.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 $(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function tn(n,e=18,t="0 0 20 20"){let i=document.createElementNS(Ka,"svg");i.setAttribute("viewBox",t),i.setAttribute("width",String(e)),i.setAttribute("height",String(e)),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.8"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let o of n){let r=document.createElementNS(Ka,"path");r.setAttribute("d",o),i.appendChild(r)}return i}function Wa(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/3600),i=Math.floor(e%3600/60),o=String(e%60).padStart(2,"0");return t>0?`${t}:${String(i).padStart(2,"0")}:${o}`:`${i}:${o}`}function Tm(n){ym();let e=!0,t=!1,i=null,o=(A,N,W)=>{let Z=n.t?.(A,W);return Z&&Z!==A?Z:W?N.replace(/\{(\w+)\}/g,(Ve,$e)=>$e in W?String(W[$e]):Ve):N},r=$("div","sl-hco");r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let s=$("div","sl-hco-card");r.appendChild(s);let a=()=>{i&&clearInterval(i),i=null},l=()=>{e=!1,a(),r.remove(),document.removeEventListener("keydown",p,!0)},c=()=>{l(),n.onCancel()},d=!0;function p(A){if(r.isConnected){if(A.key==="Tab"){let N=[...s.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(Ve=>Ve.offsetParent!==null||Ve===document.activeElement),W=N[0],Z=N[N.length-1];if(!W||!Z)return;A.shiftKey&&document.activeElement===W?(A.preventDefault(),Z.focus()):!A.shiftKey&&document.activeElement===Z&&(A.preventDefault(),W.focus());return}A.key==="Escape"&&(A.stopPropagation(),A.preventDefault(),d&&c())}}document.addEventListener("keydown",p,!0);let m=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,u=$("header","sl-hco-head"),f=$("button","sl-hco-back-icon");f.type="button",f.setAttribute("aria-label",o("checkout.back","Back to seats")),f.appendChild(tn([...Ht.back])),f.addEventListener("click",()=>{d&&c()});let b=$("div","sl-hco-htext"),T=$("h2","sl-hco-title",n.event?.name?.trim()||o("checkout.title","Checkout"));T.id=m;let C=$("p","sl-hco-sub",n.event?.detail?.trim()??"");C.hidden=!C.textContent,b.append(T,C);let k=$("span","sl-hco-timer");k.setAttribute("role","timer");let E=$("span");E.setAttribute("aria-hidden","true"),k.append(tn([...Ht.clock],14),E),k.hidden=!0,u.append(f,b,k),r.setAttribute("aria-labelledby",m);let L=$("p","sl-hco-sr");L.setAttribute("aria-live","polite");let Q=(...A)=>{s.replaceChildren(u,L,...A)},D=A=>{d=A,f.hidden=!A},g=A=>{let N=$("div","sl-hco-state");N.setAttribute("role",A.alert?"alert":"status");let W=$("div",`sl-hco-state-icon is-${A.tone}`);return W.setAttribute("aria-hidden","true"),W.appendChild(A.icon),N.appendChild(W),A.title&&N.appendChild($("h3","sl-hco-state-title",A.title)),A.text&&N.appendChild($("p",`sl-hco-status${A.alert?" sl-hco-error":""}`,A.text)),A.note&&N.appendChild($("p","sl-hco-state-note",A.note)),N},R=(...A)=>{let N=$("div","sl-hco-body");return N.append(...A),N},_=(...A)=>{let N=$("footer","sl-hco-foot");return N.append(...A),N},V=()=>{let A=$("span","sl-hco-spin");return A.setAttribute("aria-hidden","true"),A},z=(A,N="error")=>{if(!e)return;a(),k.hidden=!0,D(!0);let W=$("button",N==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",N==="expired"?o("checkout.chooseAgain","Choose seats again"):N==="taken"?o("checkout.chooseOther","Choose other seats"):o("checkout.back","Back to seats"));if(W.type="button",W.addEventListener("click",c),N==="error"){let Z=$("p","sl-hco-alert is-error sl-hco-status sl-hco-error",A);Z.setAttribute("role","alert"),Q(R(...J?[J]:[],Z),_(W))}else Q(R(g({tone:N==="expired"?"warn":"error",icon:tn([...N==="expired"?Ht.hour:Ht.seat],24,"0 0 24 24"),title:N==="expired"?o("checkout.expiredTitle","Your seats were released"):o("checkout.takenTitle","Those seats were just taken"),text:A,alert:!1})),_(W));W.focus()},F=(A,N)=>{e&&(a(),k.hidden=!0,D(!1),Q(R(g({tone:"neutral",icon:V(),...N?{title:N}:{},text:A}))))},ne=async(A,N=!1)=>{F(N?o("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let W=Date.now()+um;for(;e&&Date.now()<W;){try{let Z=await n.orderStatus(A);if(!e)return;if(Z.status==="confirmed"){t=!0,D(!1),T.textContent=o("checkout.confirmedTitle","Your tickets are confirmed");let Ve=$("p","sl-hco-status",`${Z.seatCount} ${Z.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),$e=$("dl","sl-hco-receipt"),We=(Z.tickets??[]).map(Zt=>Zt.displayLabel||Zt.label);We.length&&$e.append($("dt",void 0,"Seats"),$("dd",void 0,We.join(", ")));let ot=N||Z.totalMinor===0;$e.append($("dt",void 0,ot?o("checkout.price","Price"):o("checkout.paid","Paid")),$("dd",void 0,ot?o("checkout.free","Free"):`${Z.amountFormatted} ${Z.currency}`),$("dt",void 0,o("checkout.order","Order")),$("dd","sl-hco-ref",Z.orderId));let Ln=$("button","sl-hco-back","Close");Ln.type="button",Ln.addEventListener("click",c);let Mt=$("div","sl-hco-state");if(Mt.append(Ve,$e),Z.ticketUrl){let Zt=$("a","sl-hco-tickets",o("checkout.viewTickets","View tickets & QR codes"));Zt.href=Z.ticketUrl,Zt.target="_blank",Zt.rel="noreferrer",Mt.appendChild(Zt)}Mt.appendChild(Ln),Q(R(Mt)),d=!0,n.onConfirmed(Z);return}if(Z.status==="failed"||Z.status==="expired"){Z.status==="expired"?z("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):z("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(Z=>setTimeout(Z,mm))}!e||t||z(N?"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.")},J=null;if(n.state.kind==="unavailable"){let A=Ga(n.state.reason,n.state.seatCount);T.textContent=A.title;let N=$("button","sl-hco-back sl-hco-ghost","Back to seat map");N.type="button",N.addEventListener("click",c);let W=$("p","sl-hco-label","Seats held");return Q(R(W,g({tone:"neutral",icon:tn([...Ht.seat],24,"0 0 24 24"),text:A.body,note:A.detail})),_(N)),n.root.appendChild(r),N.focus(),{destroy:l}}if(n.state.kind==="resume")return n.root.appendChild(r),ne(n.state.orderId),{destroy:l};let{order:X,bookingForm:xe}=n.state,ge=n.state.free===!0,Ee=A=>ge?o("checkout.free","Free"):n.formatMoney(A,X.currency),Ke=Ee(X.total);J=$("section","sl-hco-sec sl-hco-order sl-hco-summary");let S=X.lines?.length?X.lines:X.labels.map(A=>({label:A,detail:null,amount:null})),P=S.length===1?[S[0].label,S[0].detail].filter(Boolean).join(" \xB7 "):`${X.tickets?.length||S.length} ${(X.tickets?.length||S.length)===1?"seat":"seats"}`,B=$("button","sl-hco-order-toggle");B.type="button",B.setAttribute("aria-expanded","false"),B.append($("span",void 0,P),tn([...Ht.down])),B.addEventListener("click",()=>{let A=!J.hasAttribute("data-open");J.toggleAttribute("data-open",A),B.setAttribute("aria-expanded",String(A))});let ee=$("div","sl-hco-order-full"),K=$("ul","sl-hco-lines sl-hco-seats");for(let A of S){let N=$("li","sl-hco-line sl-hco-seat"),W=$("span","sl-hco-line-text");W.appendChild($("span","sl-hco-where",A.label)),A.detail&&W.appendChild($("span","sl-hco-what",A.detail)),N.appendChild(W),typeof A.amount=="number"&&N.appendChild($("span","sl-hco-price",Ee(A.amount))),K.appendChild(N)}ee.append($("h3","sl-hco-h",o("checkout.yourOrder","Your order")),K),J.append(B,ee);let U=$("form","sl-hco-form");U.noValidate=!0;let G=A=>{let N=$("div","sl-hco-field"),W=$("label","sl-hco-label"),Z=$("span","sl-hco-label-row");Z.appendChild($("span",void 0,A.label));let Ve=$("span","sl-hco-optional",o("checkout.optional","Optional"));A.optional&&Z.append(" ",Ve),W.appendChild(Z),W.htmlFor=A.id;let $e=A.hint?$("p","sl-hco-help",A.hint):null;$e&&($e.id=`${A.id}-h`);let We=$("input","sl-hco-input");We.type=A.type,We.id=A.id,We.autocomplete=A.autocomplete,We.placeholder=A.placeholder;let ot=$("p","sl-hco-ferr");ot.id=`${A.id}-e`,ot.hidden=!0,We.setAttribute("aria-describedby",$e?`${$e.id} ${ot.id}`:ot.id),N.append(W,...$e?[$e]:[],We,ot);let Ln=Mt=>{ot.textContent=Mt??"",ot.hidden=!Mt,Mt?We.setAttribute("aria-invalid","true"):We.removeAttribute("aria-invalid")};return We.addEventListener("input",()=>Ln(null)),{wrap:N,input:We,optional:Ve,setError:Ln}},oe=G({id:`${m}-email`,label:o("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:o("checkout.emailHint","Your tickets are sent here."),optional:!1}),ke=oe.input;ke.required=!0,ke.inputMode="email";let be=G({id:`${m}-name`,label:o("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:o("checkout.namePlaceholder","Your name"),optional:!0}),Ie=be.input;n.buyer?.email&&(ke.value=n.buyer.email),n.buyer?.name&&(Ie.value=n.buyer.name),xe?.attendeeName==="required"&&(be.optional.previousSibling?.remove(),be.optional.remove(),Ie.setAttribute("aria-required","true"));let ae=()=>/.+@.+\..+/.test(ke.value.trim()),ie=$a({form:xe,tickets:X.tickets??[],idPrefix:m,t:o,buyer:()=>({name:Ie.value.trim(),email:ke.value.trim()}),buyerError:(A,N)=>((A==="name"?be:oe).setError(N),A==="name"?Ie:ke)}),Ce=$("section","sl-hco-sec");Ce.append($("h3","sl-hco-h",o("checkout.yourDetails","Your details")),oe.wrap,be.wrap,...ie.details?.childNodes.length?[ie.details]:[]);let Se=$("fieldset","sl-hco-fields");Se.append(J,Ce,...ie.element?[ie.element]:[]);let Ae=R(Se),Ge=$("p","sl-hco-alert is-error sl-hco-status sl-hco-error");Ge.setAttribute("role","alert"),Ge.hidden=!0;let Mn=A=>{Ge.textContent=A,Ge.hidden=!1},Oe=$("p","sl-hco-alert is-warn");Oe.hidden=!0;let Ji=$("div","sl-hco-total"),ma=X.tickets?.length||X.labels.length;Ji.append($("span",void 0,`${ma} ${ma===1?"seat":"seats"}`),$("strong",void 0,Ke));let fa=ge?o("checkout.confirmBooking","Confirm booking"):o("checkout.continue","Continue to payment"),Qt=$("button","sl-hco-pay",fa);Qt.type="submit";let eo=$("p","sl-hco-sr");eo.setAttribute("role","status");let ga=A=>{Qt.replaceChildren(V(),A),eo.textContent=A},Kr=$("p","sl-hco-trust");ge||Kr.appendChild(tn([...Ht.lock],12,"0 0 16 16")),Kr.append(ge?o("checkout.freeTrust","Free booking. Nothing is charged."):o("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),U.append(Ae,_(Ge,Oe,Ji,Qt,eo,Kr));let ba=null,ya=()=>{let A=X.expiresAt-Date.now(),N=Wa(A);E.textContent=N,k.setAttribute("aria-label",o("checkout.heldFor","Seats held for {time}",{time:N}));let W=A<=Sm;k.classList.toggle("is-warn",W),Oe.hidden=!W||!Ge.hidden,W&&(Oe.textContent=o("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:N}));let Z=A<=3e4?30:W?120:null;Z&&ba!==Z&&(ba=Z,L.textContent=Oe.textContent),A<=0&&z(o("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:S.map(Ve=>Ve.label).join(", ")}),"expired")},wu=()=>{Number.isFinite(X.expiresAt)&&(a(),k.hidden=!1,ya(),i=setInterval(ya,1e3))},to=!1,xu=async()=>{if(!to){to=!0,Ge.hidden=!0,Se.disabled=!0,Qt.disabled=!0,ga(ge?o("checkout.confirmingBooking","Confirming your booking\u2026"):o("checkout.opening","Opening secure payment\u2026"));try{let A={holdId:X.holdId,buyerEmail:ke.value.trim(),...Ie.value.trim()?{buyerName:Ie.value.trim()}:{},...ie.payload(),bookingFormVersion:1},N=0,W;for(;;)try{W=await n.startSession(A);break}catch(Ve){if(!e)return;if(N>=Ua||!Yr(Ve))throw Ve;if(N+=1,ga(ge?o("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):o("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise($e=>setTimeout($e,qa(Ve))),!e)return}if(!e)return;if(W.status==="confirmed"){ne(W.orderId,!0);return}let Z=so(W.redirectUrl);if(Z){gm(W.orderId,n.eventKey),a(),k.hidden=!0,Q(R(g({tone:"neutral",icon:tn([...Ht.card],24,"0 0 24 24"),title:o("checkout.redirectTitle","Taking you to secure payment"),text:o("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:Ke}),note:o("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(Z);return}z(nn("gateway_unavailable"))}catch(A){n.onError?.(A);let N=A;if(N?.code==="booking_form_incomplete"&&ie.element){Gr(),ie.showServerErrors(N.fields);return}if(Yr(N)){Gr(),Mn(ge?o("checkout.busyFailedBooking",nn("checkout_busy",{free:!0})):o("checkout.busyFailedPayment",nn("checkout_busy"))),Qt.textContent=o("checkout.tryAgain","Try again");return}if(N?.code==="hold_not_active"||N?.code==="hold_not_found"){z(nn(N.code),"expired");return}if(N?.code==="seats_unavailable"){z(o("checkout.seatsUnavailable",nn(N.code)),"taken");return}z(nn(N?.code,N))}}};U.addEventListener("submit",A=>{if(A.preventDefault(),to)return;let N=ae();oe.setError(N?null:o("checkout.error.email","Enter an email like name@example.com."));let W=ie.validate();if(!N){Mn(o("bookingForm.fixErrors","Some details need attention before you continue.")),ke.focus();return}if(!W){Mn(o("bookingForm.fixErrors","Some details need attention before you continue."));return}xu()});let Gr=()=>{T.textContent=n.event?.name?.trim()||o("checkout.title","Checkout"),Ge.hidden=!0,Ge.textContent="",to=!1,Se.disabled=!1,Qt.disabled=!1,Qt.textContent=fa,eo.textContent="",D(!0),Q(U),wu()};return Gr(),n.root.appendChild(r),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&ke.focus(),{destroy:l}}var um,mm,ja,fm,bm,Ua,vm,wm,xm,Ka,Ht,Sm,Xa=io(()=>{"use strict";Wr();za();um=9e4,mm=2e3,ja="seatlayer-checkout-style",fm="@seatlayer/pending-checkout/v1";bm=`
1
+ "use strict";var Lu=Object.create;var io=Object.defineProperty;var Hu=Object.getOwnPropertyDescriptor;var Ru=Object.getOwnPropertyNames;var Iu=Object.getPrototypeOf,Ou=Object.prototype.hasOwnProperty;var ka=n=>{throw TypeError(n)};var oo=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var Yr=(n,e)=>{for(var t in e)io(n,t,{get:e[t],enumerable:!0})},Sa=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ru(e))!Ou.call(n,o)&&o!==t&&io(n,o,{get:()=>e[o],enumerable:!(i=Hu(e,o))||i.enumerable});return n};var Ta=(n,e,t)=>(t=n!=null?Lu(Iu(n)):{},Sa(e||!n||!n.__esModule?io(t,"default",{value:n,enumerable:!0}):t,n)),_u=n=>Sa(io({},"__esModule",{value:!0}),n);var Xr=(n,e,t)=>e.has(n)||ka("Cannot "+t);var h=(n,e,t)=>(Xr(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?ka("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),x=(n,e,t,i)=>(Xr(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),w=(n,e,t)=>(Xr(n,e,"access private method"),t);var Ea=(n,e,t,i)=>({set _(o){x(n,e,o,t)},get _(){return h(n,e,i)}});function co(n){if(typeof n!="string"||!n)return null;try{let{protocol:e,hostname:t}=new URL(n);if(e==="https:"||e==="http:"&&(t==="localhost"||t==="127.0.0.1"))return n}catch{}return null}var Qr=oo(()=>{"use strict"});function qa(n){return n===void 0||n===""||n===!1||Array.isArray(n)&&!n.length}function Ua(n,e,t,i){if(qa(t))return e?"required":null;let o=r=>!!i?.some(s=>s.id===r);if(n==="number")return typeof t=="number"&&Number.isFinite(t)?null:"invalid";if(n==="checkbox")return t===!0?null:"invalid";if(n==="select")return o(t)?null:"invalid";if(n==="multiselect")return Array.isArray(t)&&t.length<=50&&t.every(o)?null:"invalid";if(typeof t!="string")return"invalid";if(n==="phone")return ym.test(t)?null:"invalid";if(t.length>500)return"too_long";if(n==="email")return bm.test(t)?null:"invalid";if(n==="date"){let r=vm.exec(t);if(!r)return"invalid";let[s,a,l]=[Number(r[1]),Number(r[2]),Number(r[3])],c=new Date(Date.UTC(s,a-1,l));return c.getUTCFullYear()===s&&c.getUTCMonth()===a-1&&c.getUTCDate()===l?null:"invalid"}return null}function le(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function po(n,e){let t=n?.[e];return t==="optional"||t==="required"?t:"off"}function Wa(n){let{form:e,t,idPrefix:i}=n,o=(e?.questions??[]).filter(S=>S&&!S.archived).sort((S,P)=>S.position-P.position),r=Ga.filter(([S])=>po(e,S)!=="off"),s=o.filter(S=>S.scope==="ticket"),a=o.filter(S=>S.scope!=="ticket"),l=r.length>0||s.length>0;if(!l&&!a.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let c=r.filter(([,S])=>S!=="phone"),d=r.every(([S])=>po(e,S)!=="required")&&s.every(S=>!S.required),p=[...n.tickets],m=!0,u=!1,f=new Map,b=(S,P)=>P===void 0?S:`${S}|${P}`,T=[],C=0,k=le("div","sl-hco-bf sl-hco-bf-inline"),E=le("div","sl-hco-bf"),L=le("p","sl-hco-alert is-error");L.setAttribute("role","alert"),L.hidden=!0;let Q=(S,P)=>P==="required"?t("picker.bookingForm.required","This is required."):P==="too_long"?t("picker.bookingForm.tooLong","This is too long."):S==="email"?t("picker.bookingForm.invalidEmail","Enter a valid email address."):S==="phone"?t("picker.bookingForm.invalidPhone","Enter a valid phone number."):t("picker.bookingForm.invalid","Check this answer."),D=(S,P)=>{S.error.textContent=P?Q(S.kind,P):"",S.error.hidden=!P;let B=S.kind==="multiselect"||S.control.closest(".sl-hco-chips")?S.control.closest("fieldset")??S.control:S.control;P?B.setAttribute("aria-invalid","true"):B.removeAttribute("aria-invalid"),S.control.closest(".sl-hco-block")?.classList.toggle("has-error",T.some(ee=>ee.ticketKey===S.ticketKey&&!ee.error.hidden))},g=(S,P)=>{let B=le("span",void 0,S);if(P)return B;let ee=le("span","sl-hco-label-row");return ee.append(B," ",le("span","sl-hco-optional",t("checkout.optional","Optional"))),ee},R=(S,P)=>{let B=`${i}-bf${C++}`,ee=b(P.key,P.ticketKey),K=f.get(ee),U=le("div","sl-hco-field"),G=P.help?le("p","sl-hco-help",P.help):null;G&&(G.id=`${B}-h`);let oe=le("p","sl-hco-ferr");oe.id=`${B}-e`,oe.hidden=!0;let ke=ae=>{ae.setAttribute("aria-describedby",G?`${G.id} ${oe.id}`:oe.id),P.required&&ae.tagName!=="FIELDSET"&&ae.setAttribute("aria-required","true")},be=P.kind==="select"&&(P.options??[]).length<=km,Ie;if(P.kind==="checkbox"||P.kind==="multiselect"||be){let ae=P.kind==="checkbox"?null:le("fieldset",be?"sl-hco-group sl-hco-chips":"sl-hco-group"),ie=ae?P.options??[]:[{id:"",label:P.label}];if(ae){be&&ae.setAttribute("role","radiogroup");let Pe=le("legend");Pe.appendChild(g(P.label,P.required)),ae.appendChild(Pe),G&&ae.appendChild(G),ke(ae)}let Ae=ae?le("div","sl-hco-choices"):null,Se=ie.map((Pe,Ge)=>{let Mn=le("label",be?"sl-hco-chip":"sl-hco-check"),Oe=le("input");Oe.type=be?"radio":"checkbox",Oe.value=Pe.id,be&&(Oe.name=B),ae?(Ge===0&&(Oe.id=B),Oe.checked=be?K===Pe.id:Array.isArray(K)&&K.includes(Pe.id)):(Oe.id=B,Oe.checked=K===!0,ke(Oe));let eo=ae?le("span",void 0,Pe.label):g(P.label,P.required);return Mn.append(Oe,eo),(Ae??U).appendChild(Mn),Oe});ae&&Ae?(ae.appendChild(Ae),U.appendChild(ae)):G&&U.appendChild(G),Ie={...P,control:Se[0]??ae??U,error:oe,read:be?()=>Se.find(Pe=>Pe.checked)?.value??"":ae?()=>Se.filter(Pe=>Pe.checked).map(Pe=>Pe.value):()=>!!Se[0]?.checked}}else{let ae=le("label","sl-hco-label");ae.appendChild(g(P.label,P.required)),ae.htmlFor=B;let ie;if(P.kind==="textarea")ie=le("textarea","sl-hco-input"),ie.rows=3,ie.maxLength=500;else if(P.kind==="select"){ie=le("select","sl-hco-input"),ie.appendChild(new Option(t("picker.bookingForm.choose","Choose\u2026"),""));for(let Se of P.options??[])ie.appendChild(new Option(Se.label,Se.id))}else ie=le("input","sl-hco-input"),ie.type=wm[P.kind]??"text",P.kind==="number"?(ie.step="any",ie.inputMode="decimal"):P.kind!=="date"&&(ie.maxLength=P.kind==="phone"?20:500),P.autocomplete&&(ie.autocomplete=P.autocomplete);ie.id=B,typeof K=="string"?ie.value=K:typeof K=="number"&&(ie.value=String(K)),ke(ie),U.append(ae,...G?[G]:[],ie);let Ae=ie;Ie={...P,control:ie,error:oe,read:()=>{let Se=Ae.value.trim();return P.kind!=="number"?Se:Ae.validity?.badInput?Number.NaN:Se===""?void 0:Number(Se)}}}U.appendChild(oe);let Pn=()=>{let ae=Ie.read();ae===void 0?f.delete(ee):f.set(ee,ae),D(Ie,null)};return U.addEventListener("input",Pn),U.addEventListener("change",Pn),S.appendChild(U),T.push(Ie),Ie},_=(S,P,B)=>R(S,{key:`question:${P.id}`,...B!==void 0?{ticketKey:B}:{},kind:P.type,label:P.label,required:!!P.required,help:P.helpText,options:P.options}),V=(S,P,B,ee)=>{let K=Ga.find(([U])=>U===B);return R(S,{key:B,ticketKey:P.key,kind:K[1],label:t(K[2],K[3]),required:po(e,B)==="required",autocomplete:ee===0&&m?xm[K[1]]:"off"})},z=(S,P,B="sl-hco-link")=>{let ee=le("button",B,S);return ee.type="button",ee.addEventListener("click",P),ee},F=S=>le("h3","sl-hco-h",S),ne=()=>le("section","sl-hco-sec"),J=S=>{if(!S&&p[0]){let B=n.buyer();for(let[ee,K]of c){let U=B[K];U&&f.set(b(ee,p[0].key),U)}u=!0}m=S;for(let[,B]of c)n.buyerError?.(B,null);X(),(S?E.querySelector(".sl-hco-you .sl-hco-link"):E.querySelector(".sl-hco-block input"))?.focus()};function X(){T=[],k.replaceChildren(),E.replaceChildren();let S=p[0],P=p.length===1&&m;if(l&&P&&S){for(let[G,oe]of r)oe==="phone"&&V(k,S,G,0);c.length&&k.appendChild(z(t("checkout.forSomeoneElse","Ticket for someone else?"),()=>J(!1)))}let B=l&&!P&&(!d||u||xe||!m);if(l&&!P&&!B){let G=ne(),oe=z("",()=>{u=!0,X(),E.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");oe.setAttribute("aria-expanded","false"),oe.append(le("span","sl-hco-plus","+"),le("span",void 0,t("checkout.addNames","Add names for each ticket")),le("span","sl-hco-optional",t("checkout.optional","Optional"))),G.appendChild(oe),E.appendChild(G)}if(B){let G=ne();G.appendChild(F(t("bookingForm.ticketHolders","Ticket holders"))),p.forEach((oe,ke)=>{let be=le("fieldset","sl-hco-block"),Ie=le("legend","sl-hco-legend",oe.title||t("picker.bookingForm.ticket","Ticket {number}",{number:ke+1}));be.appendChild(Ie);let Pn=ke===0&&m&&c.length>0;if(Pn){let Ae=n.buyer(),Se=le("p","sl-hco-you"),Pe=Ae.name||Ae.email;Se.append(le("span",void 0,Pe?t("checkout.holderYou","You \xB7 {name}",{name:Pe}):t("checkout.holderYouPlain","You")));let Ge=z(t("checkout.change","Change"),()=>J(!1));Ge.setAttribute("aria-label",t("checkout.changeHolder","Change the holder of {ticket}",{ticket:Ie.textContent??""})),Se.appendChild(Ge),be.appendChild(Se)}else ke===0&&!m&&c.length>0&&be.appendChild(z(t("picker.bookingForm.useMyDetails","Use my details"),()=>J(!0),"sl-hco-link sl-hco-use"));let ae=r.filter(([,Ae])=>!(Pn&&Ae!=="phone")),ie=ae.length>1?le("div","sl-hco-pair"):be;for(let[Ae]of ae)V(ie,oe,Ae,ke);ie!==be&&be.appendChild(ie);for(let Ae of s)_(be,Ae,oe.key);G.appendChild(be)}),E.appendChild(G)}let K=[...l&&P&&S?s.map(G=>({q:G,ticketKey:S.key})):[],...a.map(G=>({q:G,ticketKey:void 0}))],U=[...K.filter(({q:G})=>G.type!=="checkbox"),...K.filter(({q:G})=>G.type==="checkbox")];if(U.length){let G=ne();G.appendChild(F(t("checkout.questions","A few questions")));for(let{q:oe,ticketKey:ke}of U)_(G,oe,ke);E.appendChild(G)}E.appendChild(L)}let xe=!1;X();let ge=()=>{if(!p[0]||!m)return null;let P=n.buyer(),B=null;for(let[ee,K]of c){let U=Ua(K,po(e,ee)==="required",P[K]),G=n.buyerError?.(K,U?Q(K,U):null)??null;U&&!B&&(B=G)}return B},Ce=S=>(L.textContent=S?t("picker.bookingForm.fix","Some details need attention."):"",L.hidden=!S,S?.focus(),!!S),Ke=(S,P)=>S.compareDocumentPosition(P)&4?-1:1;return{details:k,element:E,validate(){let S=[],P=ge();P&&S.push(P);for(let B of T){let ee=Ua(B.kind,B.required,B.read(),B.options);D(B,ee),ee&&S.push(B.control)}return S.sort(Ke),!Ce(S[0]??null)},payload(){let S=new Map,P=[],B=p[0];if(B&&m){let K=n.buyer(),U={ticketKey:B.key};for(let[,G]of c){let oe=K[G];oe&&(U[G]=oe)}(U.name||U.email)&&S.set(B.key,U)}for(let K of T){let U=K.read();if(!qa(U)){if(K.key.startsWith("question:"))P.push({questionId:K.key.slice(9),...K.ticketKey!==void 0?{ticketKey:K.ticketKey}:{},value:U});else if(K.ticketKey!==void 0){let G=S.get(K.ticketKey)??{ticketKey:K.ticketKey},oe=K.key==="attendeeName"?"name":K.key==="attendeeEmail"?"email":"phone";G[oe]=String(U),S.set(K.ticketKey,G)}}}let ee=p.map(K=>S.get(K.key)).filter(K=>!!K);return{...ee.length?{attendees:ee}:{},...P.length?{answers:P}:{}}},showServerErrors(S){let P=(Array.isArray(S)?S:[]).filter(K=>!!K&&typeof K.key=="string");if(l){let K=!1;for(let U of P)typeof U.ticketKey=="string"&&!p.some(G=>G.key===U.ticketKey)&&(p.push({key:U.ticketKey}),K=!0);xe=P.some(U=>typeof U.ticketKey=="string"),(K||xe)&&X()}let B=[],ee=p[0];for(let K of P){let U=K.key==="attendeeName"?"name":K.key==="attendeeEmail"?"email":null;if(U&&m&&ee&&K.ticketKey===ee.key&&c.some(([,G])=>G===U)){let G=n.buyerError?.(U,Q(U,Ka.includes(K.code)?K.code:"invalid"));G&&B.push(G)}}for(let K of T){let U=P.find(oe=>oe.key===K.key&&(oe.ticketKey??void 0)===(K.ticketKey??void 0)),G=U?Ka.includes(U.code)?U.code:"invalid":null;D(K,G),G&&B.push(K.control)}return B.length?(B.sort(Ke),Ce(B[0])):(L.textContent=t("picker.bookingForm.fix","Some details need attention."),L.hidden=!1,!1)}}}var bm,ym,vm,Ka,Ga,wm,xm,km,Ya=oo(()=>{"use strict";bm=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ym=/^[0-9 +()-]{6,20}$/,vm=/^(\d{4})-(\d{2})-(\d{2})$/,Ka=["required","invalid","too_long"],Ga=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],wm={email:"email",phone:"tel",number:"number",date:"date"};xm={name:"name",email:"email",phone:"tel"},km=5});var nl={};Yr(nl,{CHECKOUT_BUSY_MAX_RETRIES:()=>Ja,checkoutBusyDelayMs:()=>el,errorCopy:()=>nn,formatHoldClock:()=>tl,isCheckoutBusy:()=>Zr,mountCheckout:()=>Om,unavailableCopy:()=>Za});function Cm(n,e){try{window.sessionStorage.setItem(Em,JSON.stringify({orderId:n,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function Pm(){if(typeof document>"u"||document.getElementById(Xa))return;let n=document.createElement("style");n.id=Xa,n.textContent=Am,document.head.appendChild(n)}function Za(n,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return n==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${t} 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:`${t} 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:`${t} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}function Zr(n){if(!n||typeof n!="object")return!1;let e=n;return e.status!==503||e.code==="maintenance_mode"||e.reason==="maintenance_mode"?!1:e.code==="checkout_busy"||e.code==="database_busy"?!0:e.retryable===!0}function el(n,e=Math.random){let t=n?.retryAfterS,i=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:Mm,o=Math.floor(Math.max(0,Math.min(1,e()))*Lm);return Math.min(Hm,i*1e3+o)}function Rm(n){return`${(typeof n?.notice=="string"?n.notice.trim():"")||(()=>{let i=n?.retryAfterS;if(typeof i!="number"||!Number.isFinite(i)||i<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let o=Math.max(1,Math.ceil(i/60));return`Booking is paused for maintenance. Please try again in about ${o} minute${o===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function nn(n,e){if(n==="maintenance_mode")return Rm(e);switch(n){case"checkout_busy":case"database_busy":return e?.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 $(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function tn(n,e=18,t="0 0 20 20"){let i=document.createElementNS(Qa,"svg");i.setAttribute("viewBox",t),i.setAttribute("width",String(e)),i.setAttribute("height",String(e)),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.8"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false");for(let o of n){let r=document.createElementNS(Qa,"path");r.setAttribute("d",o),i.appendChild(r)}return i}function tl(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/3600),i=Math.floor(e%3600/60),o=String(e%60).padStart(2,"0");return t>0?`${t}:${String(i).padStart(2,"0")}:${o}`:`${i}:${o}`}function Om(n){Pm();let e=!0,t=!1,i=null,o=(A,N,W)=>{let Z=n.t?.(A,W);return Z&&Z!==A?Z:W?N.replace(/\{(\w+)\}/g,(Ve,$e)=>$e in W?String(W[$e]):Ve):N},r=$("div","sl-hco");r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let s=$("div","sl-hco-card");r.appendChild(s);let a=()=>{i&&clearInterval(i),i=null},l=()=>{e=!1,a(),r.remove(),document.removeEventListener("keydown",p,!0)},c=()=>{l(),n.onCancel()},d=!0;function p(A){if(r.isConnected){if(A.key==="Tab"){let N=[...s.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(Ve=>Ve.offsetParent!==null||Ve===document.activeElement),W=N[0],Z=N[N.length-1];if(!W||!Z)return;A.shiftKey&&document.activeElement===W?(A.preventDefault(),Z.focus()):!A.shiftKey&&document.activeElement===Z&&(A.preventDefault(),W.focus());return}A.key==="Escape"&&(A.stopPropagation(),A.preventDefault(),d&&c())}}document.addEventListener("keydown",p,!0);let m=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,u=$("header","sl-hco-head"),f=$("button","sl-hco-back-icon");f.type="button",f.setAttribute("aria-label",o("checkout.back","Back to seats")),f.appendChild(tn([...Ht.back])),f.addEventListener("click",()=>{d&&c()});let b=$("div","sl-hco-htext"),T=$("h2","sl-hco-title",n.event?.name?.trim()||o("checkout.title","Checkout"));T.id=m;let C=$("p","sl-hco-sub",n.event?.detail?.trim()??"");C.hidden=!C.textContent,b.append(T,C);let k=$("span","sl-hco-timer");k.setAttribute("role","timer");let E=$("span");E.setAttribute("aria-hidden","true"),k.append(tn([...Ht.clock],14),E),k.hidden=!0,u.append(f,b,k),r.setAttribute("aria-labelledby",m);let L=$("p","sl-hco-sr");L.setAttribute("aria-live","polite");let Q=(...A)=>{s.replaceChildren(u,L,...A)},D=A=>{d=A,f.hidden=!A},g=A=>{let N=$("div","sl-hco-state");N.setAttribute("role",A.alert?"alert":"status");let W=$("div",`sl-hco-state-icon is-${A.tone}`);return W.setAttribute("aria-hidden","true"),W.appendChild(A.icon),N.appendChild(W),A.title&&N.appendChild($("h3","sl-hco-state-title",A.title)),A.text&&N.appendChild($("p",`sl-hco-status${A.alert?" sl-hco-error":""}`,A.text)),A.note&&N.appendChild($("p","sl-hco-state-note",A.note)),N},R=(...A)=>{let N=$("div","sl-hco-body");return N.append(...A),N},_=(...A)=>{let N=$("footer","sl-hco-foot");return N.append(...A),N},V=()=>{let A=$("span","sl-hco-spin");return A.setAttribute("aria-hidden","true"),A},z=(A,N="error")=>{if(!e)return;a(),k.hidden=!0,D(!0);let W=$("button",N==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",N==="expired"?o("checkout.chooseAgain","Choose seats again"):N==="taken"?o("checkout.chooseOther","Choose other seats"):o("checkout.back","Back to seats"));if(W.type="button",W.addEventListener("click",c),N==="error"){let Z=$("p","sl-hco-alert is-error sl-hco-status sl-hco-error",A);Z.setAttribute("role","alert"),Q(R(...J?[J]:[],Z),_(W))}else Q(R(g({tone:N==="expired"?"warn":"error",icon:tn([...N==="expired"?Ht.hour:Ht.seat],24,"0 0 24 24"),title:N==="expired"?o("checkout.expiredTitle","Your seats were released"):o("checkout.takenTitle","Those seats were just taken"),text:A,alert:!1})),_(W));W.focus()},F=(A,N)=>{e&&(a(),k.hidden=!0,D(!1),Q(R(g({tone:"neutral",icon:V(),...N?{title:N}:{},text:A}))))},ne=async(A,N=!1)=>{F(N?o("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let W=Date.now()+Sm;for(;e&&Date.now()<W;){try{let Z=await n.orderStatus(A);if(!e)return;if(Z.status==="confirmed"){t=!0,D(!1),T.textContent=o("checkout.confirmedTitle","Your tickets are confirmed");let Ve=$("p","sl-hco-status",`${Z.seatCount} ${Z.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),$e=$("dl","sl-hco-receipt"),We=(Z.tickets??[]).map(Zt=>Zt.displayLabel||Zt.label);We.length&&$e.append($("dt",void 0,"Seats"),$("dd",void 0,We.join(", ")));let ot=N||Z.totalMinor===0;$e.append($("dt",void 0,ot?o("checkout.price","Price"):o("checkout.paid","Paid")),$("dd",void 0,ot?o("checkout.free","Free"):`${Z.amountFormatted} ${Z.currency}`),$("dt",void 0,o("checkout.order","Order")),$("dd","sl-hco-ref",Z.orderId));let Ln=$("button","sl-hco-back","Close");Ln.type="button",Ln.addEventListener("click",c);let Mt=$("div","sl-hco-state");if(Mt.append(Ve,$e),Z.ticketUrl){let Zt=$("a","sl-hco-tickets",o("checkout.viewTickets","View tickets & QR codes"));Zt.href=Z.ticketUrl,Zt.target="_blank",Zt.rel="noreferrer",Mt.appendChild(Zt)}Mt.appendChild(Ln),Q(R(Mt)),d=!0,n.onConfirmed(Z);return}if(Z.status==="failed"||Z.status==="expired"){Z.status==="expired"?z("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):z("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(Z=>setTimeout(Z,Tm))}!e||t||z(N?"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.")},J=null;if(n.state.kind==="unavailable"){let A=Za(n.state.reason,n.state.seatCount);T.textContent=A.title;let N=$("button","sl-hco-back sl-hco-ghost","Back to seat map");N.type="button",N.addEventListener("click",c);let W=$("p","sl-hco-label","Seats held");return Q(R(W,g({tone:"neutral",icon:tn([...Ht.seat],24,"0 0 24 24"),text:A.body,note:A.detail})),_(N)),n.root.appendChild(r),N.focus(),{destroy:l}}if(n.state.kind==="resume")return n.root.appendChild(r),ne(n.state.orderId),{destroy:l};let{order:X,bookingForm:xe}=n.state,ge=n.state.free===!0,Ce=A=>ge?o("checkout.free","Free"):n.formatMoney(A,X.currency),Ke=Ce(X.total);J=$("section","sl-hco-sec sl-hco-order sl-hco-summary");let S=X.lines?.length?X.lines:X.labels.map(A=>({label:A,detail:null,amount:null})),P=S.length===1?[S[0].label,S[0].detail].filter(Boolean).join(" \xB7 "):`${X.tickets?.length||S.length} ${(X.tickets?.length||S.length)===1?"seat":"seats"}`,B=$("button","sl-hco-order-toggle");B.type="button",B.setAttribute("aria-expanded","false"),B.append($("span",void 0,P),tn([...Ht.down])),B.addEventListener("click",()=>{let A=!J.hasAttribute("data-open");J.toggleAttribute("data-open",A),B.setAttribute("aria-expanded",String(A))});let ee=$("div","sl-hco-order-full"),K=$("ul","sl-hco-lines sl-hco-seats");for(let A of S){let N=$("li","sl-hco-line sl-hco-seat"),W=$("span","sl-hco-line-text");W.appendChild($("span","sl-hco-where",A.label)),A.detail&&W.appendChild($("span","sl-hco-what",A.detail)),N.appendChild(W),typeof A.amount=="number"&&N.appendChild($("span","sl-hco-price",Ce(A.amount))),K.appendChild(N)}ee.append($("h3","sl-hco-h",o("checkout.yourOrder","Your order")),K),J.append(B,ee);let U=$("form","sl-hco-form");U.noValidate=!0;let G=A=>{let N=$("div","sl-hco-field"),W=$("label","sl-hco-label"),Z=$("span","sl-hco-label-row");Z.appendChild($("span",void 0,A.label));let Ve=$("span","sl-hco-optional",o("checkout.optional","Optional"));A.optional&&Z.append(" ",Ve),W.appendChild(Z),W.htmlFor=A.id;let $e=A.hint?$("p","sl-hco-help",A.hint):null;$e&&($e.id=`${A.id}-h`);let We=$("input","sl-hco-input");We.type=A.type,We.id=A.id,We.autocomplete=A.autocomplete,We.placeholder=A.placeholder;let ot=$("p","sl-hco-ferr");ot.id=`${A.id}-e`,ot.hidden=!0,We.setAttribute("aria-describedby",$e?`${$e.id} ${ot.id}`:ot.id),N.append(W,...$e?[$e]:[],We,ot);let Ln=Mt=>{ot.textContent=Mt??"",ot.hidden=!Mt,Mt?We.setAttribute("aria-invalid","true"):We.removeAttribute("aria-invalid")};return We.addEventListener("input",()=>Ln(null)),{wrap:N,input:We,optional:Ve,setError:Ln}},oe=G({id:`${m}-email`,label:o("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:o("checkout.emailHint","Your tickets are sent here."),optional:!1}),ke=oe.input;ke.required=!0,ke.inputMode="email";let be=G({id:`${m}-name`,label:o("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:o("checkout.namePlaceholder","Your name"),optional:!0}),Ie=be.input;n.buyer?.email&&(ke.value=n.buyer.email),n.buyer?.name&&(Ie.value=n.buyer.name),xe?.attendeeName==="required"&&(be.optional.previousSibling?.remove(),be.optional.remove(),Ie.setAttribute("aria-required","true"));let ae=()=>/.+@.+\..+/.test(ke.value.trim()),ie=Wa({form:xe,tickets:X.tickets??[],idPrefix:m,t:o,buyer:()=>({name:Ie.value.trim(),email:ke.value.trim()}),buyerError:(A,N)=>((A==="name"?be:oe).setError(N),A==="name"?Ie:ke)}),Ae=$("section","sl-hco-sec");Ae.append($("h3","sl-hco-h",o("checkout.yourDetails","Your details")),oe.wrap,be.wrap,...ie.details?.childNodes.length?[ie.details]:[]);let Se=$("fieldset","sl-hco-fields");Se.append(J,Ae,...ie.element?[ie.element]:[]);let Pe=R(Se),Ge=$("p","sl-hco-alert is-error sl-hco-status sl-hco-error");Ge.setAttribute("role","alert"),Ge.hidden=!0;let Mn=A=>{Ge.textContent=A,Ge.hidden=!1},Oe=$("p","sl-hco-alert is-warn");Oe.hidden=!0;let eo=$("div","sl-hco-total"),ba=X.tickets?.length||X.labels.length;eo.append($("span",void 0,`${ba} ${ba===1?"seat":"seats"}`),$("strong",void 0,Ke));let ya=ge?o("checkout.confirmBooking","Confirm booking"):o("checkout.continue","Continue to payment"),Qt=$("button","sl-hco-pay",ya);Qt.type="submit";let to=$("p","sl-hco-sr");to.setAttribute("role","status");let va=A=>{Qt.replaceChildren(V(),A),to.textContent=A},qr=$("p","sl-hco-trust");ge||qr.appendChild(tn([...Ht.lock],12,"0 0 16 16")),qr.append(ge?o("checkout.freeTrust","Free booking. Nothing is charged."):o("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),U.append(Pe,_(Ge,Oe,eo,Qt,to,qr));let wa=null,xa=()=>{let A=X.expiresAt-Date.now(),N=tl(A);E.textContent=N,k.setAttribute("aria-label",o("checkout.heldFor","Seats held for {time}",{time:N}));let W=A<=Im;k.classList.toggle("is-warn",W),Oe.hidden=!W||!Ge.hidden,W&&(Oe.textContent=o("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:N}));let Z=A<=3e4?30:W?120:null;Z&&wa!==Z&&(wa=Z,L.textContent=Oe.textContent),A<=0&&z(o("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:S.map(Ve=>Ve.label).join(", ")}),"expired")},Pu=()=>{Number.isFinite(X.expiresAt)&&(a(),k.hidden=!1,xa(),i=setInterval(xa,1e3))},no=!1,Mu=async()=>{if(!no){no=!0,Ge.hidden=!0,Se.disabled=!0,Qt.disabled=!0,va(ge?o("checkout.confirmingBooking","Confirming your booking\u2026"):o("checkout.opening","Opening secure payment\u2026"));try{let A={holdId:X.holdId,buyerEmail:ke.value.trim(),...Ie.value.trim()?{buyerName:Ie.value.trim()}:{},...ie.payload(),bookingFormVersion:1},N=0,W;for(;;)try{W=await n.startSession(A);break}catch(Ve){if(!e)return;if(N>=Ja||!Zr(Ve))throw Ve;if(N+=1,va(ge?o("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):o("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise($e=>setTimeout($e,el(Ve))),!e)return}if(!e)return;if(W.status==="confirmed"){ne(W.orderId,!0);return}let Z=co(W.redirectUrl);if(Z){Cm(W.orderId,n.eventKey),a(),k.hidden=!0,Q(R(g({tone:"neutral",icon:tn([...Ht.card],24,"0 0 24 24"),title:o("checkout.redirectTitle","Taking you to secure payment"),text:o("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:Ke}),note:o("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(Z);return}z(nn("gateway_unavailable"))}catch(A){n.onError?.(A);let N=A;if(N?.code==="booking_form_incomplete"&&ie.element){Wr(),ie.showServerErrors(N.fields);return}if(Zr(N)){Wr(),Mn(ge?o("checkout.busyFailedBooking",nn("checkout_busy",{free:!0})):o("checkout.busyFailedPayment",nn("checkout_busy"))),Qt.textContent=o("checkout.tryAgain","Try again");return}if(N?.code==="hold_not_active"||N?.code==="hold_not_found"){z(nn(N.code),"expired");return}if(N?.code==="seats_unavailable"){z(o("checkout.seatsUnavailable",nn(N.code)),"taken");return}z(nn(N?.code,N))}}};U.addEventListener("submit",A=>{if(A.preventDefault(),no)return;let N=ae();oe.setError(N?null:o("checkout.error.email","Enter an email like name@example.com."));let W=ie.validate();if(!N){Mn(o("bookingForm.fixErrors","Some details need attention before you continue.")),ke.focus();return}if(!W){Mn(o("bookingForm.fixErrors","Some details need attention before you continue."));return}Mu()});let Wr=()=>{T.textContent=n.event?.name?.trim()||o("checkout.title","Checkout"),Ge.hidden=!0,Ge.textContent="",no=!1,Se.disabled=!1,Qt.disabled=!1,Qt.textContent=ya,to.textContent="",D(!0),Q(U),Pu()};return Wr(),n.root.appendChild(r),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&ke.focus(),{destroy:l}}var Sm,Tm,Xa,Em,Am,Ja,Mm,Lm,Hm,Qa,Ht,Im,il=oo(()=>{"use strict";Qr();Ya();Sm=9e4,Tm=2e3,Xa="seatlayer-checkout-style",Em="@seatlayer/pending-checkout/v1";Am=`
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,7 +180,7 @@ 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
- `;Ua=3,vm=1,wm=400,xm=3e3;Ka="http://www.w3.org/2000/svg";Ht={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"]},Sm=12e4});var ol={};Ur(ol,{applyNotice:()=>Im,bannerHtml:()=>il,eventEndedWhen:()=>nl,finishing:()=>Mm,note:()=>Hm,salesView:()=>tl,sync:()=>Rm,translate:()=>Em,view:()=>Pm,words:()=>Lm});function Em(n,e){ut=n,el=e}function tl(n,e,t=!1){return!n||t?null:e==="ended"?"ended":e==="paused"||e==="live"?"closed":null}function Mm(n){return(on(n)==="closed"||!!n.guestsOnly)&&!!n.hold}function Lm(n){let e=on(n);return e?{pill:ut(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),cta:ut("picker.salesClosedCta"),toast:ut(e==="ended"?"picker.eventEndedToast":"picker.salesCloseTap")}:null}function Hm(n){let e=on(n);return e?{heading:ut(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),sentence:""}:null}function nl(n){let e=n.salesInfo?.startsAt;if(typeof e!="number"||!Number.isFinite(e))return"";let t=i=>{try{return new Date(e).toLocaleString(n.opts.locale,{...i,...n.eventTimezone?{timeZone:n.eventTimezone}:{}})}catch{return new Date(e).toLocaleString(n.opts.locale,i)}};return ut("picker.eventEndedWhen",{date:t({weekday:"short",day:"numeric",month:"short"}),time:t({hour:"numeric",minute:"2-digit"})})}function il(n,e){let t=e==="closed"&&n.hold?n.heldTicketCount():0,i=e==="ended"?"flag":t?"cart":"lock",o=ut(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),r=e==="ended"?nl(n):t?el("picker.salesCloseHeld",t):n.salesInfo?.venueSelling?ut("picker.salesCloseVenue"):"";return`<span class="sl-sales-ic${t?" held":""}" aria-hidden="true"><svg viewBox="0 0 24 24">${Am[i]}</svg></span><span class="sl-sales-copy"><b>${Za(o)}</b>${r?`<span>${Za(r)}</span>`:""}</span>`}function Rm(n){let e=n.root;if(!e)return;let t=e.ownerDocument;if(!t.getElementById(Qa)){let a=t.createElement("style");a.id=Qa,a.textContent=Cm,t.head.appendChild(a)}let i=on(n),o=e.querySelector(".sl-sales-banner");if(!i){e.removeAttribute("data-sales-view"),o?.remove();return}e.setAttribute("data-sales-view",i);let r=n.els.map;if(!r)return;o||(o=t.createElement("div"),o.className="sl-sales-banner",o.setAttribute("role","status"),r.appendChild(o));let s=il(n,i);o.innerHTML!==s&&(o.innerHTML=s)}function Im(n,e){let t=e.state,i=Number(e.revision)||0;if(n.opts.readOnly||n.destroyed||i<(Ja.get(n)??-1/0)||t!=="live"&&t!=="paused"&&t!=="ended")return;if(Ja.set(n,i),t==="live"){n.salesState=t,n.salesClosed&&!n.guestsOnly&&(n.salesClosed=!1,n.applySalesClosed());return}let o=on(n);if(n.salesState=t,!n.salesClosed){let s=new Set((n.hold?.items??[]).map(l=>l.label)),a=n.controller.getSelection().filter(l=>!s.has(l.label)).map(l=>l.id);a.length&&n.controller.deselect(a),n.dismissConfirm(),n.salesClosed=!0}n.applySalesClosed();let r=on(n);r&&r!==o&&n.toast(ut(r==="ended"?"picker.eventEndedToast":"picker.salesCloseSwitch"),"neutral")}var ut,el,Qa,Cm,Am,Za,on,Pm,Ja,rl=io(()=>{"use strict";ut=n=>n,el=n=>n;Qa="seatlayer-sales-style",Cm=`.sl-picker[data-sales-view] .sl-map-host canvas{filter:grayscale(1);opacity:.42}
183
+ `;Ja=3,Mm=1,Lm=400,Hm=3e3;Qa="http://www.w3.org/2000/svg";Ht={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"]},Im=12e4});var pl={};Yr(pl,{applyNotice:()=>jm,bannerHtml:()=>dl,eventEndedWhen:()=>cl,finishing:()=>Bm,note:()=>$m,salesView:()=>ll,sync:()=>zm,translate:()=>_m,view:()=>Fm,words:()=>Vm});function _m(n,e){mt=n,al=e}function ll(n,e,t=!1){return!n||t?null:e==="ended"?"ended":e==="paused"||e==="live"?"closed":null}function Bm(n){return(on(n)==="closed"||!!n.guestsOnly)&&!!n.hold}function Vm(n){let e=on(n);return e?{pill:mt(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),cta:mt("picker.salesClosedCta"),toast:mt(e==="ended"?"picker.eventEndedToast":"picker.salesCloseTap")}:null}function $m(n){let e=on(n);return e?{heading:mt(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),sentence:""}:null}function cl(n){let e=n.salesInfo?.startsAt;if(typeof e!="number"||!Number.isFinite(e))return"";let t=i=>{try{return new Date(e).toLocaleString(n.opts.locale,{...i,...n.eventTimezone?{timeZone:n.eventTimezone}:{}})}catch{return new Date(e).toLocaleString(n.opts.locale,i)}};return mt("picker.eventEndedWhen",{date:t({weekday:"short",day:"numeric",month:"short"}),time:t({hour:"numeric",minute:"2-digit"})})}function dl(n,e){let t=e==="closed"&&n.hold?n.heldTicketCount():0,i=e==="ended"?"flag":t?"cart":"lock",o=mt(e==="ended"?"picker.eventEndedTitle":"picker.salesCloseTitle"),r=e==="ended"?cl(n):t?al("picker.salesCloseHeld",t):n.salesInfo?.venueSelling?mt("picker.salesCloseVenue"):"";return`<span class="sl-sales-ic${t?" held":""}" aria-hidden="true"><svg viewBox="0 0 24 24">${Dm[i]}</svg></span><span class="sl-sales-copy"><b>${rl(o)}</b>${r?`<span>${rl(r)}</span>`:""}</span>`}function zm(n){let e=n.root;if(!e)return;let t=e.ownerDocument;if(!t.getElementById(ol)){let a=t.createElement("style");a.id=ol,a.textContent=Nm,t.head.appendChild(a)}let i=on(n),o=e.querySelector(".sl-sales-banner");if(!i){e.removeAttribute("data-sales-view"),o?.remove();return}e.setAttribute("data-sales-view",i);let r=n.els.map;if(!r)return;o||(o=t.createElement("div"),o.className="sl-sales-banner",o.setAttribute("role","status"),r.appendChild(o));let s=dl(n,i);o.innerHTML!==s&&(o.innerHTML=s)}function jm(n,e){let t=e.state,i=Number(e.revision)||0;if(n.opts.readOnly||n.destroyed||i<(sl.get(n)??-1/0)||t!=="live"&&t!=="paused"&&t!=="ended")return;if(sl.set(n,i),t==="live"){n.salesState=t,n.salesClosed&&!n.guestsOnly&&(n.salesClosed=!1,n.applySalesClosed());return}let o=on(n);if(n.salesState=t,!n.salesClosed){let s=new Set((n.hold?.items??[]).map(l=>l.label)),a=n.controller.getSelection().filter(l=>!s.has(l.label)).map(l=>l.id);a.length&&n.controller.deselect(a),n.dismissConfirm(),n.salesClosed=!0}n.applySalesClosed();let r=on(n);r&&r!==o&&n.toast(mt(r==="ended"?"picker.eventEndedToast":"picker.salesCloseSwitch"),"neutral")}var mt,al,ol,Nm,Dm,rl,on,Fm,sl,hl=oo(()=>{"use strict";mt=n=>n,al=n=>n;ol="seatlayer-sales-style",Nm=`.sl-picker[data-sales-view] .sl-map-host canvas{filter:grayscale(1);opacity:.42}
184
184
  .sl-picker[data-sales-view] .sl-prices,.sl-picker[data-sales-view] .sl-rail-scroll{filter:grayscale(1);opacity:.6}
185
185
  .sl-picker[data-sales-view] .sl-soldout{display:none}
186
186
  .sl-sales-banner{position:absolute;top:62px;left:50%;transform:translateX(-50%);z-index:8;box-sizing:border-box;width:min(420px,calc(100% - 32px));display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border-radius:14px;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);box-shadow:0 10px 30px rgba(15,23,42,.12)}
@@ -190,8 +190,8 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
190
190
  .sl-sales-ic svg{width:18px;height:18px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
191
191
  .sl-sales-copy{flex:1;min-width:0}
192
192
  .sl-sales-copy b{display:block;font-size:15px;font-weight:750;line-height:1.3}
193
- .sl-sales-copy span{display:block;margin-top:3px;font-size:12.5px;line-height:1.45;color:var(--sl-muted)}`,Am={lock:'<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',flag:'<path d="M5 21V4M5 4h11l-2 4 2 4H5"/>',cart:'<circle cx="9" cy="20" r="1.4"/><circle cx="17" cy="20" r="1.4"/><path d="M3 4h2l2.4 11h10.2L20 8H6.2"/>'},Za=n=>n.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`);on=n=>n.guestsOnly?null:tl(n.salesClosed,n.salesState,!!n.opts.readOnly),Pm=on;Ja=new WeakMap});var dy={};Ur(dy,{ApiError:()=>re,BuyerAccessContext:()=>De,BuyerAccessUnavailableError:()=>we,BuyerRealtimeClient:()=>st,EmbeddedDesigner:()=>rr,PerformanceGroupDestroyedError:()=>Te,PerformanceGroupPicker:()=>Hr,SEATING_CHART_CALLBACK_PROPS:()=>Ts,SEATING_CHART_HANDLE_METHODS:()=>xs,SEATING_CHART_IDENTITY_PROPS:()=>ks,SEATING_CHART_VALUE_PROPS:()=>Ss,SeasonApiError:()=>q,SeasonPicker:()=>jr,SeasonPublicSessionRefused:()=>di,SeasonRecoveryTimeoutError:()=>ci,SeatPicker:()=>Tt,SeatingChart:()=>or,attachPickerFrame:()=>vu,bindSeatingChartHandle:()=>Gc,buildSeatingChartOptions:()=>Uc,createBuyerAccessContext:()=>zn,createControllerSink:()=>Hn,parseTicketOfferAvailability:()=>lr,prewarmSeatPicker:()=>Mh,shortOperationReference:()=>oi,ticketOfferPrices:()=>Ps});module.exports=Au(dy);var de=require("@seatlayer/core");var Pu=/^[0-9A-Za-z.+-]{1,24}$/,Mu=Pu.test("0.111.0")?"0.111.0":"",Lu={host:"web",platform:"web",bundle:Mu,protocol:0,chromeOwner:"web"},Hu={...Lu},oo=null,Sa=null;function Ru(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Iu(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(Ru()),documentMs:oo==null?0:n(oo),handshakeMs:oo==null||Sa==null?0:n(Sa-oo)}}function Ta(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:o}=Hu,r=Iu();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:o,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var Ea=new Set,Ca=new Map;function ht(n){return Ea.has(n)?"repeat":"cold"}function ro(n){let e=ht(n);return Ea.add(n),e}function Ue(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function Ti(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Ou(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:Ue(n.ms),api:Ue(e.loadChartAndStatuses)||Ue(e.loadChart),scene:Ue(e.buildScene),panel:Ue(e.buildBuyerControls),paint:Ue(e.firstPaint),normalize:Ue(e.normalizeBuyerModel),renderer:Ue(e.createRenderer),seats:Ue(n.seats),floors:Ue(n.floors),view:n.view??"map",load:n.load??ht(n.event),transport:n.transport??"pubapi",...Ta(),availabilityMs:Ue(e.loadStatuses),...typeof n.revealWaitMs=="number"?{revealWaitMs:Ue(n.revealWaitMs)}:{},...typeof n.handoverMs=="number"?{handoverMs:Ue(n.handoverMs)}:{},mounts:(Ca.get(n.event)??0)+1,reconnects:Ue(n.reconnects)}}var _u=new Set;function rt(n){let e=Ou(n);if(e){Ca.set(n.event,e.mounts);for(let t of _u)try{t(e)}catch{}typeof fetch>"u"||Ti()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}var Nu="realtime.fallback_polling",Aa=new Set;function Du(n){let e=/^(wss?):\/\/([^/]+)(.*?)\/pub\/events\/([^/?#]+)\/subscribe(?:[?#]|$)/.exec(n);if(!e)return null;let t;try{t=decodeURIComponent(e[4])}catch{return null}return/^[A-Za-z0-9_-]{1,80}$/.test(t)?{apiBase:`${e[1]==="wss"?"https":"http"}://${e[2]}${e[3]}`,eventKey:t}:null}function Pa(n){let e=Du(n);return!e||Aa.has(e.eventKey)||(Aa.add(e.eventKey),typeof fetch>"u"||Ti())?!1:(fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:Nu,eventKey:e.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}var Jt="seatlayer.v1",Ma="\0",La=4401,Fu=15e3,Bu=25e3,Vu=1e4,Ha=5e3,$u=JSON.stringify({type:"resume"}),zu=3e4,ju=6e4,Ku=["pointermove","touchstart","keydown"],Gu=3,Uu=15e3,Ra=6e4;function qu(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,o]of Object.entries(n.seats))typeof o=="string"&&o!==e&&(t[i]=o);return{default:e,exceptions:t}}function Wu(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,o]of Object.entries(e.exceptions))n.exceptions[i]!==o&&t.push({label:i,status:o});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Yu(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function Ia(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var st=class{constructor(e){this.ws=null;this.watched=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.failedUpgrades=0;this.pollTimer=null;this.fellBack=!1;this.lastWake=-1/0;this.lastInput=0;this.detachWake=null;this.reconnectCount=0;this.opts=e,typeof e.url=="string"&&Ia(e.url)}get polling(){return this.pollTimer!==null}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.attachWake(),this.connect())}stop(){this.stopped=!0,this.clearTimers(),this.stopPolling(),this.detachWake?.(),this.detachWake=null;let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.failedUpgrades=0,this.start()}async connect(){if(this.stopped)return;let e=[Jt];if(this.opts.mintTicket){let a;try{a=await this.opts.mintTicket()}catch(l){this.reportIfAccessError(l),this.scheduleReconnect();return}if(this.stopped)return;a?.protocols?.length?(e=[...a.protocols],e.includes(Jt)||e.unshift(Jt)):a?.ticket&&(e=[Jt,`tkt.${a.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${i}${i.includes("?")?"&":"?"}pv=1`:i;Ia(o);let r;try{r=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(o,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=r;let s=!1;r.onopen=()=>{this.ws===r&&(s=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=r.protocol===Jt,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},Ha):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},Ha))},r.onmessage=a=>{if(this.ws!==r)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},r.onclose=a=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),!s&&a?.code!==La&&this.upgradeFailed(),a?.code===La){if(a.reason==="access_expired"){this.scheduleReconnect();return}if(a.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.stopPolling(),this.opts.onIdleExpired();return}this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.close()}catch{}}}watchHold(e){let t=this.ws;if(!(!e||e===this.watched||!t||t.readyState!==1))try{t.send(JSON.stringify({type:"watch",holdId:e})),this.watched=e}catch{}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(t==="sales"){this.opts.sink.onSales?.(e);return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],r=i.join(Ma),s=o.join(Ma);(r!==this.hidden||s!==this.closedSections)&&(this.hidden=r,this.closedSections=s,this.opts.sink.onSections?.(i,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="hold"){typeof e.holdId=="string"&&typeof e.state=="string"&&this.opts.onHoldState?.(e.holdId,e.state);return}if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let i=qu(e),o=Wu(this.projection,i);this.projection=i,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!i.length)return;this.projection&&Yu(this.projection,i),this.opts.sink.applyStatuses(i)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}upgradeFailed(){this.failedUpgrades+=1,this.failedUpgrades>=Gu&&this.startPolling()}startPolling(){if(!(this.pollTimer||this.stopped)){if(!this.fellBack){this.fellBack=!0;try{this.opts.onFallbackPolling?.()}catch{}let e=typeof this.opts.url=="function"?this.opts.url():this.opts.url;Pa(e)}this.pollTimer=setInterval(()=>{if(this.stopped){this.stopPolling();return}typeof document<"u"&&document.hidden||Promise.resolve().then(()=>this.opts.poll?this.opts.poll():this.opts.sink.resync({reason:"frame"})).catch(()=>{})},Uu)}}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}now(){return this.opts.now?this.opts.now():Date.now()}attachWake(){if(this.detachWake||typeof document>"u"||typeof window>"u"||typeof document.addEventListener!="function"||typeof window.addEventListener!="function")return;this.lastInput=this.now();let e=()=>{document.visibilityState==="visible"&&this.wake()},t=()=>{let r=this.now(),s=r-this.lastInput>=ju;this.lastInput=r,s&&this.wake()},i={capture:!0,passive:!0},o=r=>{document[r]("visibilitychange",e),window[r]("focus",e);for(let s of Ku)document[r](s,t,i)};o("addEventListener"),this.detachWake=()=>o("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<zu)){try{e.send($u)}catch{return}this.lastWake=t}}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},Vu)}},Bu)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,Fu),i=this.pollTimer?Ra/2+Math.random()*Ra/2:Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},i)}get reconnects(){return this.reconnectCount}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function Xu(n){return n==="blocked"?"not_for_sale":n==="unavailable"?"held":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}var Qu="#f43f5e";function Hn(n,e={}){let t=i=>{let o=n.tableSelection(i);if(o)return o.physicalSeatIds;let r=n.idForLabel(i);return r?[r]:[]};return{applyStatuses(i){let o=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),r={free:[],held:[],booked:[],not_for_sale:[]},s=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=Xu(c.status);if(r[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(m=>n.getStatus(m)==="free"))for(let m of d)s.push({id:m,color:Qu});p!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])r[c].length&&n.setStatus(r[c],c);for(let c of s)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,o,r){r?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,o,r)}}}var en="pricingContract=matrix-v1&pricingContract=seat-v1",re=class extends Error{constructor(e,t,i,o,r,s,a,l){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=o,this.reason=r,this.retryAfterS=s,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},Oa=10,_a=1;function Ei(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function Zu(n){let e=n;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var Ju={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function em(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),n=>n.toString(16).padStart(2,"0")).join("")}function tm(n,e){let t=e.map(i=>[i.label,i.tierId??null,i.quantity??null]).sort((i,o)=>i[0]<o[0]?-1:i[0]>o[0]?1:0);return JSON.stringify([n,t])}function nm(n){return n instanceof re?n.status===408||n.status===429||n.status>=500:!0}function Na(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var Lt=class{constructor(e,t={}){this.base=e;this.viewerId=Na();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}rotateViewerId(){this.viewerId=Na()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let o=t.method??"GET",r={},s;t.body!==void 0&&(r["Content-Type"]="application/json",s=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");if(a&&(r.Authorization=a),t.idempotency){let m=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(m??void 0),m&&(r["Idempotency-Key"]=m)}let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:r,body:s,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(u=>{if(l?.signal.aborted)throw u;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let m=p,u=m?.code??m?.error,f=d.status===401&&u==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!f&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,u)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(d.status===409){let T=u?Ju[u]:void 0,C=m?.conflicts?.map(k=>k.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:C,reason:T,code:u})}let b;if(d.status===429&&(b=Ei(d.headers.get("Retry-After"),m?.retryAfterSeconds)??_a,o==="GET"&&!i.rateLimit&&b<=Oa))return await new Promise(T=>setTimeout(T,b*1e3)),this.request(e,t,{...i,rateLimit:!0});throw d.status===503&&(b=Ei(d.headers.get("Retry-After"),m?.retryAfterSeconds)),new re(d.status,m?.error??`request_failed_${d.status}`,u,m?.conflicts,m?.reason,b,typeof m?.notice=="string"&&m.notice?m.notice:void 0,{...Array.isArray(m?.fields)?{fields:m.fields}:{},...typeof m?.retryable=="boolean"?{retryable:m.retryable}:{},...typeof m?.hint=="string"&&m.hint?{hint:m.hint}:{},...typeof m?.message=="string"&&m.message?{serverMessage:m.message}:{}})}return p}async requestBlob(e,t={}){let i={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(i.Authorization=o);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(r.status===429&&(c=Ei(r.headers.get("Retry-After"),a?.retryAfterSeconds)??_a,!t.rateLimit&&c<=Oa))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new re(r.status,a?.error??`request_failed_${r.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new re(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1&${en}`),fetchedAt:Date.now()}}hold(e,t,i,o){let r=`/pub/events/${encodeURIComponent(e)}/hold?${en}`,s={method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(r,s):this.keyedHold(r,s,tm(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=em();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,i,o=!1){let r;try{let s=await this.request(e,{...t,idempotency:{binding:i,used:a=>{r=a}}});return this.endHoldAttempt(r),s}catch(s){if(nm(s))throw s;this.endHoldAttempt(r);let a=s.code;if(a==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,i,!0);if(a==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw s}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let i=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(r=>typeof r=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(Zu)?e.ticketKeyDetails.map(({ticketKey:r,label:s,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:r,label:s,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return i||o?this.ticketKeysByHold.set(e.holdId,{...i?{ticketKeys:i}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,i,o,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${en}`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?{ttlMs:r}:{},...this.referral?{referral:this.referral}:{}}}).then(s=>this.noteTicketKeys(s))}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}}).then(i=>this.noteTicketKeys(i))}release(e,t,i){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}}).then(o=>{let r=this.ticketKeysByHold.get(i);if(r){let s=new Set(o?.released??t);this.ticketKeysByHold.set(i,{...r.ticketKeys?{ticketKeys:r.ticketKeys.filter(a=>!s.has(a))}:{},...r.ticketKeyDetails?{ticketKeyDetails:r.ticketKeyDetails.filter(a=>!s.has(a.ticketKey))}:{}})}return o})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability?${en}${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}&${en}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Jt]}createRealtime(e,t){return this.accessScoped?null:new st({url:this.subscribeUrl(e),sink:t})}};var mt=require("@seatlayer/core");var _e=require("@seatlayer/core"),vl=require("@seatlayer/core/core/seatConfidence");var ll=require("@seatlayer/core"),Qr=require("@seatlayer/core"),On=require("@seatlayer/core/core/cdnAsset");var im=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,om=/[\s"'<>`\\]/;function rm(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function sm(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function Rn(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return im.test(n);if(om.test(n))return!1;let e=sm();if(rm(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var Dm=require("@seatlayer/core/core/cdnAsset");function v(n,e){let t=(0,Qr.t)(n);return t===n?e:t}function rn(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function lo(){return{rotate:v("picker.dragToRotateVenue","Drag to rotate the venue"),move:v("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:v("picker.zoomIn","Zoom in"),zoomOut:v("picker.zoomOut","Zoom out"),fitView:v("picker.fitWholeVenue","Show whole venue")}}function co(n){return n==="map"||n==="classic"?{touchNavigation:n}:{}}function po(n){return typeof n=="boolean"?{crowdFigures:n?Number.POSITIVE_INFINITY:0}:{}}var sl=new WeakMap;function ho(n){let e=n.doc??null,t=e?sl.get(e):void 0;if(t)return t;let i=new Map(n.getGAAreas().map(o=>[o.id,{categoryKey:o.categoryKey??"",wheelchairPlaces:o.wheelchairPlaces??0}]));return e&&sl.set(e,i),i}function uo(n,e=()=>!1,t=()=>0){let i={};for(let[o,r]of Object.entries(n)){let s=r.available==null?"":(0,ll.gaAvailabilityText)({available:r.available,wheelchairFree:r.wheelchairFree});i[o]={available:r.available,selected:r.selected??0,wheelchairFree:r.wheelchairFree??null,filteredOut:e(o),statusText:s&&t(o)>0?`${Om} ${s}`:s}}return i}var Om="\u267F",Xr=new WeakSet;function mo(n,e){if(Xr.has(n))return;Xr.add(n);let t=()=>{Xr.delete(n),e()};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):setTimeout(t,16)}function cl(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let o=[...i][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+i.slice(o.length)}function dl(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function Y(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function fo(n,e,t){let i=e.find(r=>Rn(r))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=i,n.appendChild(o),i}var In=null;function go(){if(In!==null)return In;try{if(typeof document>"u")return In=!1;In=!!document.createElement("canvas").getContext("webgl2")}catch{In=!1}return In}var Ci=null;function Ai(){return Ci||(Ci=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(e=>{throw Ci=null,e}),Ci)}function bo(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Ai().catch(()=>{})}async function yo(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function _n(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-checkout.mjs"):Promise.resolve().then(()=>(Xa(),Ya))}async function pl(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,On.importCdnAsset)("seatlayer-sales.mjs"):Promise.resolve().then(()=>(rl(),ol))}function hl(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function ul(n){return n.lineItems.reduce((e,t)=>e+t.quantity,0)}function Zr(n,e){if(n.objectType!=="ga")return n.displayLabel??n.label;let t=e.find(i=>i.id===n.objectId);return n.displayLabel??t?.displayLabel??t?.label??v("picker.generalAdmission","General admission")}function _m(n,e){let t=new Map;for(let i of n){let o=i.rowLabel&&i.seatNumber?[i.sectionLabel,`${v("picker.row","Row")} ${i.rowLabel}`,`${v("picker.seat","Seat")} ${i.seatNumber}`].filter(Boolean).join(" \xB7 "):Zr(i,e),r=[i.categoryLabel,i.tierLabel].filter(Boolean).join(" \xB7 "),s=Math.max(1,Math.floor(i.quantity||1)),a=`${o}\0${r}`,l=t.get(a)??{label:o,detail:r,units:0,amount:0};l.units+=s,l.amount+=i.unitPrice*s,t.set(a,l)}return[...t.values()].map(i=>({label:i.units>1?`${i.label} \xD7${i.units}`:i.label,...i.detail?{detail:i.detail}:{},amount:i.amount}))}var al=(n,e,t)=>(0,Qr.t)("picker.bookingForm.guestOfCount",{label:n,index:e,total:t});function Nm(n,e,t=[]){let i=new Map,o=[];for(let d of n.lineItems){let p=Zr(d,t),m=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&m>1)){o.push({key:d.label,name:p,unitIndex:1,quantity:1});continue}for(let u=1;u<=m;u+=1){let f=(i.get(d.label)??0)+1;i.set(d.label,f),o.push({key:`${d.label}#${f}`,name:p,unitIndex:u,quantity:m})}}let r=e?.ticketKeyDetails??[],s=e?.ticketKeys??r.map(d=>d.ticketKey),a=(s.length===o.length?s:o.map(d=>d.key)).map(d=>{let p=o.find(u=>u.key===d),m=r.find(u=>u.ticketKey===d);return{key:d,name:m?.displayLabel??p?.name,unitIndex:m?.unitIndex??p?.unitIndex??1,quantity:m?.quantity??p?.quantity??1}}),l=new Map;for(let d of a)d.name&&d.quantity<=1&&l.set(d.name,(l.get(d.name)??0)+1);let c=new Map;return a.map(({key:d,name:p,unitIndex:m,quantity:u})=>{if(!p)return{key:d};if(u>1)return{key:d,title:al(p,m,u)};let f=(c.get(p)??0)+1;c.set(p,f);let b=l.get(p)??1;return{key:d,title:b>1?al(p,f,b):p}})}function ml(n,e,t,i,o=[]){let r=new Map;for(let s of n.lineItems){let a=Zr(s,o);r.set(a,(r.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:[...r].map(([s,a])=>a>1?`${s} \xD7${a}`:s),tickets:Nm(n,i,o),lines:_m(n.lineItems,o)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function fl(n){return String(n?.code).startsWith("booking_form_")}function vo(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(n);if(e)try{return o.toLocaleString(t,{...i,timeZone:e})}catch{}return o.toLocaleString(t,i)}function Jr(n){return/early[\s-]*bird/i.test(n?.trim()??"")}function gl(n){return Jr(n)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function wo(n,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(n)}" title="${e(n)}">${gl(n)}</span>`}function xo(n,e){return`<span class="sl-offer-badge">${gl(n)}<span>${e(n)}</span></span>`}function bl(n,e=Date.now()){let t=n-e;if(t<=0)return null;let i=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(i/1440),r=Math.floor(i%1440/60),s=i%60;return`${(o>0?[`${o}d`,...r?[`${r}h`]:[]]:[...r?[`${r}h`]:[],...s||!r?[`${s}m`]:[]]).join(" ")} left`}function es(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function H(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function ts(n){return n?(0,_e.seatNoteRowModel)(n).map(e=>({...e,title:v(e.titleKey,e.titleFallback)})):[]}function wl(n){return ts(n).map(e=>e.title)}function sn(n,e={}){return ns(ts(n),e)}function ns(n,e={}){if(!n.length)return"";let t=e.compact?15:17,i=n.map(o=>`<div class="sl-note sl-note-${H(o.tone)}"><span class="sl-note-i">${(0,_e.seatTypeIconSvg)(o.icon,{size:t})}</span><span class="sl-note-t"><b>${H(o.title)}</b>`+(o.note?`<span class="sl-note-n">${H(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${i}</div>`}function xl(n){return ts(n).map(e=>{let t=H(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${H(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,_e.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function ko(n){let e=[];return n?.restrictedView&&e.push(v("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(v("picker.obstructedView","Obstructed view")),e}function is(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),i=e?v("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${i}</span></button>`}function kl(n,e){if(!e)return"";let t=e,i=t.includes(n.id),o=i?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${H(o)}</span></button>`}function Sl(n,e,t){if(!t)return"";let i=(0,vl.seatConfidenceDisclosure)(n.confidenceEvidence),o=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${H(n.displayLabel??n.label)}"><span><em>${H(e)}</em><strong>${H(i.headline)}</strong><small>${H(o)}</small></span><b>Passport</b></button>`}function ve(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let o=`${t}${i}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,_e.compactRowLabel)(e,t)}function Fm(n){switch(n){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:v("picker.accessRefresh","Refresh")};case"idle":return{title:v("picker.idlePausedTitle","Your session expired"),body:v("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:v("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","The seat map timed out"),body:v("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:v("picker.accessRefresh","Refresh")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:v("picker.accessRefresh","Refresh")}}}var Bm=6;function Tl(n,e,t){let i=es;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Bm?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(ve(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function El(n,e,t){let i=es,o=n?.objectType==="booth",r=n?.objectType==="table"&&!!n?.bookingMode,s=o||r||!n?.seatNumber,a=n?.sectionLabel??(s?void 0:n?.displayLabel),l=r?`${v("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(s?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${ve(n)??""}`.trim():void 0,`${v("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function Cl(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Al(n,e){if(!n||e)return"";let t=v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function yl(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function So(n,e,t,i=()=>{}){let o=es;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${(0,_e.t)("picker.ticketType")}</span></legend>`+n.map(a=>{let l=yl(a),c=i(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${xo(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let r=n[0],s=r?yl(r):void 0;return s?`<p class="sl-confirm-tier-note">${o(s)}</p>`:""}function Pl(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${H(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${H(n.priceLabel)}</span>`:"")+"</div>"+(n.priceLabel&&n.feeNote?`<div class="sl-confirm-fee">${H(n.feeNote)}</div>`:"")+'<div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${H(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${H(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${H(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.commercial+n.tierChoices+n.groupDates+n.wheelchair+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${H(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${H(n.selectLabel)}</span></button></div></div>`}function Ml(n,e){let t=Y,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?(0,_e.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,_e.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,_e.t)("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,_e.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t((0,_e.t)("picker.guestsCount",{count:n.capacity}))}</span>`+(n.entrance?`<span class="muted">${t(v("picker.entrance","Entrance"))}</span><span>${t(n.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(v("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,_e.t)("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,_e.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):i?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Ll(n,e){let t=Fm(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let r=document.createElement("div");r.className="sl-interrupt-title",r.textContent=t.title;let s=document.createElement("div");s.className="sl-interrupt-body",s.textContent=t.body,o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{i.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),i.appendChild(o),i}function Hl(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${H(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${Y(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Rl(n){return n.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${H(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${H(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${H(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${Nn({id:`sl-info-${Y(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:H(e.note)})}</div>`:t}).join("")}function Nn(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${Y(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${Y(n.label)}" aria-describedby="${Y(n.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${Y(n.id)}"${n.ref?` data-ref="${Y(n.ref)}"`:""}>${n.text}</span></span>`}function Il(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Ol(n){let e=n.performanceLabel?`<div class="sl-chip-when">${Y(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${Y(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${Y(i)}</span>`).join("")}</span></div>`:"";return e+Vm(n)+t}function Vm(n){let{d:e,area:t,label:i,objectType:o,quantity:r=1,identity:s}=n,a=L=>String(L??"\u2014").replace(/[&<>"]/g,Q=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[Q]),l=o==="ga"?"ga":e?.objectType??o,c=s?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("picker.row","Row")),d=s?.rowLabel??s?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",m="",u=[];l==="table"&&s?.bookingMode?(m=`${c} ${d}`,u.push([v("picker.guests","Guests"),String(r)])):l==="ga"?(m=String(t?.displayLabel??d),r>1&&u.push([v("picker.tickets","Tickets"),String(r)])):l==="booth"?(m=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&u.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?m=String(d):(m=e.sectionLabel??"",e.rowLabel&&u.push([c,String(ve(e)??e.rowLabel)]),e.seatNumber&&u.push([v("picker.seat","Seat"),String(e.seatNumber)]));let f=!m&&!!p,b=m||p||String(d),T=!!p&&!f&&p!==b,C=n.offerName?wo(n.offerName,a):"",k=u.map(([L,Q])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(L)}</span> <b>${a(Q)}</b></span>`);T&&k.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span>${C}</span>`);let E=[b,...u.map(([L,Q])=>`${L} ${Q}`),T?p:"",n.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(E)}</span><span class="sl-chip-name" aria-hidden="true">${a(b)}${T?"":C}</span>`+(k.length?`<span class="sl-chip-pos" aria-hidden="true">${k.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function To(n,e,t){return n.map(i=>`<option value="${t(i.id)}"${i.id===e?" selected":""}>${t(i.name)}</option>`).join("")}function $m(n){let e=Y;return` data-key="${e(n.key)}"`+(n.heldLabels.length?` data-held="${e(encodeURIComponent(n.heldLabels.join(`
194
- `)))}"`:"")+(n.seatIds.length?` data-seat="${e(n.seatIds.join(" "))}"`:"")+(n.locateId?` data-locate="${e(n.locateId)}"`:"")}function _l(n){let e=Y;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+$m(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${H(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function os(n,e){let t=Y(n),i=e?Y(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${Y((0,mt.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Eo(n,e){return new Set(n.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function Co(n,e){let t=(n.doc?.categories??[]).filter(s=>!s.notForSale),i=e?t.filter(s=>s.key===e):t;if(!i.length)return null;let o=Eo(i,n.categoryAvailability());return o.size<i.length||(n.currentHold()?.items??[]).some(s=>o.has(s.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function Nl(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,mt.t)("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${v("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${v("picker.findSeatsTogether","Find seats together")}</span>`+Nn({id:"sl-info-best-seats",label:v("picker.aboutBestSeats","About finding seats together"),text:v("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${Y(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${Y(v("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>e.soldOut?`<option value="${Y(e.key)}" disabled>${Y(`${e.label} \xB7 ${v("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${Y(e.key)}"${n.selectedCategory===e.key?" selected":""}>${Y(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${Y(e.id)}"${n.selectedZone===e.id?" selected":""}>${Y(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,mt.tCount)("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Dl(n){return n==="setup"||n==="testable"?{heading:v("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:v("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:n==="paused"?{heading:v("picker.salesPausedPill","Sales are paused"),sentence:v("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:v("picker.salesClosedPill","Sales are closed"),sentence:v("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function Fl(n,e=!1){if(!e&&(n==="setup"||n==="testable"||n==="paused")){let t=Dl(n);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:v("picker.salesClosedPill","Sales are closed"),cta:v("picker.salesClosedCta","Sales closed"),toast:v("picker.salesClosedToast","Sales are closed for this event.")}}function Bl(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${Y(n.whenText)}</span>`:"",t=n.note??Dl(n.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function Vl(n){return n.hasGaAreas?n.seated?n.venue3d?(0,mt.t)("picker.trayHintChoose3dOrStanding"):v("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):n.venue3d?(0,mt.t)("picker.gaTrayHintChoose3dArea"):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):n.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?n.season?(0,mt.t)("picker.season.trayHint"):v("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):n.venue3d?(0,mt.t)("picker.trayHintChoose3dOrBest"):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var Ne=require("@seatlayer/core");var Fn=require("@seatlayer/core");var Mo=require("@seatlayer/core/core/color");function ft(n){if(!n)return null;let e=n.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="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(e)?.[1];if(t){let o=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let i=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return i?{r:Math.max(0,Math.min(255,Number(i[1]))),g:Math.max(0,Math.min(255,Number(i[2]))),b:Math.max(0,Math.min(255,Number(i[3])))}:null}function Ao(n){return(0,Mo.relativeLuminance255)([n.r,n.g,n.b])}function et(n,e){let t=ft(n),i=ft(e);if(!t||!i)return null;let o=Math.max(Ao(t),Ao(i)),r=Math.min(Ao(t),Ao(i));return(o+.05)/(r+.05)}function an(n,e="#172033",t="#eef1f8"){return(et(e,n)??0)>=(et(t,n)??0)?e:t}function zm(n){return(0,Mo.rgb255ToHex)(n.r,n.g,n.b)}function rs(n,e,t){let i=ft(n),o=ft(e);if(!i||!o)return null;let r=Math.max(0,Math.min(1,t));return zm({r:i.r*r+o.r*(1-r),g:i.g*r+o.g*(1-r),b:i.b*r+o.b*(1-r)})}var Po="#d8a425",jm=.18;function $l(n,e){let t=rs(Po,e,jm)??e;if((et(Po,t)??0)>=4.5)return Po;for(let i=.15;i<=1;i+=.05){let o=rs(Po,n,1-i);if(o&&(et(o,t)??0)>=4.5)return o}return an(t)}function zl(n,e,t,i){if((et(n,t)??4.5)>=4.5&&(et(n,i)??4.5)>=4.5)return n;if(!ft(n)||!ft(e))return e;for(let o=.15;o<=1;o+=.05){let r=rs(n,e,1-o);if(r&&(et(r,t)??0)>=4.5&&(et(r,i)??0)>=4.5)return r}return e}function jl(n){return{"--sl-chrome":n?"#d6dce6":"#556278","--sl-chrome-line":n?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var Kl=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function Gl(n,e){let t=e??n["--sl-bg"],i=ft(t)?an(t)==="#172033":!1,o=ft(n["--sl-bg"])?an(n["--sl-bg"])==="#172033":!1;if(i===o)return null;let r=i?"#ffffff":"#1a2234",s=an(t),a=n["--sl-accent"];return{"--sl-bg":t,"--sl-surface":r,"--sl-text":s,"--sl-muted":i?"#667085":"#a5aec2","--sl-line":i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":zl(a,s,t,r),...jl(i),"--sl-warn-text":$l(s,r)}}var Km="#f7f8fb",Ul={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 Gm(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Pi(n){if(n)return n==="auto"?Gm()?"dark":"light":n}function Dn(n,e=n?.mode){if(n?.map)return n.map;let t=Pi(e);return t?{background:Ul[t].map}:null}function Lo(n){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>n(i.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function gt(n,e,t,i){let o=t?Ul[t]:null,r=e?.background??o?.background??n?.background??Km,s=ft(r)?an(r)==="#172033":!1,a=e?.surface??o?.surface??(s?"#ffffff":"#1a2234"),l=i&&/^#[0-9a-f]{6}$/i.test(i)?i:void 0,c=e?.accent??n?.accent??l??"#f4b740",d=n?.accentInk,p=e?.accentInk??(d&&(et(d,c)??4.5)>=4.5?d:an(c,"#1a1200","#ffffff")),m=o?void 0:n?.textColor,u=e?.text??o?.text??(m&&(et(m,r)??4.5)>=4.5&&(et(m,a)??4.5)>=4.5?m:an(r));return{"--sl-accent":c,"--sl-accent-ink":p,"--sl-accent-text":zl(c,u,r,a),"--sl-warn-text":$l(u,a),"--sl-bg":r,"--sl-surface":a,"--sl-text":u,"--sl-muted":e?.muted??o?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??o?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...jl(s),"--sl-scrim-ink":s?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function Um(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function ql(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,Fn.getLocale)(),i.dir=(0,Fn.localeDirection)(),n.appendChild(i),Object.entries(gt(void 0,t)).forEach(([r,s])=>i.style.setProperty(r,s)),i.innerHTML=`
193
+ .sl-sales-copy span{display:block;margin-top:3px;font-size:12.5px;line-height:1.45;color:var(--sl-muted)}`,Dm={lock:'<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',flag:'<path d="M5 21V4M5 4h11l-2 4 2 4H5"/>',cart:'<circle cx="9" cy="20" r="1.4"/><circle cx="17" cy="20" r="1.4"/><path d="M3 4h2l2.4 11h10.2L20 8H6.2"/>'},rl=n=>n.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`);on=n=>n.guestsOnly?null:ll(n.salesClosed,n.salesState,!!n.opts.readOnly),Fm=on;sl=new WeakMap});var Cy={};Yr(Cy,{ApiError:()=>re,BuyerAccessContext:()=>De,BuyerAccessUnavailableError:()=>we,BuyerRealtimeClient:()=>st,EmbeddedDesigner:()=>lr,PerformanceGroupDestroyedError:()=>Te,PerformanceGroupPicker:()=>Or,SEATING_CHART_CALLBACK_PROPS:()=>As,SEATING_CHART_HANDLE_METHODS:()=>Ts,SEATING_CHART_IDENTITY_PROPS:()=>Es,SEATING_CHART_VALUE_PROPS:()=>Cs,SeasonApiError:()=>q,SeasonPicker:()=>Ur,SeasonPublicSessionRefused:()=>pi,SeasonRecoveryTimeoutError:()=>di,SeatPicker:()=>Tt,SeatingChart:()=>ar,attachPickerFrame:()=>Au,bindSeatingChartHandle:()=>Zc,buildSeatingChartOptions:()=>Jc,createBuyerAccessContext:()=>jn,createControllerSink:()=>Hn,parseTicketOfferAvailability:()=>pr,prewarmSeatPicker:()=>Dh,shortOperationReference:()=>ri,ticketOfferPrices:()=>Hs});module.exports=_u(Cy);var de=require("@seatlayer/core");var Nu=/^[0-9A-Za-z.+-]{1,24}$/,Du=Nu.test("0.113.0")?"0.113.0":"",Fu={host:"web",platform:"web",bundle:Du,protocol:0,chromeOwner:"web"},Aa={...Fu},ro=null,Ca=null;function Bu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Pa(){return{...Aa}}function Vu(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(Bu()),documentMs:ro==null?0:n(ro),handshakeMs:ro==null||Ca==null?0:n(Ca-ro)}}function Ma(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:o}=Aa,r=Vu();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:o,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var La=new Set,Ha=new Map;function ut(n){return La.has(n)?"repeat":"cold"}function so(n){let e=ut(n);return La.add(n),e}function Ue(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function Ei(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function $u(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:Ue(n.ms),api:Ue(e.loadChartAndStatuses)||Ue(e.loadChart),scene:Ue(e.buildScene),panel:Ue(e.buildBuyerControls),paint:Ue(e.firstPaint),normalize:Ue(e.normalizeBuyerModel),renderer:Ue(e.createRenderer),seats:Ue(n.seats),floors:Ue(n.floors),view:n.view??"map",load:n.load??ut(n.event),transport:n.transport??"pubapi",...Ma(),availabilityMs:Ue(e.loadStatuses),...typeof n.revealWaitMs=="number"?{revealWaitMs:Ue(n.revealWaitMs)}:{},...typeof n.handoverMs=="number"?{handoverMs:Ue(n.handoverMs)}:{},mounts:(Ha.get(n.event)??0)+1,reconnects:Ue(n.reconnects)}}var zu=new Set;function rt(n){let e=$u(n);if(e){Ha.set(n.event,e.mounts);for(let t of zu)try{t(e)}catch{}typeof fetch>"u"||Ei()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}var ju="realtime.fallback_polling",Ra=new Set;function Ku(n){let e=/^(wss?):\/\/([^/]+)(.*?)\/pub\/events\/([^/?#]+)\/subscribe(?:[?#]|$)/.exec(n);if(!e)return null;let t;try{t=decodeURIComponent(e[4])}catch{return null}return/^[A-Za-z0-9_-]{1,80}$/.test(t)?{apiBase:`${e[1]==="wss"?"https":"http"}://${e[2]}${e[3]}`,eventKey:t}:null}function Ia(n){let e=Ku(n);if(!e||Ra.has(e.eventKey)||(Ra.add(e.eventKey),typeof fetch>"u"||Ei()))return!1;let t=Pa().bundle;return fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:ju,severity:"warning",eventKey:e.eventKey,...t?{appVersion:t}:{}}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0}var Jt="seatlayer.v1",Oa="\0",_a=4401,Gu=15e3,Uu=25e3,qu=1e4,Na=5e3,Wu=JSON.stringify({type:"resume"}),Yu=3e4,Xu=6e4,Qu=["pointermove","touchstart","keydown"],Zu=3,Ju=15e3,Da=6e4;function em(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,o]of Object.entries(n.seats))typeof o=="string"&&o!==e&&(t[i]=o);return{default:e,exceptions:t}}function tm(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,o]of Object.entries(e.exceptions))n.exceptions[i]!==o&&t.push({label:i,status:o});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function nm(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function Fa(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var st=class{constructor(e){this.ws=null;this.watched=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.failedUpgrades=0;this.pollTimer=null;this.fellBack=!1;this.lastWake=-1/0;this.lastInput=0;this.detachWake=null;this.reconnectCount=0;this.opts=e,typeof e.url=="string"&&Fa(e.url)}get polling(){return this.pollTimer!==null}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.attachWake(),this.connect())}stop(){this.stopped=!0,this.clearTimers(),this.stopPolling(),this.detachWake?.(),this.detachWake=null;let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.failedUpgrades=0,this.start()}async connect(){if(this.stopped)return;let e=[Jt];if(this.opts.mintTicket){let a;try{a=await this.opts.mintTicket()}catch(l){this.reportIfAccessError(l),this.scheduleReconnect();return}if(this.stopped)return;a?.protocols?.length?(e=[...a.protocols],e.includes(Jt)||e.unshift(Jt)):a?.ticket&&(e=[Jt,`tkt.${a.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${i}${i.includes("?")?"&":"?"}pv=1`:i;Fa(o);let r;try{r=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(o,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=r;let s=!1;r.onopen=()=>{this.ws===r&&(s=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=r.protocol===Jt,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},Na):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},Na))},r.onmessage=a=>{if(this.ws!==r)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},r.onclose=a=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),!s&&a?.code!==_a&&this.upgradeFailed(),a?.code===_a){if(a.reason==="access_expired"){this.scheduleReconnect();return}if(a.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.stopPolling(),this.opts.onIdleExpired();return}this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.close()}catch{}}}watchHold(e){let t=this.ws;if(!(!e||e===this.watched||!t||t.readyState!==1))try{t.send(JSON.stringify({type:"watch",holdId:e})),this.watched=e}catch{}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(t==="sales"){this.opts.sink.onSales?.(e);return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],r=i.join(Oa),s=o.join(Oa);(r!==this.hidden||s!==this.closedSections)&&(this.hidden=r,this.closedSections=s,this.opts.sink.onSections?.(i,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="hold"){typeof e.holdId=="string"&&typeof e.state=="string"&&this.opts.onHoldState?.(e.holdId,e.state);return}if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let i=em(e),o=tm(this.projection,i);this.projection=i,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!i.length)return;this.projection&&nm(this.projection,i),this.opts.sink.applyStatuses(i)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}upgradeFailed(){this.failedUpgrades+=1,this.failedUpgrades>=Zu&&this.startPolling()}startPolling(){if(!(this.pollTimer||this.stopped)){if(!this.fellBack){this.fellBack=!0;try{this.opts.onFallbackPolling?.()}catch{}let e=typeof this.opts.url=="function"?this.opts.url():this.opts.url;Ia(e)}this.pollTimer=setInterval(()=>{if(this.stopped){this.stopPolling();return}typeof document<"u"&&document.hidden||Promise.resolve().then(()=>this.opts.poll?this.opts.poll():this.opts.sink.resync({reason:"frame"})).catch(()=>{})},Ju)}}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}now(){return this.opts.now?this.opts.now():Date.now()}attachWake(){if(this.detachWake||typeof document>"u"||typeof window>"u"||typeof document.addEventListener!="function"||typeof window.addEventListener!="function")return;this.lastInput=this.now();let e=()=>{document.visibilityState==="visible"&&this.wake()},t=()=>{let r=this.now(),s=r-this.lastInput>=Xu;this.lastInput=r,s&&this.wake()},i={capture:!0,passive:!0},o=r=>{document[r]("visibilitychange",e),window[r]("focus",e);for(let s of Qu)document[r](s,t,i)};o("addEventListener"),this.detachWake=()=>o("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<Yu)){try{e.send(Wu)}catch{return}this.lastWake=t}}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},qu)}},Uu)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,Gu),i=this.pollTimer?Da/2+Math.random()*Da/2:Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},i)}get reconnects(){return this.reconnectCount}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function im(n){return n==="blocked"?"not_for_sale":n==="unavailable"?"held":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}var om="#f43f5e";function Hn(n,e={}){let t=i=>{let o=n.tableSelection(i);if(o)return o.physicalSeatIds;let r=n.idForLabel(i);return r?[r]:[]};return{applyStatuses(i){let o=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),r={free:[],held:[],booked:[],not_for_sale:[]},s=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=im(c.status);if(r[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(m=>n.getStatus(m)==="free"))for(let m of d)s.push({id:m,color:om});p!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])r[c].length&&n.setStatus(r[c],c);for(let c of s)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,o,r){r?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,o,r)}}}var en="pricingContract=matrix-v1&pricingContract=seat-v1",re=class extends Error{constructor(e,t,i,o,r,s,a,l){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=o,this.reason=r,this.retryAfterS=s,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},Ba=10,Va=1;function Ci(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function rm(n){let e=n;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var sm={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function $a(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),n=>n.toString(16).padStart(2,"0")).join("")}function am(n,e){let t=e.map(i=>[i.label,i.tierId??null,i.quantity??null]).sort((i,o)=>i[0]<o[0]?-1:i[0]>o[0]?1:0);return JSON.stringify([n,t])}function lm(n){return n instanceof re?n.status===408||n.status===429||n.status>=500:!0}var ja=3,cm=7e3,dm=500,pm=.25;function Rn(n){if(n instanceof TypeError)return!0;let e=n;return!e||typeof e!="object"||typeof e.status!="number"?!1:e.status===503&&e.retryable===!0?!0:e.status>=500&&e.message===`request_failed_${e.status}`}var lo=class extends Error{},hm=2;async function ao(n,e,t=ja,i){let o=0;for(let r=1;;r+=1)try{return await n()}catch(s){if(r>=t||!Rn(s)||i&&!i())throw s;let a=s.retryAfterS,l=typeof a=="number"&&a>0?a*1e3:dm*2**(r-1),c=Math.round(l*(1+pm*Math.random()));if(o+c>cm)throw s;o+=c,await new Promise(d=>setTimeout(d,c)),e?.()}}function za(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var Lt=class{constructor(e,t={}){this.base=e;this.viewerId=za();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}rotateViewerId(){this.viewerId=za()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let o=t.method??"GET",r={},s;t.body!==void 0&&(r["Content-Type"]="application/json",s=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");if(a&&(r.Authorization=a),t.idempotency){let m=`${t.idempotency.binding}\0${a??""}`,{resendOf:u}=t.idempotency;if(u!==void 0&&(this.holdAttempt?.binding!==m||this.holdAttempt.key!==u))throw new lo;let f=u??this.holdAttemptKey(m);t.idempotency.used(f??void 0),f&&(r["Idempotency-Key"]=f)}t.idempotencyKey&&(r["Idempotency-Key"]=t.idempotencyKey);let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:r,body:s,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(u=>{if(l?.signal.aborted)throw u;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let m=p,u=m?.code??m?.error,f=d.status===401&&u==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!f&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,u)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(d.status===409){let T=u?sm[u]:void 0,C=m?.conflicts?.map(k=>k.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:C,reason:T,code:u})}let b;if(d.status===429&&(b=Ci(d.headers.get("Retry-After"),m?.retryAfterSeconds)??Va,o==="GET"&&!i.rateLimit&&b<=Ba))return await new Promise(T=>setTimeout(T,b*1e3)),this.request(e,t,{...i,rateLimit:!0});throw d.status===503&&(b=Ci(d.headers.get("Retry-After"),m?.retryAfterSeconds)),new re(d.status,m?.error??`request_failed_${d.status}`,u,m?.conflicts,m?.reason,b,typeof m?.notice=="string"&&m.notice?m.notice:void 0,{...Array.isArray(m?.fields)?{fields:m.fields}:{},...typeof m?.retryable=="boolean"?{retryable:m.retryable}:{},...typeof m?.hint=="string"&&m.hint?{hint:m.hint}:{},...typeof m?.message=="string"&&m.message?{serverMessage:m.message}:{}})}return p}async requestBlob(e,t={}){let i={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(i.Authorization=o);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(r.status===429&&(c=Ci(r.headers.get("Retry-After"),a?.retryAfterSeconds)??Va,!t.rateLimit&&c<=Ba))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new re(r.status,a?.error??`request_failed_${r.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new re(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1&${en}`),fetchedAt:Date.now()}}hold(e,t,i,o){let r=`/pub/events/${encodeURIComponent(e)}/hold?${en}`,s={method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(r,s):this.keyedHold(r,s,am(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=$a();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,i,o=!1){let r,s,a,l=0;try{let c=await ao(async()=>{l+=1;let d=l>1;try{return await this.request(e,{...t,idempotency:{binding:i,used:p=>{r=p},...d?{resendOf:s}:{}}})}catch(p){throw d||(s=r,a=p),p}},void 0,ja,()=>s!==void 0);return this.endHoldAttempt(r),c}catch(c){let d=c instanceof lo?a:c;if(lm(d))throw d;this.endHoldAttempt(r);let p=d.code;if(p==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,i,!0);if(p==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw d}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let i=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(r=>typeof r=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(rm)?e.ticketKeyDetails.map(({ticketKey:r,label:s,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:r,label:s,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return i||o?this.ticketKeysByHold.set(e.holdId,{...i?{ticketKeys:i}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,i,o,r){let s=$a()??void 0,a=()=>this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${en}`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?{ttlMs:r}:{},...this.referral?{referral:this.referral}:{}},...s?{idempotencyKey:s}:{}});return(s?ao(a,void 0,hm):a()).then(l=>this.noteTicketKeys(l))}resume(e,t){return ao(()=>this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})).then(i=>this.noteTicketKeys(i))}release(e,t,i){this.holdAttempt=null;let o=!1;return ao(()=>this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}}),()=>{o=!0}).then(r=>{let s=o?{...r,released:[...t]}:r,a=this.ticketKeysByHold.get(i);if(a){let l=new Set(s?.released??t);this.ticketKeysByHold.set(i,{...a.ticketKeys?{ticketKeys:a.ticketKeys.filter(c=>!l.has(c))}:{},...a.ticketKeyDetails?{ticketKeyDetails:a.ticketKeyDetails.filter(c=>!l.has(c.ticketKey))}:{}})}return s})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability?${en}${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}&${en}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Jt]}createRealtime(e,t){return this.accessScoped?null:new st({url:this.subscribeUrl(e),sink:t})}};var ft=require("@seatlayer/core");var _e=require("@seatlayer/core"),Cl=require("@seatlayer/core/core/seatConfidence");var fl=require("@seatlayer/core"),es=require("@seatlayer/core"),_n=require("@seatlayer/core/core/cdnAsset");var um=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,mm=/[\s"'<>`\\]/;function fm(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function gm(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function In(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return um.test(n);if(mm.test(n))return!1;let e=gm();if(fm(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var qm=require("@seatlayer/core/core/cdnAsset");function v(n,e){let t=(0,es.t)(n);return t===n?e:t}function rn(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function ho(){return{rotate:v("picker.dragToRotateVenue","Drag to rotate the venue"),move:v("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:v("picker.zoomIn","Zoom in"),zoomOut:v("picker.zoomOut","Zoom out"),fitView:v("picker.fitWholeVenue","Show whole venue")}}function uo(n){return n==="map"||n==="classic"?{touchNavigation:n}:{}}function mo(n){return typeof n=="boolean"?{crowdFigures:n?Number.POSITIVE_INFINITY:0}:{}}var ul=new WeakMap;function fo(n){let e=n.doc??null,t=e?ul.get(e):void 0;if(t)return t;let i=new Map(n.getGAAreas().map(o=>[o.id,{categoryKey:o.categoryKey??"",wheelchairPlaces:o.wheelchairPlaces??0}]));return e&&ul.set(e,i),i}function go(n,e=()=>!1,t=()=>0){let i={};for(let[o,r]of Object.entries(n)){let s=r.available==null?"":(0,fl.gaAvailabilityText)({available:r.available,wheelchairFree:r.wheelchairFree});i[o]={available:r.available,selected:r.selected??0,wheelchairFree:r.wheelchairFree??null,filteredOut:e(o),statusText:s&&t(o)>0?`${Km} ${s}`:s}}return i}var Km="\u267F",Jr=new WeakSet;function bo(n,e){if(Jr.has(n))return;Jr.add(n);let t=()=>{Jr.delete(n),e()};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):setTimeout(t,16)}function gl(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let o=[...i][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+i.slice(o.length)}function bl(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function Y(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function yo(n,e,t){let i=e.find(r=>In(r))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=i,n.appendChild(o),i}var On=null;function vo(){if(On!==null)return On;try{if(typeof document>"u")return On=!1;On=!!document.createElement("canvas").getContext("webgl2")}catch{On=!1}return On}var Ai=null;function Pi(){return Ai||(Ai=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,_n.importCdnAsset)("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(e=>{throw Ai=null,e}),Ai)}function wo(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Pi().catch(()=>{})}async function xo(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,_n.importCdnAsset)("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function Nn(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,_n.importCdnAsset)("seatlayer-checkout.mjs"):Promise.resolve().then(()=>(il(),nl))}async function yl(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?(0,_n.importCdnAsset)("seatlayer-sales.mjs"):Promise.resolve().then(()=>(hl(),pl))}function vl(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function wl(n){return n.lineItems.reduce((e,t)=>e+t.quantity,0)}function ts(n,e){if(n.objectType!=="ga")return n.displayLabel??n.label;let t=e.find(i=>i.id===n.objectId);return n.displayLabel??t?.displayLabel??t?.label??v("picker.generalAdmission","General admission")}function Gm(n,e){let t=new Map;for(let i of n){let o=i.rowLabel&&i.seatNumber?[i.sectionLabel,`${v("picker.row","Row")} ${i.rowLabel}`,`${v("picker.seat","Seat")} ${i.seatNumber}`].filter(Boolean).join(" \xB7 "):ts(i,e),r=[i.categoryLabel,i.tierLabel].filter(Boolean).join(" \xB7 "),s=Math.max(1,Math.floor(i.quantity||1)),a=`${o}\0${r}`,l=t.get(a)??{label:o,detail:r,units:0,amount:0};l.units+=s,l.amount+=i.unitPrice*s,t.set(a,l)}return[...t.values()].map(i=>({label:i.units>1?`${i.label} \xD7${i.units}`:i.label,...i.detail?{detail:i.detail}:{},amount:i.amount}))}var ml=(n,e,t)=>(0,es.t)("picker.bookingForm.guestOfCount",{label:n,index:e,total:t});function Um(n,e,t=[]){let i=new Map,o=[];for(let d of n.lineItems){let p=ts(d,t),m=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&m>1)){o.push({key:d.label,name:p,unitIndex:1,quantity:1});continue}for(let u=1;u<=m;u+=1){let f=(i.get(d.label)??0)+1;i.set(d.label,f),o.push({key:`${d.label}#${f}`,name:p,unitIndex:u,quantity:m})}}let r=e?.ticketKeyDetails??[],s=e?.ticketKeys??r.map(d=>d.ticketKey),a=(s.length===o.length?s:o.map(d=>d.key)).map(d=>{let p=o.find(u=>u.key===d),m=r.find(u=>u.ticketKey===d);return{key:d,name:m?.displayLabel??p?.name,unitIndex:m?.unitIndex??p?.unitIndex??1,quantity:m?.quantity??p?.quantity??1}}),l=new Map;for(let d of a)d.name&&d.quantity<=1&&l.set(d.name,(l.get(d.name)??0)+1);let c=new Map;return a.map(({key:d,name:p,unitIndex:m,quantity:u})=>{if(!p)return{key:d};if(u>1)return{key:d,title:ml(p,m,u)};let f=(c.get(p)??0)+1;c.set(p,f);let b=l.get(p)??1;return{key:d,title:b>1?ml(p,f,b):p}})}function xl(n,e,t,i,o=[]){let r=new Map;for(let s of n.lineItems){let a=ts(s,o);r.set(a,(r.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:[...r].map(([s,a])=>a>1?`${s} \xD7${a}`:s),tickets:Um(n,i,o),lines:Gm(n.lineItems,o)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function kl(n){return String(n?.code).startsWith("booking_form_")}function ko(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(n);if(e)try{return o.toLocaleString(t,{...i,timeZone:e})}catch{}return o.toLocaleString(t,i)}function ns(n){return/early[\s-]*bird/i.test(n?.trim()??"")}function Sl(n){return ns(n)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function So(n,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(n)}" title="${e(n)}">${Sl(n)}</span>`}function To(n,e){return`<span class="sl-offer-badge">${Sl(n)}<span>${e(n)}</span></span>`}function Tl(n,e=Date.now()){let t=n-e;if(t<=0)return null;let i=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(i/1440),r=Math.floor(i%1440/60),s=i%60;return`${(o>0?[`${o}d`,...r?[`${r}h`]:[]]:[...r?[`${r}h`]:[],...s||!r?[`${s}m`]:[]]).join(" ")} left`}function is(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function H(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function os(n){return n?(0,_e.seatNoteRowModel)(n).map(e=>({...e,title:v(e.titleKey,e.titleFallback)})):[]}function Al(n){return os(n).map(e=>e.title)}function sn(n,e={}){return rs(os(n),e)}function rs(n,e={}){if(!n.length)return"";let t=e.compact?15:17,i=n.map(o=>`<div class="sl-note sl-note-${H(o.tone)}"><span class="sl-note-i">${(0,_e.seatTypeIconSvg)(o.icon,{size:t})}</span><span class="sl-note-t"><b>${H(o.title)}</b>`+(o.note?`<span class="sl-note-n">${H(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${i}</div>`}function Pl(n){return os(n).map(e=>{let t=H(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${H(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,_e.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function Eo(n){let e=[];return n?.restrictedView&&e.push(v("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(v("picker.obstructedView","Obstructed view")),e}function ss(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),i=e?v("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${i}</span></button>`}function Ml(n,e){if(!e)return"";let t=e,i=t.includes(n.id),o=i?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${H(o)}</span></button>`}function Ll(n,e,t){if(!t)return"";let i=(0,Cl.seatConfidenceDisclosure)(n.confidenceEvidence),o=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${H(n.displayLabel??n.label)}"><span><em>${H(e)}</em><strong>${H(i.headline)}</strong><small>${H(o)}</small></span><b>Passport</b></button>`}function ve(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let o=`${t}${i}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,_e.compactRowLabel)(e,t)}function Wm(n){switch(n){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:v("picker.accessRefresh","Refresh")};case"idle":return{title:v("picker.idlePausedTitle","Your session expired"),body:v("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:v("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","The seat map timed out"),body:v("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:v("picker.accessRefresh","Refresh")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:v("picker.accessRefresh","Refresh")}}}var Ym=6;function Hl(n,e,t){let i=is;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Ym?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(ve(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Rl(n,e,t){let i=is,o=n?.objectType==="booth",r=n?.objectType==="table"&&!!n?.bookingMode,s=o||r||!n?.seatNumber,a=n?.sectionLabel??(s?void 0:n?.displayLabel),l=r?`${v("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(s?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${ve(n)??""}`.trim():void 0,`${v("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function Il(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Ol(n,e){if(!n||e)return"";let t=v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function El(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Co(n,e,t,i=()=>{}){let o=is;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${(0,_e.t)("picker.ticketType")}</span></legend>`+n.map(a=>{let l=El(a),c=i(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${To(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let r=n[0],s=r?El(r):void 0;return s?`<p class="sl-confirm-tier-note">${o(s)}</p>`:""}function _l(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${H(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${H(n.priceLabel)}</span>`:"")+"</div>"+(n.priceLabel&&n.feeNote?`<div class="sl-confirm-fee">${H(n.feeNote)}</div>`:"")+'<div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${H(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${H(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${H(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.commercial+n.tierChoices+n.groupDates+n.wheelchair+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${H(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${H(n.selectLabel)}</span></button></div></div>`}function Nl(n,e){let t=Y,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?(0,_e.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,_e.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,_e.t)("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,_e.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t((0,_e.t)("picker.guestsCount",{count:n.capacity}))}</span>`+(n.entrance?`<span class="muted">${t(v("picker.entrance","Entrance"))}</span><span>${t(n.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(v("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,_e.t)("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,_e.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):i?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Dl(n,e){let t=Wm(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let r=document.createElement("div");r.className="sl-interrupt-title",r.textContent=t.title;let s=document.createElement("div");s.className="sl-interrupt-body",s.textContent=t.body,o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{i.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),i.appendChild(o),i}function Fl(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${H(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${Y(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Bl(n){return n.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${H(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${H(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${H(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${Dn({id:`sl-info-${Y(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:H(e.note)})}</div>`:t}).join("")}function Dn(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${Y(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${Y(n.label)}" aria-describedby="${Y(n.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${Y(n.id)}"${n.ref?` data-ref="${Y(n.ref)}"`:""}>${n.text}</span></span>`}function Vl(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function $l(n){let e=n.performanceLabel?`<div class="sl-chip-when">${Y(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${Y(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${Y(i)}</span>`).join("")}</span></div>`:"";return e+Xm(n)+t}function Xm(n){let{d:e,area:t,label:i,objectType:o,quantity:r=1,identity:s}=n,a=L=>String(L??"\u2014").replace(/[&<>"]/g,Q=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[Q]),l=o==="ga"?"ga":e?.objectType??o,c=s?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("picker.row","Row")),d=s?.rowLabel??s?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",m="",u=[];l==="table"&&s?.bookingMode?(m=`${c} ${d}`,u.push([v("picker.guests","Guests"),String(r)])):l==="ga"?(m=String(t?.displayLabel??d),r>1&&u.push([v("picker.tickets","Tickets"),String(r)])):l==="booth"?(m=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&u.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?m=String(d):(m=e.sectionLabel??"",e.rowLabel&&u.push([c,String(ve(e)??e.rowLabel)]),e.seatNumber&&u.push([v("picker.seat","Seat"),String(e.seatNumber)]));let f=!m&&!!p,b=m||p||String(d),T=!!p&&!f&&p!==b,C=n.offerName?So(n.offerName,a):"",k=u.map(([L,Q])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(L)}</span> <b>${a(Q)}</b></span>`);T&&k.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span>${C}</span>`);let E=[b,...u.map(([L,Q])=>`${L} ${Q}`),T?p:"",n.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(E)}</span><span class="sl-chip-name" aria-hidden="true">${a(b)}${T?"":C}</span>`+(k.length?`<span class="sl-chip-pos" aria-hidden="true">${k.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function Ao(n,e,t){return n.map(i=>`<option value="${t(i.id)}"${i.id===e?" selected":""}>${t(i.name)}</option>`).join("")}function Qm(n){let e=Y;return` data-key="${e(n.key)}"`+(n.heldLabels.length?` data-held="${e(encodeURIComponent(n.heldLabels.join(`
194
+ `)))}"`:"")+(n.seatIds.length?` data-seat="${e(n.seatIds.join(" "))}"`:"")+(n.locateId?` data-locate="${e(n.locateId)}"`:"")}function zl(n){let e=Y;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+Qm(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${H(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function as(n,e){let t=Y(n),i=e?Y(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${Y((0,ft.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Po(n,e){return new Set(n.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function Mo(n,e){let t=(n.doc?.categories??[]).filter(s=>!s.notForSale),i=e?t.filter(s=>s.key===e):t;if(!i.length)return null;let o=Po(i,n.categoryAvailability());return o.size<i.length||(n.currentHold()?.items??[]).some(s=>o.has(s.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function jl(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,ft.t)("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${v("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${v("picker.findSeatsTogether","Find seats together")}</span>`+Dn({id:"sl-info-best-seats",label:v("picker.aboutBestSeats","About finding seats together"),text:v("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${Y(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${Y(v("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>e.soldOut?`<option value="${Y(e.key)}" disabled>${Y(`${e.label} \xB7 ${v("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${Y(e.key)}"${n.selectedCategory===e.key?" selected":""}>${Y(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${Y(e.id)}"${n.selectedZone===e.id?" selected":""}>${Y(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,ft.tCount)("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Kl(n){return n==="setup"||n==="testable"?{heading:v("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:v("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:n==="paused"?{heading:v("picker.salesPausedPill","Sales are paused"),sentence:v("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:v("picker.salesClosedPill","Sales are closed"),sentence:v("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function Gl(n,e=!1){if(!e&&(n==="setup"||n==="testable"||n==="paused")){let t=Kl(n);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:v("picker.salesClosedPill","Sales are closed"),cta:v("picker.salesClosedCta","Sales closed"),toast:v("picker.salesClosedToast","Sales are closed for this event.")}}function Ul(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${Y(n.whenText)}</span>`:"",t=n.note??Kl(n.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function ql(n){return n.hasGaAreas?n.seated?n.venue3d?(0,ft.t)("picker.trayHintChoose3dOrStanding"):v("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):n.venue3d?(0,ft.t)("picker.gaTrayHintChoose3dArea"):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):n.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?n.season?(0,ft.t)("picker.season.trayHint"):v("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):n.venue3d?(0,ft.t)("picker.trayHintChoose3dOrBest"):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var Ne=require("@seatlayer/core");var Bn=require("@seatlayer/core");var Ro=require("@seatlayer/core/core/color");function gt(n){if(!n)return null;let e=n.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="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(e)?.[1];if(t){let o=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let i=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return i?{r:Math.max(0,Math.min(255,Number(i[1]))),g:Math.max(0,Math.min(255,Number(i[2]))),b:Math.max(0,Math.min(255,Number(i[3])))}:null}function Lo(n){return(0,Ro.relativeLuminance255)([n.r,n.g,n.b])}function et(n,e){let t=gt(n),i=gt(e);if(!t||!i)return null;let o=Math.max(Lo(t),Lo(i)),r=Math.min(Lo(t),Lo(i));return(o+.05)/(r+.05)}function an(n,e="#172033",t="#eef1f8"){return(et(e,n)??0)>=(et(t,n)??0)?e:t}function Zm(n){return(0,Ro.rgb255ToHex)(n.r,n.g,n.b)}function ls(n,e,t){let i=gt(n),o=gt(e);if(!i||!o)return null;let r=Math.max(0,Math.min(1,t));return Zm({r:i.r*r+o.r*(1-r),g:i.g*r+o.g*(1-r),b:i.b*r+o.b*(1-r)})}var Ho="#d8a425",Jm=.18;function Wl(n,e){let t=ls(Ho,e,Jm)??e;if((et(Ho,t)??0)>=4.5)return Ho;for(let i=.15;i<=1;i+=.05){let o=ls(Ho,n,1-i);if(o&&(et(o,t)??0)>=4.5)return o}return an(t)}function Yl(n,e,t,i){if((et(n,t)??4.5)>=4.5&&(et(n,i)??4.5)>=4.5)return n;if(!gt(n)||!gt(e))return e;for(let o=.15;o<=1;o+=.05){let r=ls(n,e,1-o);if(r&&(et(r,t)??0)>=4.5&&(et(r,i)??0)>=4.5)return r}return e}function Xl(n){return{"--sl-chrome":n?"#d6dce6":"#556278","--sl-chrome-line":n?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var Ql=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function Zl(n,e){let t=e??n["--sl-bg"],i=gt(t)?an(t)==="#172033":!1,o=gt(n["--sl-bg"])?an(n["--sl-bg"])==="#172033":!1;if(i===o)return null;let r=i?"#ffffff":"#1a2234",s=an(t),a=n["--sl-accent"];return{"--sl-bg":t,"--sl-surface":r,"--sl-text":s,"--sl-muted":i?"#667085":"#a5aec2","--sl-line":i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":Yl(a,s,t,r),...Xl(i),"--sl-warn-text":Wl(s,r)}}var ef="#f7f8fb",Jl={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 tf(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Mi(n){if(n)return n==="auto"?tf()?"dark":"light":n}function Fn(n,e=n?.mode){if(n?.map)return n.map;let t=Mi(e);return t?{background:Jl[t].map}:null}function Io(n){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>n(i.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function bt(n,e,t,i){let o=t?Jl[t]:null,r=e?.background??o?.background??n?.background??ef,s=gt(r)?an(r)==="#172033":!1,a=e?.surface??o?.surface??(s?"#ffffff":"#1a2234"),l=i&&/^#[0-9a-f]{6}$/i.test(i)?i:void 0,c=e?.accent??n?.accent??l??"#f4b740",d=n?.accentInk,p=e?.accentInk??(d&&(et(d,c)??4.5)>=4.5?d:an(c,"#1a1200","#ffffff")),m=o?void 0:n?.textColor,u=e?.text??o?.text??(m&&(et(m,r)??4.5)>=4.5&&(et(m,a)??4.5)>=4.5?m:an(r));return{"--sl-accent":c,"--sl-accent-ink":p,"--sl-accent-text":Yl(c,u,r,a),"--sl-warn-text":Wl(u,a),"--sl-bg":r,"--sl-surface":a,"--sl-text":u,"--sl-muted":e?.muted??o?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??o?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...Xl(s),"--sl-scrim-ink":s?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function nf(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function ec(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,Bn.getLocale)(),i.dir=(0,Bn.localeDirection)(),n.appendChild(i),Object.entries(bt(void 0,t)).forEach(([r,s])=>i.style.setProperty(r,s)),i.innerHTML=`
195
195
  <div class="sl-head">
196
196
  <div class="sl-logo" data-ref="logo"></div>
197
197
  <div class="sl-head-info" data-ref="headInfo">
@@ -242,7 +242,7 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
242
242
  </div>
243
243
  <div class="sl-boot" data-ref="boot">
244
244
  <div class="sl-boot-bar" aria-hidden="true"></div>
245
- ${Um()}
245
+ ${nf()}
246
246
  <span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
247
247
  </div>
248
248
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
@@ -256,10 +256,10 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
256
256
  <div class="sl-sec sl-filtersec" data-ref="filtersSec" data-sl-t="picker.filters">${e("picker.filters","Filters")}</div>
257
257
  <div class="sl-filters" data-ref="filters"></div>
258
258
  <div class="sl-offer" data-ref="offer" role="status" aria-live="polite"></div>
259
- <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${Nn({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
259
+ <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${Dn({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
260
260
  <div class="sl-prices" data-ref="prices"></div>
261
261
  <div class="sl-sec sl-seats-sec">
262
- <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${Nn({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
262
+ <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${Dn({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
263
263
  <span class="sl-seat-summary" data-ref="seatSummary"></span>
264
264
  </div>
265
265
  <div class="sl-tray" data-ref="tray"></div>
@@ -268,9 +268,9 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
268
268
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
269
269
  </div>
270
270
  </div>
271
- </div>`;let o={};return i.querySelectorAll("[data-ref]").forEach(r=>{o[r.dataset.ref]=r}),{root:i,mapHost:o.map,els:o}}function Ho(n){let e=(t,i)=>{for(let o of n.querySelectorAll(`[${t}]`)){let r=o.getAttribute(t);if(!r)continue;let s=(0,Fn.t)(r);s!==r&&i(o,s)}};e("data-sl-t",(t,i)=>{t.textContent=i}),e("data-sl-a",(t,i)=>{t.setAttribute("aria-label",i)}),e("data-sl-ti",(t,i)=>{t.setAttribute("title",i)})}function Ro(n,e){let t=(0,Ne.resolveLocale)(n),i=Ne.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Ne.setStringOverrides)(e),{locale:i,direction:(0,Ne.localeDirection)(i),ready:(0,Ne.loadLocale)(n)}}function Io(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function Wl(n,e){if(!n)return null;let t=(e.languages??[]).map(o=>(0,Ne.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=Ne.LOCALE_NAMES[o]??o,r.selected=o===(0,Ne.getLocale)(),i.appendChild(r)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function Yl(n,e){e.root.lang=n,e.root.dir=(0,Ne.localeDirection)(n),Ho(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}function Bn(n,e,t,i=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let r=!1,s=d=>{r||(r=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>s({outcome:"cancelled"}),l=setTimeout(()=>{r||t()},8e3),c=setTimeout(()=>s({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>r?void 0:n()).then(d=>{r||s({outcome:"loaded",value:d})},d=>s({outcome:"error",error:d}))})}var we=class extends Error{constructor(e){super(`buyer_access_unavailable:${e.reason}`),this.name="BuyerAccessUnavailableError",this.reason=e.reason,this.code=e.code,this.status=e.status}},qm=new Set(["buyer_access_expired"]),Wm=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Ym(n,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return n===401?"invalid":null}function Xm(n){return/^Bearer\s+(\S+)$/i.exec(n?.trim()??"")?.[1]??null}function _o(n){return n instanceof we?n.reason!=="paused"&&n.reason!=="channel_denied":!n||typeof n!="object"?!1:n.status===401}function Qm(n,e){return n===401&&!!e&&qm.has(e)}var Zm=3e4,ze,je,ln,Vn,Mi,It,Ot,bt,$n,Li,Hi,Ri,cn,Le,ss,Oo,Rt,De=class{constructor(e){M(this,Le);M(this,ze,null);M(this,je,0);M(this,ln,null);M(this,Vn);M(this,Mi);M(this,It,null);M(this,Ot,null);M(this,bt,null);M(this,$n,null);M(this,Li);M(this,Hi);M(this,Ri,!1);M(this,cn);if(x(this,Vn,e.provider),x(this,Mi,e.skewMs??Zm),x(this,Li,e.onExpired),x(this,Hi,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;w(this,Le,ss).call(this,t)}x(this,Ri,!!h(this,Vn)||!!h(this,ze))}get configured(){return h(this,Ri)}onRenewed(e){x(this,cn,e)}get unavailable(){return h(this,bt)}get hasToken(){return!!h(this,ze)&&(h(this,je)===0||h(this,je)>Date.now())}get expiresAt(){return h(this,je)}async authorization(e="initial"){if(!this.configured)return null;if(h(this,bt))throw new we(h(this,bt));let t=Date.now();if(!h(this,ze)||h(this,je)>0&&h(this,je)-h(this,Mi)<=t){let o=!!h(this,ze)&&h(this,je)>0&&h(this,je)<=t,r=h(this,ze)?o?"expired":"expiring":e,s=await w(this,Le,Oo).call(this,r);if(!s)throw new we(h(this,bt)??h(this,$n)??w(this,Le,Rt).call(this,"provider_failed"));return`Bearer ${s}`}return`Bearer ${h(this,ze)}`}async handleFailure(e,t,i){var r;if(!this.configured)return!1;if(Qm(e,t)){let s=Xm(i)??h(this,ln);x(this,ze,null),x(this,je,0);let a=await w(this,Le,Oo).call(this,"unauthorized",t),l=!!a&&a!==s;return(r=h(this,Li))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&w(this,Le,Rt).call(this,"revoked",t,e),l}let o=Ym(e,t);return o&&w(this,Le,Rt).call(this,o,t,e),!1}async refresh(e="manual"){return x(this,bt,null),x(this,$n,null),x(this,ze,null),x(this,je,0),!!await w(this,Le,Oo).call(this,e)}clear(){h(this,Ot)?.abort(),x(this,Ot,null),x(this,ze,null),x(this,ln,null),x(this,je,0),x(this,It,null),x(this,cn,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ze=new WeakMap,je=new WeakMap,ln=new WeakMap,Vn=new WeakMap,Mi=new WeakMap,It=new WeakMap,Ot=new WeakMap,bt=new WeakMap,$n=new WeakMap,Li=new WeakMap,Hi=new WeakMap,Ri=new WeakMap,cn=new WeakMap,Le=new WeakSet,ss=function(e){return!e||typeof e.token!="string"||!e.token?null:(x(this,ln,e.token),x(this,ze,e.token),x(this,je,typeof e.expiresAt=="number"?e.expiresAt:0),h(this,ze))},Oo=function(e,t){if(h(this,It))return h(this,It);let i=h(this,Vn);if(!i)return w(this,Le,Rt).call(this,"no_token",t),Promise.resolve(null);let o=h(this,ln),r=new AbortController;x(this,Ot,r);let s=(async()=>{try{let a=await Bn(()=>Promise.resolve(i({reason:e})),r.signal,()=>{},4e4);if(r.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return w(this,Le,Rt).call(this,"provider_failed",t),null;let l=a.value,c=w(this,Le,ss).call(this,l);if(!c)return w(this,Le,Rt).call(this,"provider_failed",t),null;if(o&&o!==c&&h(this,cn))try{await h(this,cn).call(this,{previousToken:o,token:c,reason:e})}catch{}return r.signal.aborted?null:c}catch{return w(this,Le,Rt).call(this,"provider_failed",t),null}finally{h(this,Ot)===r&&(x(this,It,null),x(this,Ot,null))}})();return x(this,It,s),s},Rt=function(e,t,i){var r;let o={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return x(this,$n,o),Wm.has(e)||(x(this,bt,o),x(this,ze,null),x(this,je,0)),(r=h(this,Hi))==null||r.call(this,o),o};function zn(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new De({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}function Xl(n){let e=n?.event;if(e?.guestsOnly!==!0)return null;let t=e.guestsOnlyForMs;return{forMs:typeof t=="number"&&Number.isFinite(t)&&t>=0?t:null}}var Jm=2147483647,ef=1e3;function Ql(n,e,t=typeof document>"u"?null:document){let i=e+ef,o=Date.now()+i,r=i<=Jm?setTimeout(l,i):null;function s(){r&&clearTimeout(r),t?.removeEventListener("visibilitychange",a)}function a(){t?.visibilityState==="visible"&&Date.now()>=o&&l()}function l(){s(),!(n.destroyed||!n.guestsOnly)&&(n.guestsOnly=!1,n.salesClosed=!!n.opts.readOnly||n.salesState==="paused"||n.salesState==="ended",n.applySalesClosed())}return t?.addEventListener("visibilitychange",a),s}function Zl(n){let e=n?.code;return e==="guests_only"||e==="guest_choice_closed"?e:null}function No(){return{pill:v("picker.guestsOnlyPill","Invited guests only"),cta:v("picker.guestsOnlyPill","Invited guests only"),toast:v("picker.guestsOnlyToast","This event is for invited guests.")}}function Jl(){return{heading:v("picker.guestsOnlyPill","Invited guests only"),sentence:v("picker.guestsOnlyCopy","Each guest chooses their seats from their own link.")}}function ec(){return v("picker.guestChoiceClosed","Seat choice isn\u2019t open right now.")}function tc(n){n.guestsOnly=!0;let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.controller.getSelection().filter(i=>!e.has(i.label)).map(i=>i.id);t.length&&n.controller.deselect(t),n.gaQty&&tf(n.gaQty,n.hold?.items??[])}function tf(n,e){let t=new Map;for(let i of e){if(i.objectType!=="ga"||!i.objectId)continue;let o=t.get(i.objectId)??new Map,r=i.tierId??null;o.set(r,(o.get(r)??0)+(i.quantity??1)),t.set(i.objectId,o)}for(let[i,o]of[...n]){for(let[r,s]of[...o]){let a=Math.min(s,t.get(i)?.get(r)??0);a>0?o.set(r,a):o.delete(r)}o.size||n.delete(i)}}function Do(n){let e={state:"none"};return{transport:new Proxy(n,{get(i,o){let r=Reflect.get(i,o,i);return typeof r!="function"?r:o!=="chart"?r.bind(i):(...s)=>{let a;try{a=r.apply(i,s)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>{let c=Xl(l);return e=c?{state:"resolved",guestsOnly:c}:{state:"resolved"},l},l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function Fo(n,e){if(!e||!n)return null;if(n.state==="resolved")return"chart_load:transform_failed";if(n.state!=="rejected")return null;let t=n.error;return t instanceof re?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var nc=new Set;function Bo(n){return nc.has(n.reason)||(nc.add(n.reason),typeof fetch>"u"||Ti())?!1:(fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:n.reason,eventKey:n.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function ls(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function nf(n){return ls(n.availability)?n.availability:null}function of(n){let e=n.subscribeTicket;if(!ls(e))return null;let t=e.ticket,i=e.protocols;return t!==void 0&&typeof t!="string"||i!==void 0&&(!Array.isArray(i)||i.some(o=>typeof o!="string"))||t===void 0&&i===void 0?null:{...t===void 0?{}:{ticket:t},...i===void 0?{}:{protocols:i}}}var ic=3e4,rf=2e4;function sf(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function af(n){return n>=400&&n<500&&n!==408&&n!==429}var Vo=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-ic>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-ic>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=new AbortController,o=setTimeout(()=>i.abort(),4e4);try{let r=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${en}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:i.signal}),s=await r.json().catch(()=>null);if(!r.ok){let a=r.status===429?Ei(r.headers.get("Retry-After"),s?.retryAfterSeconds):void 0,l=new re(r.status,s?.error??`request_failed_${r.status}`,s?.code??s?.error,void 0,void 0,a,void 0,{...typeof s?.hint=="string"&&s.hint?{hint:s.hint}:{},...typeof s?.message=="string"&&s.message?{serverMessage:s.message}:{}});throw af(r.status)&&(this.refusal=l),l}if(!sf(s))throw new re(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=s,this.fetchedAt=Date.now(),s}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.load(t);return{token:i.token,expiresAt:i.expiresAt}}};function lf(n,e){let t=n?.guestsOnlyForMs;return typeof t!="number"||!e?n:{...n,guestsOnlyForMs:Math.max(0,t-Math.max(0,Date.now()-e))}}var as=class extends Lt{constructor(t,i,o,r,s){super(t,{...s,access:r});this.event=i;this.loader=o;this.bootstrapAccess=r;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new re(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let i=this.loader.refused();if(i)throw i;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let i=await this.bundle(t);return this.initialChartDelivered=!0,{event:lf(i.event,this.loader.fetchedAt),doc:i.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let i=await this.bundle(t);return this.initialObjectsDelivered=!0,{...i.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,i=!1){if(this.assertEvent(t),i||this.initialAvailabilityDelivered)return super.availability(t,i);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,nf(o)??super.availability(t,i)}async pickerIdleMinutes(){let t=await this.bundle(this.event),i=ls(t.realtime)?t.realtime.idleMinutes:void 0;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let i=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<rf?of(i)??super.subscribeTicket(t):super.subscribeTicket(t)}},jn=new Map;function oc(n,e,t){return`${n}
271
+ </div>`;let o={};return i.querySelectorAll("[data-ref]").forEach(r=>{o[r.dataset.ref]=r}),{root:i,mapHost:o.map,els:o}}function Oo(n){let e=(t,i)=>{for(let o of n.querySelectorAll(`[${t}]`)){let r=o.getAttribute(t);if(!r)continue;let s=(0,Bn.t)(r);s!==r&&i(o,s)}};e("data-sl-t",(t,i)=>{t.textContent=i}),e("data-sl-a",(t,i)=>{t.setAttribute("aria-label",i)}),e("data-sl-ti",(t,i)=>{t.setAttribute("title",i)})}function _o(n,e){let t=(0,Ne.resolveLocale)(n),i=Ne.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Ne.setStringOverrides)(e),{locale:i,direction:(0,Ne.localeDirection)(i),ready:(0,Ne.loadLocale)(n)}}function No(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function tc(n,e){if(!n)return null;let t=(e.languages??[]).map(o=>(0,Ne.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=Ne.LOCALE_NAMES[o]??o,r.selected=o===(0,Ne.getLocale)(),i.appendChild(r)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function nc(n,e){e.root.lang=n,e.root.dir=(0,Ne.localeDirection)(n),Oo(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}function Vn(n,e,t,i=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let r=!1,s=d=>{r||(r=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>s({outcome:"cancelled"}),l=setTimeout(()=>{r||t()},8e3),c=setTimeout(()=>s({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>r?void 0:n()).then(d=>{r||s({outcome:"loaded",value:d})},d=>s({outcome:"error",error:d}))})}var we=class extends Error{constructor(e){super(`buyer_access_unavailable:${e.reason}`),this.name="BuyerAccessUnavailableError",this.reason=e.reason,this.code=e.code,this.status=e.status}},of=new Set(["buyer_access_expired"]),rf=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function sf(n,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return n===401?"invalid":null}function af(n){return/^Bearer\s+(\S+)$/i.exec(n?.trim()??"")?.[1]??null}function Fo(n){return n instanceof we?n.reason!=="paused"&&n.reason!=="channel_denied":!n||typeof n!="object"?!1:n.status===401}function lf(n,e){return n===401&&!!e&&of.has(e)}var cf=3e4,ze,je,ln,$n,Li,It,Ot,yt,zn,Hi,Ri,Ii,cn,Le,cs,Do,Rt,De=class{constructor(e){M(this,Le);M(this,ze,null);M(this,je,0);M(this,ln,null);M(this,$n);M(this,Li);M(this,It,null);M(this,Ot,null);M(this,yt,null);M(this,zn,null);M(this,Hi);M(this,Ri);M(this,Ii,!1);M(this,cn);if(x(this,$n,e.provider),x(this,Li,e.skewMs??cf),x(this,Hi,e.onExpired),x(this,Ri,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;w(this,Le,cs).call(this,t)}x(this,Ii,!!h(this,$n)||!!h(this,ze))}get configured(){return h(this,Ii)}onRenewed(e){x(this,cn,e)}get unavailable(){return h(this,yt)}get hasToken(){return!!h(this,ze)&&(h(this,je)===0||h(this,je)>Date.now())}get expiresAt(){return h(this,je)}async authorization(e="initial"){if(!this.configured)return null;if(h(this,yt))throw new we(h(this,yt));let t=Date.now();if(!h(this,ze)||h(this,je)>0&&h(this,je)-h(this,Li)<=t){let o=!!h(this,ze)&&h(this,je)>0&&h(this,je)<=t,r=h(this,ze)?o?"expired":"expiring":e,s=await w(this,Le,Do).call(this,r);if(!s)throw new we(h(this,yt)??h(this,zn)??w(this,Le,Rt).call(this,"provider_failed"));return`Bearer ${s}`}return`Bearer ${h(this,ze)}`}async handleFailure(e,t,i){var r;if(!this.configured)return!1;if(lf(e,t)){let s=af(i)??h(this,ln);x(this,ze,null),x(this,je,0);let a=await w(this,Le,Do).call(this,"unauthorized",t),l=!!a&&a!==s;return(r=h(this,Hi))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&w(this,Le,Rt).call(this,"revoked",t,e),l}let o=sf(e,t);return o&&w(this,Le,Rt).call(this,o,t,e),!1}async refresh(e="manual"){return x(this,yt,null),x(this,zn,null),x(this,ze,null),x(this,je,0),!!await w(this,Le,Do).call(this,e)}clear(){h(this,Ot)?.abort(),x(this,Ot,null),x(this,ze,null),x(this,ln,null),x(this,je,0),x(this,It,null),x(this,cn,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ze=new WeakMap,je=new WeakMap,ln=new WeakMap,$n=new WeakMap,Li=new WeakMap,It=new WeakMap,Ot=new WeakMap,yt=new WeakMap,zn=new WeakMap,Hi=new WeakMap,Ri=new WeakMap,Ii=new WeakMap,cn=new WeakMap,Le=new WeakSet,cs=function(e){return!e||typeof e.token!="string"||!e.token?null:(x(this,ln,e.token),x(this,ze,e.token),x(this,je,typeof e.expiresAt=="number"?e.expiresAt:0),h(this,ze))},Do=function(e,t){if(h(this,It))return h(this,It);let i=h(this,$n);if(!i)return w(this,Le,Rt).call(this,"no_token",t),Promise.resolve(null);let o=h(this,ln),r=new AbortController;x(this,Ot,r);let s=(async()=>{try{let a=await Vn(()=>Promise.resolve(i({reason:e})),r.signal,()=>{},4e4);if(r.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return w(this,Le,Rt).call(this,"provider_failed",t),null;let l=a.value,c=w(this,Le,cs).call(this,l);if(!c)return w(this,Le,Rt).call(this,"provider_failed",t),null;if(o&&o!==c&&h(this,cn))try{await h(this,cn).call(this,{previousToken:o,token:c,reason:e})}catch{}return r.signal.aborted?null:c}catch{return w(this,Le,Rt).call(this,"provider_failed",t),null}finally{h(this,Ot)===r&&(x(this,It,null),x(this,Ot,null))}})();return x(this,It,s),s},Rt=function(e,t,i){var r;let o={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return x(this,zn,o),rf.has(e)||(x(this,yt,o),x(this,ze,null),x(this,je,0)),(r=h(this,Ri))==null||r.call(this,o),o};function jn(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new De({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}function ic(n){let e=n?.event;if(e?.guestsOnly!==!0)return null;let t=e.guestsOnlyForMs;return{forMs:typeof t=="number"&&Number.isFinite(t)&&t>=0?t:null}}var df=2147483647,pf=1e3;function oc(n,e,t=typeof document>"u"?null:document){let i=e+pf,o=Date.now()+i,r=i<=df?setTimeout(l,i):null;function s(){r&&clearTimeout(r),t?.removeEventListener("visibilitychange",a)}function a(){t?.visibilityState==="visible"&&Date.now()>=o&&l()}function l(){s(),!(n.destroyed||!n.guestsOnly)&&(n.guestsOnly=!1,n.salesClosed=!!n.opts.readOnly||n.salesState==="paused"||n.salesState==="ended",n.applySalesClosed())}return t?.addEventListener("visibilitychange",a),s}function rc(n){let e=n?.code;return e==="guests_only"||e==="guest_choice_closed"?e:null}function Bo(){return{pill:v("picker.guestsOnlyPill","Invited guests only"),cta:v("picker.guestsOnlyPill","Invited guests only"),toast:v("picker.guestsOnlyToast","This event is for invited guests.")}}function sc(){return{heading:v("picker.guestsOnlyPill","Invited guests only"),sentence:v("picker.guestsOnlyCopy","Each guest chooses their seats from their own link.")}}function ac(){return v("picker.guestChoiceClosed","Seat choice isn\u2019t open right now.")}function lc(n){n.guestsOnly=!0;let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.controller.getSelection().filter(i=>!e.has(i.label)).map(i=>i.id);t.length&&n.controller.deselect(t),n.gaQty&&hf(n.gaQty,n.hold?.items??[])}function hf(n,e){let t=new Map;for(let i of e){if(i.objectType!=="ga"||!i.objectId)continue;let o=t.get(i.objectId)??new Map,r=i.tierId??null;o.set(r,(o.get(r)??0)+(i.quantity??1)),t.set(i.objectId,o)}for(let[i,o]of[...n]){for(let[r,s]of[...o]){let a=Math.min(s,t.get(i)?.get(r)??0);a>0?o.set(r,a):o.delete(r)}o.size||n.delete(i)}}function Vo(n){let e={state:"none"};return{transport:new Proxy(n,{get(i,o){let r=Reflect.get(i,o,i);return typeof r!="function"?r:o!=="chart"?r.bind(i):(...s)=>{let a;try{a=r.apply(i,s)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>{let c=ic(l);return e=c?{state:"resolved",guestsOnly:c}:{state:"resolved"},l},l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function $o(n,e){if(!e||!n)return null;if(n.state==="resolved")return"chart_load:transform_failed";if(n.state!=="rejected")return null;let t=n.error;return t instanceof re?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var cc=new Set;function zo(n){return cc.has(n.reason)||(cc.add(n.reason),typeof fetch>"u"||Ei())?!1:(fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:n.reason,eventKey:n.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function ps(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function uf(n){return ps(n.availability)?n.availability:null}function mf(n){let e=n.subscribeTicket;if(!ps(e))return null;let t=e.ticket,i=e.protocols;return t!==void 0&&typeof t!="string"||i!==void 0&&(!Array.isArray(i)||i.some(o=>typeof o!="string"))||t===void 0&&i===void 0?null:{...t===void 0?{}:{ticket:t},...i===void 0?{}:{protocols:i}}}var dc=3e4,ff=2e4;function gf(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function bf(n){return n>=400&&n<500&&n!==408&&n!==429}var yf=4e4,vf=[2e3,4e3,8e3],wf=.5,xf=10,kf=3e4;function Sf(n,e,t,i=Math.random){if(n instanceof TypeError||!Rn(n))return null;let o=vf[e];if(o===void 0)return null;let r=n.retryAfterS??0;if(r>xf)return null;let s=Math.round(Math.max(o,r*1e3)*(1+wf*i()));return t+s>kf?null:s}var jo=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-dc>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-dc>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=Date.now();for(let o=0;;o+=1)try{return await this.fetchOnce(i+yf)}catch(r){let s=Sf(r,o,Date.now()-i);if(s===null)throw r;await new Promise(a=>setTimeout(a,s))}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async fetchOnce(e){let t=new AbortController,i=setTimeout(()=>t.abort(),Math.max(0,e-Date.now()));try{let o=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${en}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:t.signal}),r=await o.json().catch(()=>null);if(!o.ok){let s=o.status===429||o.status===503?Ci(o.headers.get("Retry-After"),r?.retryAfterSeconds):void 0,a=new re(o.status,r?.error??`request_failed_${o.status}`,r?.code??r?.error,void 0,void 0,s,void 0,{...typeof r?.retryable=="boolean"?{retryable:r.retryable}:{},...typeof r?.hint=="string"&&r.hint?{hint:r.hint}:{},...typeof r?.message=="string"&&r.message?{serverMessage:r.message}:{}});throw bf(o.status)&&(this.refusal=a),a}if(!gf(r))throw new re(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,this.fetchedAt=Date.now(),r}finally{clearTimeout(i)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.load(t);return{token:i.token,expiresAt:i.expiresAt}}};function Tf(n,e){let t=n?.guestsOnlyForMs;return typeof t!="number"||!e?n:{...n,guestsOnlyForMs:Math.max(0,t-Math.max(0,Date.now()-e))}}var ds=class extends Lt{constructor(t,i,o,r,s){super(t,{...s,access:r});this.event=i;this.loader=o;this.bootstrapAccess=r;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new re(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let i=this.loader.refused();if(i)throw i;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let i=await this.bundle(t);return this.initialChartDelivered=!0,{event:Tf(i.event,this.loader.fetchedAt),doc:i.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let i=await this.bundle(t);return this.initialObjectsDelivered=!0,{...i.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,i=!1){if(this.assertEvent(t),i||this.initialAvailabilityDelivered)return super.availability(t,i);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,uf(o)??super.availability(t,i)}async pickerIdleMinutes(){let t=await this.bundle(this.event),i=ps(t.realtime)?t.realtime.idleMinutes:void 0;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let i=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<ff?mf(i)??super.subscribeTicket(t):super.subscribeTicket(t)}},Kn=new Map;function pc(n,e,t){return`${n}
272
272
  ${e}
273
- ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let o=oc(e,t,i);if(jn.get(o)?.usable())return;let s=new Vo(e,t,i);jn.set(o,s),s.load().catch(()=>{jn.get(o)===s&&jn.delete(o)})}function cf(n,e,t){let i=oc(n,e,t),o=jn.get(i);return o?(jn.delete(i),o.usable()?o:null):null}function $o(n){let e=cf(n.base,n.event,n.publicKey)??new Vo(n.base,n.event,n.publicKey),t=new De({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new as(n.base,n.event,e,t,n.apiOptions??{})}}var he=require("@seatlayer/core");var Pe={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var df=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${Pe.enter}ms;--sl-dur-exit:${Pe.exit}ms;--sl-dur-spring:${Pe.spring}ms;--sl-dur-flight:${Pe.flight}ms;--sl-dur-stagger:${Pe.stagger}ms;--sl-dur-xfade:${Pe.crossfade}ms;--sl-dur-collapse:${Pe.collapse}ms;--sl-dur-rung:${Pe.rung}ms;--sl-ease-enter:${Pe.easeEnter};--sl-ease-exit:${Pe.easeExit};--sl-ease-spring:${Pe.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,pf=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${Pe.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${Pe.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,sc=df+`
273
+ ${t}`}function hc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let o=pc(e,t,i);if(Kn.get(o)?.usable())return;let s=new jo(e,t,i);Kn.set(o,s),s.load().catch(()=>{Kn.get(o)===s&&Kn.delete(o)})}function Ef(n,e,t){let i=pc(n,e,t),o=Kn.get(i);return o?(Kn.delete(i),o.usable()?o:null):null}function Ko(n){let e=Ef(n.base,n.event,n.publicKey)??new jo(n.base,n.event,n.publicKey),t=new De({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new ds(n.base,n.event,e,t,n.apiOptions??{})}}var he=require("@seatlayer/core");var Me={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Cf=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${Me.enter}ms;--sl-dur-exit:${Me.exit}ms;--sl-dur-spring:${Me.spring}ms;--sl-dur-flight:${Me.flight}ms;--sl-dur-stagger:${Me.stagger}ms;--sl-dur-xfade:${Me.crossfade}ms;--sl-dur-collapse:${Me.collapse}ms;--sl-dur-rung:${Me.rung}ms;--sl-ease-enter:${Me.easeEnter};--sl-ease-exit:${Me.easeExit};--sl-ease-spring:${Me.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Af=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${Me.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${Me.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,uc=Cf+`
274
274
  /* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
275
275
  makes the card look attached to the seat rather than dropped on the map. */
276
276
  .sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
@@ -337,7 +337,7 @@ ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
337
337
  @keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
338
338
  .sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
339
339
  @keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
340
- `+pf;function zo(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function cs(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}jo(n,e,n.getBoundingClientRect())}function jo(n,e,t){let i=t.width||1,o=t.height||1,r=s=>Math.max(0,Math.min(100,s));n.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/o*100).toFixed(1)}%`)}function ac(n,e,t){let i=n.getBoundingClientRect(),o=t.getBoundingClientRect();jo(n,e,{left:i.left-o.left,top:i.top-o.top,width:i.width,height:i.height})}function lc(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&cs(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function cc(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Ko(n,e,t={className:"sl-mo-out",duration:Pe.exit}){let i=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(r),n.removeEventListener("animationend",i),e?e():n.remove()))},o=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let r=setTimeout(i,zo()?0:t.duration+60)}var tv={className:"sl-mo-slide-down",duration:Pe.exit};function dc(n){if(zo())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let o=window.setTimeout(i,Pe.flight+80);return e}var se=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Ii(n){let e=(0,he.t)("picker.maxTicketsForOrder",{count:n});return n===1?v("picker.maxOneTicketForOrder",e):e}function Un(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function pc(n){let e=new Map;for(let t of n.keys())e.set(t,Un(n,t));return e}function dn(n,e,t,i){let o=n.get(e)??new Map;i>0?o.set(t,i):o.delete(t),o.size?n.set(e,o):n.delete(e)}function hs(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function hc(n,e){let t=hs(e),i=[];for(let[o,r]of n){let s=t.get(o)??0;for(let[a,l]of r){let c=Math.max(0,l-s);s=Math.max(0,s-l),c>0&&i.push({areaId:o,tierId:a,qty:c})}}return i}function uc(n,e){let t=new Map;for(let i of e)i.objectType!=="ga"||!i.objectId||n.has(i.objectId)||dn(t,i.objectId,i.tierId??null,(t.get(i.objectId)?.get(i.tierId??null)??0)+(i.quantity??1));for(let[i,o]of t)n.set(i,o)}function yt(n,e){let t=hs(e),i=0;for(let o of n.keys())i+=Math.max(0,Un(n,o)-(t.get(o)??0));return i}function mc(n,e,t){let i=hs(t),o=0;for(let r of e){let s=n.gaQty.get(r.id);if(!s)continue;let a=i.get(r.id)??0;for(let[l,c]of s){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*n.paidPrice(r.categoryKey,l,hf(r,l),r.id)}}return o}function hf(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function fc(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let o=`${i.objectId}\0${i.tierId??""}`,r=t.get(o);if(r){r.quantity=(r.quantity??0)+(i.quantity??1),r.labels.push(i.label);continue}let s={...i,quantity:i.quantity??1,labels:[i.label]};t.set(o,s),e.push(s)}return e}function gc(n,e,t){let i=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&i.has(o.label)&&dn(n,o.objectId,o.tierId??null,0)}function Uo(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function uf(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function us(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??(0,he.t)("picker.generalAdmission"),price:n.price}]}function bc(n,e){let t=n.totalTicketCount()-Un(n.gaQty,e.id);return Math.max(0,Math.min(pn(n,e),n.maxTickets-t))}function pn(n,e){return ms(n)?Gn(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function Gn(n){if(n.bookingMode!=="whole"&&n.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(n.maxOccupancy??n.capacity)),t=n.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(n.minOccupancy??1)));return{mode:n.bookingMode,min:t,max:e}}function yc(n,e){return ms(n)&&e.available>0?n.tf("picker.noWheelchairSpace","No wheelchair space"):n.tf("picker.soldOutTitle","Sold out")}function ms(n){return n.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function mf(n){return`${(0,he.t)("picker.access.wheelchair")} \xB7 ${(0,he.tCount)("picker.leftCount",n.wheelchairAvailable??0)}`}function ff(n){let e=[];return n.wheelchairPlaces&&e.push({icon:"wheelchair",title:(0,he.t)("picker.access.wheelchair"),tone:"access",note:(0,he.tCount)("picker.leftCount",n.wheelchairAvailable??0)}),n.entrance&&e.push({icon:"entrance",title:(0,he.t)("picker.entrance"),note:n.entrance,tone:"place"}),ns(e,{compact:!0})}function vc(n,e){let t=Gn(n),i=us(n),o=pn({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},n),r=t?t.max:Math.max(0,Math.min(o,e.room));return{area:n,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:r,tiers:i,confirm:s=>{if(typeof s=="number"){e.hold(s,t&&i.length>1?i[0].id:null);return}if(t){let a=Object.entries(s).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(s).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function fs(n,e,t,i){if(at(n,!1),n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=Gn(e),r=us(e),s=n.gaQty.get(e.id),a=Un(n.gaQty,e.id)>0,l=bc(n,e);if((o?l<o.min:l<=0)&&!a){n.toast(pn(n,e)<=0||o&&pn(n,e)<o.min?yc(n,e):Ii(n.maxTickets),"warning");return}let c=o?[...s??[]].find(([,f])=>f>0)?.[0]??r[0].id:null;if(n.onGAPromptHook){let f={};for(let[T,C]of s??[])f[T??""]=C;if(n.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:f,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:r,confirm:T=>{vf(n,e,r,T,l,o)},cancel:()=>at(n)})===!0)return}let d=new Map;for(let f of r)d.set(f.id,s?.get(f.id)??0);!a&&l>0&&d.set(o?c:r[0].id,o?o.min:1);let p={area:e,tiers:r,draft:d,max:l,reopened:a,box:o,boxTier:c},m=n.root?.dataset.layout==="narrow",u=document.createElement("div");u.className=m?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",u.innerHTML=gf(n,p,m),n.root?.appendChild(u),n.gaPromptEl=u,n.gaPromptReturnFocus=i??document.activeElement,m||wf(n,u,t,i),n.reducedMotion()&&(u.dataset.motion="reduced"),ds(n,p),bf(n,u,p),requestAnimationFrame(()=>u.querySelector('[data-ga-step="1"]')?.focus())}function gf(n,e,t){let{area:i,tiers:o,box:r}=e,s=o.length>1,a=i.displayLabel??i.label,l=r&&s?So(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id))):"",c=r?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${se(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${se(n.tf("picker.numberOfGuests","Number of guests"))}</span>`+(r.mode==="variable"?`<small data-ga-range>${se((0,he.t)("picker.chooseMinMaxGuests",{min:r.min,max:r.max}))}</small>`:"")+"</div>"+(r.mode==="whole"?`<output data-ga-qty>${r.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${se(a)}"><button type="button" data-ga-step="-1" aria-label="${se(n.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${se(n.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${se(d.id??"")}"><div class="sl-ga-prompt-label"><span>${se(s?d.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${se(n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${se(s?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${se(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${se(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${se((0,he.t)("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${se(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${se(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${se((0,he.t)("common.close"))}">\xD7</button></div>`+ff(i)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||r?`<div class="sl-ga-prompt-total"><span>${se(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${se(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${se((0,he.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Go(n){let e=0;for(let t of n.draft.values())e+=t;return e}function wc(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function ds(n,e){let t=n.gaPromptEl;if(!t)return;let i=Go(e),o=wc(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,m=c.querySelector("[data-ga-qty]");m&&(m.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(u=>{u.disabled=Number(u.dataset.gaStep)<0?p<=(e.box?e.box.min:0):i>=(e.box?Math.min(e.box.max,e.max):e.max)})});let r=t.querySelector("[data-ga-sub]");if(r){let c=e.box&&e.tiers.find(p=>p.id===e.boxTier)||e.tiers[0],d=n.money(n.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));r.textContent=e.box?(0,he.t)("picker.perGuestPrice",{price:d}):`${d} \xB7 ${(0,he.tCount)("picker.leftCount",e.area.available)}`}let s=t.querySelector("[data-ga-total]");s&&(s.textContent=n.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":i>=e.max&&e.max>0?ms(n)&&e.area.wheelchairPlaces?mf(e.area):e.area.available<=e.max?(0,he.tCount)("picker.leftCount",e.area.available):Ii(n.maxTickets):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=(0,he.t)("picker.guestsCount",{count:i});l.textContent=e.reopened?(0,he.tCount)("picker.gaUpdate",i,{count:i}):e.box?.mode==="whole"?n.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${n.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${n.money(o)}`:(0,he.tCount)("picker.gaAdd",i,{count:i,price:n.money(o)}),l.disabled=(e.box?i<e.box.min:i<=0)&&!e.reopened}}function bf(n,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(i=>{i.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===i.dataset.confirmTier);if(!o||!t.box)return;let r=Go(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,r),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===i))});let s=e.querySelector("[data-ga-tier]");s&&(s.dataset.gaTier=o.id??""),ds(n,t)})}),e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest("[data-ga-tier]");if(!o)return;let r=o.dataset.gaTier?o.dataset.gaTier:null,s=Number(i.dataset.gaStep),a=t.draft.get(r)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-Go(t),c=t.box?t.box.min:0;t.draft.set(r,Math.max(c,a+(s>0?Math.min(1,l):-1))),ds(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>at(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),at(n),n.syncTray(),ps(n,(0,he.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{yf(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&at(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),at(n);return}if(i.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let r=o[0],s=o[o.length-1];i.shiftKey&&document.activeElement===r?(i.preventDefault(),s.focus()):!i.shiftKey&&document.activeElement===s&&(i.preventDefault(),r.focus())})}function yf(n,e){let t=Go(e),i=wc(n,e);for(let r of e.tiers)dn(n.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);at(n),n.syncTray();let o=e.area.displayLabel??e.area.label;t>0?ps(n,(0,he.tCount)("picker.gaAdded",t,{count:t,area:o,price:n.money(i)})):ps(n,(0,he.t)("picker.gaRemoved",{area:o}))}function vf(n,e,t,i,o,r=null){if(r){let s=typeof i=="number"?{tierId:t[0].id,wanted:i}:(()=>{let c=Object.entries(i).find(([,p])=>p>0);return{tierId:(t.find(p=>(p.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(s.wanted),l=a<=0?0:r.mode==="whole"?r.max:Math.max(r.min,Math.min(r.max,o,a));n.gaQty.delete(e.id),dn(n.gaQty,e.id,s.tierId,l<=o?l:0)}else if(typeof i=="number")dn(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(i))));else{n.gaQty.delete(e.id);let s=o;for(let a of t){let l=Math.max(0,Math.floor(i[a.id??""]??0)),c=Math.min(l,s);s-=c,dn(n.gaQty,e.id,a.id,c)}}n.syncTray()}function at(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&Ko(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function wf(n,e,t,i){let o=n.root,r=e.querySelector(".sl-ga-pop");if(!o||!r)return;if(!t){i&&o.contains(i)&&xf(o,r,i);return}let s=o.getBoundingClientRect(),a=t.x-s.left,l=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=r.offsetWidth||260,d=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-c-8,a-c/2)),m=l-d-14,u=m>=8?m:Math.min(s.height-d-8,l+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,u)}px`,r.dataset.side=m>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-p))}px`)})}var Kn=14;function xf(n,e,t){requestAnimationFrame(()=>{let i=n.getBoundingClientRect(),o=t.getBoundingClientRect(),r=e.offsetWidth||288,s=e.offsetHeight||220,a=o.left-i.left-Kn-8,l=i.right-o.right-Kn-8,c=a>=l?"left":"right";if(Math.max(a,l)<r){let u=o.left+o.width/2-i.left,f=o.top-i.top-s-Kn,b=f>=8?f:Math.min(i.height-s-8,o.bottom-i.top+Kn),T=Math.max(8,Math.min(i.width-r-8,u-r/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,b)}px`,e.dataset.side=f>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(r-12,u-T))}px`);return}let d=o.top+o.height/2-i.top,p=Math.max(8,Math.min(i.height-s-8,d-s/2)),m=c==="left"?o.left-i.left-Kn-r:o.right-i.left+Kn;e.style.left=`${m}px`,e.style.top=`${p}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(s-16,d-p))}px`)})}function ps(n,e){n.srEl&&(n.srEl.textContent=e)}function xc(n,e,t=[]){let i=[],o=uf(t);for(let s of e){let a=n.gaQty.get(s.id);if(!a)continue;let l=us(s);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${s.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(s.categoryKey,c.id,c.price,s.id),m=Gn(s);i.push(`<div class="sl-ga" data-ga="${se(s.id)}" data-ga-row-tier="${se(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${se(s.displayLabel??s.label)}</div><div class="sl-ga-sub">${se(m?[l.length>1?c.label:"",(0,he.t)("picker.perGuestPrice",{price:n.money(p)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:s.displayType??n.tf("picker.generalAdmission","General admission")} \xB7 ${n.money(p)} \xB7 ${(0,he.tCount)("picker.leftCount",s.available)}`)}</div></div>`+(m?`<button type="button" class="sl-table-edit" data-ga-open="${se(s.id)}">${se((0,he.t)("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${se(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${se(n.tf("picker.more","More"))}">+</button></div></div>`))}}let r=e.filter(s=>Un(n.gaQty,s.id)<=0&&!t.some(a=>a.objectId===s.id));return r.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${se(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${r.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.map(s=>`<button type="button" class="sl-ga-area-open" data-ga-open="${se(s.id)}"${pn(n,s)<=0?" disabled":""}><span class="name">${se(s.displayLabel??s.label)}<small>${se(s.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${se(pn(n,s)<=0?yc(n,s):`${n.money(n.paidPrice(s.categoryKey,null,s.price,s.id))} \xB7 ${Gn(s)?(0,he.t)("picker.capacityGuests",{count:Gn(s).max}):(0,he.tCount)("picker.leftCount",pn(n,s))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function kc(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest(".sl-ga");if(!o?.dataset.ga)return;let r=t.find(c=>c.id===o.dataset.ga);if(!r)return;let s=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(r.id)?.get(s)??0;if(a>0&&bc(n,r)-Un(n.gaQty,r.id)<=0){n.toast(Ii(n.maxTickets),"warning");return}dn(n.gaQty,r.id,s,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let o=t.find(r=>r.id===i.dataset.gaOpen);o&&fs(n,o,null,i)})})}var kf=/^[a-zA-Z0-9._-]+$/;function gs(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!i||!kf.test(o)?null:{eventKey:i,asset:o}}catch{return null}}function Sf(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var qn=class{constructor(e,t){this.eventKey=e;this.load=t;this.pending=new Map;this.created=new Set;this.disposed=!1}resolve(e){let t=gs(e);if(!t)return Promise.resolve(Sf(e)||!Rn(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let o=this.load(this.eventKey,t.asset).then(r=>{let s=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(s),null):(this.created.add(s),s)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Nt=require("@seatlayer/core"),Qo=require("@seatlayer/core/view3d/crossfade/panorama");var Sc=`
340
+ `+Af;function Go(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function hs(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}Uo(n,e,n.getBoundingClientRect())}function Uo(n,e,t){let i=t.width||1,o=t.height||1,r=s=>Math.max(0,Math.min(100,s));n.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/o*100).toFixed(1)}%`)}function mc(n,e,t){let i=n.getBoundingClientRect(),o=t.getBoundingClientRect();Uo(n,e,{left:i.left-o.left,top:i.top-o.top,width:i.width,height:i.height})}function fc(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&hs(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function gc(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function qo(n,e,t={className:"sl-mo-out",duration:Me.exit}){let i=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(r),n.removeEventListener("animationend",i),e?e():n.remove()))},o=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let r=setTimeout(i,Go()?0:t.duration+60)}var yv={className:"sl-mo-slide-down",duration:Me.exit};function bc(n){if(Go())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let o=window.setTimeout(i,Me.flight+80);return e}var se=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Oi(n){let e=(0,he.t)("picker.maxTicketsForOrder",{count:n});return n===1?v("picker.maxOneTicketForOrder",e):e}function qn(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function yc(n){let e=new Map;for(let t of n.keys())e.set(t,qn(n,t));return e}function dn(n,e,t,i){let o=n.get(e)??new Map;i>0?o.set(t,i):o.delete(t),o.size?n.set(e,o):n.delete(e)}function fs(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function vc(n,e){let t=fs(e),i=[];for(let[o,r]of n){let s=t.get(o)??0;for(let[a,l]of r){let c=Math.max(0,l-s);s=Math.max(0,s-l),c>0&&i.push({areaId:o,tierId:a,qty:c})}}return i}function wc(n,e){let t=new Map;for(let i of e)i.objectType!=="ga"||!i.objectId||n.has(i.objectId)||dn(t,i.objectId,i.tierId??null,(t.get(i.objectId)?.get(i.tierId??null)??0)+(i.quantity??1));for(let[i,o]of t)n.set(i,o)}function vt(n,e){let t=fs(e),i=0;for(let o of n.keys())i+=Math.max(0,qn(n,o)-(t.get(o)??0));return i}function xc(n,e,t){let i=fs(t),o=0;for(let r of e){let s=n.gaQty.get(r.id);if(!s)continue;let a=i.get(r.id)??0;for(let[l,c]of s){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*n.paidPrice(r.categoryKey,l,Pf(r,l),r.id)}}return o}function Pf(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function kc(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let o=`${i.objectId}\0${i.tierId??""}`,r=t.get(o);if(r){r.quantity=(r.quantity??0)+(i.quantity??1),r.labels.push(i.label);continue}let s={...i,quantity:i.quantity??1,labels:[i.label]};t.set(o,s),e.push(s)}return e}function Sc(n,e,t){let i=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&i.has(o.label)&&dn(n,o.objectId,o.tierId??null,0)}function Yo(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function Mf(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function gs(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??(0,he.t)("picker.generalAdmission"),price:n.price}]}function Tc(n,e){let t=n.totalTicketCount()-qn(n.gaQty,e.id);return Math.max(0,Math.min(pn(n,e),n.maxTickets-t))}function pn(n,e){return bs(n)?Un(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function Un(n){if(n.bookingMode!=="whole"&&n.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(n.maxOccupancy??n.capacity)),t=n.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(n.minOccupancy??1)));return{mode:n.bookingMode,min:t,max:e}}function Ec(n,e){return bs(n)&&e.available>0?n.tf("picker.noWheelchairSpace","No wheelchair space"):n.tf("picker.soldOutTitle","Sold out")}function bs(n){return n.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function Lf(n){return`${(0,he.t)("picker.access.wheelchair")} \xB7 ${(0,he.tCount)("picker.leftCount",n.wheelchairAvailable??0)}`}function Hf(n){let e=[];return n.wheelchairPlaces&&e.push({icon:"wheelchair",title:(0,he.t)("picker.access.wheelchair"),tone:"access",note:(0,he.tCount)("picker.leftCount",n.wheelchairAvailable??0)}),n.entrance&&e.push({icon:"entrance",title:(0,he.t)("picker.entrance"),note:n.entrance,tone:"place"}),rs(e,{compact:!0})}function Cc(n,e){let t=Un(n),i=gs(n),o=pn({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},n),r=t?t.max:Math.max(0,Math.min(o,e.room));return{area:n,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:r,tiers:i,confirm:s=>{if(typeof s=="number"){e.hold(s,t&&i.length>1?i[0].id:null);return}if(t){let a=Object.entries(s).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(s).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function ys(n,e,t,i){if(at(n,!1),n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=Un(e),r=gs(e),s=n.gaQty.get(e.id),a=qn(n.gaQty,e.id)>0,l=Tc(n,e);if((o?l<o.min:l<=0)&&!a){n.toast(pn(n,e)<=0||o&&pn(n,e)<o.min?Ec(n,e):Oi(n.maxTickets),"warning");return}let c=o?[...s??[]].find(([,f])=>f>0)?.[0]??r[0].id:null;if(n.onGAPromptHook){let f={};for(let[T,C]of s??[])f[T??""]=C;if(n.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:f,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:r,confirm:T=>{_f(n,e,r,T,l,o)},cancel:()=>at(n)})===!0)return}let d=new Map;for(let f of r)d.set(f.id,s?.get(f.id)??0);!a&&l>0&&d.set(o?c:r[0].id,o?o.min:1);let p={area:e,tiers:r,draft:d,max:l,reopened:a,box:o,boxTier:c},m=n.root?.dataset.layout==="narrow",u=document.createElement("div");u.className=m?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",u.innerHTML=Rf(n,p,m),n.root?.appendChild(u),n.gaPromptEl=u,n.gaPromptReturnFocus=i??document.activeElement,m||Nf(n,u,t,i),n.reducedMotion()&&(u.dataset.motion="reduced"),us(n,p),If(n,u,p),requestAnimationFrame(()=>u.querySelector('[data-ga-step="1"]')?.focus())}function Rf(n,e,t){let{area:i,tiers:o,box:r}=e,s=o.length>1,a=i.displayLabel??i.label,l=r&&s?Co(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id))):"",c=r?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${se(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${se(n.tf("picker.numberOfGuests","Number of guests"))}</span>`+(r.mode==="variable"?`<small data-ga-range>${se((0,he.t)("picker.chooseMinMaxGuests",{min:r.min,max:r.max}))}</small>`:"")+"</div>"+(r.mode==="whole"?`<output data-ga-qty>${r.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${se(a)}"><button type="button" data-ga-step="-1" aria-label="${se(n.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${se(n.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${se(d.id??"")}"><div class="sl-ga-prompt-label"><span>${se(s?d.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${se(n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${se(s?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${se(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${se(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${se((0,he.t)("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${se(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${se(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${se((0,he.t)("common.close"))}">\xD7</button></div>`+Hf(i)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||r?`<div class="sl-ga-prompt-total"><span>${se(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${se(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${se((0,he.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Wo(n){let e=0;for(let t of n.draft.values())e+=t;return e}function Ac(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function us(n,e){let t=n.gaPromptEl;if(!t)return;let i=Wo(e),o=Ac(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,m=c.querySelector("[data-ga-qty]");m&&(m.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(u=>{u.disabled=Number(u.dataset.gaStep)<0?p<=(e.box?e.box.min:0):i>=(e.box?Math.min(e.box.max,e.max):e.max)})});let r=t.querySelector("[data-ga-sub]");if(r){let c=e.box&&e.tiers.find(p=>p.id===e.boxTier)||e.tiers[0],d=n.money(n.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));r.textContent=e.box?(0,he.t)("picker.perGuestPrice",{price:d}):`${d} \xB7 ${(0,he.tCount)("picker.leftCount",e.area.available)}`}let s=t.querySelector("[data-ga-total]");s&&(s.textContent=n.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":i>=e.max&&e.max>0?bs(n)&&e.area.wheelchairPlaces?Lf(e.area):e.area.available<=e.max?(0,he.tCount)("picker.leftCount",e.area.available):Oi(n.maxTickets):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=(0,he.t)("picker.guestsCount",{count:i});l.textContent=e.reopened?(0,he.tCount)("picker.gaUpdate",i,{count:i}):e.box?.mode==="whole"?n.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${n.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${n.money(o)}`:(0,he.tCount)("picker.gaAdd",i,{count:i,price:n.money(o)}),l.disabled=(e.box?i<e.box.min:i<=0)&&!e.reopened}}function If(n,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(i=>{i.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===i.dataset.confirmTier);if(!o||!t.box)return;let r=Wo(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,r),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===i))});let s=e.querySelector("[data-ga-tier]");s&&(s.dataset.gaTier=o.id??""),us(n,t)})}),e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest("[data-ga-tier]");if(!o)return;let r=o.dataset.gaTier?o.dataset.gaTier:null,s=Number(i.dataset.gaStep),a=t.draft.get(r)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-Wo(t),c=t.box?t.box.min:0;t.draft.set(r,Math.max(c,a+(s>0?Math.min(1,l):-1))),us(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>at(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),at(n),n.syncTray(),ms(n,(0,he.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Of(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&at(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),at(n);return}if(i.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let r=o[0],s=o[o.length-1];i.shiftKey&&document.activeElement===r?(i.preventDefault(),s.focus()):!i.shiftKey&&document.activeElement===s&&(i.preventDefault(),r.focus())})}function Of(n,e){let t=Wo(e),i=Ac(n,e);for(let r of e.tiers)dn(n.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);at(n),n.syncTray();let o=e.area.displayLabel??e.area.label;t>0?ms(n,(0,he.tCount)("picker.gaAdded",t,{count:t,area:o,price:n.money(i)})):ms(n,(0,he.t)("picker.gaRemoved",{area:o}))}function _f(n,e,t,i,o,r=null){if(r){let s=typeof i=="number"?{tierId:t[0].id,wanted:i}:(()=>{let c=Object.entries(i).find(([,p])=>p>0);return{tierId:(t.find(p=>(p.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(s.wanted),l=a<=0?0:r.mode==="whole"?r.max:Math.max(r.min,Math.min(r.max,o,a));n.gaQty.delete(e.id),dn(n.gaQty,e.id,s.tierId,l<=o?l:0)}else if(typeof i=="number")dn(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(i))));else{n.gaQty.delete(e.id);let s=o;for(let a of t){let l=Math.max(0,Math.floor(i[a.id??""]??0)),c=Math.min(l,s);s-=c,dn(n.gaQty,e.id,a.id,c)}}n.syncTray()}function at(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&qo(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function Nf(n,e,t,i){let o=n.root,r=e.querySelector(".sl-ga-pop");if(!o||!r)return;if(!t){i&&o.contains(i)&&Df(o,r,i);return}let s=o.getBoundingClientRect(),a=t.x-s.left,l=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=r.offsetWidth||260,d=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-c-8,a-c/2)),m=l-d-14,u=m>=8?m:Math.min(s.height-d-8,l+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,u)}px`,r.dataset.side=m>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-p))}px`)})}var Gn=14;function Df(n,e,t){requestAnimationFrame(()=>{let i=n.getBoundingClientRect(),o=t.getBoundingClientRect(),r=e.offsetWidth||288,s=e.offsetHeight||220,a=o.left-i.left-Gn-8,l=i.right-o.right-Gn-8,c=a>=l?"left":"right";if(Math.max(a,l)<r){let u=o.left+o.width/2-i.left,f=o.top-i.top-s-Gn,b=f>=8?f:Math.min(i.height-s-8,o.bottom-i.top+Gn),T=Math.max(8,Math.min(i.width-r-8,u-r/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,b)}px`,e.dataset.side=f>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(r-12,u-T))}px`);return}let d=o.top+o.height/2-i.top,p=Math.max(8,Math.min(i.height-s-8,d-s/2)),m=c==="left"?o.left-i.left-Gn-r:o.right-i.left+Gn;e.style.left=`${m}px`,e.style.top=`${p}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(s-16,d-p))}px`)})}function ms(n,e){n.srEl&&(n.srEl.textContent=e)}function Pc(n,e,t=[]){let i=[],o=Mf(t);for(let s of e){let a=n.gaQty.get(s.id);if(!a)continue;let l=gs(s);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${s.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(s.categoryKey,c.id,c.price,s.id),m=Un(s);i.push(`<div class="sl-ga" data-ga="${se(s.id)}" data-ga-row-tier="${se(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${se(s.displayLabel??s.label)}</div><div class="sl-ga-sub">${se(m?[l.length>1?c.label:"",(0,he.t)("picker.perGuestPrice",{price:n.money(p)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:s.displayType??n.tf("picker.generalAdmission","General admission")} \xB7 ${n.money(p)} \xB7 ${(0,he.tCount)("picker.leftCount",s.available)}`)}</div></div>`+(m?`<button type="button" class="sl-table-edit" data-ga-open="${se(s.id)}">${se((0,he.t)("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${se(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${se(n.tf("picker.more","More"))}">+</button></div></div>`))}}let r=e.filter(s=>qn(n.gaQty,s.id)<=0&&!t.some(a=>a.objectId===s.id));return r.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${se(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${r.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.map(s=>`<button type="button" class="sl-ga-area-open" data-ga-open="${se(s.id)}"${pn(n,s)<=0?" disabled":""}><span class="name">${se(s.displayLabel??s.label)}<small>${se(s.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${se(pn(n,s)<=0?Ec(n,s):`${n.money(n.paidPrice(s.categoryKey,null,s.price,s.id))} \xB7 ${Un(s)?(0,he.t)("picker.capacityGuests",{count:Un(s).max}):(0,he.tCount)("picker.leftCount",pn(n,s))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Mc(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest(".sl-ga");if(!o?.dataset.ga)return;let r=t.find(c=>c.id===o.dataset.ga);if(!r)return;let s=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(r.id)?.get(s)??0;if(a>0&&Tc(n,r)-qn(n.gaQty,r.id)<=0){n.toast(Oi(n.maxTickets),"warning");return}dn(n.gaQty,r.id,s,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let o=t.find(r=>r.id===i.dataset.gaOpen);o&&ys(n,o,null,i)})})}var Ff=/^[a-zA-Z0-9._-]+$/;function vs(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!i||!Ff.test(o)?null:{eventKey:i,asset:o}}catch{return null}}function Bf(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Wn=class{constructor(e,t){this.eventKey=e;this.load=t;this.pending=new Map;this.created=new Set;this.disposed=!1}resolve(e){let t=vs(e);if(!t)return Promise.resolve(Bf(e)||!In(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let o=this.load(this.eventKey,t.asset).then(r=>{let s=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(s),null):(this.created.add(s),s)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Nt=require("@seatlayer/core"),er=require("@seatlayer/core/view3d/crossfade/panorama");var Lc=`
341
341
  /* confirm card: a candidate is not in the tray until Select. Map gestures and
342
342
  floating chrome pause while the card owns focus, keeping the camera stable. */
343
343
  .sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
@@ -720,7 +720,7 @@ ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
720
720
  color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
721
721
  .sl-confirm-view:hover{border-color:var(--sl-muted)}
722
722
  .sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
723
- `;var Tc=`
723
+ `;var Hc=`
724
724
  /* Test mode is environment context, not an action. The chip flows in the
725
725
  top-left anchor region: the old rotated corner ribbon sat at a negative
726
726
  offset and was clipped by the widget root's rounded overflow:hidden (its
@@ -984,7 +984,7 @@ ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
984
984
  .sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
985
985
  @media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
986
986
  @media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
987
- `;var Ec=`
987
+ `;var Rc=`
988
988
  /* \u2500\u2500 Selects \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
989
989
  /* One chevron for every select the panel owns: same glyph, same weight, same
990
990
  inset from the edge. The platform's own arrow is a different size, colour
@@ -1084,7 +1084,7 @@ ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1084
1084
  .sl-ba-qty button:active:not(:disabled),.sl-ga-qty button:active:not(:disabled),
1085
1085
  .sl-picker .sl-ba-go:active:not(:disabled){transform:none}
1086
1086
  }
1087
- `;var Cc=`
1087
+ `;var Ic=`
1088
1088
  /* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
1089
1089
  Carries its own gradient so it paints instantly before the scene builds, and
1090
1090
  cross-fades on enter/exit via a compositor-only opacity transition. Sits below
@@ -1453,7 +1453,7 @@ ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1453
1453
  .sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
1454
1454
  .sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
1455
1455
  }
1456
- `;var Ac=`
1456
+ `;var Oc=`
1457
1457
  .sl-notes{display:flex;flex-direction:column;gap:0;margin:0}
1458
1458
  /* No radius, no border, no inset: a band is the card's full width or it is a
1459
1459
  plate again. The hairline lives on the JOIN, so the first band sits flush
@@ -1488,7 +1488,7 @@ ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1488
1488
  .sl-notes.compact .sl-note{padding:7px 12px 7px 15px}
1489
1489
  .sl-notes.compact .sl-note-t b{font-size:11.5px;font-weight:750}
1490
1490
  .sl-notes.compact .sl-note-n{font-size:10.5px}
1491
- `;var Pc=`
1491
+ `;var _c=`
1492
1492
  /* The head is a bare 19.5px strip: the pill's upper half and nothing else. It
1493
1493
  used to reserve 26px (6px of ground above a 20px pill) and the sheet drew a
1494
1494
  border above that, so the chrome between the map and the cart was 33px of
@@ -1607,7 +1607,7 @@ ${t}`}function rc(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1607
1607
  above the line. The map now reaches the line, so the column keeps the same
1608
1608
  clearance from the pill's top rather than dropping onto the hairline. */
1609
1609
  .sl-picker[data-layout="narrow"] .sl-anchor[data-region="bottom-right"]{bottom:32px}
1610
- `;var Mc=`
1610
+ `;var Nc=`
1611
1611
  /* THE PHONE SHOWS THE DESKTOP CARD (owner call 2026-09-06: "cards should be
1612
1612
  the same design as desktop"). What used to be here was a second rendering of
1613
1613
  the cart \u2014 a bordered .sl-tlist box of 44px hairline-divided .sl-tline rows,
@@ -1815,13 +1815,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
1815
1815
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1816
1816
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1817
1817
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1818
- `;function bs(n){return n?[...n.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function Lc(n){return n.length?n.reduce((e,t)=>e+t.offsetWidth,0)+8*(n.length-1):0}function Tf({mapWidth:n,leftWidth:e,centerWidth:t,rightWidth:i}){if(n<=0)return!0;let o=i>0?i+8:0;if(o>n*.38)return!1;if(t<=0)return!0;let r=n/2,s=r-12-(e>0?Math.min(e,n*.38)+8:0),a=r-12-(o>0?o+8:0);return t/2<=Math.min(s,a)}function Hc(n,e,t){if(!n)return;if(n.dataset.layout==="narrow"){delete n.dataset.topbar;return}let i=bs(t["top-right"]),o={mapWidth:e.clientWidth,leftWidth:Lc(bs(t["top-left"])),centerWidth:Math.max(0,...bs(t["top-center"]).filter(s=>s.classList.contains("sl-rungs")).map(s=>s.offsetWidth)),rightWidth:Lc(i)};!Tf(o)?n.dataset.topbar="stacked":delete n.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(o.rightWidth+8)}px`)}var Rc=`
1818
+ `;function ws(n){return n?[...n.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function Dc(n){return n.length?n.reduce((e,t)=>e+t.offsetWidth,0)+8*(n.length-1):0}function Vf({mapWidth:n,leftWidth:e,centerWidth:t,rightWidth:i}){if(n<=0)return!0;let o=i>0?i+8:0;if(o>n*.38)return!1;if(t<=0)return!0;let r=n/2,s=r-12-(e>0?Math.min(e,n*.38)+8:0),a=r-12-(o>0?o+8:0);return t/2<=Math.min(s,a)}function Fc(n,e,t){if(!n)return;if(n.dataset.layout==="narrow"){delete n.dataset.topbar;return}let i=ws(t["top-right"]),o={mapWidth:e.clientWidth,leftWidth:Dc(ws(t["top-left"])),centerWidth:Math.max(0,...ws(t["top-center"]).filter(s=>s.classList.contains("sl-rungs")).map(s=>s.offsetWidth)),rightWidth:Dc(i)};!Vf(o)?n.dataset.topbar="stacked":delete n.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(o.rightWidth+8)}px`)}var Bc=`
1819
1819
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-right"]{flex-wrap:nowrap;max-width:none}
1820
1820
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-left"]{
1821
1821
  max-width:calc(100% - 32px - var(--sl-topright-w,160px))}
1822
1822
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-center"]{
1823
1823
  top:64px;max-width:calc(100% - 24px)}
1824
- `;var Ic="seatlayer-picker-style",Ef=`
1824
+ `;var Vc="seatlayer-picker-style",$f=`
1825
1825
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1826
1826
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1827
1827
  /* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
@@ -3514,7 +3514,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3514
3514
  Paint twelve pixels of the frame ground below its box to cover that seam;
3515
3515
  this does not enlarge the picker or move its checkout controls. */
3516
3516
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0;box-shadow:0 12px 0 var(--sl-bg)}}
3517
- `;function vt(){if(document.getElementById(Ic))return;let n=document.createElement("style");n.id=Ic,n.textContent=Ef+Pc+Ac+Sc+Mc+Ec+Cc+Rc+Tc+sc,document.head.appendChild(n)}async function qo(n,e){let t=n.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return n;let i=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let r=await e(o.contentImageUrl);if(!r){let{contentImageUrl:s,...a}=o;return a}return{...o,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...s}=o;return s}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function Wo(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var _t=require("@seatlayer/core/view/panoramaDelivery");function Yo(n){let{root:e,source:t,caption:i,real:o,closeLabel:r,dragHint:s,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,m=n.chrome??{},u=document.createElement("div");u.className="sl-view sl-mo-zoom",u.setAttribute("role","dialog"),u.setAttribute("aria-label",a),u.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let f=S=>u.querySelector(S)?.remove();m.title===!1?f(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,m.caption===!1?f(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",r),m.badge===!1?f(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=o?l:c,u.querySelector(".sl-view-hint").textContent=s,e.appendChild(u);let b=u.querySelector(".sl-view-pano"),T=(0,_t.planPanoramaDelivery)(t,(0,_t.browserPanoramaConstraints)()),C=new AbortController;b.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let k=()=>{};T.upgradeUrl&&(k=(0,_t.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(S=>!S||C.signal.aborted?null:(0,_t.loadPanoramaImage)(S,C.signal).then(()=>S)).then(S=>{!S||!u.isConnected||C.signal.aborted||(b.style.backgroundImage=`url(${JSON.stringify(S)})`)}).catch(()=>{})}));let E=70,L=35,Q=1,D=b.clientHeight||1,g=b.clientWidth||1,R=-(D*(180/E)*2/2-g/2),_=0,V=()=>{let S=b.clientHeight||1,P=S*(180/E)*Q,B=Math.max(0,P-S),ee=Math.min(B/2,L/180*P);_=Math.min(ee,Math.max(-ee,_)),b.style.backgroundSize=`auto ${P}px`,b.style.backgroundPosition=`${R}px ${_-B/2}px`};V();let z=!1,F=0,ne=0,J=S=>{z=!0,F=S.clientX,ne=S.clientY,b.classList.add("drag"),b.setPointerCapture?.(S.pointerId)},X=S=>{z&&(R+=S.clientX-F,_+=S.clientY-ne,F=S.clientX,ne=S.clientY,V())},xe=S=>{z=!1,b.classList.remove("drag"),b.releasePointerCapture?.(S.pointerId)},ge=S=>{S.preventDefault(),Q=Math.min(2.4,Math.max(1,Q+(S.deltaY<0?.12:-.12))),V()};b.addEventListener("pointerdown",J),b.addEventListener("pointermove",X),b.addEventListener("pointerup",xe),b.addEventListener("pointercancel",xe),b.addEventListener("wheel",ge,{passive:!1});let Ee=u.querySelector(".sl-view-x");Ee.addEventListener("click",p);let Ke=S=>{S.key==="Escape"&&(S.stopPropagation(),p())};return u.addEventListener("keydown",Ke),Ee.focus(),{element:u,dispose(){k(),C.abort(),b.removeEventListener("pointerdown",J),b.removeEventListener("pointermove",X),b.removeEventListener("pointerup",xe),b.removeEventListener("pointercancel",xe),b.removeEventListener("wheel",ge),u.removeEventListener("keydown",Ke),Ee.removeEventListener("click",p)}}}function Cf(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(r=>r.rowId===t.rowId),o=i.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:o>0?i[o-1].id:null,nextSeatId:o>=0&&o+1<i.length?i[o+1].id:null}}var Oc=6e4,Xo=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Cf(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!go()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),o=this.options.doc();if(!t||!i||!o)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,s,a,l=!1;if(t.viewUrl){let f=t.viewMeta?.previewUrl,b=!!f&&f!==t.viewUrl,T=b?await this.options.resolveAsset(f):null,C=b?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!C||b&&!T)return;s={url:C,...T?{previewUrl:T}:{},...b?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,Qo.seatViewDisclosure)(s),l=(0,Qo.isAuthoredSeatView)(s)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:f}=await yo();if(r!==this.seatViewGeneration)return;let b=o.floors?.find(k=>k.objects.some(E=>E.type==="row"&&E.id===t.rowId)),T=t.focalPoint??b?.focalPoint??o.focalPoint,C=f(t,T,[...this.options.seats()]);s={url:C.url,generated:!0},a=(0,Nt.t)("picker.illustrationCaption",{m:C.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,o),vt();let c=this.options.chrome??{},d=rn(),p=(0,Nt.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?(0,Nt.t)("picker.real360"):(0,Nt.t)("picker.preview"),u=Yo({root:i,source:s,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,Nt.t)("picker.real360"),previewLabel:(0,Nt.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=u.element,this.seatViewDispose=u.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:m,real:l,generated:!!s.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)),this.options.areaStates&&this.handle.setAreaStates&&mo(this,()=>{let e=this.options.areaStates?.();e&&this.handle?.setAreaStates?.(e)}))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(o=>o.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Oc/2:Oc}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");vt(),this.prepareHostTheme(t,i);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=v("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(r),t.appendChild(o),this.overlay=o;let s=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(s!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Ai(),this.options.loadEventConfiguration()]),c=l?await qo(l,this.options.resolveAsset):null,d=await Wo(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(s!==this.generation||this.overlay!==o)return;let p={doc:i,seats:[...this.options.seats()],...po(this.options.enable3DCrowd),crowdSeatCeiling:this.max3DSeats(),...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};r.textContent=(0,Nt.t)("picker.building3d");let m=await a.prepareVenue3D(p);if(s!==this.generation||this.overlay!==o)return;let u=this.options.chrome??{},f=a.mountVenue3D(o,{...p,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:rn(),navLabels:lo(),...co(this.options.touchNavigation3D),...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:b=>this.findSeat(b)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:b=>this.toggleSeat(b),onSeatInspect:b=>this.toggleSeat(b),onObjectPick:b=>{b.kind==="area"&&this.options.onAreaPick?.(b.id)},onViewTargetChange:b=>{this.targetSeatId_=b,b&&(this.focusedSectionId_=this.findSeat(b)?.sectionId??null),this.options.onViewChange("venue3d",b)},onSectionFocusChange:b=>{this.focusedSectionId_=b,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:b=>this.seatViewFor3D(b)}:{}});if(s!==this.generation||this.overlay!==o){f.dispose();return}this.handle=f,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(f),requestAnimationFrame(()=>r.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await f.flyToSeat(e)}catch(a){if(s!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&i&&o){o.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",r()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!o){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),this.applyNavigationMode(i),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await this.options.resolveAsset(i):null,s=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!s||o&&!r)throw new Error("seat_view_unavailable");return{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:v("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var ys=require("@seatlayer/core");function wt(n,e,t,i){let o=e?n?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}function Zo(n,e,t,i,o){let r=(0,ys.seatPriceFor)(n?.objects,e,i);return r!==void 0?r:(0,ys.seatPriceFor)(n?.seatPrices,e,i)!==void 0?o:wt(n?.prices,t,i,o)}function Jo(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Af(n){return Jo(n.foot?.querySelector(".sl-total"))??Jo(n.tray)??Jo(n.sheetHead)}function ws(n,e,t,i,o){let r=n,s=r.map;if(!s||!e){o?.();return}let a=s.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=i?.find(m=>m.key===t.categoryKey)?.color,p=()=>{let m=Af(r);if(!m){o?.();return}dc({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:d,onArrive:o})};r.sheetHead&&Jo(r.sheetHead)?requestAnimationFrame(p):p()}var vs=60,Pf=650;function _c(n,e){if(!e.length||n.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let i=e.filter(o=>o.sectionId===t);n.focus(t,{x:i.reduce((o,r)=>o+r.x,0)/i.length,y:i.reduce((o,r)=>o+r.y,0)/i.length})}function Nc(n,e){let t=!zo();_c({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,o)=>n.focusSection(i,o)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function Dc(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((s,a)=>{n.schedule(()=>n.pop(s.id),a*vs)});let i=t?0:e.length*vs,o=e.find(s=>s.sectionId)?.sectionId;if(n.schedule(()=>_c(n,e),i),t)return;let r=i+(n.focusSeats||o?Pf:0);e.forEach((s,a)=>{n.schedule(()=>ws(n.regions,n.screenPoint(s),s,n.categories),r+a*vs)})}function Mf(n,e,t){for(let i of n)if(e>=i.x&&t>=i.y&&e<=i.x+i.w&&t<=i.y+i.h)return!0;return!1}var er=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let i=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):i=!1;i&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(i=>this.touches.has(i.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let i=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);i&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let i=this.host.getBoundingClientRect();return Mf(this.rects,e-i.left,t-i.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Fc=.48,Lf=8;function Hf(n,e,t,i=Fc){let o=Math.max(0,t.top),r=e.height-Math.max(0,t.bottom);if(!(r>o))return 0;let s=Number.isFinite(i)?Math.min(1,Math.max(0,i)):Fc,a=o+(r-o)*s-n;return Math.abs(a)<=Lf?0:Math.round(a)}function Bc(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let o=n.seatPoint(e);if(!o)return{dy:0,gestures:i};let r=Hf(o.y,{height:n.mapHeight()},n.insets(),t.fraction);return r?{dy:n.panScreenBy({x:0,y:r},t.animate!==!1)?r:0,gestures:i}:{dy:0,gestures:i}}var Oi=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return Dn(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Lo(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var $c=require("@seatlayer/core"),zc=require("@seatlayer/core/core/seatConfidence");var Vc=require("@seatlayer/core");function Wn(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(gs(e)||Rn(e))?e:null}function nr(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var Rf=512,tr=new Map;function ir(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=tr.get(t);if(i!==void 0)return i;let o=null;try{o=(0,Vc.generateSeatThumb)(n,e).distanceM??null}catch{o=null}return tr.size>=Rf&&tr.clear(),tr.set(t,o),o}function _i(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function If(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function Of(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function _f(n,e,t,i){for(let o of e){if(o.count<=0)continue;let r=n.accessibilitySpread?.([o.key]);for(let s of r?.sections??[]){let a=t.get(s.id)??i.get(s.id);if(!a||s.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=s.free}}}function jc(n,e,t){let i=n.doc,o=i?.theme??{},r=n.categoryAvailability(),s=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=Of(c,l),p=e.seatPosition,m=p.targetSeatId?n.seatDetails(p.targetSeatId):null,u=new Map(l.map(k=>[k.id,k])),f=nr(i),b=i?.floors?.flatMap(k=>k.objects)??i?.objects??[],T=new Map,C=new Map;for(let k of b){if(k.type!=="section")continue;let E={id:k.id,label:k.label,...k.displayLabel?{displayLabel:k.displayLabel}:{},...k.zone?{zoneId:k.zone}:{}};T.set(k.id,E);let L=k.logicalSectionId??k.id;C.has(L)||C.set(L,E)}return _f(n,c,T,C),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,$c.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:s.length>0,tiers:!!i?.categories.some(k=>k.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(k=>!k.notForSale).map(k=>({key:k.key,label:k.label,color:k.color,price:wt(t.hostPrices_,k.key,null,k.price??k.tiers?.[0]?.price??0),available:r[k.key]??0,...Object.prototype.hasOwnProperty.call(r,k.key)?{free:r[k.key]}:{},tiers:(k.tiers??[]).map(E=>({id:E.id,name:E.name,price:wt(t.hostPrices_,k.key,E.id,E.price),...E.currency?{currency:E.currency}:{}}))})),zones:(i?.zones??[]).map(k=>({id:k.id,label:k.label,...k.color?{color:k.color}:{}})),sections:[...T.values()],gaAreas:s,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:_i(n)||t.focusedSection_!==null,...If(n),focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:m,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(k=>{let E=t.hostPrices_||t.hostObjects_?{...k,price:Zo({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:i?.seatPrices},k.label,k.categoryKey,k.tierId,k.price)}:k,L=u.get(E.id);if(!L)return E;let Q=n.worldToScreen({x:L.x,y:L.y}),D=Wn(L),g=f?ir(L,L.focalPoint??i?.focalPoint):null;return{...E,screenPoint:{x:Q.x,y:Q.y},...D?{seatViewThumb:{reference:D,kind:"real"}}:{},...g!=null?{sightlineMetres:g}:{},...L.confidenceEvidence?{seatViewConfidence:(0,zc.seatConfidenceDisclosure)(L.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Nf="https://api.seatlayer.io",Kc=10;function Df(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var or=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.paintedLocale=null;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Kc,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices,this.hostObjects_=e.pricing?.objects;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??Nf).replace(/\/+$/,"");this.apiBase=o;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?$o({base:o,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??zn(e,i);let s=r?.api??new Lt(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=s,this.chartFetch=Do(s),this.controller=new de.PickerController({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),seatPriceLabel:a=>this.hostSeatPriceLabel(a.label),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>this.areaClicked(a),onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??Oi.groundFor(e.theme?.mode)??null}),this.hostSurface=new Oi({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new qn(e.event,(a,l)=>s.asset(a,l)),this.immersive=new Xo({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,enable3DCrowd:e.enable3DCrowd,touchNavigation3D:e.touchNavigation3D,onAreaPick:a=>this.areaClicked(a),areaStates:()=>this.areaStates3d(),...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=_i(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=_i(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=_i(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Ro(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1;this.paintedLocale=(0,de.getLocale)(),this.mount=Df(this.opts.container);let o=document.createElement("div");o.style.width="100%",o.style.height="100%",o.style.position="relative",this.mount.appendChild(o),this.hostEl=o,this.blockedRegions?.attach(o),Io(o,t,s=>{s!==this.paintedLocale&&this.applyActiveLocale(s,i)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let r=await this.controller.render(o);if(!r){let s=Fo(this.chartFetch?.outcome(),this.renderErrorEmitted);return s&&Bo({apiBase:this.apiBase,eventKey:this.opts.event,reason:s}),rt({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:ht(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(o),this}if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(o),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let s=document.createElement("div");s.setAttribute("role","tooltip"),s.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',o.appendChild(s),this.tipEl=s,this.onTipMove=a=>{let l=o.getBoundingClientRect();this.tipPos={x:a.clientX-l.left,y:a.clientY-l.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},o.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){o.style.overflow="hidden";let s=document.createElement("div");s.dataset.slI18n="testMode",s.textContent=(0,de.t)("picker.testMode"),s.setAttribute("aria-label",(0,de.t)("picker.testMode")),s.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",o.appendChild(s)}return rt({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ro(this.opts.event),transport:"pubapi"}),this}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,o=this.tipPos.x+14,r=this.tipPos.y-i-12;o+t>e-8&&(o=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,de.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let s=document.createElement("span");s.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(r,s,a),this.tipEl.replaceChildren(i,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=(0,de.t)("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,de.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,de.t)("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=de.LOCALE_NAMES[o]??o,r.selected=o===(0,de.getLocale)(),i.appendChild(r)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=this.localeGeneration+=1,i=await(0,de.loadLocale)(e);return this.opts.messages&&(0,de.setStringOverrides)(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){this.paintedLocale=e,i.lang=e,i.dir=(0,de.localeDirection)(e);for(let o of i.querySelectorAll("[data-sl-i18n]"))o.dataset.slI18n==="testMode"&&(o.textContent=(0,de.t)("picker.testMode"),o.setAttribute("aria-label",(0,de.t)("picker.testMode")));Ho(i),this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy(),this.immersive?.pushLiveState()}}getMode(){return this.mode_}getPickerState(){return jc(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_,hostObjects_:this.hostObjects_})}getHostPrices(){return this.hostPrices_}getHostPricing(){return{prices:this.hostPrices_,objects:this.hostObjects_,seatPrices:this.controller.doc?.seatPrices}}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.immersive?.pushLiveState(),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.immersive?.pushLiveState(),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}areaStates3d(){let e=this.categoryFilter_,t=ho(this.controller);return uo(this.controller.gaStates(),i=>e!=null&&!e.includes(t.get(i)?.categoryKey??""),i=>t.get(i)?.wheelchairPlaces??0)}areaClicked(e){let t=this.controller.getGAAreas().find(i=>i.id===e);t&&(this.opts.onGAClick?.(t),this.opts.onGAPrompt?.(vc(t,{room:(this.opts.maxSelection??Kc)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(i,o)=>{this.holdGA(t.id,i,o?{tierId:o}:{})}})))}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,i={}){let o=await this.controller.holdGA(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,i={}){let o=Co(this.controller,t);if(o)throw o;let r=await this.controller.bestAvailable(e,t,i);return Nc(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,i){let o=await this.controller.replaceTableQuantity(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new er,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let i=this.controller.getRenderer();return Bc({seatPoint:o=>{let r=this.controller.getExpandedSeats().find(s=>s.id===o);return r?this.controller.worldToScreen({x:r.x,y:r.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(o,r)=>i?.panScreenBy?(i.panScreenBy(o,{animate:r}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0,i=e?.objects&&Object.keys(e.objects).length?e.objects:void 0;JSON.stringify([t??null,i??null])!==JSON.stringify([this.hostPrices_??null,this.hostObjects_??null])&&(this.hostPrices_=t,this.hostObjects_=i,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostSeatPriceLabel(e){let t=(0,de.seatPriceEntry)(this.hostObjects_,e);if(t===void 0)return;let i=typeof t=="number"?[t]:Object.values(t.tiers);if(!i.length)return;let o=this.eventInfo?.currency??this.opts.currency??"USD",r=Math.min(...i),s=Math.max(...i);return s>r?`${(0,de.formatMoney)(r,o)}\u2013${(0,de.formatMoney)(s,o)}`:(0,de.formatMoney)(r,o)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let i=t.tiers?.length?t.tiers.map(o=>wt(e,t.key,o.id,o.price)):t.price==null?[]:[wt(e,t.key,null,t.price)];return i.length?[[t.key,{min:Math.min(...i),max:Math.max(...i)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new st({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Hn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent=v("picker.mapDidNotLoad","The seat map didn\u2019t load"),i.dataset.slT="picker.mapDidNotLoad",t.appendChild(i);let o=document.createElement("button");o.type="button",o.textContent=v("picker.accessRetry","Try again"),o.dataset.slT="picker.accessRetry",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var xs=["hold","resumeHold","getCurrentHold","getGAAreas","holdGA","bestAvailable","release","releaseLabels","getSelection","selectObjects","deselectObjects","clearSelection","selectCategories","deselectCategories","setSelectableObjects","setMaxSelection","getSelectionValidity","setSeatTier","getFloors","setFloor","setColorblindSafe","zoomIn","zoomOut","zoomToFit","refreshAccess"],Ff={hold:()=>Promise.resolve(null),resumeHold:()=>Promise.resolve(null),getCurrentHold:()=>null,getGAAreas:()=>[],holdGA:()=>Promise.resolve(null),bestAvailable:()=>Promise.resolve(null),release:()=>Promise.resolve(),releaseLabels:()=>Promise.resolve(!1),getSelection:()=>[],selectObjects:()=>[],deselectObjects:()=>{},clearSelection:()=>{},selectCategories:()=>[],deselectCategories:()=>{},setSelectableObjects:()=>{},setMaxSelection:()=>{},getSelectionValidity:()=>null,setSeatTier:()=>{},getFloors:()=>[],setFloor:()=>{},setColorblindSafe:()=>{},zoomIn:()=>{},zoomOut:()=>{},zoomToFit:()=>{},refreshAccess:()=>Promise.resolve(!1)};function Gc(n){let e={};for(let t of xs)e[t]=(...i)=>{let o=n();return o?o[t](...i):Ff[t]()};return e}var ks=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Ss=[...ks,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Ts=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Uc(n,e,t){let i={container:n};for(let o of Ss)i[o]=e[o];for(let o of Ts)i[o]=t[o];return i}var Bf=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Vf=2e4,$f=0,zf=180*1e3,jf=900*1e3,Kf=.8,Gf=30*1e3,Uf=1e5,qf=4,Wf=50;function Es(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function Yf(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Xf={expired:{title:"This design session expired",body:"For your security, editing sessions are short-lived. Start a fresh one to keep designing."},mismatch:{title:"This editor doesn't match this chart",body:"The session that loaded belongs to a different chart or workspace. Reopen the designer to continue."},timeout:{title:"The designer is taking too long",body:"It did not finish loading in time. This is usually a slow connection \u2014 try again."},load:{title:"We couldn't load the designer",body:"Something went wrong while opening the editor. Please try again."}},rr=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!Bf.has(t.type))return;let i={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(o||i.chartId!==void 0),s=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(o||i.workspaceId!==void 0);if(r||s){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=Yf(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let i=Es(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let o=this.options.loadingTimeoutMs??Vf;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let s=i();t.style.setProperty("height",`${Uf}px`,"important");let a=i();return o?t.style.setProperty("height",o,r):t.style.removeProperty("height"),!(a-s>qf)&&s>=Wf?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??$f;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),r=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),s=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-r));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,o]of Object.entries(e))this.frame.style.setProperty(i,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=i=>{i.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let i=t<jf?t*Kf:t-zf,o=Math.max(Gf,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Es(this.options.container).style.position=this.restoreContainerPosition}catch{}this.restoreContainerPosition=null}}removeOverlay(){this.overlay?.remove(),this.overlay=null}showError(e){if(this.phase="error",this.clearTimeoutTimer(),!this.loadingStateEnabled())return;let t;try{t=Es(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,i??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3517
+ `;function wt(){if(document.getElementById(Vc))return;let n=document.createElement("style");n.id=Vc,n.textContent=$f+_c+Oc+Lc+Nc+Rc+Ic+Bc+Hc+uc,document.head.appendChild(n)}async function Xo(n,e){let t=n.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return n;let i=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let r=await e(o.contentImageUrl);if(!r){let{contentImageUrl:s,...a}=o;return a}return{...o,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...s}=o;return s}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function Qo(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var _t=require("@seatlayer/core/view/panoramaDelivery");function Zo(n){let{root:e,source:t,caption:i,real:o,closeLabel:r,dragHint:s,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,m=n.chrome??{},u=document.createElement("div");u.className="sl-view sl-mo-zoom",u.setAttribute("role","dialog"),u.setAttribute("aria-label",a),u.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let f=S=>u.querySelector(S)?.remove();m.title===!1?f(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,m.caption===!1?f(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",r),m.badge===!1?f(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=o?l:c,u.querySelector(".sl-view-hint").textContent=s,e.appendChild(u);let b=u.querySelector(".sl-view-pano"),T=(0,_t.planPanoramaDelivery)(t,(0,_t.browserPanoramaConstraints)()),C=new AbortController;b.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let k=()=>{};T.upgradeUrl&&(k=(0,_t.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(S=>!S||C.signal.aborted?null:(0,_t.loadPanoramaImage)(S,C.signal).then(()=>S)).then(S=>{!S||!u.isConnected||C.signal.aborted||(b.style.backgroundImage=`url(${JSON.stringify(S)})`)}).catch(()=>{})}));let E=70,L=35,Q=1,D=b.clientHeight||1,g=b.clientWidth||1,R=-(D*(180/E)*2/2-g/2),_=0,V=()=>{let S=b.clientHeight||1,P=S*(180/E)*Q,B=Math.max(0,P-S),ee=Math.min(B/2,L/180*P);_=Math.min(ee,Math.max(-ee,_)),b.style.backgroundSize=`auto ${P}px`,b.style.backgroundPosition=`${R}px ${_-B/2}px`};V();let z=!1,F=0,ne=0,J=S=>{z=!0,F=S.clientX,ne=S.clientY,b.classList.add("drag"),b.setPointerCapture?.(S.pointerId)},X=S=>{z&&(R+=S.clientX-F,_+=S.clientY-ne,F=S.clientX,ne=S.clientY,V())},xe=S=>{z=!1,b.classList.remove("drag"),b.releasePointerCapture?.(S.pointerId)},ge=S=>{S.preventDefault(),Q=Math.min(2.4,Math.max(1,Q+(S.deltaY<0?.12:-.12))),V()};b.addEventListener("pointerdown",J),b.addEventListener("pointermove",X),b.addEventListener("pointerup",xe),b.addEventListener("pointercancel",xe),b.addEventListener("wheel",ge,{passive:!1});let Ce=u.querySelector(".sl-view-x");Ce.addEventListener("click",p);let Ke=S=>{S.key==="Escape"&&(S.stopPropagation(),p())};return u.addEventListener("keydown",Ke),Ce.focus(),{element:u,dispose(){k(),C.abort(),b.removeEventListener("pointerdown",J),b.removeEventListener("pointermove",X),b.removeEventListener("pointerup",xe),b.removeEventListener("pointercancel",xe),b.removeEventListener("wheel",ge),u.removeEventListener("keydown",Ke),Ce.removeEventListener("click",p)}}}function zf(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(r=>r.rowId===t.rowId),o=i.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:o>0?i[o-1].id:null,nextSeatId:o>=0&&o+1<i.length?i[o+1].id:null}}var $c=6e4,Jo=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return zf(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!vo()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),o=this.options.doc();if(!t||!i||!o)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,s,a,l=!1;if(t.viewUrl){let f=t.viewMeta?.previewUrl,b=!!f&&f!==t.viewUrl,T=b?await this.options.resolveAsset(f):null,C=b?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!C||b&&!T)return;s={url:C,...T?{previewUrl:T}:{},...b?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,er.seatViewDisclosure)(s),l=(0,er.isAuthoredSeatView)(s)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:f}=await xo();if(r!==this.seatViewGeneration)return;let b=o.floors?.find(k=>k.objects.some(E=>E.type==="row"&&E.id===t.rowId)),T=t.focalPoint??b?.focalPoint??o.focalPoint,C=f(t,T,[...this.options.seats()]);s={url:C.url,generated:!0},a=(0,Nt.t)("picker.illustrationCaption",{m:C.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,o),wt();let c=this.options.chrome??{},d=rn(),p=(0,Nt.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?(0,Nt.t)("picker.real360"):(0,Nt.t)("picker.preview"),u=Zo({root:i,source:s,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,Nt.t)("picker.real360"),previewLabel:(0,Nt.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=u.element,this.seatViewDispose=u.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:m,real:l,generated:!!s.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)),this.options.areaStates&&this.handle.setAreaStates&&bo(this,()=>{let e=this.options.areaStates?.();e&&this.handle?.setAreaStates?.(e)}))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(o=>o.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?$c/2:$c}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");wt(),this.prepareHostTheme(t,i);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=v("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(r),t.appendChild(o),this.overlay=o;let s=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(s!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Pi(),this.options.loadEventConfiguration()]),c=l?await Xo(l,this.options.resolveAsset):null,d=await Qo(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(s!==this.generation||this.overlay!==o)return;let p={doc:i,seats:[...this.options.seats()],...mo(this.options.enable3DCrowd),crowdSeatCeiling:this.max3DSeats(),...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};r.textContent=(0,Nt.t)("picker.building3d");let m=await a.prepareVenue3D(p);if(s!==this.generation||this.overlay!==o)return;let u=this.options.chrome??{},f=a.mountVenue3D(o,{...p,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:rn(),navLabels:ho(),...uo(this.options.touchNavigation3D),...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:b=>this.findSeat(b)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:b=>this.toggleSeat(b),onSeatInspect:b=>this.toggleSeat(b),onObjectPick:b=>{b.kind==="area"&&this.options.onAreaPick?.(b.id)},onViewTargetChange:b=>{this.targetSeatId_=b,b&&(this.focusedSectionId_=this.findSeat(b)?.sectionId??null),this.options.onViewChange("venue3d",b)},onSectionFocusChange:b=>{this.focusedSectionId_=b,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:b=>this.seatViewFor3D(b)}:{}});if(s!==this.generation||this.overlay!==o){f.dispose();return}this.handle=f,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(f),requestAnimationFrame(()=>r.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await f.flyToSeat(e)}catch(a){if(s!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&i&&o){o.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",r()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!o){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),this.applyNavigationMode(i),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await this.options.resolveAsset(i):null,s=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!s||o&&!r)throw new Error("seat_view_unavailable");return{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:v("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var xs=require("@seatlayer/core");function xt(n,e,t,i){let o=e?n?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}function tr(n,e,t,i,o){let r=(0,xs.seatPriceFor)(n?.objects,e,i);return r!==void 0?r:(0,xs.seatPriceFor)(n?.seatPrices,e,i)!==void 0?o:xt(n?.prices,t,i,o)}function nr(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function jf(n){return nr(n.foot?.querySelector(".sl-total"))??nr(n.tray)??nr(n.sheetHead)}function Ss(n,e,t,i,o){let r=n,s=r.map;if(!s||!e){o?.();return}let a=s.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=i?.find(m=>m.key===t.categoryKey)?.color,p=()=>{let m=jf(r);if(!m){o?.();return}bc({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:d,onArrive:o})};r.sheetHead&&nr(r.sheetHead)?requestAnimationFrame(p):p()}var ks=60,Kf=650;function zc(n,e){if(!e.length||n.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let i=e.filter(o=>o.sectionId===t);n.focus(t,{x:i.reduce((o,r)=>o+r.x,0)/i.length,y:i.reduce((o,r)=>o+r.y,0)/i.length})}function jc(n,e){let t=!Go();zc({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,o)=>n.focusSection(i,o)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function Kc(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((s,a)=>{n.schedule(()=>n.pop(s.id),a*ks)});let i=t?0:e.length*ks,o=e.find(s=>s.sectionId)?.sectionId;if(n.schedule(()=>zc(n,e),i),t)return;let r=i+(n.focusSeats||o?Kf:0);e.forEach((s,a)=>{n.schedule(()=>Ss(n.regions,n.screenPoint(s),s,n.categories),r+a*ks)})}function Gf(n,e,t){for(let i of n)if(e>=i.x&&t>=i.y&&e<=i.x+i.w&&t<=i.y+i.h)return!0;return!1}var ir=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let i=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):i=!1;i&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(i=>this.touches.has(i.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let i=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);i&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let i=this.host.getBoundingClientRect();return Gf(this.rects,e-i.left,t-i.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Gc=.48,Uf=8;function qf(n,e,t,i=Gc){let o=Math.max(0,t.top),r=e.height-Math.max(0,t.bottom);if(!(r>o))return 0;let s=Number.isFinite(i)?Math.min(1,Math.max(0,i)):Gc,a=o+(r-o)*s-n;return Math.abs(a)<=Uf?0:Math.round(a)}function Uc(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let o=n.seatPoint(e);if(!o)return{dy:0,gestures:i};let r=qf(o.y,{height:n.mapHeight()},n.insets(),t.fraction);return r?{dy:n.panScreenBy({x:0,y:r},t.animate!==!1)?r:0,gestures:i}:{dy:0,gestures:i}}var _i=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return Fn(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Io(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var Wc=require("@seatlayer/core"),Yc=require("@seatlayer/core/core/seatConfidence");var qc=require("@seatlayer/core");function Yn(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(vs(e)||In(e))?e:null}function rr(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var Wf=512,or=new Map;function sr(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=or.get(t);if(i!==void 0)return i;let o=null;try{o=(0,qc.generateSeatThumb)(n,e).distanceM??null}catch{o=null}return or.size>=Wf&&or.clear(),or.set(t,o),o}function Ni(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function Yf(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function Xf(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Qf(n,e,t,i){for(let o of e){if(o.count<=0)continue;let r=n.accessibilitySpread?.([o.key]);for(let s of r?.sections??[]){let a=t.get(s.id)??i.get(s.id);if(!a||s.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=s.free}}}function Xc(n,e,t){let i=n.doc,o=i?.theme??{},r=n.categoryAvailability(),s=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=Xf(c,l),p=e.seatPosition,m=p.targetSeatId?n.seatDetails(p.targetSeatId):null,u=new Map(l.map(k=>[k.id,k])),f=rr(i),b=i?.floors?.flatMap(k=>k.objects)??i?.objects??[],T=new Map,C=new Map;for(let k of b){if(k.type!=="section")continue;let E={id:k.id,label:k.label,...k.displayLabel?{displayLabel:k.displayLabel}:{},...k.zone?{zoneId:k.zone}:{}};T.set(k.id,E);let L=k.logicalSectionId??k.id;C.has(L)||C.set(L,E)}return Qf(n,c,T,C),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,Wc.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:s.length>0,tiers:!!i?.categories.some(k=>k.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(k=>!k.notForSale).map(k=>({key:k.key,label:k.label,color:k.color,price:xt(t.hostPrices_,k.key,null,k.price??k.tiers?.[0]?.price??0),available:r[k.key]??0,...Object.prototype.hasOwnProperty.call(r,k.key)?{free:r[k.key]}:{},tiers:(k.tiers??[]).map(E=>({id:E.id,name:E.name,price:xt(t.hostPrices_,k.key,E.id,E.price),...E.currency?{currency:E.currency}:{}}))})),zones:(i?.zones??[]).map(k=>({id:k.id,label:k.label,...k.color?{color:k.color}:{}})),sections:[...T.values()],gaAreas:s,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:Ni(n)||t.focusedSection_!==null,...Yf(n),focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:m,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(k=>{let E=t.hostPrices_||t.hostObjects_?{...k,price:tr({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:i?.seatPrices},k.label,k.categoryKey,k.tierId,k.price)}:k,L=u.get(E.id);if(!L)return E;let Q=n.worldToScreen({x:L.x,y:L.y}),D=Yn(L),g=f?sr(L,L.focalPoint??i?.focalPoint):null;return{...E,screenPoint:{x:Q.x,y:Q.y},...D?{seatViewThumb:{reference:D,kind:"real"}}:{},...g!=null?{sightlineMetres:g}:{},...L.confidenceEvidence?{seatViewConfidence:(0,Yc.seatConfidenceDisclosure)(L.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Zf="https://api.seatlayer.io",Qc=10;function Jf(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var ar=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.paintedLocale=null;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Qc,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices,this.hostObjects_=e.pricing?.objects;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??Zf).replace(/\/+$/,"");this.apiBase=o;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Ko({base:o,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??jn(e,i);let s=r?.api??new Lt(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=s,this.chartFetch=Vo(s),this.controller=new de.PickerController({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),seatPriceLabel:a=>this.hostSeatPriceLabel(a.label),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>this.areaClicked(a),onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??_i.groundFor(e.theme?.mode)??null}),this.hostSurface=new _i({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new Wn(e.event,(a,l)=>s.asset(a,l)),this.immersive=new Jo({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,enable3DCrowd:e.enable3DCrowd,touchNavigation3D:e.touchNavigation3D,onAreaPick:a=>this.areaClicked(a),areaStates:()=>this.areaStates3d(),...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Ni(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Ni(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Ni(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=_o(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1;this.paintedLocale=(0,de.getLocale)(),this.mount=Jf(this.opts.container);let o=document.createElement("div");o.style.width="100%",o.style.height="100%",o.style.position="relative",this.mount.appendChild(o),this.hostEl=o,this.blockedRegions?.attach(o),No(o,t,s=>{s!==this.paintedLocale&&this.applyActiveLocale(s,i)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let r=await this.controller.render(o);if(!r){let s=$o(this.chartFetch?.outcome(),this.renderErrorEmitted);return s&&zo({apiBase:this.apiBase,eventKey:this.opts.event,reason:s}),rt({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:ut(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(o),this}if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(o),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let s=document.createElement("div");s.setAttribute("role","tooltip"),s.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',o.appendChild(s),this.tipEl=s,this.onTipMove=a=>{let l=o.getBoundingClientRect();this.tipPos={x:a.clientX-l.left,y:a.clientY-l.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},o.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){o.style.overflow="hidden";let s=document.createElement("div");s.dataset.slI18n="testMode",s.textContent=(0,de.t)("picker.testMode"),s.setAttribute("aria-label",(0,de.t)("picker.testMode")),s.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",o.appendChild(s)}return rt({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:so(this.opts.event),transport:"pubapi"}),this}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,o=this.tipPos.x+14,r=this.tipPos.y-i-12;o+t>e-8&&(o=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,de.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let s=document.createElement("span");s.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(r,s,a),this.tipEl.replaceChildren(i,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=(0,de.t)("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,de.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,de.t)("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=de.LOCALE_NAMES[o]??o,r.selected=o===(0,de.getLocale)(),i.appendChild(r)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=this.localeGeneration+=1,i=await(0,de.loadLocale)(e);return this.opts.messages&&(0,de.setStringOverrides)(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){this.paintedLocale=e,i.lang=e,i.dir=(0,de.localeDirection)(e);for(let o of i.querySelectorAll("[data-sl-i18n]"))o.dataset.slI18n==="testMode"&&(o.textContent=(0,de.t)("picker.testMode"),o.setAttribute("aria-label",(0,de.t)("picker.testMode")));Oo(i),this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy(),this.immersive?.pushLiveState()}}getMode(){return this.mode_}getPickerState(){return Xc(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_,hostObjects_:this.hostObjects_})}getHostPrices(){return this.hostPrices_}getHostPricing(){return{prices:this.hostPrices_,objects:this.hostObjects_,seatPrices:this.controller.doc?.seatPrices}}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.immersive?.pushLiveState(),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.immersive?.pushLiveState(),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}areaStates3d(){let e=this.categoryFilter_,t=fo(this.controller);return go(this.controller.gaStates(),i=>e!=null&&!e.includes(t.get(i)?.categoryKey??""),i=>t.get(i)?.wheelchairPlaces??0)}areaClicked(e){let t=this.controller.getGAAreas().find(i=>i.id===e);t&&(this.opts.onGAClick?.(t),this.opts.onGAPrompt?.(Cc(t,{room:(this.opts.maxSelection??Qc)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(i,o)=>{this.holdGA(t.id,i,o?{tierId:o}:{})}})))}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,i={}){let o=await this.controller.holdGA(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,i={}){let o=Mo(this.controller,t);if(o)throw o;let r=await this.controller.bestAvailable(e,t,i);return jc(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,i){let o=await this.controller.replaceTableQuantity(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new ir,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let i=this.controller.getRenderer();return Uc({seatPoint:o=>{let r=this.controller.getExpandedSeats().find(s=>s.id===o);return r?this.controller.worldToScreen({x:r.x,y:r.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(o,r)=>i?.panScreenBy?(i.panScreenBy(o,{animate:r}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0,i=e?.objects&&Object.keys(e.objects).length?e.objects:void 0;JSON.stringify([t??null,i??null])!==JSON.stringify([this.hostPrices_??null,this.hostObjects_??null])&&(this.hostPrices_=t,this.hostObjects_=i,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostSeatPriceLabel(e){let t=(0,de.seatPriceEntry)(this.hostObjects_,e);if(t===void 0)return;let i=typeof t=="number"?[t]:Object.values(t.tiers);if(!i.length)return;let o=this.eventInfo?.currency??this.opts.currency??"USD",r=Math.min(...i),s=Math.max(...i);return s>r?`${(0,de.formatMoney)(r,o)}\u2013${(0,de.formatMoney)(s,o)}`:(0,de.formatMoney)(r,o)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let i=t.tiers?.length?t.tiers.map(o=>xt(e,t.key,o.id,o.price)):t.price==null?[]:[xt(e,t.key,null,t.price)];return i.length?[[t.key,{min:Math.min(...i),max:Math.max(...i)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new st({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Hn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent=v("picker.mapDidNotLoad","The seat map didn\u2019t load"),i.dataset.slT="picker.mapDidNotLoad",t.appendChild(i);let o=document.createElement("button");o.type="button",o.textContent=v("picker.accessRetry","Try again"),o.dataset.slT="picker.accessRetry",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var Ts=["hold","resumeHold","getCurrentHold","getGAAreas","holdGA","bestAvailable","release","releaseLabels","getSelection","selectObjects","deselectObjects","clearSelection","selectCategories","deselectCategories","setSelectableObjects","setMaxSelection","getSelectionValidity","setSeatTier","getFloors","setFloor","setColorblindSafe","zoomIn","zoomOut","zoomToFit","refreshAccess"],eg={hold:()=>Promise.resolve(null),resumeHold:()=>Promise.resolve(null),getCurrentHold:()=>null,getGAAreas:()=>[],holdGA:()=>Promise.resolve(null),bestAvailable:()=>Promise.resolve(null),release:()=>Promise.resolve(),releaseLabels:()=>Promise.resolve(!1),getSelection:()=>[],selectObjects:()=>[],deselectObjects:()=>{},clearSelection:()=>{},selectCategories:()=>[],deselectCategories:()=>{},setSelectableObjects:()=>{},setMaxSelection:()=>{},getSelectionValidity:()=>null,setSeatTier:()=>{},getFloors:()=>[],setFloor:()=>{},setColorblindSafe:()=>{},zoomIn:()=>{},zoomOut:()=>{},zoomToFit:()=>{},refreshAccess:()=>Promise.resolve(!1)};function Zc(n){let e={};for(let t of Ts)e[t]=(...i)=>{let o=n();return o?o[t](...i):eg[t]()};return e}var Es=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay","enable3D","enable3DCrowd","touchNavigation3D"],Cs=[...Es,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],As=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Jc(n,e,t){let i={container:n};for(let o of Cs)i[o]=e[o];for(let o of As)i[o]=t[o];return i}var tg=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),ng=2e4,ig=0,og=180*1e3,rg=900*1e3,sg=.8,ag=30*1e3,lg=1e5,cg=4,dg=50;function Ps(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function pg(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var hg={expired:{title:"This design session expired",body:"For your security, editing sessions are short-lived. Start a fresh one to keep designing."},mismatch:{title:"This editor doesn't match this chart",body:"The session that loaded belongs to a different chart or workspace. Reopen the designer to continue."},timeout:{title:"The designer is taking too long",body:"It did not finish loading in time. This is usually a slow connection \u2014 try again."},load:{title:"We couldn't load the designer",body:"Something went wrong while opening the editor. Please try again."}},lr=class{constructor(e){this.frame=null;this.designerOrigin="";this.overlay=null;this.timeoutTimer=null;this.renewTimer=null;this.autoRecoverUsed=!1;this.phase="loading";this.identityEstablished=!1;this.restoreContainerPosition=null;this.pinned=!1;this.frameStyleBeforeFs=null;this.docOverflowBeforeFs=null;this.bodyOverflowBeforeFs=null;this.fsKeyHandler=null;this.lastAutoHeight="";this.fillRaf=null;this.reprobeRaf=null;this.fillListening=!1;this.containerEl=null;this.fillMode=null;this.resizeObs=null;this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))};this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))};this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!tg.has(t.type))return;let i={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(o||i.chartId!==void 0),s=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(o||i.workspaceId!==void 0);if(r||s){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=pg(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let i=Ps(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let o=this.options.loadingTimeoutMs??ng;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let s=i();t.style.setProperty("height",`${lg}px`,"important");let a=i();return o?t.style.setProperty("height",o,r):t.style.removeProperty("height"),!(a-s>cg)&&s>=dg?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??ig;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),r=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),s=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-r));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,o]of Object.entries(e))this.frame.style.setProperty(i,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=i=>{i.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let i=t<rg?t*sg:t-og,o=Math.max(ag,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Ps(this.options.container).style.position=this.restoreContainerPosition}catch{}this.restoreContainerPosition=null}}removeOverlay(){this.overlay?.remove(),this.overlay=null}showError(e){if(this.phase="error",this.clearTimeoutTimer(),!this.loadingStateEnabled())return;let t;try{t=Ps(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,i??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3518
3518
  [data-seatlayer-designer-overlay="loading"]{container-type:inline-size}
3519
3519
  .sl-designer-skeleton{position:absolute;inset:0;display:flex;flex-direction:column;pointer-events:none}
3520
3520
  .sl-designer-skeleton *{box-sizing:border-box}
@@ -3536,8 +3536,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3536
3536
  <div class="sl-designer-skeleton-rail" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></div>
3537
3537
  <div class="sl-designer-skeleton-canvas"><div class="sl-designer-skeleton-caption"><span class="sl-designer-skeleton-spinner" aria-hidden="true"></span><span>Loading designer\u2026<small>Preparing your floor plan</small></span></div></div>
3538
3538
  <div class="sl-designer-skeleton-inspector" aria-hidden="true"><div class="sl-designer-skeleton-bar"></div></div>
3539
- </div>`,e.append(i)}buildErrorCard(e,t){let i=Xf[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let r=document.createElement("h2");r.textContent=i.title,Object.assign(r.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let s=document.createElement("p");s.textContent=i.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(r,s,a),e.append(o)}};function Yn(n,e){let t=(a,[l,c])=>{a.textContent=v(l,c??l),a.dataset.slT=l},i=document.createElement("div");i.className="sl-loading-state";let o=document.createElement("div");if(o.setAttribute("role",e.busy?"status":"alert"),o.setAttribute("aria-atomic","true"),e.busy){let a=document.createElement("div");a.className="sl-boot-spin",a.setAttribute("aria-hidden","true"),i.append(a)}let r=document.createElement("div");if(r.className="sl-boot-title",t(r,e.title),o.append(r),e.description){let a=document.createElement("p");a.className="sl-loading-description",t(a,e.description),o.append(a)}i.append(o);let s=null;return e.action&&(s=document.createElement("button"),s.type="button",s.className="sl-boot-retry",t(s,e.action),i.append(s)),n.replaceChildren(i),s}function Qf(n){let{viewportWidth:e,viewportHeight:t,offsetTop:i,offsetLeft:o,clientWidth:r,clientHeight:s,innerHeight:a,largeViewportHeight:l}=n;if(![e,t,i,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(r)&&r>0?r:e,d=Number.isFinite(s)&&s>0?s:t,p=i;return Number.isFinite(l)&&a>l+1&&d<l-1&&(p=Math.max(p,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:p,left:o}}function qc(n){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let i=()=>{let c=Qf({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(n.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,r=0,s=0,a=()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),o=window.requestAnimationFrame(()=>{o=0,r=window.requestAnimationFrame(()=>{r=0,i()})}),s=window.setTimeout(()=>{s=0,i()},250)},l=()=>{i(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}var Zf=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function sr(n,e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",e),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",n),o.tabIndex=-1,i.appendChild(o),document.body.appendChild(i);let r=document.body.style.overflow;document.body.style.overflow="hidden";let s=qc(i),a=()=>{let u=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(f=>f.isConnected&&!f.closest('[hidden], [aria-hidden="true"], [inert]'));return u[u.length-1]??o},l=(u,f)=>{let b=u;for(;b;){let T=window.getComputedStyle(b);if(b.hidden||b.getAttribute("aria-hidden")==="true"||b.hasAttribute("inert")||T.display==="none"||T.visibility==="hidden"||T.visibility==="collapse")return!0;if(b===f)return!1;b=b.parentElement}return!0},c=u=>[...u.querySelectorAll(Zf)].filter(f=>f.tabIndex>=0&&!f.matches(":disabled")&&!l(f,u)),d=(u,f)=>{let b=c(u),T=f?b[b.length-1]:b[0];T?T.focus({preventScroll:!0}):(u.hasAttribute("tabindex")||(u.tabIndex=-1),u.focus({preventScroll:!0}))},p=null,m=!0;return{scrim:i,frame:o,trapKeys(u){let f=b=>{if(b.key==="Tab"){if(b.defaultPrevented)return;let T=a(),C=c(T),k=C[0],E=C[C.length-1],L=document.activeElement;!k||!E?(b.preventDefault(),d(T,b.shiftKey)):L===T||!L||!T.contains(L)?(b.preventDefault(),(b.shiftKey?E:k).focus({preventScroll:!0})):b.shiftKey&&L===k?(b.preventDefault(),E.focus({preventScroll:!0})):!b.shiftKey&&L===E&&(b.preventDefault(),k.focus({preventScroll:!0}));return}b.key==="Escape"&&u(b)};return p=f,document.addEventListener("keydown",f),f},onScrimPress(u){i.addEventListener("mousedown",f=>{f.target===i&&u()})},focusFirst(){d(a(),!1)},teardown(u=!0){m&&(m=!1,s(),document.body.style.overflow=r,p&&document.removeEventListener("keydown",p),p=null,i.remove(),u&&t?.isConnected&&t.focus({preventScroll:!0}))}}}function Wc(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(o,r){let s=n,a=Reflect.get(s,r,s);return typeof a!="function"?a:(i.has(r)||i.set(r,t.has(String(r))?async(...l)=>{let c=await Bn(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),i.get(r))}})}var I=require("@seatlayer/core"),Ar=require("@seatlayer/core/view3d/crossfade/panorama");function Yc(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function Jf(n){return n.some(e=>Yc(e))}var ar="data-fit-gone",eg=12;function Cs(n,e,t=Yc){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${ar}]`).forEach(i=>{i.removeAttribute(ar),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let o=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(o.cls),n.dataset.fit=String(i+1);let r=o.give?o.give(n):!0;if(!t(n))return i+1;if(o.repeat&&o.give){for(let s=1;r&&s<eg;s+=1)if(r=o.give(n),!t(n))return i+1}}return e.length}function tg(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:Xc(t[t.length-1])}function ng(n,e){let t=n.querySelector(e);return t&&!t.hidden?Xc(t):!1}function Xc(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(ar,""),e.hidden=!0),n.setAttribute(ar,""),n.hidden=!0,!0}function ig(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function Qc(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return Cs(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>ig(e)}],()=>Jf([e,t]))}function Zc(n){return Cs(n,[{cls:"sl-fit-notype",give:e=>ng(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>tg(e),repeat:!0}])}function Jc(n){return n?(n.classList.add("sl-fitpill"),Cs(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Xn;function ed(n){if(!n)return!1;delete n.dataset.fit;let e=n.selectedOptions?.[0]?.textContent??n.options[n.selectedIndex]?.textContent??"",t=n.clientWidth;if(!e||!t)return!1;if(Xn===void 0)try{Xn=document.createElement("canvas").getContext("2d")}catch{Xn=null}if(!Xn)return!1;let i=getComputedStyle(n);Xn.font=`${i.fontStyle} ${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;let o=Xn.measureText(e).width,r=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0)+(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.borderRightWidth)||0);return o+r<=t?!1:(n.dataset.fit="row",!0)}function og(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let{amountMinor:e,currency:t}=n;return typeof e!="number"||!Number.isSafeInteger(e)||e<=0||typeof t!="string"||!/^[A-Za-z]{3}$/.test(t)?null:{amountMinor:e,currency:t.toUpperCase()}}var rg=["on-sale","low","sold-out","presale","closed"];function Ni(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function As(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function td(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let r={index:i,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;r.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=As(e[s]);if(a===void 0)return;r[s]=a}return r}function sg(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let m=p,u=typeof m.categoryKey=="string"?m.categoryKey.trim():"",f=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,b=Ni(m.price);if(!u||f===void 0||b===void 0||b===null)return;let T=`${u}\0${f??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:u,tierId:f,price:b})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],r=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||r.has(l)||!i.has(c))return;r.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function lr(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=rg.find(p=>p===e.state);if(!t)return null;let i=Ni(e.fromPrice),o=Ni(e.previousPrice);if(i===void 0||o===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let s=td(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:td(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let p=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let u=m,f=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!f)return null;let b=Ni(u.price),T=Ni(u.previousPrice);if(b==null||T===void 0)return null;let C={categoryKey:f,price:b,previousPrice:T};if(u.tierId!==void 0){if(u.tierId!==null&&(typeof u.tierId!="string"||!u.tierId.trim()))return null;C.tierId=u.tierId===null?null:u.tierId.trim()}if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;C.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;C.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;C.remaining=u.remaining==null?null:u.remaining}for(let k of["startsAt","endsAt"]){if(u[k]===void 0)continue;let E=As(u[k]);if(E===void 0)return null;C[k]=E}p.push(C)}l=p}let c=sg(e.channelPricing);if(c===void 0)return null;let d=As(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:i,previousPrice:o,currency:r,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{},...e.bookingFee!==void 0?{bookingFee:og(e.bookingFee)}:{}}}function nd(n){return n?.changed!==!1}function id(n,e){if(!n)return null;let t=null,i=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[n.release,n.upcoming])i(o?.startsAt),i(o?.endsAt);for(let o of n.prices)i(o.startsAt),i(o.endsAt);return i(n.nextPriceChangeAt),t}function Ps(n){let e={};for(let t of n?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let i=e[t.categoryKey],o=typeof i=="number"?{base:i}:i??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function od(n,e){let t={...n};for(let[i,o]of Object.entries(Ps(e))){let r=t[i];t[i]=typeof o=="number"?o:{...typeof r=="number"?{base:r}:r,...o,tiers:{...typeof r=="object"?r.tiers:{},...o.tiers}}}return t}var Di=require("@seatlayer/core"),ag={seat:()=>"",tray:n=>sd(n)?ad():""};function rd(n,e,t){let i=n?.bookingFee;return!i||i.amountMinor<=0||i.currency!==e.toUpperCase()||t?.prices&&Object.keys(t.prices).length||t?.objects&&Object.keys(t.objects).length?null:i}function sd(n){return n.some(e=>(e.bookingFeeMinor??0)>0)}function ad(){return` \xB7 ${(0,Di.t)("picker.fee.included")}`}function ld(n,e,t){return n?{seat:i=>i>0?(0,Di.t)("picker.fee.includesAmount",{amount:t((0,Di.fromMinorUnits)(n.amountMinor,e))}):"",tray:(i,o,r)=>{let s=i.reduce((a,l)=>a+(l.quantity??1),0);return sd(i)||o>s&&r>0?ad():""}}:ag}function cd(n,e){let t=n.bookingFeeMinor;return typeof t!="number"||!Number.isSafeInteger(t)||t<=0?{}:typeof n.basePrice!="number"||!Number.isFinite(n.basePrice)||n.basePrice<0?{}:e!==n.unitPrice?{}:{basePrice:n.basePrice,bookingFeeMinor:t}}var pd=require("@seatlayer/core");var dd="maintenance_mode";function lg(n){if(!n||typeof n!="object")return!1;let e=n;return e.reason===dd||e.code===dd}function cg(n){return typeof n!="number"||!Number.isFinite(n)||n<0?null:Math.max(1,Math.ceil(n/60))}function Ms(n){if(!lg(n))return null;if(typeof n.notice=="string"&&n.notice.trim())return n.notice.trim();let e=cg(n.retryAfterS);if(e===null)return v("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=(0,pd.tCount)("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}function hd(n){return n.focusedSection!==null?n.deeperThanSectionFrame===!1?"venue":"section":n.atVenueFit!==void 0?n.atVenueFit?"none":"venue":n.seatsRevealed?"venue":"none"}var ud=["pointerdown","pointermove","keydown","wheel","touchstart"],cr=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let i of ud)e.addEventListener(i,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of ud)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((i,o)=>setTimeout(i,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function md(n,e){let t=await n.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(n.destroyed||n.idleClock)return;let i=new cr({minutes:t??30,blocked:()=>!!n.hold,onIdle:()=>fd(n)});i.enabled&&(n.idleClock=i,i.attach(e))}function fd(n){n.destroyed||!n.root||n.holdExpiredEl||(n.realtime?.stop(),n.realtime=null,n.showAccessPanel({reason:"idle",retryable:!0}))}async function gd(n){if(n.destroyed)return!1;if(n.pubApi?.rotateViewerId(),n.access?.configured){let e=await n.refreshAccess();return e&&n.idleClock?.resume(),e}return n.dismissAccessPanel(),await n.controller.refresh(),n.realtime?n.realtime.restart():n.startRealtime(),n.idleClock?.resume(),!0}function bd(n){if(!n.destroyed){if(n.hold||n.idleClock?.recentlyActive()){n.pubApi?.rotateViewerId(),n.realtime?.restart();return}fd(n)}}var dr=require("@seatlayer/core");function yd(n,e,t=[],i=8,o=[]){let r=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-n.top+i),0),s=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.bottom-c.top+i),r>0?i:0),a=o.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.right-c.left+i),0);return{top:Math.max(0,Math.ceil(r)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(s)),left:0}}function vd(n){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",(0,dr.t)("picker.chooseLevel")),e.title=(0,dr.t)("picker.floorHelp");let t=n.tf("picker.allLevels","All levels"),i=[...n.floors.map((o,r)=>({id:o.id,name:o.name,code:dg(r)})).reverse(),{id:"",name:t,code:""}];for(let o of i){let r=document.createElement("button");if(r.type="button",r.className="sl-level",r.dataset.level=o.id,r.setAttribute("aria-pressed","false"),r.title=o.name,o.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=o.code,r.appendChild(a),r.setAttribute("aria-label",`${o.name} (${o.code})`)}let s=document.createElement("span");if(s.className="sl-level-name",s.textContent=o.name,r.appendChild(s),!o.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=(0,dr.t)("picker.allLevelsShort"),r.appendChild(a)}r.addEventListener("click",()=>n.onChoose(o.id)),e.appendChild(r)}return e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let r=[...e.querySelectorAll(".sl-level")],s=r.indexOf(document.activeElement);s<0||(o.preventDefault(),r[Math.max(0,Math.min(r.length-1,s+(o.key==="ArrowUp"?-1:1)))].focus())}),e}function dg(n){return n===0?"G":String(n)}function wd(n,e,t){if(!n)return;let i=t?"":e;for(let o of n.querySelectorAll(".sl-level"))o.setAttribute("aria-pressed",String(o.dataset.level===i))}var pr=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let o=this.host.activeFloorObjects().find(k=>k.type==="section"&&k.id===t.id)?.outline;if(!o||o.length<3)return 0;let r=o.map(k=>this.host.controller.worldToScreen(k)),s=r.map(k=>k.x),a=r.map(k=>k.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let m=i.getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left-m.left,b=u.top-m.top,T=Math.max(0,Math.min(f+u.width,l+d)-Math.max(f,l)),C=Math.max(0,Math.min(b+u.height,c+p)-Math.max(b,c));return T*C/(d*p)}};var Zn=require("@seatlayer/core"),Ud=require("@seatlayer/core/core/color");var He=require("@seatlayer/core");function Ls(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var hr=(n,e)=>Ls(n,e,{dateStyle:"medium"}),ur=(n,e)=>Ls(n,e,{timeStyle:"short"}),Qn=(n,e)=>Ls(n,e,{weekday:"short",day:"numeric",month:"short"});function xd(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(o=>`${hr(o,t)} \xB7 ${ur(o,t)}`)}}function pg(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function kd(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function hg(n,e,t="",i=!1){if(!n.length)return"";let o=n.map(r=>{let s=r.free?e.free:e.blocked,a=i&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${H(r.eventKey)}" aria-label="${H(`${r.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${H(`${r.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${H(r.shortDate)}</span><span class="st">${H(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${H(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${H(e.notAvailableOn)}</p>`+t+"</div>"}function ug(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${H(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${H(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${H(n.advice)}</p>`}function mg(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function Sd(n,e,t){if(mg(n)<2)return"";let i=(r,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${H(s)}</li>`,o=[];return n.available&&o.push(i("sl-pg-sw-free",e.available,` style="background:${H(t)}"`)),n.selected&&o.push(i("sl-pg-sw-sel",e.selected)),n.partial&&o.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${H(t)}"`)),n.unavailable&&o.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${H(e.title)}">${o.join("")}</ul>`}function Td(n,e){if(!n.length)return"";let t=n.map(i=>{let o=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${H(i.eventKey)}"><span class="n">${H(i.name)}</span><span class="s">${H(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${H(e.title)}"><div class="sl-pg-nights-title">${H(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Hs(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=pg(e,t);return{states:i,missing:i.filter(o=>!o.free).map(o=>o.shortDate)}}function Ed(n,e){return n?hg(n.states,{title:e.words?.title??v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:(0,He.t)("picker.group.notAvailableOn",{dates:kd(n.missing,e.locale)})},ug({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:e.words?.advice??v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function fg(n,e,t,i){if(!n.length)return"";let o=new Set(e),r=new Set(t),s=n.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${H(a.eventKey)}" aria-label="${H(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&r.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${H(a.shortDate)}</span><span class="sl-confirm-date-state">${H(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${H(i.title)}</legend><p class="sl-confirm-dates-copy">${H(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${H(i.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Cd(n,e,t,i){let o=e.availableEventKeys(t);return fg(n,o,e.includedEventKeys(),{title:(0,He.t)("picker.group.confirmDatesTitle"),copy:o.length===n.length?(0,He.t)("picker.group.confirmAllDatesCopy").replace("{count}",String(n.length)):(0,He.t)("picker.group.confirmPartialDatesCopy").replace("{available}",String(o.length)).replace("{total}",String(n.length)),selectAll:(0,He.t)("picker.group.confirmSelectAll"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function Ad(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Pd(n,e,t){let i=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!i.length)return;let o=n.querySelector(".sl-confirm-add"),r=n.querySelector("[data-pg-confirm-all]"),s=()=>{let a=i.filter(d=>!d.disabled),l=Ad(n).length;r&&(r.checked=l===a.length,r.indeterminate=l>0&&l<a.length);let c=n.querySelector("[data-pg-confirm-summary]");c&&(c.textContent=l===a.length?(0,He.t)("picker.group.confirmAllSelected").replace("{count}",String(l)):(0,He.t)("picker.group.confirmSelectedOfAvailable").replace("{selected}",String(l)).replace("{available}",String(a.length))),o.disabled=l===0,o.textContent=l?e.label(l):(0,He.t)("picker.group.confirmChooseOne"),t()};i.forEach(a=>a.addEventListener("change",s)),r?.addEventListener("change",()=>{i.filter(a=>!a.disabled).forEach(a=>{a.checked=r.checked}),s()}),s()}async function Md(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=Ad(n);if(!i.length)return!1;let o=n.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,i)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Ld(n,e,t,i=!1){if(!n)return"";let o={label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:kd(n.missing,t)};return i?(0,He.t)("picker.season.seatPartlyAvailable",o):(0,He.t)("picker.group.seatPartlyAvailable",o)}function Hd(n,e){let t=n.map((i,o)=>{let r=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${H(i.id)}" data-state="${H(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(o+1)}</span><span class="l">${H(i.label)}</span><span class="sl-pg-sr">${H(r)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${H(e.label)}">${t}</ol>`}function Rs(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${H(i.eventKey)}"><span class="n">${H(i.name)}</span><time datetime="${H(i.iso)}"><span class="d">${H(i.date)}</span><span class="t">${H(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${H(e)}</p>`}function Rd(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${H(t.eventKey)}"><span class="n">${H(t.name)}</span><span class="s">${H(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${H(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${H(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${H(n.total.label)}</span><b>${H(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${H(n.holdStatus)}</p>`:"")}function Id(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Od(n,e,t=!1){if(!n||n.seats<=0)return"";if(e==="same_seat"){let i=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,He.tCount)("picker.group.performancesChosenOf",i,{chosen:n.performances,total:n.totalPerformances}):t?(0,He.tCount)("picker.season.seatsEveryDate",i):(0,He.tCount)("picker.group.seatsEveryPerformance",i)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,He.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,He.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function _d(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),i())})})}function xt(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function gg(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",o=t||i||!n.seatNumber,r=o?n.rowLabel??n.displayLabel??n.label:n.seatNumber,s=t?`${v("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${ve(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${xt(r)}</span>`+(s?`<span class="sl-tip-row">${xt(s)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${xt(n.sectionLabel)}</span></div>`:"")+"</div>"}function Nd(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",o=n.status==="free"||i?"":`<span class="sl-tip-tag">${e.ownHold?v("picker.heldForYou","Held for you"):v("picker.group.legendUnavailable","Unavailable")}</span>`,r=t?"":e.price,s=r?`<span class="sl-tip-amt">${xt(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${xt(e.priceNote)}</div>`:"",l=r&&e.feeNote?`<div class="sl-tip-fee">${xt(e.feeNote)}</div>`:"",c=sn(n,{compact:!0}),d=e.reason?`<div class="sl-tip-reason">${xt(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+gg(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${xt(n.categoryColor)}"></span><span class="sl-tip-name">${xt(n.categoryLabel)}</span>`+o+s+"</div>"+l+a+d+c+(e.extra??"")}function Dd(n,e,t,i){let o=n.x+14,r=n.y-i.height-12,s=n.y+18,a=r;o+i.width>e-8&&(o=n.x-i.width-14),r<8&&s+i.height<=t-8&&(a=s);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Fd(n,e,t,i=22){let o=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),r=n.y-i-t.height,s=n.y+i;return r>=8?{left:o,top:r,placement:"above"}:s+t.height<=e.height-8?{left:o,top:s,placement:"below"}:{left:o,top:Math.max(8,Math.min(r<8?s:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var Is=14,bg=12,yg=12,vg=8;function Bd(n,e,t,i=bg){let o=e.height-Is-t.height,r=yg,s=o-i;if(s<=r)return{placement:"sheet",nudgeY:0};let a=(r+s)/2-n;return Math.abs(a)<=vg?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Vd(n,e,t,i,o=0){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),a=n.y+o+t.height+24<=e.height,l=n.y-o<t.height+24&&a?"below":"above",c=l==="above"?n.y-o:n.y+o,d=i&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function $d(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),o=[...n.querySelectorAll("[data-pg-event-key]")],r=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!i)return;let a=r().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};o.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),i?.addEventListener("click",()=>{let a=r();a.length&&t?.(a)})}function Dt(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?v("picker.table","Table"):n?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var wg="sl-confirm-scrim",xg="--sl-scrim-mask";function kg(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function zd(n,e,t,i){let o=n??document.createElement("div");return n||(o.className=wg),o.style.setProperty(xg,kg(i)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function Os(n){return n?.remove(),null}var jd={passport:!1,compare:!1},Sg=360,Tg=160,Eg=700,Kd=450,Cg=8;function Gd(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Ag(n){return(0,Ud.contrastRatio)("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var mr=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.closedByThisPress=null;this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=Wn(e)?e.viewUrl??"":"",o=nr(t);if(!i&&!o)return"";let r=i?null:ir(e,e.focalPoint??t.focalPoint);if(!i&&r==null)return"";let s="";if(!i)return s;let a=Y((0,Zn.t)("picker.viewFromSeat",{label:e.label})),l=Y(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+s}show(e,t="add"){let i=this.host;if(t==="remove"&&this.closedByThisPress===e.id){this.closedByThisPress=null;return}if(t==="remove"&&i.performanceGroup()&&i.controller.currentHold()?.labels.includes(e.label))return;let o=this.mode==="remove"?void 0:this.seat?.id;this.mode=t,this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(F=>F.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),o&&o!==e.id&&i.controller.deselect([o]),i.hideTooltip();let r=i.controller.seatDetails(e.id),s=i.controller.doc?.categories.find(F=>F.key===e.categoryKey),a=r?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?i.paidPrice(e.categoryKey,r?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=Tl(r,e.displayLabel??e.label,Dt(r)),d=r?.tiers??s?.tiers??[],p=r?.tierId??d[0]?.id,m=i.suppressPricing()?"":So(d,p,F=>i.money(i.paidPrice(e.categoryKey,F.id,F.price,e.label)),F=>i.offerName(e.categoryKey,F.id)),u=i.buyerView()==="venue3d",f=i.performanceGroup()?.confirmDateSelection??void 0,b=f?i.performanceGroup()?.nights?.()??[]:[],T=f?Cd(b,f,e.id,(F,ne)=>i.tf(F,ne)):"";this.shownAt=performance.now();let C=document.createElement("div");C.className="sl-confirm sl-mo-in",t==="remove"&&C.classList.add("sl-confirm-removing"),T&&C.classList.add("sl-confirm-group-dates"),C.setAttribute("role","dialog"),C.setAttribute("aria-label",(0,Zn.t)("picker.confirmSeatLabel",{label:e.label}));let k=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";C.style.setProperty("--sl-cat",k),C.style.setProperty("--sl-cat-ink",Ag(k));let E=String(r?.categoryLabel??s?.label??e.categoryKey),L=i.controller.categoryAvailability()[e.categoryKey],Q=typeof L=="number"&&L>0?(0,Zn.tCount)("picker.leftCount",L):"",D=i.packagePrice?.(e.categoryKey)??null,g=i.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,R=jd.passport?Sl(e,g,u):"",_=jd.compare?kl(e,u?i.view3dCompareSeatIds():null):"";C.innerHTML=Pl({identityFields:c,identity:El(r,e.displayLabel??e.label,Dt(r)),marker:xl({...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{}}),see3dPill:Cl(i.canOffer3d(),u),categoryColor:k,categoryLabel:E,priceLabel:D?D.price:!i.suppressPricing()&&l!=null?i.money(l):"",feeNote:D?D.note:!i.suppressPricing()&&l!=null?i.feeNote?.(l)??"":"",categoryLeftLabel:Q,tierChoices:m,groupDates:T,wheelchair:"",commercial:sn({...e.accessibility?.length?{accessibility:e.accessibility}:{},...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...r?.aisle?{aisle:!0}:{},...r?.boothType?{boothType:r.boothType}:{},...r?.entrance?{entrance:r.entrance}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${R}${_}${is(i.canOffer3d(),u)}</div>`:is(i.canOffer3d(),u),see3dRow:Al(i.canOffer3d(),u),cancelLabel:(0,Zn.t)("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(r?.objectType)}),t==="remove"&&C.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(C),this.el=C;let V=C.querySelector(".sl-confirm-thumb"),z=V?.closest(".sl-confirm-thumbwrap")??null;if(V&&z){let F=!1,ne=()=>{if(F||!z.isConnected)return;F=!0;let X=()=>{z.remove(),this.el===C&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){X();return}z.style.height=`${z.offsetHeight}px`,z.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{z.style.height="0px",z.style.opacity="0"}),setTimeout(X,Tg)};V.addEventListener("error",ne),V.addEventListener("load",()=>{V.naturalWidth||ne()});let J=e.viewMeta?.previewUrl??e.viewUrl;J?i.resolveAssetUrl(J).then(X=>{if(!(!C.isConnected||this.el!==C)){if(!X){ne();return}V.src=X}}).catch(X=>{ne(),i.onError(X)}):ne()}i.reanchor(),this.liftSeatClearOfSheet(e),C.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),C.querySelector(".sl-confirm-confidence")?.addEventListener("click",F=>{i.openSeatConfidencePassport(e,F.currentTarget instanceof HTMLElement?F.currentTarget:null)}),C.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),C.querySelectorAll("[data-confirm-tier]").forEach(F=>{F.addEventListener("click",()=>{let ne=F.dataset.confirmTier,J=d.find(Ee=>Ee.id===ne);if(!J)return;i.controller.setSeatTier(e.id,J.id),C.querySelectorAll("[data-confirm-tier]").forEach(Ee=>{Ee.setAttribute("aria-pressed",String(Ee===F))});let X=C.querySelector(".sl-confirm-price"),xe=i.paidPrice(e.categoryKey,J.id,J.price,e.label);X&&(X.textContent=i.money(xe));let ge=C.querySelector(".sl-confirm-fee");ge&&(ge.textContent=i.feeNote?.(xe)??""),i.reanchor()})}),C.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(F=>{F.addEventListener("pointerdown",bo,{once:!0}),F.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),Pd(C,f,()=>i.reanchor()),C.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),C.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(C),requestAnimationFrame(()=>{let F=C.querySelector(".sl-confirm-add");F?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(C,F)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let r=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=Bd(r.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+Eg:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=zd(this.scrim,i,this.el,t),ac(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=Os(this.scrim);let o=i.clientWidth,r=i.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=Vd(t,{width:o,height:r},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,jo(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return Gd()?performance.now()-this.shownAt<Kd:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=new Map,o=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=i.get(l.pointerId);i.delete(l.pointerId),d&&s.type==="pointerup"&&i.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=Cg&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(i.set(l.pointerId,{x:l.clientX,y:l.clientY}),i.size>1)for(let d of i.keys())i.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let r=t.root();setTimeout(()=>{this.outsideTap===o&&((r??document).addEventListener("pointerdown",o,!0),(r??document).addEventListener("pointerup",o,!0),(r??document).addEventListener("pointercancel",o,!0))},Gd()?Kd:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=Os(this.scrim),this.settleLift(),this.el&&Ko(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Md(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);ws(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){r();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let s=o.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,Sg)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"?e.controller.deselect([t.id]):(this.closedByThisPress=t.id,setTimeout(()=>{this.closedByThisPress=null},0)),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let i=e.releaseHeldSeat(t);i||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function qd(n,e,t){if(!e||t||n.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function Wd(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var Ye=require("@seatlayer/core"),Jn=require("@seatlayer/core/picker/minimapGeometry");function Pg(n){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of n){let r=t.get(o.id);(!r||e[o.state]>e[r])&&t.set(o.id,o.state)}let i={selected:0,available:0,inactive:0};for(let o of t.values())i[o]+=1;return i}function Mg(n,e){return n.x<=e.x&&n.y<=e.y&&n.x+n.width>=e.x+e.width&&n.y+n.height>=e.y+e.height}function Yd(n,e){let t=new _s(n);return t.build(e),t}var _s=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 i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",(0,Ye.t)("picker.openVenueMap")),i.setAttribute("aria-expanded","false"),i.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(i),this.miniToggle=i;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let s=document.createElement("span");s.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",(0,Ye.t)("picker.minimapStateKey")),a.append(...[["focused","picker.minimapStateFocused"],["selected","picker.minimapStateSelected"],["","picker.minimapStateAvailable"],["inactive","picker.minimapStateInactive"]].map(([p,m])=>{let u=document.createElement("i");return p&&(u.className=p),u.title=(0,Ye.t)(m),u}));let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",(0,Ye.t)("picker.closeVenueMap")),l.textContent="\xD7",r.append(s,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",(0,Ye.t)("picker.venueMapLabel")),o.append(r,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=s,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),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,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let o=196,r=146,s=6,a=i.width/Math.max(1,i.height),l=o,c=Math.round(o/a);c>r&&(c=r,l=Math.round(r*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,Jn.createMinimapTransform)(i,e.width,e.height,d,s)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?(0,Ye.t)("picker.allFloors"):e.find(l=>l.id===this.host.controller.getActiveFloorId())?.name??(0,Ye.t)("picker.venueOverview"),i=this.host.controller.getMinimapSnapshot().sections,r=i.find(l=>l.active)?.label??this.host.focusedSectionLabel(),s=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=s;let a=(0,Ye.t)("picker.venueMapSummary",Pg(i));this.miniWrap.setAttribute("aria-label",i.length?`${s}. ${a}`:s),this.miniCanvas?.setAttribute("aria-label",i.length?`${s}. ${a} ${(0,Ye.t)("picker.venueMapPanSections")}`:`${s}. ${(0,Ye.t)("picker.venueMapPanEmpty")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let o=p=>p*t.scale+t.offX,r=p=>p*t.scale+t.offY,s=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((u,f)=>f===0?i.moveTo(o(u.x),r(u.y)):i.lineTo(o(u.x),r(u.y))),i.closePath();let m=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,m?i.fillStyle=m.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=m?.stroke||s,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let u=p.outline.reduce((f,b)=>({x:f.x+b.x,y:f.y+b.y}),{x:0,y:0});i.beginPath(),i.arc(o(u.x/p.outline.length),r(u.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((f,b)=>b===0?i.moveTo(o(f.x),r(f.y)):i.lineTo(o(f.x),r(f.y))),i.closePath()}p.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),m=new Map,u=f=>{let b=m.get(f);if(b)return b;let T=this.host.tint?.(f)||c;return m.set(f,T),T};for(let f of d.seats)i.globalAlpha=f.state==="inactive"?.22:.78,i.fillStyle=f.state==="inactive"?a:f.state==="selected"?l:u(f.categoryKey),i.beginPath(),i.arc(o(f.x),r(f.y),p,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let s=Mg(r.visible,r.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",s),s)return;let a=(0,Jn.minimapViewportPlan)(r.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),l=this.host.cssVar("--sl-text")||"#12151c",c=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=l,o.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,i.dpr*3.25),o.strokeStyle=c,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,i.dpr*1.75),o.strokeStyle=l,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),o.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let o=t.getBoundingClientRect(),r=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),s=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,Jn.minimapPointToWorld)({x:r,y:s},i),px:r,py:s}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.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 t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&(0,Ye.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var fr=require("@seatlayer/core");var Lg=12;function Xd(n,e){let t=e.floors(),i=new Set(t.map(D=>D.label.trim().toLocaleLowerCase())),o=e.zones().filter(D=>D.seatCount>0&&!i.has(D.label.trim().toLocaleLowerCase())),r=e.sections().filter(D=>D.seatCount>0&&!i.has(D.label.trim().toLocaleLowerCase())),s=o.length>1?[]:r,a=t.length>1,l=o.length>1,c=s.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.setAttribute("aria-expanded","false");let u='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',f=document.createElement("span");m.innerHTML=u,m.appendChild(f);let b=()=>{for(let D of d.querySelectorAll(":scope > div")){let g=D.querySelector('[aria-pressed="true"]');!g||D.scrollWidth<=D.clientWidth||g.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let D of d.querySelectorAll(":scope > div")){let g=D.querySelector('button[aria-pressed="true"]'),R=g?.textContent?.trim();if(R&&g?.dataset.floor!=="")return R}return a&&(l||c)?v("picker.levelsAndAreas","Levels & zones"):a?v("picker.levels","Levels"):v("picker.areas","Zones")},C=D=>{d.classList.toggle("is-open",D),m.setAttribute("aria-expanded",String(D)),D&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(b),f.textContent=T()};m.addEventListener("click",()=>C(!d.classList.contains("is-open"))),d.addEventListener("keydown",D=>{D.key!=="Escape"||!d.classList.contains("is-open")||(D.preventDefault(),D.stopPropagation(),C(!1),m.focus())});let k=document.createElement("button");k.type="button",k.className="sl-view3d-nav-close",k.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let E=v("picker.closeVenueNavigation","Close venue navigation");k.setAttribute("aria-label",E),k.title=E,k.addEventListener("click",()=>{C(!1),m.focus()}),C(!1),d.appendChild(m);let L=D=>{},Q=D=>{};if(a){let D=document.createElement("div");D.setAttribute("role","group"),D.setAttribute("aria-label",v("picker.levels","Levels"));let g=[];Q=V=>{g.forEach(z=>{z.setAttribute("aria-pressed",String((z.dataset.floor===""?null:Number(z.dataset.floor))===V))})};let R=V=>{e.focusFloor(V)&&(Q(V),L(V))},_=(V,z)=>{let F=document.createElement("button");F.type="button",F.textContent=V,F.dataset.floor=z===null?"":String(z),F.setAttribute("aria-pressed",String(z===null)),F.addEventListener("click",()=>{R(z),C(!1)}),g.push(F),D.appendChild(F)};_(v("picker.allLevels","All levels"),null);for(let V of t)_(V.label||(0,fr.t)("picker.levelNumber",{number:V.index+1}),V.index);d.appendChild(D)}if(l||c){let D=document.createElement("div");D.setAttribute("role","group"),D.setAttribute("aria-label",v("picker.areas","Zones"));let g=l?o.map(_=>({id:_.id,label:_.label||_.id,go:()=>{e.focusZone(_.id)}})):s.map(_=>({id:_.id,label:_.label||_.id,floorIndex:_.floorIndex,go:()=>{e.focusSection(_.id),Number.isFinite(_.floorIndex)&&Q(_.floorIndex)}})),R=_=>{let V=l||_===null?g:g.filter(z=>z.floorIndex===void 0||z.floorIndex===_);if(D.replaceChildren(),!V.length){D.remove();return}if(D.isConnected||d.insertBefore(D,k.isConnected?k:null),!l&&V.length>Lg){let z=document.createElement("select");z.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let F=document.createElement("option");F.value="",F.textContent=v("picker.jumpToSection","Jump to section"),z.appendChild(F);for(let ne of V){let J=document.createElement("option");J.value=ne.id,J.textContent=ne.label,z.appendChild(J)}z.addEventListener("change",()=>{V.find(ne=>ne.id===z.value)?.go()}),D.appendChild(z);return}for(let z of V){let F=document.createElement("button");F.type="button",F.textContent=z.label,F.dataset.area=z.id,F.addEventListener("click",()=>{p=z.label,z.go(),C(!1)}),D.appendChild(F)}};L=R,R(null)}return d.appendChild(k),n.appendChild(d),d}var gr=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",v("picker.savedSeatComparison","Saved seat comparison"));let r=document.createElement("button");r.type="button",r.className="main",r.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",v("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(r,s),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=i>1?(0,fr.t)("picker.compareCount",{count:i}):v("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",i>1?(0,fr.t)("picker.openComparisonOfSeats",{count:i}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Qd(n){return!n?.querySelector('[data-ref="zfs"]')}var Zd="sl:sheet-hint";function Jd(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),450),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),Hg(n.root)},700)}function Hg(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Zd))return;window.sessionStorage.setItem(Zd,"1")}catch{}let e=n.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function ep(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function yr(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],o=new Set(i.map(m=>m.label)),r=mc(n,t,i),s=yt(n.gaQty,i),a=i.reduce((m,u)=>m+n.heldPrice(u)*(u.quantity??1),0),l=i.reduce((m,u)=>m+(u.quantity??1),0),c=e.filter(m=>!o.has(m.label)),d=c.reduce((m,u)=>m+n.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+r+a,p=c.reduce((m,u)=>m+(u.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:o,heldCount:l,total:d,count:p}}function vr(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function wr(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key){for(let i of n.pricesByChannel.values())for(let o of i)o.categoryKey===e.key&&t.push(o.price);t.push(...Rg(n).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var br=null;function Rg(n){let e=n.controller.doc,t=n.hostObjectPrices();if(br?.doc!==e||br.host!==t){let i=new Map;for(let[o,r]of Object.entries({...e?.seatPrices,...t})){let s=n.controller.seatByLabel(o)?.categoryKey??n.controller.tableSelection(o)?.categoryKey;s&&(i.has(s)||i.set(s,[]),i.get(s).push(...typeof r=="number"?[r]:Object.values(r.tiers)))}br={doc:e,host:t,spread:i}}return br.spread}var Fi="seatlayer_";function Ig(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function qe(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Og(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function _g(n,e){let t=n.event();if(!t)return qe("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function tp(n,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),i=n.find(o=>t(o.key??o.id))??n.find(o=>t(o.label));return i?.key??i?.id??null}function np(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,o)=>t[o]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,o)=>i+o.price,0)}}function Ng(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.rowKey);s?s.push(r):i.set(r.rowKey,[r])}let o=[];for(let r of i.values()){let s=[...r].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(np(n,s.slice(d,d+t)));a=l}}return o}function Dg(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.sectionKey);s?s.push(r):i.set(r.sectionKey,[r])}let o=[];for(let r of i.values()){if(r.length<t)continue;let s=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(np(n,s.slice(0,t)))}return o}function Fg(n,e){if(!n.event())return qe("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>i.max)return qe("bad_count",`count must be a whole number between 1 and ${i.max}.`);let r=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?tp(n.categories(),l):null;if(l&&!d)return qe("no_match",`No ticket type called "${l}".`);if(d&&n.categories().find(b=>b.key===d)?.available===0)return qe("sold_out",`"${l}" is sold out.`);let p=c?tp(n.zones(),c):null;if(c&&!p)return qe("no_match",`No zone called "${c}".`);let m=n.seats().filter(b=>b.available);if(!m.length)return qe("sold_out");let u=m.filter(b=>(!d||b.categoryKey===d)&&(!p||b.zoneId===p)&&(a==null||b.price<=a));if(!u.length)return qe("no_match");let f=s?Ng(n,u,o):Dg(n,u,o);return f.length?(f.sort((b,T)=>T.unitPrice!==b.unitPrice?T.unitPrice-b.unitPrice:b.row.localeCompare(T.row)||b.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:f.slice(0,r),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:s}}}):qe(s?"not_enough_together":"no_match")}function ip(n){return{ok:!0,...n.selection()}}function Bg(n,e){let t=n.event();if(!t)return qe("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return t.guestsOnly?qe("guests_only","This event is for invited guests."):qe("event_closed","Sales are closed for this event.");let i=Og(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),ip(n)):qe("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Vg(n,e){let t=async o=>{try{return await o()}catch(r){return qe("error",r instanceof Error?r.message:String(r))}},i=[{name:`${Fi}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>_g(n,e))},{name:`${Fi}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>Fg(n,o))},{name:`${Fi}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>Bg(n,o))},{name:`${Fi}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>ip(n))}];return e&&i.push({name:`${Fi}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function op(n,e={}){let t=Ig();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,o=Vg(n,!!e.holds),r=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:i.signal,...s?{exposedTo:s}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function rp(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await op(Ds(n,t),{holds:t,exposedTo:i}),n.destroyed&&Ns(n)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function Ns(n){n.webMcp?.dispose(),n.webMcp=null}function Ds(n,e){let t=(i,o)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let r=i.id.lastIndexOf(":"),s=r<0?NaN:Number(i.id.slice(r+1));return Number.isFinite(s)?s:o};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed,...n.guestsOnly?{guestsOnly:!0}:{}}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let r=wr(n,o),s=vr(n,o);return{key:o.key,label:o.label??o.key,...s===void 0?{}:{price:s},...r&&r.min!==r.max?{priceRange:r}:{},available:i[o.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),o=[];return n.allSeats().forEach((r,s)=>{if(r.floorId&&i&&r.floorId!==i)return;let a=n.controller.getStatus(r.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,s),categoryKey:r.categoryKey,price:n.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:i=>{let o=n.controller.seatDetails(i);return o?{section:o.sectionLabel??"",row:ve(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:i,total:o,count:r}=yr(n);return{seats:i.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:ve(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:n.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:r,total:o,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?$g(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function $g(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function sp(n,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=n.seatByLabel(e.label),i=t?n.toSeat(t).tiers:void 0;return i&&i.length>1?i:null}async function ap(n,e,t,i){let o=n.currentHold(),r=o?.items??[],s=r.find(c=>c.label===e);if(!o||!s||s.tierId===t)return null;let a=r.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await n.api.hold(n.key,a,i,o.holdId);return n.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),n.currentHold()}function Fs(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function lp(n,e){rt({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport,revealWaitMs:n.revealWaitMs,handoverMs:n.handoverMs}),e("chart_rendered",Fs(n))}var cp=require("@seatlayer/core/core/seatConfidence");function Fe(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function dp(n){let e=(0,cp.seatConfidenceDisclosure)(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Fe(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Fe(e.modeledTarget)}</dd></div>`:"",r=t?`<div><dt>Evidence ID</dt><dd>${Fe(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Fe(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Fe(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Fe(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Fe(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=ko(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Fe(s)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Fe(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Fe(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Fe(e.headline)}</strong><span>${Fe(e.coverage)} \xB7 ${Fe(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Fe(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Fe(e.reality)}</dd></div><div><dt>Source</dt><dd>${Fe(e.provenance)}</dd></div>`+a+o+r+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function pp(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function xr(n,e,t){let i=n?.querySelector("[data-report]"),o=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Bs(n,e,t=null){let i=n.view3dEl;if(!i)return;Bi(n,!1);let o=e.confidenceEvidence,r=n.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=dp({seat:e,title:r?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(m=>m!==i)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");i.appendChild(s),i.classList.add("has-passport"),n.view3dPassportEl=s;let c=s.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),Bi(n);return}if(m.key!=="Tab")return;let u=d();if(!u.length)return;let f=u[0],b=u[u.length-1];m.shiftKey&&document.activeElement===f?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),f.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let b of l)b.element.inert=b.inert,b.ariaHidden===null?b.element.removeAttribute("aria-hidden"):b.element.setAttribute("aria-hidden",b.ariaHidden);let m=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,u=m?.closest(".sl-confirm,.sl-view3d-compare");u?.isConnected&&(u.inert=!1,u.removeAttribute("aria-hidden")),s.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===s&&(n.view3dPassportEl=null);let f=m??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:f)?.focus()},s.addEventListener("click",m=>{let u=pp(m.target instanceof HTMLElement?m.target:null);u==="close"&&Bi(n),u==="report"&&zg(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function zg(n,e){if(n.api.reportViewEvidence){xr(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),xr(n.view3dPassportEl,"received",t.report.id)}catch{xr(n.view3dPassportEl,"failed")}}}function Bi(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function hp(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;hn(n,!1);let t=n.view3dCompareSeatIds.map(u=>n.view3dComparisonSnapshot(u)).filter(u=>!!u);if(t.length<2){n.clearView3dComparison();return}let i=u=>H(u),o=t.some(u=>!!u.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let s=t.map((u,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${i(u.label)}</strong><small>Section ${i(u.section)} \xB7 Row ${i(u.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${i(u.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(u.category)}</dd></div><div><dt>Availability</dt><dd>${i(u.availability)}</dd></div><div><dt>View source</dt><dd>${i(u.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(u.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(u.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(u.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(u.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(u.seat.id)}">Passport</button><button type="button" data-view-seat="${i(u.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(u.seat.id)}"${u.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(u=>u instanceof HTMLElement),c=l.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of l)u.inert=!0,u.setAttribute("aria-hidden","true");e.appendChild(r),e.classList.add("has-comparison"),n.view3dCompareEl=r;let d=r.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=u=>{if(u.key==="Escape"){u.preventDefault(),hn(n);return}if(u.key!=="Tab")return;let f=p();if(!f.length)return;let b=f[0],T=f[f.length-1];u.shiftKey&&document.activeElement===b?(u.preventDefault(),T.focus()):!u.shiftKey&&document.activeElement===T&&(u.preventDefault(),b.focus())};window.addEventListener("keydown",m),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);for(let u of c)u.element.inert=u.inert,u.ariaHidden===null?u.element.removeAttribute("aria-hidden"):u.element.setAttribute("aria-hidden",u.ariaHidden);r.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===r&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>hn(n)),r.querySelectorAll("[data-passport-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.passportSeat,b=f?n.allSeats().find(T=>T.id===f):void 0;b&&Bs(n,b,u)})),r.querySelectorAll("[data-view-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.viewSeat;hn(n,!1),f&&n.view3dHandle?.flyToSeat(f)})),r.querySelectorAll("[data-select-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.selectSeat;f&&jg(n,f)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function hn(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function jg(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(o=>o.id===e);if(!t)return;if(hn(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var fp=require("@seatlayer/core"),gp=require("@seatlayer/core/view3d/crossfade/panorama");var Vs=require("@seatlayer/core");var Kg=900,Gg=450;function Ug(n){switch(n){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function up(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),n.append(t,o);let r=null,s=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),!a){o.classList.remove("is-shown"),o.textContent="",s=setTimeout(()=>{s=null,n.classList.remove("is-seat-view")},Gg);return}n.classList.add("is-seat-view"),o.textContent=Ug(a),o.classList.add("is-shown"),r=setTimeout(()=>{r=null,o.classList.remove("is-shown")},Kg)},dispose(){r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),t.remove(),o.remove(),n.classList.remove("is-seat-view")}}}var qg=44,Wg=92;function mp(n,e,t,i={}){let o=n?.sectionLabel,r=ve(n),s=Yg(n,e),a=[o,r?(0,Vs.t)("picker.rowLabel",{label:r}):null,s?(0,Vs.t)("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?qg:Wg);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Yg(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(ve(n)),t}var bp=require("@seatlayer/core/core/seatConfidence");var Xg=220;function Qg(n,e,t){let i=null,o=null,r=null;return(s,a)=>{n()?.presentSeatHover?.(s,a,e),r=a,s!==o&&(o=s,i&&(clearTimeout(i),i=null),!(!s||!t)&&(i=setTimeout(()=>{if(i=null,o!==s)return;let c=t()?.(s)??null;c&&o===s&&n()?.presentSeatHover?.(s,r,e,c)},Xg)))}}function yp(n){return n.buyerView}function vp(n,e,t){if(e==="map"){n.exit3d();return}let i=t?.flyToSeatId;if(n.buyerView==="venue3d"){i?(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),n.view3dHandle?.flyToSeat(i)):t?.resetView&&n.view3dHandle?.focusOverview();return}n.enter3d(i)}function wp(n,e){switch(n.controller.getStatus(e.id)){case"held":if(!kp(n,e))return"held";break;case"booked":case"not_for_sale":return"sold";default:break}return n.priceBandKeys!=null&&!n.priceBandKeys.has(e.categoryKey)||n.controller.accessibilityFilterDims?.(e)||n.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function xp(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e),n.syncSelectionTo3d(),$s(n)}function $s(n){n.view3dHandle?.setAreaStates&&mo(n,()=>{let e=n.view3dHandle;if(!e?.setAreaStates)return;let t=n.priceBandKeys,i=ho(n.controller);e.setAreaStates(uo(n.controller.gaStates(),o=>t!=null&&!t.has(i.get(o)?.categoryKey??""),o=>i.get(o)?.wheelchairPlaces??0))})}function kp(n,e){return Sp(n,e)!=null}function Sp(n,e){let t=n.controller.currentHold()?.labels;if(!t?.length)return null;if(t.includes(e.label))return e.label;let i=n.controller.tableSelection(e.id)?.label;return i!=null&&t.includes(i)?i:null}function Zg(n){return(n.controller.currentHold()?.labels??[]).flatMap(e=>{let t=n.controller.tableSelection(e)?.physicalSeatIds;if(t?.length)return t;let i=n.controller.seatByLabel(e)?.id;return i?[i]:[]})}function Tp(n){if(!n.view3dHandle)return;let e=new Set;for(let t of n.controller.getSelection()){let i=t.physicalSeatIds;if(i?.length)for(let o of i)e.add(o);else e.add(t.id)}for(let t of Zg(n))e.add(t);n.view3dHandle.setSelection([...e])}function Ep(n,e){let t=n.view3dHandle;if(!t)return;n.pushAvailabilityTo3d(),n.syncSelectionTo3d();let i=e[0];!i||e.every(r=>r.rowId===i.rowId)&&t.focusRow(i.rowId)||i.sectionId&&t.focusSection(i.sectionId)}async function Cp(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await n.buyerAssetUrls.resolve(i):null,s=o?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!s||o&&!r?null:{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:a=>n.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return n.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:n.tf("picker.chartDerivedModel","Chart-derived model")}}function Ap(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),n.syncSelectionTo3d();return}let t=n.allSeats().find(l=>l.id===e);if(!t)return;let i=n.controller.tableSelection(e),o=Sp(n,t);if(o!=null){if(n.syncSelectionTo3d(),n.performanceGroup)return;if(n.opts.confirmSelection===!1){n.removeHeldTicket(o);return}if(n.confirmSeat?.id===t.id){n.dismissConfirm();return}n.showConfirm(o===t.label?t:{...t,label:o},"remove");return}if(n.committedSelection().some(l=>i?l.label===i.label:l.id===e)){if(i||n.opts.confirmSelection===!1){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}n.syncSelectionTo3d(),n.showConfirm(t,"remove");return}let s=n.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){n.syncSelectionTo3d();return}if(!n.controller.select([e]).length){n.syncSelectionTo3d(),n.dismissConfirm();return}if(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),n.flashPickedSeat(e),i){n.showTableDialog(i,!1),n.syncSelectionTo3d();return}n.opts.confirmSelection!==!1?n.showConfirm(t):n.syncTray(),n.syncSelectionTo3d()}function Pp(n,e){let t=n.allSeats().find(i=>i.id===e);return mp(n.controller.seatDetails(e),t?.displayLabel??t?.label??e,n.tf("picker.viewFromYourSeat","view from your seat"),{narrow:n.root?.dataset.layout==="narrow",shortTail:n.tf("picker.fromYourSeat","from your seat")})}function Mp(n,e){if(n.buyerView!=="venue3d")return;let t=n.view3dCompareSeatIds;t.includes(e.id)||(n.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),n.confirmSeat?.id===e.id&&(n.controller.deselect([e.id]),n.dismissConfirm(),n.syncSelectionTo3d(),n.syncTray()),n.view3dCompareChip.sync(),n.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:n.view3dCompareSeatIds.length}),n.view3dCompareSeatIds.length>1?n.openView3dComparison():n.toast(n.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Lp(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function Hp(n,e){let t=n.allSeats().find(f=>f.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),o=n.controller.doc?.categories.find(f=>f.key===t.categoryKey),r=i?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),s=r!=null?n.paidPrice(t.categoryKey,i?.tierId??o?.tiers?.[0]?.id??null,r,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="free"||!a?n.tf("picker.available","Available"):kp(n,t)?n.tf("picker.heldForYou","Held for you"):n.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?(0,gp.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):n.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=ko(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=wl({...t.accessibility?.length?{accessibility:t.accessibility}:{},...i?.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{}}),m=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:n.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=(0,bp.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:ve(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??o?.label??t.categoryKey,price:n.suppressPricing||s==null?"":n.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:u}}async function Rp(n,e){if(n.view3dEl||!n.canOffer3d()||!n.els.map)return;let t=n.controller.doc;if(!t)return;n.buyerView="venue3d",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),n.root?.setAttribute("data-view3d","on"),n.dismissConfirm(),n.syncProjection(),n.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",n.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${n.tf("picker.backToMap","Back to map")}</span>`;let r=o.querySelector("span"),s=c=>{n.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),n.root&&(n.root.dataset.view3dSeat=d?"on":"off");let p=d?n.tf("picker.backToVenue","Back to venue"):n.tf("picker.backToMap","Back to map");r&&(r.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(o),n.view3dBack=o,n.publish3dTopInset(),Qd(n.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=n.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||n.fsFallback||n.framedFs)),c.addEventListener("click",()=>n.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=n.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),n.els.map.appendChild(i),n.view3dEl=i,n.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++n.view3dGen;try{let c=n.allSeats(),[d,p]=await Promise.all([Ai(),n.controller.loadEventConfiguration()]),m=p?await qo(p,E=>n.buyerAssetUrls.resolve(E)):null,u=t.theme?.venue3d?.shellAssetUrl,f=await Wo(u,E=>n.buyerAssetUrls.resolve(E));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let b={...po(n.opts.enable3DCrowd),crowdSeatCeiling:n.max3dSeats()},T={doc:t,seats:c,...b,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...f?{registeredShellGlb:f}:{}};a.textContent=(0,fp.t)("picker.building3d");let C=await d.prepareVenue3D(T);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let k=d.mountVenue3D(i,{...T,prepared:C},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:rn(),navLabels:lo(),...co(n.opts.touchNavigation3D),seatViewActionLabel:E=>n.allSeats().find(L=>L.id===E)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:E=>n.seatViewCaption(E),onSeatViewStopChange:E=>n.view3dSeatViewChrome?.onStopChange(E),onSeatPick:E=>n.onView3dSeatPick(E),onSeatInspect:E=>n.onView3dSeatPick(E),onObjectPick:E=>{E.kind==="area"&&n.openAreaChooser(E.id,E.point)},onSeatHover:Qg(()=>n.controller.getRenderer(),i,()=>{let E=k.captureSeatView;return E?L=>E.call(k,L):void 0}),onSectionFocusChange:E=>{let L=i.querySelector('select[data-locator="section"]'),Q=E??"";!L||L.value===Q||(L.value=Q,L.dispatchEvent(new Event("change")))},onViewTargetChange:E=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!E),s(E),n.opts.onBuyerViewChange?.({view:"venue3d",...E?{seatId:E}:{}})},...n.seatViewEnabled()?{getSeatView:E=>new Promise((L,Q)=>{let D=()=>{n.seatViewFor3d(E).then(R=>{R?L(R):Q(new Error("seat_view_unavailable"))})},g=globalThis.requestIdleCallback;typeof g=="function"?g(D,{timeout:1500}):setTimeout(D,50)})}:{},onAnalytics:(E,L)=>n.emit3dAnalytics(E,L)});n.view3dHandle=k,n.view3dSeatViewChrome=up(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=Xd(n.regions["bottom-left"]??i,k),e&&k.flyToSeat(e)}catch(c){if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;n.opts.onError?.(c),n.toast(n.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),n.exit3d()}}function Ip(n){let e=n.regions["top-left"];if(!n.root||!e)return;let t=()=>{!n.root||n.root.dataset.view3d!=="on"||n.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Op(n){if(n.buyerView!=="venue3d"&&!n.view3dEl)return;n.view3dGen++,n.buyerView="map",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"map"}),n.root?.removeAttribute("data-view3d"),n.closeSeatConfidencePassport(!1),n.closeView3dComparison(!1),n.view3dCompareChip.remove(),n.view3dSeatViewChrome?.dispose(),n.view3dSeatViewChrome=null,n.view3dBack?.remove(),n.view3dBack=null,n.view3dNav?.remove(),n.view3dNav=null,n.root?.removeAttribute("data-view3d-seat"),n.root?.style.removeProperty("--sl-3d-top-inset");try{n.view3dHandle?.dispose()}catch{}n.view3dHandle=null;let e=n.view3dEl;n.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),n.syncProjection(),n.syncTray();let t=n.view3dReturnSeat;n.view3dReturnSeat=null,t&&n.committedSelection().some(i=>i.id===t.id)&&n.opts.confirmSelection!==!1&&n.showConfirm(t)}var js=require("@seatlayer/core");var _p=Symbol("seatlayer.performance-group-picker");function kr(n,e){return Object.defineProperty(n,_p,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function Sr(n){return!n||n.surface==="season"}function un(n){return n?.surface==="season"}function Np(n){return n[_p]??null}var Vi=require("@seatlayer/core");function Dp(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Tr(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?(0,Vi.t)("picker.selectExactMore",{count:n.remaining}):(0,Vi.t)("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?(0,Vi.t)("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,Vi.t)("picker.orphanHint")}var zs=6e4,Fp=5*6e4,eb=String(Math.round(Fp/6e4));function Bp(n){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(n.regions["bottom-center"]??n.els.map).appendChild(e),n.extendEl=e,n.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),n.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),n.els.extendBtn.textContent=Vp(n),n.els.extendDismiss.setAttribute("aria-label",n.tf("picker.close","Close")),n.els.extendBtn.addEventListener("click",()=>{n.handleExtend()}),n.els.extendDismiss.addEventListener("click",()=>{n.extendDismissed=!0,n.setExtendPrompt(!1,0)})}function Vp(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",eb)}function $p(n){let e=n.hold?.items??[],t=new Set(e.map(o=>o.label));return n.committedSelection().filter(o=>!t.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0)+yt(n.gaQty,n.hold?.items??[])}function zp(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function jp(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,o)=>i+(o.quantity??1),0);return n.heldTicketCount()+t+yt(n.gaQty,n.hold?.items??[])}function Kp(n){let e=new Set((n.hold?.items??[]).map(o=>o.label)),t=n.committedSelection().filter(o=>e.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-yt(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function Gp(n,e=n.lastTrayCount,t=n.pendingSelectionCount()){let i=n.els.cta;if(!i)return;if(delete i.dataset.act,n.salesClosed&&!n.finishingHold?.()){i.disabled=!0,i.textContent=n.closedWords?.().cta??n.tf("picker.salesClosedCta","Sales closed");return}if(n.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(n.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(o&&!o.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let r=n.controller.getSelectionValidity(e);if(r&&!r.isValid){i.disabled=!0,i.textContent=Tr(r,(s,a)=>n.tf(s,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&Sr(n.performanceGroup)&&!n.hold&&!n.bestAvailableSoldOut){i.disabled=!1,i.dataset.act="find",i.textContent=n.tf("picker.findBestSeats","Find best seats");return}i.disabled=e===0,i.textContent=n.hold?t?(0,js.t)("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?tb(n,n.performanceGroup):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function tb(n,e){let t=un(e),i=t?(0,js.t)("picker.season.holdSeatsForAllDates"):n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances");return(e.performanceCount===1?n.tf(t?"picker.season.holdSeatsForOneDate":"picker.holdSeatsForOnePerformance",i):i).replace("{count}",String(e.performanceCount))}function Up(n,e){n.ctaPhase=e,n.syncCta()}async function qp(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function Wp(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function Yp(n){if(n.opts.initialHoldId)return n.opts.initialHoldId;if(n.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(n.holdStorageKey())}catch{return null}}function Xp(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function Qp(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function Zp(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let o={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=o,uc(n.gaQty,o.items??[]),n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(o.expiresAt),n.rememberHold(o),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(o,o.seats??[],n.buildHandoff(o)),o}catch(i){let o=i?.status;if(o===404||o===409)n.forgetHold();else if(o===401&&i?.code==="buyer_access_invalid")n.forgetHold(),n.toast(n.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(n.opts.onError?.(i),t)throw i;return null}}async function Jp(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function eh(n,e){n.stopHoldTimer(),n.holdExpiresAt=e,n.extendDismissed=!1,n.extendUsed=!1,n.hold&&n.rememberHold(n.hold);let t=n.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${n.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]'),o=()=>{let r=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=Il(r)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=zs),n.setExtendPrompt(r>0&&r<=zs,r),(r<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(o,500),o()}function th(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function nh(n,e,t){if(!n.extendEl)return;let i=e&&t>0&&n.root?.dataset.layout!=="narrow"&&!!n.api.extend&&!n.extendDismissed&&!n.extendUsed&&!!n.controller.currentHold()&&!n.bookedShown;n.extendEl.classList.toggle("on",i)}function ih(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=zs,e)}async function oh(n){let e=n.els.extendBtn,t=n.controller.currentHold();if(!(!t||!n.api.extend||n.extendUsed)){e.disabled=!0,e.textContent=n.tf("picker.addingEllipsis","Adding\u2026");try{let i=await n.api.extend(n.controller.key,t.holdId,Fp);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let o=n.controller.currentHold();if(!o)return;n.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},n.holdExpiresAt=o.expiresAt,n.extendUsed=!0,n.extendEl?.classList.remove("on"),n.rememberHold(n.hold),n.emitHoldChange(),n.toast(n.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(i){if(i?.reason==="extend_limit"){n.extendUsed=!0,n.setExtendPrompt(!1,0);return}n.opts.onError?.(i),n.toast(n.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=Vp(n)}}}function ib(n){let e=n;return e?.status===404?"ended":e?.status!==409||e.code!=="hold_not_active"?"unknown":e.reason==="booked"?"booked":"ended"}async function rh(n,e){try{return await n(e),!1}catch(t){return ib(t)==="booked"}}var ei=require("@seatlayer/core");function sh(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function ah(n){return ob(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+rb(n.status)}function ob(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let o=n.priceOf(i),r=n.rangeOf(i),s=n.offerOf(i.key),a=sh(s),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(i.label)}</span>`+(s?.offerName?wo(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function rb(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(n.unavailable)}</span>`+(n.partial?`<span class="sl-status-item"><i class="sl-status-icon partial" aria-hidden="true"></i>${e(n.partial)}</span>`:"")+"</div>"}function Ks(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function lh(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(o=>{let r=n.rangeOf(o),s=n.priceOf(o),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(n.left,o.key)&&n.left[o.key]<=0,c=sh(n.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${n.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${n.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function ch(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(o.length/4),s=[];for(let a=0;a<o.length;a+=r){let l=o.slice(a,a+r),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));s.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return s}function dh(n){if(n.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),n.priceSelect=null,n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=ch((n.controller.doc?.categories??[]).filter(o=>!o.notForSale),n.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",n.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=n.tf("picker.allPrices","All prices"),t.appendChild(i);for(let o of e){let r=document.createElement("option");r.value=o.id,r.textContent=o.label,t.appendChild(r)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function ph(n,e){if(n.focusedCatKey=null,n.priceBandKeys=e?new Set(e):null,n.priceSelect){let t=e?n.priceSelect.value:"all";n.priceSelect.value!==t&&(n.priceSelect.value=t)}n.controller.setCategoryFilter(e),n.controller.focusCategoryFilter(e),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}function hh(n){return{colorOf:e=>n.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>n.catPriceRange(e),priceOf:e=>n.catPrice(e),offerOf:e=>n.offerPrice(e),money:e=>e?n.money(e):n.tf("checkout.free","Free"),esc:Y}}function uh(n,e,t,i=n.legendDeps()){let o=n.els.railScroll,r=e.length>1;if(n.els.rail?.classList.toggle("has",r),!o)return;o.innerHTML=r?lh({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:(0,ei.t)("picker.soldOut"),allWord:n.tf("picker.allPrices","All prices"),allActive:!n.focusedCatKey&&!n.priceBandKeys}):"";let s=e.map(a=>a.key).join("|");n.lastRailSignature!==s&&(n.lastRailSignature=s,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){n.applyPriceBand(null);return}n.focusCategory(a.dataset.cat??"")})}),n.railEdgesBound||(n.railEdgesBound=!0,o.addEventListener("scroll",()=>Ks(o),{passive:!0})),requestAnimationFrame(()=>Ks(o))}function mh(n){let e=n.controller.doc;if(!e||!n.els.prices)return;let t=n.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);n.syncSoldout(i,t);let o=n.legendDeps(),r=n.suppressPricing,s=r?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;r&&(n.els.pricesSec?.querySelector("span")?.replaceChildren((0,ei.t)("picker.seatCategories")),n.els.pricesInfo?.remove()),n.syncPriceRail(i,t,s);let a=5,l=i.length-a,c=l>1&&!n.pricesExpanded,d=c?i.slice(0,a):i;n.els.prices.classList.toggle("sl-expanded",l>1&&n.pricesExpanded),n.els.prices.innerHTML=ah({...s,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(p,m)=>m?n.tf("picker.showAllSeats","Show all seats"):(0,ei.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?r?(0,ei.t)("picker.showAllCategories"):(0,ei.t)("picker.showAllTicketTypes",{count:i.length}):n.tf("picker.showFewer","Show fewer"):null,status:{legend:n.tf("picker.seatStatusLegend","Seat status legend"),unavailable:n.tf("picker.group.legendUnavailable","Unavailable"),partial:n.partialLegend()}}),n.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>n.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>n.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>n.focusCategory(p.dataset.cat??"");p.addEventListener("click",m),p.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),m())})}),n.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{n.pricesExpanded=!n.pricesExpanded,n.syncPrices()})}function fh(n,e){if(!e)return;let t=n.focusedCatKey===e?null:e;n.focusedCatKey=t,n.priceBandKeys=t?new Set([t]):null;let i=n.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),n.controller.setCategoryFilter(t?[t]:null),n.controller.focusCategoryFilter(t?[t]:null),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}var ti=require("@seatlayer/core");function Xe(n,e,t){let i=(0,ti.t)(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(o,r)=>r in t?String(t[r]):o):e}function ab(n){let e=(0,ti.tCount)("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function lb(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function cb(n){if(n.length<2)return!1;let e=[...n].sort((t,i)=>t-i);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function db(n){let e=n.filter(o=>o.objectType==="ga"),t=n.filter(o=>o.objectType!=="ga"),i=[];if(t.length){let o=ab(t.length),r=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(r.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?Xe("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:r[0],row:s[0],seat:String(t[0].seatNumber??"")}):cb(a)?Xe("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:r[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?Xe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):Xe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]}))}else r.length===1?i.push(Xe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]})):r.length>1?i.push(Xe("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:lb(r)})):i.push(o)}for(let o of e)i.push(Xe("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return i.length?i.reduce((o,r)=>Xe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:r})):""}function gh(n){if(!n)return[];let e=new Map((n.seats??[]).map(o=>[o.label,o])),t=n.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let r=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...r?.sectionLabel?{sectionLabel:r.sectionLabel}:{},...r?.rowLabel?{rowLabel:ve(r)??r.rowLabel}:{},...r?.seatNumber?{seatNumber:r.seatNumber}:{}}})}function bh(n,e){if(!n.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let i=n.seatByLabel(t.label);!i||n.statusOf(i.id)!=="free"||n.flash(i.id,n.accent)}}function yh(n,e){if(!e.recoverable.length||!n.isConnected)return;let t=n.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>(0,ti.t)("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),o=i?.querySelector(".sl-interrupt-act");if(!i||!o)return;o.classList.add("sl-interrupt-act-secondary");let r=document.createElement("button");r.type="button",r.className="sl-interrupt-act sl-hold-expired-recover",r.textContent=(0,ti.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),r.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(r,o),n.classList.add("has-recovery"),r.focus()}function vh(n,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let i=document.createElement("div");i.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let r=document.createElement("span");r.className="sl-interrupt-glyph",r.setAttribute("aria-hidden","true"),r.textContent="\u23F1";let s=document.createElement("span");s.textContent=Xe("picker.holdExpiredTitle","Your seats were released"),o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=Xe("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(o,a);let l=db(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,i.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=Xe("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=Xe("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>n.restart()),d.appendChild(p),i.appendChild(d),t.appendChild(i),t.addEventListener("pointerdown",m=>{m.target===t&&n.restart()}),t}var kt=require("@seatlayer/core");var wh={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},pb='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',hb='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',ub=8,mb=8,fb=88;function gb(n){let e=n.gap??ub,t=n.margin??mb,i=n.min??fb,o=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-o-e-t),i)}var Er=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=hb,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let r of this.stored())this.offeredFree().has(r)&&this.active.add(r);if(this.menu.innerHTML=Hl(o,t.tf("picker.close","Close"))+Rl(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",r=>r.stopPropagation()),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",r=>{r.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.menu.addEventListener("focusin",r=>{let s=r.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:o})=>[i,o])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let o=i.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let r=o.slice(5),s=e.get(r);if(s===void 0)continue;let a=this.countNode(i),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(r,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${gb({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();cs(this.menu,{x:t.left+t.width/2,y:t.top}),cc(this.menu),lc(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,kt.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:pb,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:o})=>({key:i,count:o}));let t=this.deps.present;return t?kt.ACCESSIBILITY_TYPES.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(kt.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:o})=>{let r=t.get(i);return r?[{key:`a11y:${i}`,iconHtml:(0,kt.seatTypeIconSvg)(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,wh[i]??r.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),i=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",i),e.setAttribute("aria-expanded",String(i))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let i=t.slice(5),o=!this.active.has(i);o?this.active.add(i):this.active.delete(i),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=i,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,r.textContent??""));let s=o.querySelector(".sl-info");s?s.after(r):e.after(r),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),r.addEventListener("click",a=>{a.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(i);l&&r.setAttribute("aria-label",this.jumpLabel(i,r.textContent??"",l.label))})}}countText(e){return e>0?(0,kt.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=wh[e]??kt.ACCESSIBILITY_TYPES.find(i=>i.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var xh=require("@seatlayer/core"),bb=250;function kh(n,e=bb){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},o=(0,xh.attachVisibilityCatchUp)(i),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),o(),r&&window.removeEventListener("focus",i)}}var mn=require("@seatlayer/core");var Cr=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,mn.holdRecoveryShape)(e),i=e.lapsedLabels.length,o=i-e.recoverable.length,r=t==="all"?(0,mn.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,mn.tCount)("picker.holdLapsedSomeTaken",o):(0,mn.tCount)("picker.holdLapsedAllTaken",i);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${Y(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${Y(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,mn.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var Sh="@seatlayer/pending-checkout/v1";function yb(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function ni(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let o=window.sessionStorage.getItem(Sh);if(o){let r=null;try{r=JSON.parse(o)}catch{}if(r&&yb(r.orderId)){let s=Date.now()-Number(r.storedAt);if(s>=0&&s<=144e5){if(r.eventKey&&r.eventKey!==n)return null;i=r.orderId}}}window.sessionStorage.removeItem(Sh)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function Th(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Eh="https://api.seatlayer.io",vb=10,wb=250,Ch=6e4,Ah=4,xb=10,kb=40,Sb=220,Gs=["mini","peek","open"],Ph="seatmap.a11y.cb";function St(n,e,t){return t?{ok:!1,reason:n,message:e,labels:t}:{ok:!1,reason:n,message:e}}function Tb(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Ph);return n==null?null:n==="1"}catch{return null}}function Eb(n){try{window.localStorage.setItem(Ph,n?"1":"0")}catch{}}var Tt=class n{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.paintedLocale=null;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.guestsOnly=!1;this.guestsDeadlineStop=null;this.salesInfo=null;this.salesUi=null;this.salesUiLoad=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new gr({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Cr({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.escHandler=null;this.closeModal=null;this.markedSeatIds=new Set;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Np(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Eh).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?$o({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??zn(e,t),this.pubApi=e.transport?null:i?.api??new Lt(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=Wc(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Do(this.api),this.buyerAssetUrls=new qn(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let r=Dp(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(vb,r)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.baQty=Math.min(this.baQty,this.maxTickets),this.cbSafe=Tb()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Wn(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Th({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Ah&&t.width>=window.innerWidth-Ah}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}fullscreenMeasurementChanged(e,t){let i=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,r=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:o},r}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){vt();let t=sr(v("picker.seatSelection","Seat selection"),gt(void 0,e.theme)["--sl-bg"]),i;try{i=new n({...e,container:t.frame})}catch(s){throw t.teardown(!1),s}i.modalCleanup=()=>{i.modalCleanup=null,t.teardown()};let o=!1,r=()=>{if(o)return;o=!0,i.modalCleanup?.();let s=()=>{i.destroy(),e.onClose?.()};i.hold&&!i.handedOff&&e.holdOnClose!=="keep"?i.release().finally(s):s()};i.closeModal=r,t.onScrimPress(r),i.escHandler=t.trapKeys(s=>{i.tableDialog?(s.preventDefault(),i.cancelTableDialog()):i.confirmSeat?(s.preventDefault(),i.cancelConfirm()):i.bestAvailableConfirm?(s.preventDefault(),i.bestAvailableConfirm=!1,i.syncTray()):(s.preventDefault(),r())});try{let s=i.render();i.els.close?.classList.add("on"),i.els.close?.addEventListener("click",r),await s}catch(s){throw i.destroy(),s}return i.destroyed||t.focusFirst(),i}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;rc({base:(e.apiBase??Eh).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new I.PickerController({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,unselectableAsUnavailable:e.unselectableAsUnavailable,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),seatPriceLabel:t=>{let i=this.seatPriceRangeOf(t.label,t.categoryKey);return i?this.moneyRange(i):void 0},flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:Dn(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>this.openAreaChooser(t,this.lastMapPoint),onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),nd(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=gh(this.hold);let o=this.hold;this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear();let r=this.api.resume,s=t&&!i&&o&&r?rh(a=>r.call(this.api,this.opts.event,a),o.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||i){let a=()=>this.toast((0,I.t)("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");if(!s){a();return}s.then(l=>{if(!(this.destroyed||this.hold)){if(!l){a();return}this.hold=o,this.showBooked()}});return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),s?s.then(a=>{a||this.opts.onHoldExpired?.()}):this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(Ii(this.maxTickets),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onSalesNotice:t=>this.salesNotice(t),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=b=>Math.round((performance.now()-b)*100)/100;this.rendered=!0,vt();let o=performance.now(),r=Ro(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=dl(this.opts.container),{root:c,els:d,mapHost:p}=ql(l,(b,T)=>this.tf(b,T),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,this.paintedLocale=(0,I.getLocale)(),this.opts.checkoutBar===!1&&(c.dataset.checkoutBar="off"),Io(c,r,b=>{t.loadLocale=i(o),this.destroyed||this.applyActiveLocale(b,s)}),ep(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]);let m=this.performanceGroup?.modalClose;m&&(this.els.close?.classList.add("on"),this.els.close?.addEventListener("click",()=>m()));let u=this.performanceGroup?.subheader;u&&c.querySelector(".sl-head")?.after(u),this.syncFullscreenButtons(),this.wireBuyerShell(c);let f=document.createElement("div");return f.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(f),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(f,t,i,e,c)}async loadAndFinishChart(e,t,i,o,r){this.startRealtime(),this.startIdleClock(r);let s=await this.loadChart(e,t,i);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(o);let a=performance.now();this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,this.salesInfo=s;let l=this.chartFetch.outcome();if(this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,l.state==="resolved"&&l.guestsOnly){this.guestsOnly=!0,this.salesClosed=!0;let{forMs:E}=l.guestsOnly;E!==null&&(this.guestsDeadlineStop=Ql(this,E))}if(r.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),s.mode==="test"){let E=document.createElement("div");E.className="sl-testbadge",this.testBadgeEl=E,this.syncTestBadge(),this.regions["top-left"].appendChild(E)}let c=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(r),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,fo(this.els.logo,[this.opts.theme?.logoUrl,c?.logoUrl,this.performanceGroup?.brandLogoUrl,s.posterUrl],this.opts.theme?.brandName??c?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let d=s.startsAt?vo(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=d||null,this.els.meta.textContent=[s.venue,d].filter(Boolean).join(" \xB7 "),this.syncProjection();let p=!!this.controller.doc&&this.controller.getExpandedSeats().some(E=>E.commercial?.restrictedView||E.commercial?.obstructedView);this.buildAccessibilityMenu(p),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),r.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=i(a);let m=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(m),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,f=ro(this.opts.event),b=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),T=b??"event",C={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:T,surface:b==="season"?"season_picker":b==="performance_group"?"performance_group_picker":"seat_picker",ms:i(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(E=>E.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:f,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};lp(C,(E,L)=>this.emitAnalytics(E,L));let k=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",Fs({...C,performanceProfile:{...C.performanceProfile,...k}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return rp(this)}webMcpHost(e){return Ds(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=kh(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let r=0,s=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,r=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-r;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-r)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),i())}),e.addEventListener("click",o=>{let r=o.target.closest("[data-sl-info]");if(!r||!e.contains(r))return;o.stopPropagation();let s=r.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),r.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-r.left,y:o.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let i=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),i==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),i=this.els.sheetToggle;i?.setAttribute("aria-expanded",String(e==="open")),i?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=Gs.indexOf(this.sheetState()),i=Math.min(Gs.length-1,Math.max(0,t+e));this.setSheetState(Gs[i])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let o=e.clientHeight,r=i!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:o};let s=this.fullscreenMeasurementChanged(i,o);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),r&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let r=await Bn(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=(0,I.t)("picker.loadingTakingLonger"))});if(this.loadAbort=null,r.outcome==="cancelled"||this.destroyed)return null;let s=r.outcome==="loaded"?r.value:null,a=r.outcome==="loaded"&&!s&&!this.opts.transport?Fo(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=i(o),this.destroyed)return null;if(!s){a&&Bo({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),rt({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:r.outcome==="timeout"?"load_timeout":r.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:ht(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Yn(this.els.boot,{title:["picker.eventUnavailableTitle","This event isn\u2019t available"],description:["picker.eventUnavailable","Tickets can\u2019t be booked here right now."]});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Yn(this.els.boot,{title:["picker.mapDidNotLoad","The seat map didn\u2019t load"],description:["picker.checkConnection","Check your connection and try again."],action:["picker.accessRetry","Try again"]}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Yn(this.els.boot,{title:["picker.loadingSeatMap","Loading seat map\u2026"],busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},i,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),i=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;rt({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:ht(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Yn(this.els.boot,{title:["picker.restoreUnavailableTitle"],description:["picker.restoreUnavailable"],action:["picker.accessRetry","Try again"]}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Yn(this.els.boot,{title:["picker.restoringSeats"],busy:!0})}}return!1}finally{t.forEach((o,r)=>{i[r]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=ni(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new Er(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,o)=>this.tf(i,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,I.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let s=e?this.regions["bottom-center"]??this.els.map:i;s&&o.parentElement!==s&&(o.dataset.dock=e?"map":"head",s===i?s.insertBefore(o,this.els.close??null):s.appendChild(o))}let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Bp(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${Y(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return this.guestsOnly?No():this.salesUi?.words(this)??Fl(this.wordsSalesState(),!!this.opts.readOnly)}wordsSalesState(){return this.salesState==="testable"&&this.salesInfo?.mode==="test"?"live":this.salesState}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=pl().then(e=>(e.translate(I.t,I.tCount),this.salesUi=e,this.destroyed||this.applySalesClosed(),e),()=>null)}salesNotice(e){(this.salesUi||e.state!=="live")&&this.withSalesUi().then(t=>t?.applyNotice(this,e))}tf(e,t){return v(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,o,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,i),r=[...Eo(e,t)].join("|");r!==this.baSoldOutSig&&(this.baSoldOutSig=r,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog(),this.salesClosed&&!this.salesUi&&this.withSalesUi();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed&&!this.salesUi?.view(this));let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),i=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);if(this.buyerView==="venue3d"&&this.view3dHandle){Ep(this,i);return}Dc({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,r)=>this.controller.focusSection(o,r),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,r)=>this.scheduleMotion(o,r)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){return $p(this)}heldTicketCount(){return zp(this)}totalTicketCount(){return jp(this)}updateSelectionCapacity(){Kp(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Gp(this,e,t)}setCtaPhase(e){Up(this,e)}runCheckoutHandoff(e,t){return qp(this,e,t)}holdStorageKey(){return Wp(this)}rememberedHoldId(){return Yp(this)}rememberHold(e){Xp(this,e)}forgetHold(){Qp(this)}resumeHoldFromServer(e,t=!1){return Zp(this,e,t)}restoreRememberedHold(){return Jp(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(o=>o.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Yd({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return vr(this,e)}catPriceRange(e){return wr(this,e)}buildPriceFilter(){dh(this)}applyPriceBand(e){ph(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.dataset.slA="picker.venueView",i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])o.addEventListener(r,bo,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=(0,I.effectiveFloorOverview)(e)==="combined"&&(e.floors?.length??0)>1&&o.size===0||i.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,I.t)("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:(0,I.t)("picker.rungLabel.zones"),sections:(0,I.t)("picker.rungLabel.sections"),seats:(0,I.t)("picker.rungLabel.seats")},d={zones:(0,I.t)("picker.rungTip.zones"),sections:(0,I.t)("picker.rungTip.sections"),seats:(0,I.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" data-sl-t="picker.rungLabel.${p}" data-sl-ti="picker.rungTip.${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let m=p.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let i=vd({floors:this.controller.getFloors(),tf:(o,r)=>this.tf(o,r),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(i),this.floorsEl=i,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&Hc(this.root,e,this.regions);let t=e?yd(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(i=>i?.isConnected?i.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(i=>t[i]===this.arenaViewportInsets[i])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,i=this.root?.dataset.layout==="narrow",o=0;if(i&&e&&t?.isConnected){let r=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(o=Math.max(0,r.bottom-s.top+8))}this.controller.setFitClearance?.(o)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=cl((0,I.t)("picker.testMode"),(0,I.getLocale)()),e.setAttribute("aria-label",(0,I.t)("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let o=i.dataset.rung===e;i.classList.toggle("on",o),i.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),r=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,s=hd({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!i&&i.disabled!==r||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,i&&(i.disabled=r,i.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?(0,I.t)("picker.priceHint3d"):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!go()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Ch/2:Ch}syncFloors(){wd(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new pr({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let i=t.findIndex(o=>o.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=Hs(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Ld(t,e.displayLabel??e.label,this.opts.locale,un(this.performanceGroup))}seatPriceRangeOf(e,t){let i=this.controller.doc?.categories.find(r=>r.key===t),o=i?i.tiers?.length?i.tiers.map(r=>this.paidPrice(i.key,r.id??null,r.price,e)):i.price==null?[]:[this.paidPrice(i.key,null,i.price,e)]:[];return o.length?{min:Math.min(...o),max:Math.max(...o)}:void 0}moneyRange(e){return e.max>e.min?`${this.money(e.min)}\u2013${this.money(e.max)}`:this.money(e.min)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let i=this.controller.doc?.categories.find(u=>u.key===e.categoryKey),r=(this.controller.getStatus(e.id)??"free")==="free"?this.tf("picker.statusAvailable","available"):this.controller.currentHold()?.labels.includes(e.label)?this.tf("picker.heldForYou","Held for you").toLocaleLowerCase((0,I.getLocale)()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase((0,I.getLocale)()),s=this.seatPriceRangeOf(e.label,e.categoryKey),a=!this.suppressPricing&&s?this.moneyRange(s):void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=Dt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,I.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,I.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,I.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,I.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=Ml(e,{variable:r,held:t,typeWord:Dt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>s.querySelector(r?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,I.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new mr({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),feeNote:e=>this.feeWords().seat(e),paidPrice:(e,t,i,o)=>this.paidPrice(e,t,i,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,packagePrice:e=>this.performanceGroup?.packagePricing?.seatCardPrice(e)??null,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){qd(e,t,this.reducedMotion())}addSeatLabel(e){return Wd(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,o=this.controller.getActiveFloorId(),r=e.focalPoint??i?.floors?.find(p=>p.id===o)?.focalPoint??i?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let p,m=null;try{let f=e.viewMeta?.previewUrl;f&&f!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(f),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(f){t===this.seatViewGen&&this.opts.onError?.(f);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!m||!this.root||!this.seatViewEnabled())return;let u={url:p,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};s=u,a=(0,Ar.seatViewDisclosure)(u),l=(0,Ar.isAuthoredSeatView)(u)}else{let p;try{let{generateSeatPanorama:m}=await yo();p=m(e,r,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:p.url,generated:!0},a=(0,I.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,I.t)("picker.viewFromSeat",{label:e.label}),d=Yo({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:rn(),viewFromSeatLabel:c,real360Label:(0,I.t)("picker.real360"),previewLabel:(0,I.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}feeWords(){return ld(rd(this.offerAvailability,this.currency,this.hostPricing),this.currency,e=>this.money(e))}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,I.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,r)=>`${o} ${r}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=id(e,t);if(i==null)return;let o=6*36e5,r=Math.min(Math.max(i-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<wb}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let i=lr(t);if(!i)return;let o=this.offerAvailability?.bookingFee?.amountMinor;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i),this.setPricing(this.hostPricing),i.bookingFee?.amountMinor!==o&&this.syncTray(),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let i=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?i.find(o=>(o.tierId??null)===t)??i.find(o=>o.tierId==null)??null:i[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(i=>i.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0||Object.keys(this.opts.pricing?.objects??{}).length>0||Object.keys(this.controller.doc?.seatPrices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(i=>{let o=this.catPriceRange(i);return o?[[i.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,o=!i&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!o){e.classList.remove("has"),e.replaceChildren();return}let r=i??o,s=r.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let p=r.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));Jr(p)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=xo(p,Y);let m=document.createElement("span");m.className="sl-offer-line";let u=[];if(!s&&i&&t.fromPrice!=null&&u.push(this.money(t.fromPrice/100)),!s&&i&&r.remaining!=null&&u.push((0,I.t)("picker.offerRemainingAvailable",{count:r.remaining})),i&&r.endsAt!=null){let k=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?bl(r.endsAt):null;if(u.push(k??(0,I.t)("picker.offerUntil",{time:vo(r.endsAt,this.eventTimezone,this.opts.locale)})),k){let E=Math.max(1e3,r.endsAt-Date.now()),L=E%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=r.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(L+25,E+25))}}if(o?.startsAt!=null&&u.push((0,I.t)("picker.offerStarts",{time:vo(o.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=u.join(" \xB7 "),s||l.append(c),l.append(d,m),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let f=document.createElement("details");f.className="sl-offer-info";let b=document.createElement("summary");b.setAttribute("aria-label",(0,I.t)("picker.howOfferWorks",{name:d.textContent??""})),b.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=i?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),f.append(b,T),a.append(l,f),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,o){if(o){let s=(0,I.seatPriceFor)(this.opts.pricing?.objects,o,t)??(0,I.seatPriceFor)(this.controller.doc?.seatPrices,o,t);if(s!==void 0)return s}let r=o?this.channelByObject.get(o):void 0;if(r&&e){let s=this.pricesByChannel.get(r)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(s)return s.price}return wt(this.opts.pricing?.prices,e,t,i)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:Zo({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return hh(this)}seatCategory(e){return this.controller.seatByLabel(e)?.categoryKey||null}seatPlaces(e){return e.map(t=>{let i=this.controller.seatByLabel(t),o=i?this.controller.seatDetails(i.id):null,r=o?ve(o)||o.rowLabel:null;return{label:t,...o?.sectionLabel?{section:o.sectionLabel}:{},...r?{row:String(r)}:{},...o?.seatNumber!=null?{seat:String(o.seatNumber)}:{}}})}partialLegend(){return this.markedSeatIds.size?this.performanceGroup?.partialWords?.legend??null:null}syncPriceRail(e,t,i=this.legendDeps()){uh(this,e,t,i)}syncPrices(){this.currencyResolved&&mh(this)}focusCategory(e){fh(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast((0,I.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:o,total:r,count:s}=yr(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(Td(g,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let R=this.performanceGroup?.selectionModeSwitch;R&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${Y(R.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.wordsSalesState(),note:this.guestsOnly?Jl():this.salesUi?.note(this),hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,season:un(this.performanceGroup),seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Bl(c)),this.els.trayHint&&(this.els.trayHint.textContent=Vl(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!i.length&&!yt(this.gaQty,this.hold?.items??[]);if(Sr(this.performanceGroup)&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let g=(this.controller.doc?.categories??[]).filter(V=>!V.notForSale),R=this.controller.getBestAvailableZones();this.baZone&&!R.some(V=>V.id===this.baZone)&&(this.baZone="");let _=Eo(g,this.controller.categoryAvailability());this.baSoldOutSig=[..._].join("|"),this.bestAvailableSoldOut=g.length>0&&_.size===g.length,_.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Nl({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:g.map(V=>_.has(V.key)?{...V,soldOut:!0}:V),zones:R,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(g,R,_,V=1,z,F,ne,J)=>Ol({categoryLabel:ne,offerName:J,d:g?this.controller.seatDetails(g):null,area:_==="ga"?t.find(X=>X.id===z):void 0,label:R,objectType:_,quantity:V,identity:F,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=Y,u=[];for(let g of fc(i)){let R=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(R);let _=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,V=this.performanceGroup?.packagePricing?g.categoryKey||_?.categoryKey||"":g.categoryKey,z=this.controller.doc?.categories.find(B=>B.key===V),F=this.performanceGroup||this.suppressPricing?null:sp(this.controller,g),ne=this.performanceGroup?.packagePricing?.seat(g.label,V),J=(g.tierId&&!F?z?.tiers?.find(B=>B.id===g.tierId)?.name:void 0)??ne?.types?.options.find(B=>B.id===ne.types?.selected)?.name,X=this.offerPrice(g.categoryKey,g.tierId??null)?.offerName,xe=g.objectType==="table"?this.controller.tableSelection(g.label):null,ge=_?this.controller.seatDetails(_.id):null,Ee=this.seatViewEnabled()&&!!_&&g.objectType!=="table"&&!!this.deliverableViewReference(_),Ke=m(this.tf("picker.heldForYou","Held for you")),S=(xe?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,I.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+(F?`<select class="tier" data-held-tier="${m(g.label)}" aria-label="${m((0,I.t)("picker.ticketTierFor",{label:g.label}))}">${To(F,g.tierId??void 0,m)}</select>`:""),P=this.heldPrice(g)*(g.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!0,seatIds:[],heldLabels:g.labels,removeAria:(0,I.t)("picker.removeHeldTicketLabel",{label:Uo(g,t)}),locateId:_?.id??null,section:ge?.sectionLabel??"",rowLabel:ge&&ve(ge)||"",seatLabel:ge?.seatNumber??g.label,categoryLabel:`${z?.label??V}${J?` \xB7 ${J}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(V)??z?.color??"",identityHtml:p(_?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,xe??void 0,`${z?.label??V}${J?` \xB7 ${J}`:""}`,X),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ke}" title="${Ke}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:S,amount:P,amountText:ne?ne.amountText:this.suppressPricing?"":this.money(P),noteHtml:sn(_??void 0),railHtml:this.performanceGroup?"":os((0,I.t)("picker.removeHeldTicketLabel",{label:Uo(g,t)}),Ee?g.label:null)})}let f=this.seatViewEnabled();for(let g of e.filter(R=>!o.has(R.label))){let R=`seat:${g.id}`;l.add(R);let _=this.controller.doc?.categories.find(S=>S.key===g.categoryKey),V=this.performanceGroup?.packagePricing?.seat(g.label,g.categoryKey),z=V?.types?`<select class="tier" data-season-type="${m(g.label)}" aria-label="${m((0,I.t)("picker.ticketTierFor",{label:g.label}))}">`+To(V.types.options,V.types.selected,m)+"</select>":g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(g.id)}" aria-label="${m((0,I.t)("picker.ticketTierFor",{label:g.label}))}">`+To(g.tiers,g.tierId,m)+"</select>":"",F=g.tiers?.find(S=>S.id===g.tierId)??g.tiers?.[0],ne=this.offerPrice(g.categoryKey,F?.id??null)?.offerName,J=F?.buyerMessage?.trim()||(F?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),X=this.controller.seatDetails(g.id),xe=m(this.tf("picker.selected","Selected")),ge=(0,I.t)("picker.removeSeatLabel",{label:g.label}),Ee=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,I.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+z,Ke=this.paidPrice(g.categoryKey,g.tierId??null,g.price,g.label)*(g.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!1,seatIds:[g.id],heldLabels:[],locateId:g.id,section:X?.sectionLabel??"",rowLabel:X&&ve(X)||"",seatLabel:X?.seatNumber??g.label,categoryLabel:_?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,_?.label??g.categoryKey,ne),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??_?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${xe}" title="${xe}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Ee,amount:Ke,amountText:V?V.amountText:this.suppressPricing?"":this.money(Ke),removeAria:ge,noteHtml:sn(g)+(J?`<small class="sl-tier-note">${m(J)}</small>`:""),railHtml:os(ge,f&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}u.length&&a.push(u.map(_l).join("")),t.length&&a.push(xc(this,t,i)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let b=this.performanceGroup?.selectNight;b&&_d(this.els.tray,g=>b(g)),this.els.tray.querySelectorAll("[data-ba]").forEach(g=>{g.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(g.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",g=>{this.baCat=g.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",g=>{this.baZone=g.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(g=>{g.addEventListener("click",()=>{let R=g.closest(".sl-chip");if(R.dataset.held){this.removeHeldLabels(decodeURIComponent(R.dataset.held).split(`
3540
- `),R);return}let _=R.dataset.seat.split(" "),V=()=>{this.controller.deselect(_)};if(this.reducedMotion()){V();return}R.classList.remove("sl-enter"),R.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(V,Pe.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",R=>{R.stopPropagation();let _=decodeURIComponent(g.dataset.tableEdit??""),V=this.controller.tableSelection(_);if(!V)return;let z=i.find(F=>F.label===_&&F.objectType==="table");this.showTableDialog({...V,quantity:z?.quantity??V.quantity},!!z,g)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(g=>{g.addEventListener("change",()=>{let R=g.dataset.seasonType,_=this.performanceGroup?.packagePricing;R&&_?(_.setType(R,g.value),this.syncTray()):g.dataset.heldTier?this.changeHeldTier(g,g.dataset.heldTier):this.controller.setSeatTier(g.dataset.tier,g.value||null)})}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(g=>{g.addEventListener("click",()=>{let R=this.controller.seatByLabel(g.dataset.viewLabel);R&&this.openSeatView(R)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(g=>{let R=()=>this.controller.flashSeat(g.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");g.addEventListener("mouseenter",R),g.addEventListener("focusin",R),g.addEventListener("click",_=>{_.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([g.dataset.locate],{animate:!this.reducedMotion()})||R()})}),kc(this,this.els.tray,t),this.controller.setGASelection(pc(this.gaQty)),$s(this),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(g=>{g.disabled=!0});let T=this.pendingSelectionCount(),C=this.lastTrayCount,k=this.lastTrayTotal,E=Od(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat",un(this.performanceGroup)),L=s?this.performanceGroup?.packagePricing?.total([...i.filter(g=>g.objectType!=="ga"),...e.filter(g=>!o.has(g.label))].map(g=>({label:g.label,categoryKey:g.categoryKey||this.controller.seatByLabel(g.label)?.categoryKey||""}))):null;this.els.count.textContent=L?.countText||E||(s?(0,I.tCount)("picker.ticketsCount",s)+(this.suppressPricing?"":this.feeWords().tray(i,s,r)):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=L?L.amountText:s&&!this.suppressPricing?this.money(r):"",this.root?.setAttribute("data-has-selection",String(s>0)),this.sheetState()==="mini"&&s===0?this.setSheetState("mini"):s>C&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=E||(s?(0,I.tCount)("picker.seatsSelectedCount",s):"")),this.syncCta(s,T);let D=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";s!==C&&!D&&this.animateOnce(this.els.count,"sl-value-pop",380),r!==k&&!D&&this.animateOnce(this.els.total,"sl-value-pop",380),C===0&&s>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=s,this.lastTrayTotal=r,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(s,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){Qc(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Zc),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Jc),ed(this.els.tray?.querySelector("select.sl-ba-cat"))}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}async removeHeldLabels(e,t){let i=e.filter(s=>s&&!this.releasingLabels.has(s));if(!i.length||this.performanceGroup)return!1;let o=i[0];i.forEach(s=>this.releasingLabels.add(s)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,I.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;gc(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{i.forEach(s=>this.releasingLabels.delete(s)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async holdSelection(){return this.ctaPhase!=="idle"?St("busy",this.tf("picker.securingSeats","Securing your seats\u2026")):!this.hold&&this.totalTicketCount()===0?St("nothing_selected",this.tf("picker.selectSeats","Select seats")):this.handleCta(!1)}async handleCta(e=!0,t=e){if(this.salesClosed&&!this.finishingHold())return St("sales_closed",this.guestsOnly?No().toast:this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."));let i=this.controller.getSelectionValidity(this.totalTicketCount());if(i&&!i.isValid){let r=Tr(i,(s,a)=>this.tf(s,a));return this.toast(r,"warning"),St("selection_invalid",r)}if(this.totalTicketCount()>this.maxTickets){let r=(0,I.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets});return this.toast(r,"warning"),St("too_many_tickets",r)}let o=this.committedSelection();if(this.hold&&(this.salesClosed||!o.some(r=>!(this.hold.items??[]).some(s=>s.label===r.label))&&!yt(this.gaQty,this.hold.items??[]))){let r=this.hold.seats??o;return this.handedOff=!0,this.holdConflicted=!1,e&&await this.runCheckoutHandoff(this.hold,r),{ok:!0,hold:this.hold,seats:r}}this.holdingLabels=new Set(o.map(r=>r.label)),this.setCtaPhase("holding");try{let r=null,s=hc(this.gaQty,this.controller.currentHold?.()?.items??this.hold?.items??[]),a=this.committedSelection();if(a.length){let d=await this.controller.hold(void 0,this.opts.holdTtlMs);r=d?{holdId:d.holdId,expiresAt:d.expiresAt,seats:d.seats,items:d.items}:null}for(let{areaId:d,tierId:p,qty:m}of s){let u=await this.controller.holdGA(d,m,{tierId:p,ttlMs:this.opts.holdTtlMs});r=u?{holdId:u.holdId,expiresAt:u.expiresAt,seats:u.seats,items:u.items}:r}if(!r){let d=this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");return this.raiseHoldConflict(d),this.setCtaPhase("idle"),this.syncTray(),St("seats_taken",d)}this.hold=r,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(r.expiresAt),this.flashHeldSeats(r),this.emitHoldChange();let l=this.performanceGroup;return e&&(!l||t&&l.checkoutReady?.(r.holdId)===!0)?(this.handedOff=!0,await this.runCheckoutHandoff(r,r.seats??a)):this.setCtaPhase("idle"),{ok:!0,hold:r,seats:r.seats??a}}catch(r){this.opts.onError?.(r);let s=Ms(r);if(s)return this.toast(s,"warning"),this.setCtaPhase("idle"),St("paused",s);let a=this.guestRefusalMessage(r);if(a)return this.toast(a,"warning"),this.setCtaPhase("idle"),St("sales_closed",a);let l=r,c=(l.conflicts??[]).map(m=>m.label).filter(Boolean).slice(0,3);l.reason==="event_closed"&&this.setSalesClosed(!0);let d=l.buyerMessage?l.buyerMessage:l.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):l.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):l.reason==="ticket_option_not_applicable"?(0,I.t)("picker.ticketOptionNotApplicable"):c.length?c.length===1?(0,I.t)("picker.labelsNoLongerAvailable.one",{labels:c.join(", ")}):(0,I.t)("picker.labelsNoLongerAvailable.other",{labels:c.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(d),this.setCtaPhase("idle");let p=l.reason==="event_closed"?"sales_closed":l.reason==="companion_pair_required"||l.reason==="ticket_option_not_applicable"?l.reason:"seats_taken";return St(p,d,c.length?c:void 0)}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){eh(this,e)}stopHoldTimer(){th(this)}setExtendPrompt(e,t){nh(this,e,t)}refreshExtendPrompt(){ih(this)}handleExtend(){return oh(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.holdConflicted||this.controller.currentHold()===null&&this.showBooked()}settleBookedHold(e){this.hold?.holdId!==e||this.bookedShown||this.holdConflicted||(this.controller.clearHold(),this.showBooked())}guestRefusalMessage(e){let t=Zl(e);return t==="guest_choice_closed"?ec():t!=="guests_only"?null:(tc(this),this.salesClosed=!0,this.applySalesClosed(),No().toast)}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}bookedLine(){return this.checkoutMode==="hosted"?this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way."):this.tf("picker.confirmedOnly","confirmed.")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,r)=>o+r.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();if(this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${un(this.performanceGroup)?(0,I.tCount)("picker.season.ticketsConfirmedAcross",i.seats,{performances:i.performances}):(0,I.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,I.tCount)("picker.ticketsCount",t)}</span> ${this.bookedLine()}`),this.els.bookedList){let o=this.controller.getGAAreas();this.els.bookedList.innerHTML=e.lineItems.map(r=>{let s=r.rowLabel&&r.objectType!=="ga"?this.controller.seatDetails(this.controller.seatByLabel(r.label)?.id??""):null,a=Dt({displayType:r.displayType??s?.displayType,rowType:s?.rowType,objectType:s?.objectType??r.objectType}),c=(r.objectType==="ga"?"":[r.sectionLabel,r.rowLabel&&`${a} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 "))||(r.objectType==="ga"?r.displayLabel||Uo(r,o):r.objectType==="table"?`${a} ${r.displayLabel||r.label}`:r.displayLabel||r.label),d=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${Y(c)}${d}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0}this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let r=o?.bookingMode==="free",s=o?.providers?.[0]??null;if(!s&&!r){let a=hl(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:i}),this.opts.onCheckout?.(e,t,i),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:ul(i)});return}await this.openCheckoutPanel(ml(i,s,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await _n())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:i=>this.money(i),t:I.t,startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>{fl(i)&&(this.paymentOptions=null),i?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(i)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(s=>{let a=this.controller.lineItemDisplay(s),l=s.objectType==="seat"||s.objectType==="booth"?this.controller.seatByLabel(s.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?ve(c):void 0,p=this.controller.doc?.categories.find(f=>f.key===s.categoryKey),m=s.tierId?p?.tiers?.find(f=>f.id===s.tierId)?.name:void 0,u=this.heldPrice(s);return{label:s.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...p?.label?{categoryLabel:p.label}:{},...m?{tierLabel:m}:{},objectId:s.objectId,objectType:s.objectType,categoryKey:s.categoryKey,tierId:s.tierId,unitPrice:u,...cd(s,u),currency:s.currency??this.currency,quantity:s.quantity??1}}),o=i[0]?.currency??this.currency,r=i.reduce((s,a)=>s+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:i,total:r}}emitHoldChange(){let e=this.hold;this.realtime?.watchHold(e?.holdId??null),this.syncSelectionTo3d(),this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let o=this.els.toast;if(!o)return;o.replaceChildren();let r=document.createElement("span");if(r.textContent=e,o.appendChild(r),o.classList.toggle("has-action",!!i),i){let s=document.createElement("button");s.type="button",s.className="sl-toast-action",s.textContent=i.label,s.addEventListener("click",i.onClick,{once:!0}),o.appendChild(s)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let r=i.getBoundingClientRect(),s=r.height||i.offsetHeight||Sb,a=r.height?r.top-this.els.map.getBoundingClientRect().top:o-Is-s,l=Math.round(o-a+xb);if(l+kb>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),Jd({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Fd(this.tipPos,e,t):null,o=i??Dd(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,o=Hs(e.mark,i?.nights?.()),r=o?.states.filter(s=>s.free).length??0;return Ed(o,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(r)??null,pinned:t,words:i?.partialWords})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let i=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor);let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=this.performanceGroup?.packagePricing?.seatCardPrice(e.categoryKey)??null;this.tipEl.innerHTML=Nd(e,{price:s?s.price:this.suppressPricing?"":this.money(r),feeNote:s?s.note:this.suppressPricing?"":this.feeWords().seat(r),priceNote:s||!this.suppressPricing?"":this.performanceGroup?.surface==="season"?(0,I.t)("picker.season.includedInPackage"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"),rowTypeWord:Dt(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:o+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${Y(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=i,this.tipEl.classList.toggle("sl-tip-pinned",i),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),$d(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,a=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,a)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let i={};for(let[o,r]of Object.entries(e())){let s=this.controller.idForLabel(o);s&&(i[s]=r,r?this.markedSeatIds.add(s):this.markedSeatIds.delete(s))}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.baQty=Math.min(this.baQty,this.maxTickets),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Pi(this.themeMode),i=gt(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent);for(let[o,r]of Object.entries(i))e.style.setProperty(o,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Lo(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Dn(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Pi(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Pi(this.themeMode),i=gt(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent),o=Dn(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=Gl(i,o);for(let s of Kl)r?e.style.setProperty(s,r[s]):e.style.removeProperty(s)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=od(e?.prices,this.offerAvailability),i=Object.keys(t).length>0||e?.formatter||e?.objects?{prices:t,...e?.objects?{objects:e.objects}:{},...e?.formatter?{formatter:e.formatter}:{}}:void 0;JSON.stringify(this.opts.pricing??null)!==JSON.stringify(i??null)&&(this.opts.pricing=i,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Wl(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=this.localeGeneration+=1,i=await(0,I.loadLocale)(e);return this.opts.messages&&(0,I.setStringOverrides)(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(this.paintedLocale=e,Yl(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons(),()=>this.syncTestBadge()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Eb(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return yp(this)}setBuyerView(e,t){vp(this,e,t)}seatState3dFor(e){return wp(this,e)}pushAvailabilityTo3d(){xp(this)}syncSelectionTo3d(){Tp(this)}seatViewFor3d(e){return Cp(this,e)}onView3dSeatPick(e){Ap(this,e)}openAreaChooser(e,t){let i=this.controller.getGAAreas().find(o=>o.id===e);i&&(this.collapseSheet(),fs(this,i,t))}seatViewCaption(e){return Pp(this,e)}saveView3dComparisonSeat(e){Mp(this,e)}clearView3dComparison(){Lp(this)}view3dComparisonSnapshot(e){return Hp(this,e)}enter3d(e){return Rp(this,e)}publish3dTopInset(){Ip(this)}exit3d(){Op(this)}openSeatConfidencePassport(e,t=null){Bs(this,e,t)}closeSeatConfidencePassport(e=!0){Bi(this,e)}openView3dComparison(){hp(this)}closeView3dComparison(e=!0){hn(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let i=await ap(this.controller,t,e.value,this.opts.holdTtlMs);i&&(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.startHoldTimer(i.expiresAt),this.emitHoldChange())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){this.opts.onError?.(o);let r=Ms(o);if(r)return this.toast(r,"warning"),null;let s=this.guestRefusalMessage(o);if(s)return this.toast(s,"warning"),null;let a=o?.reason,l=o?.buyerMessage,c=l||(a==="not_enough_together"?(0,I.t)("picker.couldNotFindSeatsTogether",{count:e}):a==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):a==="ticket_option_not_applicable"?(0,I.t)("picker.ticketOptionNotApplicable"):a==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):a==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type."));return this.toast(c,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=Co(this.controller,t);if(o)throw o;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let r=this.els.tray?.querySelector(".sl-ba-go");r&&(r.disabled=!0,r.classList.add("sl-busy"),r.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(a=>a.commercial?.premium)&&this.toast((0,I.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(r){this.opts.onError?.(r),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new st({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>bd(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,i)=>{i==="booked"&&this.settleBookedHold(t)},sink:{...Hn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}}),onSales:t=>this.salesNotice(t)}}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),at(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Ll(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return md(this.idlePauseHost,e)}resumeFromIdle(){return gd(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=vh({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let i=t.filter(s=>s.objectType!=="ga"),o=[],r=[];for(let s of i){let a=this.controller.seatByLabel(s.label);(a&&this.controller.getStatus(a.id)==="free"?o:r).push(s.label)}yh(e,{recoverable:o,taken:r,onRecover:s=>this.recoverAfterHoldExpiry(s)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||bh({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,o)=>this.controller.flashSeat(i,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,Ns(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),at(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function Mh(n){Tt.prewarm(n)}var $t=require("@seatlayer/core");var Lh="seatlayer-performance-group-picker-style";function Hh(){if(document.getElementById(Lh))return;let n=document.createElement("style");n.id=Lh,n.textContent=`
3539
+ </div>`,e.append(i)}buildErrorCard(e,t){let i=hg[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let r=document.createElement("h2");r.textContent=i.title,Object.assign(r.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let s=document.createElement("p");s.textContent=i.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(r,s,a),e.append(o)}};function Xn(n,e){let t=(a,[l,c])=>{a.textContent=v(l,c??l),a.dataset.slT=l},i=document.createElement("div");i.className="sl-loading-state";let o=document.createElement("div");if(o.setAttribute("role",e.busy?"status":"alert"),o.setAttribute("aria-atomic","true"),e.busy){let a=document.createElement("div");a.className="sl-boot-spin",a.setAttribute("aria-hidden","true"),i.append(a)}let r=document.createElement("div");if(r.className="sl-boot-title",t(r,e.title),o.append(r),e.description){let a=document.createElement("p");a.className="sl-loading-description",t(a,e.description),o.append(a)}i.append(o);let s=null;return e.action&&(s=document.createElement("button"),s.type="button",s.className="sl-boot-retry",t(s,e.action),i.append(s)),n.replaceChildren(i),s}function ug(n){let{viewportWidth:e,viewportHeight:t,offsetTop:i,offsetLeft:o,clientWidth:r,clientHeight:s,innerHeight:a,largeViewportHeight:l}=n;if(![e,t,i,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(r)&&r>0?r:e,d=Number.isFinite(s)&&s>0?s:t,p=i;return Number.isFinite(l)&&a>l+1&&d<l-1&&(p=Math.max(p,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:p,left:o}}function ed(n){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let i=()=>{let c=ug({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(n.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,r=0,s=0,a=()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),o=window.requestAnimationFrame(()=>{o=0,r=window.requestAnimationFrame(()=>{r=0,i()})}),s=window.setTimeout(()=>{s=0,i()},250)},l=()=>{i(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}var mg=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function cr(n,e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",e),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",n),o.tabIndex=-1,i.appendChild(o),document.body.appendChild(i);let r=document.body.style.overflow;document.body.style.overflow="hidden";let s=ed(i),a=()=>{let u=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(f=>f.isConnected&&!f.closest('[hidden], [aria-hidden="true"], [inert]'));return u[u.length-1]??o},l=(u,f)=>{let b=u;for(;b;){let T=window.getComputedStyle(b);if(b.hidden||b.getAttribute("aria-hidden")==="true"||b.hasAttribute("inert")||T.display==="none"||T.visibility==="hidden"||T.visibility==="collapse")return!0;if(b===f)return!1;b=b.parentElement}return!0},c=u=>[...u.querySelectorAll(mg)].filter(f=>f.tabIndex>=0&&!f.matches(":disabled")&&!l(f,u)),d=(u,f)=>{let b=c(u),T=f?b[b.length-1]:b[0];T?T.focus({preventScroll:!0}):(u.hasAttribute("tabindex")||(u.tabIndex=-1),u.focus({preventScroll:!0}))},p=null,m=!0;return{scrim:i,frame:o,trapKeys(u){let f=b=>{if(b.key==="Tab"){if(b.defaultPrevented)return;let T=a(),C=c(T),k=C[0],E=C[C.length-1],L=document.activeElement;!k||!E?(b.preventDefault(),d(T,b.shiftKey)):L===T||!L||!T.contains(L)?(b.preventDefault(),(b.shiftKey?E:k).focus({preventScroll:!0})):b.shiftKey&&L===k?(b.preventDefault(),E.focus({preventScroll:!0})):!b.shiftKey&&L===E&&(b.preventDefault(),k.focus({preventScroll:!0}));return}b.key==="Escape"&&u(b)};return p=f,document.addEventListener("keydown",f),f},onScrimPress(u){i.addEventListener("mousedown",f=>{f.target===i&&u()})},focusFirst(){d(a(),!1)},teardown(u=!0){m&&(m=!1,s(),document.body.style.overflow=r,p&&document.removeEventListener("keydown",p),p=null,i.remove(),u&&t?.isConnected&&t.focus({preventScroll:!0}))}}}function td(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(o,r){let s=n,a=Reflect.get(s,r,s);return typeof a!="function"?a:(i.has(r)||i.set(r,t.has(String(r))?async(...l)=>{let c=await Vn(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),i.get(r))}})}var I=require("@seatlayer/core"),Lr=require("@seatlayer/core/view3d/crossfade/panorama");function nd(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function fg(n){return n.some(e=>nd(e))}var dr="data-fit-gone",gg=12;function Ms(n,e,t=nd){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${dr}]`).forEach(i=>{i.removeAttribute(dr),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let o=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(o.cls),n.dataset.fit=String(i+1);let r=o.give?o.give(n):!0;if(!t(n))return i+1;if(o.repeat&&o.give){for(let s=1;r&&s<gg;s+=1)if(r=o.give(n),!t(n))return i+1}}return e.length}function bg(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:id(t[t.length-1])}function yg(n,e){let t=n.querySelector(e);return t&&!t.hidden?id(t):!1}function id(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(dr,""),e.hidden=!0),n.setAttribute(dr,""),n.hidden=!0,!0}function vg(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function od(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return Ms(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>vg(e)}],()=>fg([e,t]))}function rd(n){return Ms(n,[{cls:"sl-fit-notype",give:e=>yg(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>bg(e),repeat:!0}])}function sd(n){return n?(n.classList.add("sl-fitpill"),Ms(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Qn;function ad(n){if(!n)return!1;delete n.dataset.fit;let e=n.selectedOptions?.[0]?.textContent??n.options[n.selectedIndex]?.textContent??"",t=n.clientWidth;if(!e||!t)return!1;if(Qn===void 0)try{Qn=document.createElement("canvas").getContext("2d")}catch{Qn=null}if(!Qn)return!1;let i=getComputedStyle(n);Qn.font=`${i.fontStyle} ${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;let o=Qn.measureText(e).width,r=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0)+(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.borderRightWidth)||0);return o+r<=t?!1:(n.dataset.fit="row",!0)}function wg(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let{amountMinor:e,currency:t}=n;return typeof e!="number"||!Number.isSafeInteger(e)||e<=0||typeof t!="string"||!/^[A-Za-z]{3}$/.test(t)?null:{amountMinor:e,currency:t.toUpperCase()}}var xg=["on-sale","low","sold-out","presale","closed"];function Di(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Ls(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function ld(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let r={index:i,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;r.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=Ls(e[s]);if(a===void 0)return;r[s]=a}return r}function kg(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let m=p,u=typeof m.categoryKey=="string"?m.categoryKey.trim():"",f=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,b=Di(m.price);if(!u||f===void 0||b===void 0||b===null)return;let T=`${u}\0${f??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:u,tierId:f,price:b})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],r=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||r.has(l)||!i.has(c))return;r.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function pr(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=xg.find(p=>p===e.state);if(!t)return null;let i=Di(e.fromPrice),o=Di(e.previousPrice);if(i===void 0||o===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let s=ld(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:ld(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let p=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let u=m,f=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!f)return null;let b=Di(u.price),T=Di(u.previousPrice);if(b==null||T===void 0)return null;let C={categoryKey:f,price:b,previousPrice:T};if(u.tierId!==void 0){if(u.tierId!==null&&(typeof u.tierId!="string"||!u.tierId.trim()))return null;C.tierId=u.tierId===null?null:u.tierId.trim()}if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;C.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;C.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;C.remaining=u.remaining==null?null:u.remaining}for(let k of["startsAt","endsAt"]){if(u[k]===void 0)continue;let E=Ls(u[k]);if(E===void 0)return null;C[k]=E}p.push(C)}l=p}let c=kg(e.channelPricing);if(c===void 0)return null;let d=Ls(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:i,previousPrice:o,currency:r,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{},...e.bookingFee!==void 0?{bookingFee:wg(e.bookingFee)}:{}}}function cd(n){return n?.changed!==!1}function dd(n,e){if(!n)return null;let t=null,i=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[n.release,n.upcoming])i(o?.startsAt),i(o?.endsAt);for(let o of n.prices)i(o.startsAt),i(o.endsAt);return i(n.nextPriceChangeAt),t}function Hs(n){let e={};for(let t of n?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let i=e[t.categoryKey],o=typeof i=="number"?{base:i}:i??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function pd(n,e){let t={...n};for(let[i,o]of Object.entries(Hs(e))){let r=t[i];t[i]=typeof o=="number"?o:{...typeof r=="number"?{base:r}:r,...o,tiers:{...typeof r=="object"?r.tiers:{},...o.tiers}}}return t}var Fi=require("@seatlayer/core"),Sg={seat:()=>"",tray:n=>ud(n)?md():""};function hd(n,e,t){let i=n?.bookingFee;return!i||i.amountMinor<=0||i.currency!==e.toUpperCase()||t?.prices&&Object.keys(t.prices).length||t?.objects&&Object.keys(t.objects).length?null:i}function ud(n){return n.some(e=>(e.bookingFeeMinor??0)>0)}function md(){return` \xB7 ${(0,Fi.t)("picker.fee.included")}`}function fd(n,e,t){return n?{seat:i=>i>0?(0,Fi.t)("picker.fee.includesAmount",{amount:t((0,Fi.fromMinorUnits)(n.amountMinor,e))}):"",tray:(i,o,r)=>{let s=i.reduce((a,l)=>a+(l.quantity??1),0);return ud(i)||o>s&&r>0?md():""}}:Sg}function gd(n,e){let t=n.bookingFeeMinor;return typeof t!="number"||!Number.isSafeInteger(t)||t<=0?{}:typeof n.basePrice!="number"||!Number.isFinite(n.basePrice)||n.basePrice<0?{}:e!==n.unitPrice?{}:{basePrice:n.basePrice,bookingFeeMinor:t}}var yd=require("@seatlayer/core");var bd="maintenance_mode";function Tg(n){if(!n||typeof n!="object")return!1;let e=n;return e.reason===bd||e.code===bd}function Eg(n){return typeof n!="number"||!Number.isFinite(n)||n<0?null:Math.max(1,Math.ceil(n/60))}function Rs(n){if(!Tg(n))return null;if(typeof n.notice=="string"&&n.notice.trim())return n.notice.trim();let e=Eg(n.retryAfterS);if(e===null)return v("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=(0,yd.tCount)("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}function vd(n){return n.focusedSection!==null?n.deeperThanSectionFrame===!1?"venue":"section":n.atVenueFit!==void 0?n.atVenueFit?"none":"venue":n.seatsRevealed?"venue":"none"}var wd=["pointerdown","pointermove","keydown","wheel","touchstart"],hr=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let i of wd)e.addEventListener(i,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of wd)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((i,o)=>setTimeout(i,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function xd(n,e){let t=await n.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(n.destroyed||n.idleClock)return;let i=new hr({minutes:t??30,blocked:()=>!!n.hold,onIdle:()=>kd(n)});i.enabled&&(n.idleClock=i,i.attach(e))}function kd(n){n.destroyed||!n.root||n.holdExpiredEl||(n.realtime?.stop(),n.realtime=null,n.showAccessPanel({reason:"idle",retryable:!0}))}async function Sd(n){if(n.destroyed)return!1;if(n.pubApi?.rotateViewerId(),n.access?.configured){let e=await n.refreshAccess();return e&&n.idleClock?.resume(),e}return n.dismissAccessPanel(),await n.controller.refresh(),n.realtime?n.realtime.restart():n.startRealtime(),n.idleClock?.resume(),!0}function Td(n){if(!n.destroyed){if(n.hold||n.idleClock?.recentlyActive()){n.pubApi?.rotateViewerId(),n.realtime?.restart();return}kd(n)}}var ur=require("@seatlayer/core");function Ed(n,e,t=[],i=8,o=[]){let r=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-n.top+i),0),s=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.bottom-c.top+i),r>0?i:0),a=o.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.right-c.left+i),0);return{top:Math.max(0,Math.ceil(r)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(s)),left:0}}function Cd(n){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",(0,ur.t)("picker.chooseLevel")),e.title=(0,ur.t)("picker.floorHelp");let t=n.tf("picker.allLevels","All levels"),i=[...n.floors.map((o,r)=>({id:o.id,name:o.name,code:Cg(r)})).reverse(),{id:"",name:t,code:""}];for(let o of i){let r=document.createElement("button");if(r.type="button",r.className="sl-level",r.dataset.level=o.id,r.setAttribute("aria-pressed","false"),r.title=o.name,o.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=o.code,r.appendChild(a),r.setAttribute("aria-label",`${o.name} (${o.code})`)}let s=document.createElement("span");if(s.className="sl-level-name",s.textContent=o.name,r.appendChild(s),!o.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=(0,ur.t)("picker.allLevelsShort"),r.appendChild(a)}r.addEventListener("click",()=>n.onChoose(o.id)),e.appendChild(r)}return e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let r=[...e.querySelectorAll(".sl-level")],s=r.indexOf(document.activeElement);s<0||(o.preventDefault(),r[Math.max(0,Math.min(r.length-1,s+(o.key==="ArrowUp"?-1:1)))].focus())}),e}function Cg(n){return n===0?"G":String(n)}function Ad(n,e,t){if(!n)return;let i=t?"":e;for(let o of n.querySelectorAll(".sl-level"))o.setAttribute("aria-pressed",String(o.dataset.level===i))}var mr=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let o=this.host.activeFloorObjects().find(k=>k.type==="section"&&k.id===t.id)?.outline;if(!o||o.length<3)return 0;let r=o.map(k=>this.host.controller.worldToScreen(k)),s=r.map(k=>k.x),a=r.map(k=>k.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let m=i.getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left-m.left,b=u.top-m.top,T=Math.max(0,Math.min(f+u.width,l+d)-Math.max(f,l)),C=Math.max(0,Math.min(b+u.height,c+p)-Math.max(b,c));return T*C/(d*p)}};var Jn=require("@seatlayer/core"),Jd=require("@seatlayer/core/core/color");var He=require("@seatlayer/core");function Is(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var fr=(n,e)=>Is(n,e,{dateStyle:"medium"}),gr=(n,e)=>Is(n,e,{timeStyle:"short"}),Zn=(n,e)=>Is(n,e,{weekday:"short",day:"numeric",month:"short"});function Pd(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(o=>`${fr(o,t)} \xB7 ${gr(o,t)}`)}}function Ag(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function Md(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Pg(n,e,t="",i=!1){if(!n.length)return"";let o=n.map(r=>{let s=r.free?e.free:e.blocked,a=i&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${H(r.eventKey)}" aria-label="${H(`${r.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${H(`${r.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${H(r.shortDate)}</span><span class="st">${H(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${H(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${H(e.notAvailableOn)}</p>`+t+"</div>"}function Mg(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${H(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${H(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${H(n.advice)}</p>`}function Lg(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function Ld(n,e,t){if(Lg(n)<2)return"";let i=(r,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${H(s)}</li>`,o=[];return n.available&&o.push(i("sl-pg-sw-free",e.available,` style="background:${H(t)}"`)),n.selected&&o.push(i("sl-pg-sw-sel",e.selected)),n.partial&&o.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${H(t)}"`)),n.unavailable&&o.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${H(e.title)}">${o.join("")}</ul>`}function Hd(n,e){if(!n.length)return"";let t=n.map(i=>{let o=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${H(i.eventKey)}"><span class="n">${H(i.name)}</span><span class="s">${H(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${H(e.title)}"><div class="sl-pg-nights-title">${H(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Os(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Ag(e,t);return{states:i,missing:i.filter(o=>!o.free).map(o=>o.shortDate)}}function Rd(n,e){return n?Pg(n.states,{title:e.words?.title??v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:(0,He.t)("picker.group.notAvailableOn",{dates:Md(n.missing,e.locale)})},Mg({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:e.words?.advice??v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Hg(n,e,t,i){if(!n.length)return"";let o=new Set(e),r=new Set(t),s=n.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${H(a.eventKey)}" aria-label="${H(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&r.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${H(a.shortDate)}</span><span class="sl-confirm-date-state">${H(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${H(i.title)}</legend><p class="sl-confirm-dates-copy">${H(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${H(i.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Id(n,e,t,i){let o=e.availableEventKeys(t);return Hg(n,o,e.includedEventKeys(),{title:(0,He.t)("picker.group.confirmDatesTitle"),copy:o.length===n.length?(0,He.t)("picker.group.confirmAllDatesCopy").replace("{count}",String(n.length)):(0,He.t)("picker.group.confirmPartialDatesCopy").replace("{available}",String(o.length)).replace("{total}",String(n.length)),selectAll:(0,He.t)("picker.group.confirmSelectAll"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function Od(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function _d(n,e,t){let i=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!i.length)return;let o=n.querySelector(".sl-confirm-add"),r=n.querySelector("[data-pg-confirm-all]"),s=()=>{let a=i.filter(d=>!d.disabled),l=Od(n).length;r&&(r.checked=l===a.length,r.indeterminate=l>0&&l<a.length);let c=n.querySelector("[data-pg-confirm-summary]");c&&(c.textContent=l===a.length?(0,He.t)("picker.group.confirmAllSelected").replace("{count}",String(l)):(0,He.t)("picker.group.confirmSelectedOfAvailable").replace("{selected}",String(l)).replace("{available}",String(a.length))),o.disabled=l===0,o.textContent=l?e.label(l):(0,He.t)("picker.group.confirmChooseOne"),t()};i.forEach(a=>a.addEventListener("change",s)),r?.addEventListener("change",()=>{i.filter(a=>!a.disabled).forEach(a=>{a.checked=r.checked}),s()}),s()}async function Nd(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=Od(n);if(!i.length)return!1;let o=n.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,i)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Dd(n,e,t,i=!1){if(!n)return"";let o={label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:Md(n.missing,t)};return i?(0,He.t)("picker.season.seatPartlyAvailable",o):(0,He.t)("picker.group.seatPartlyAvailable",o)}function Fd(n,e){let t=n.map((i,o)=>{let r=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${H(i.id)}" data-state="${H(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(o+1)}</span><span class="l">${H(i.label)}</span><span class="sl-pg-sr">${H(r)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${H(e.label)}">${t}</ol>`}function _s(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${H(i.eventKey)}"><span class="n">${H(i.name)}</span><time datetime="${H(i.iso)}"><span class="d">${H(i.date)}</span><span class="t">${H(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${H(e)}</p>`}function Bd(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${H(t.eventKey)}"><span class="n">${H(t.name)}</span><span class="s">${H(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${H(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${H(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${H(n.total.label)}</span><b>${H(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${H(n.holdStatus)}</p>`:"")}function Vd(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function $d(n,e,t=!1){if(!n||n.seats<=0)return"";if(e==="same_seat"){let i=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,He.tCount)("picker.group.performancesChosenOf",i,{chosen:n.performances,total:n.totalPerformances}):t?(0,He.tCount)("picker.season.seatsEveryDate",i):(0,He.tCount)("picker.group.seatsEveryPerformance",i)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,He.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,He.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function zd(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),i())})})}function kt(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Rg(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",o=t||i||!n.seatNumber,r=o?n.rowLabel??n.displayLabel??n.label:n.seatNumber,s=t?`${v("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${ve(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${kt(r)}</span>`+(s?`<span class="sl-tip-row">${kt(s)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${kt(n.sectionLabel)}</span></div>`:"")+"</div>"}function jd(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",o=n.status==="free"||i?"":`<span class="sl-tip-tag">${e.ownHold?v("picker.heldForYou","Held for you"):v("picker.group.legendUnavailable","Unavailable")}</span>`,r=t?"":e.price,s=r?`<span class="sl-tip-amt">${kt(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${kt(e.priceNote)}</div>`:"",l=r&&e.feeNote?`<div class="sl-tip-fee">${kt(e.feeNote)}</div>`:"",c=sn(n,{compact:!0}),d=e.reason?`<div class="sl-tip-reason">${kt(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Rg(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${kt(n.categoryColor)}"></span><span class="sl-tip-name">${kt(n.categoryLabel)}</span>`+o+s+"</div>"+l+a+d+c+(e.extra??"")}function Kd(n,e,t,i){let o=n.x+14,r=n.y-i.height-12,s=n.y+18,a=r;o+i.width>e-8&&(o=n.x-i.width-14),r<8&&s+i.height<=t-8&&(a=s);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Gd(n,e,t,i=22){let o=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),r=n.y-i-t.height,s=n.y+i;return r>=8?{left:o,top:r,placement:"above"}:s+t.height<=e.height-8?{left:o,top:s,placement:"below"}:{left:o,top:Math.max(8,Math.min(r<8?s:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var Ns=14,Ig=12,Og=12,_g=8;function Ud(n,e,t,i=Ig){let o=e.height-Ns-t.height,r=Og,s=o-i;if(s<=r)return{placement:"sheet",nudgeY:0};let a=(r+s)/2-n;return Math.abs(a)<=_g?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function qd(n,e,t,i,o=0){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),a=n.y+o+t.height+24<=e.height,l=n.y-o<t.height+24&&a?"below":"above",c=l==="above"?n.y-o:n.y+o,d=i&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function Wd(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),o=[...n.querySelectorAll("[data-pg-event-key]")],r=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!i)return;let a=r().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};o.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),i?.addEventListener("click",()=>{let a=r();a.length&&t?.(a)})}function Dt(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?v("picker.table","Table"):n?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var Ng="sl-confirm-scrim",Dg="--sl-scrim-mask";function Fg(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Yd(n,e,t,i){let o=n??document.createElement("div");return n||(o.className=Ng),o.style.setProperty(Dg,Fg(i)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function Ds(n){return n?.remove(),null}var Xd={passport:!1,compare:!1},Bg=360,Vg=160,$g=700,Qd=450,zg=8;function Zd(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function jg(n){return(0,Jd.contrastRatio)("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var br=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.closedByThisPress=null;this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=Yn(e)?e.viewUrl??"":"",o=rr(t);if(!i&&!o)return"";let r=i?null:sr(e,e.focalPoint??t.focalPoint);if(!i&&r==null)return"";let s="";if(!i)return s;let a=Y((0,Jn.t)("picker.viewFromSeat",{label:e.label})),l=Y(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+s}show(e,t="add"){let i=this.host;if(t==="remove"&&this.closedByThisPress===e.id){this.closedByThisPress=null;return}if(t==="remove"&&i.performanceGroup()&&i.controller.currentHold()?.labels.includes(e.label))return;let o=this.mode==="remove"?void 0:this.seat?.id;this.mode=t,this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(F=>F.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),o&&o!==e.id&&i.controller.deselect([o]),i.hideTooltip();let r=i.controller.seatDetails(e.id),s=i.controller.doc?.categories.find(F=>F.key===e.categoryKey),a=r?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?i.paidPrice(e.categoryKey,r?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=Hl(r,e.displayLabel??e.label,Dt(r)),d=r?.tiers??s?.tiers??[],p=r?.tierId??d[0]?.id,m=i.suppressPricing()?"":Co(d,p,F=>i.money(i.paidPrice(e.categoryKey,F.id,F.price,e.label)),F=>i.offerName(e.categoryKey,F.id)),u=i.buyerView()==="venue3d",f=i.performanceGroup()?.confirmDateSelection??void 0,b=f?i.performanceGroup()?.nights?.()??[]:[],T=f?Id(b,f,e.id,(F,ne)=>i.tf(F,ne)):"";this.shownAt=performance.now();let C=document.createElement("div");C.className="sl-confirm sl-mo-in",t==="remove"&&C.classList.add("sl-confirm-removing"),T&&C.classList.add("sl-confirm-group-dates"),C.setAttribute("role","dialog"),C.setAttribute("aria-label",(0,Jn.t)("picker.confirmSeatLabel",{label:e.label}));let k=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";C.style.setProperty("--sl-cat",k),C.style.setProperty("--sl-cat-ink",jg(k));let E=String(r?.categoryLabel??s?.label??e.categoryKey),L=i.controller.categoryAvailability()[e.categoryKey],Q=typeof L=="number"&&L>0?(0,Jn.tCount)("picker.leftCount",L):"",D=i.packagePrice?.(e.categoryKey)??null,g=i.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,R=Xd.passport?Ll(e,g,u):"",_=Xd.compare?Ml(e,u?i.view3dCompareSeatIds():null):"";C.innerHTML=_l({identityFields:c,identity:Rl(r,e.displayLabel??e.label,Dt(r)),marker:Pl({...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{}}),see3dPill:Il(i.canOffer3d(),u),categoryColor:k,categoryLabel:E,priceLabel:D?D.price:!i.suppressPricing()&&l!=null?i.money(l):"",feeNote:D?D.note:!i.suppressPricing()&&l!=null?i.feeNote?.(l)??"":"",categoryLeftLabel:Q,tierChoices:m,groupDates:T,wheelchair:"",commercial:sn({...e.accessibility?.length?{accessibility:e.accessibility}:{},...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...r?.aisle?{aisle:!0}:{},...r?.boothType?{boothType:r.boothType}:{},...r?.entrance?{entrance:r.entrance}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${R}${_}${ss(i.canOffer3d(),u)}</div>`:ss(i.canOffer3d(),u),see3dRow:Ol(i.canOffer3d(),u),cancelLabel:(0,Jn.t)("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(r?.objectType)}),t==="remove"&&C.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(C),this.el=C;let V=C.querySelector(".sl-confirm-thumb"),z=V?.closest(".sl-confirm-thumbwrap")??null;if(V&&z){let F=!1,ne=()=>{if(F||!z.isConnected)return;F=!0;let X=()=>{z.remove(),this.el===C&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){X();return}z.style.height=`${z.offsetHeight}px`,z.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{z.style.height="0px",z.style.opacity="0"}),setTimeout(X,Vg)};V.addEventListener("error",ne),V.addEventListener("load",()=>{V.naturalWidth||ne()});let J=e.viewMeta?.previewUrl??e.viewUrl;J?i.resolveAssetUrl(J).then(X=>{if(!(!C.isConnected||this.el!==C)){if(!X){ne();return}V.src=X}}).catch(X=>{ne(),i.onError(X)}):ne()}i.reanchor(),this.liftSeatClearOfSheet(e),C.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),C.querySelector(".sl-confirm-confidence")?.addEventListener("click",F=>{i.openSeatConfidencePassport(e,F.currentTarget instanceof HTMLElement?F.currentTarget:null)}),C.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),C.querySelectorAll("[data-confirm-tier]").forEach(F=>{F.addEventListener("click",()=>{let ne=F.dataset.confirmTier,J=d.find(Ce=>Ce.id===ne);if(!J)return;i.controller.setSeatTier(e.id,J.id),C.querySelectorAll("[data-confirm-tier]").forEach(Ce=>{Ce.setAttribute("aria-pressed",String(Ce===F))});let X=C.querySelector(".sl-confirm-price"),xe=i.paidPrice(e.categoryKey,J.id,J.price,e.label);X&&(X.textContent=i.money(xe));let ge=C.querySelector(".sl-confirm-fee");ge&&(ge.textContent=i.feeNote?.(xe)??""),i.reanchor()})}),C.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(F=>{F.addEventListener("pointerdown",wo,{once:!0}),F.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),_d(C,f,()=>i.reanchor()),C.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),C.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(C),requestAnimationFrame(()=>{let F=C.querySelector(".sl-confirm-add");F?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(C,F)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let r=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=Ud(r.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+$g:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Yd(this.scrim,i,this.el,t),mc(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=Ds(this.scrim);let o=i.clientWidth,r=i.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=qd(t,{width:o,height:r},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Uo(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return Zd()?performance.now()-this.shownAt<Qd:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=new Map,o=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=i.get(l.pointerId);i.delete(l.pointerId),d&&s.type==="pointerup"&&i.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=zg&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(i.set(l.pointerId,{x:l.clientX,y:l.clientY}),i.size>1)for(let d of i.keys())i.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let r=t.root();setTimeout(()=>{this.outsideTap===o&&((r??document).addEventListener("pointerdown",o,!0),(r??document).addEventListener("pointerup",o,!0),(r??document).addEventListener("pointercancel",o,!0))},Zd()?Qd:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=Ds(this.scrim),this.settleLift(),this.el&&qo(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Nd(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);Ss(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){r();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let s=o.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,Bg)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"?e.controller.deselect([t.id]):(this.closedByThisPress=t.id,setTimeout(()=>{this.closedByThisPress=null},0)),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let i=e.releaseHeldSeat(t);i||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function ep(n,e,t){if(!e||t||n.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function tp(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var Ye=require("@seatlayer/core"),ei=require("@seatlayer/core/picker/minimapGeometry");function Kg(n){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of n){let r=t.get(o.id);(!r||e[o.state]>e[r])&&t.set(o.id,o.state)}let i={selected:0,available:0,inactive:0};for(let o of t.values())i[o]+=1;return i}function Gg(n,e){return n.x<=e.x&&n.y<=e.y&&n.x+n.width>=e.x+e.width&&n.y+n.height>=e.y+e.height}function np(n,e){let t=new Fs(n);return t.build(e),t}var Fs=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 i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",(0,Ye.t)("picker.openVenueMap")),i.setAttribute("aria-expanded","false"),i.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(i),this.miniToggle=i;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let s=document.createElement("span");s.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",(0,Ye.t)("picker.minimapStateKey")),a.append(...[["focused","picker.minimapStateFocused"],["selected","picker.minimapStateSelected"],["","picker.minimapStateAvailable"],["inactive","picker.minimapStateInactive"]].map(([p,m])=>{let u=document.createElement("i");return p&&(u.className=p),u.title=(0,Ye.t)(m),u}));let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",(0,Ye.t)("picker.closeVenueMap")),l.textContent="\xD7",r.append(s,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",(0,Ye.t)("picker.venueMapLabel")),o.append(r,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=s,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),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,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let o=196,r=146,s=6,a=i.width/Math.max(1,i.height),l=o,c=Math.round(o/a);c>r&&(c=r,l=Math.round(r*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,ei.createMinimapTransform)(i,e.width,e.height,d,s)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?(0,Ye.t)("picker.allFloors"):e.find(l=>l.id===this.host.controller.getActiveFloorId())?.name??(0,Ye.t)("picker.venueOverview"),i=this.host.controller.getMinimapSnapshot().sections,r=i.find(l=>l.active)?.label??this.host.focusedSectionLabel(),s=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=s;let a=(0,Ye.t)("picker.venueMapSummary",Kg(i));this.miniWrap.setAttribute("aria-label",i.length?`${s}. ${a}`:s),this.miniCanvas?.setAttribute("aria-label",i.length?`${s}. ${a} ${(0,Ye.t)("picker.venueMapPanSections")}`:`${s}. ${(0,Ye.t)("picker.venueMapPanEmpty")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let o=p=>p*t.scale+t.offX,r=p=>p*t.scale+t.offY,s=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((u,f)=>f===0?i.moveTo(o(u.x),r(u.y)):i.lineTo(o(u.x),r(u.y))),i.closePath();let m=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,m?i.fillStyle=m.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=m?.stroke||s,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let u=p.outline.reduce((f,b)=>({x:f.x+b.x,y:f.y+b.y}),{x:0,y:0});i.beginPath(),i.arc(o(u.x/p.outline.length),r(u.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((f,b)=>b===0?i.moveTo(o(f.x),r(f.y)):i.lineTo(o(f.x),r(f.y))),i.closePath()}p.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),m=new Map,u=f=>{let b=m.get(f);if(b)return b;let T=this.host.tint?.(f)||c;return m.set(f,T),T};for(let f of d.seats)i.globalAlpha=f.state==="inactive"?.22:.78,i.fillStyle=f.state==="inactive"?a:f.state==="selected"?l:u(f.categoryKey),i.beginPath(),i.arc(o(f.x),r(f.y),p,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let s=Gg(r.visible,r.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",s),s)return;let a=(0,ei.minimapViewportPlan)(r.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),l=this.host.cssVar("--sl-text")||"#12151c",c=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=l,o.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,i.dpr*3.25),o.strokeStyle=c,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,i.dpr*1.75),o.strokeStyle=l,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),o.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let o=t.getBoundingClientRect(),r=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),s=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,ei.minimapPointToWorld)({x:r,y:s},i),px:r,py:s}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.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 t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&(0,Ye.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var yr=require("@seatlayer/core");var Ug=12;function ip(n,e){let t=e.floors(),i=new Set(t.map(D=>D.label.trim().toLocaleLowerCase())),o=e.zones().filter(D=>D.seatCount>0&&!i.has(D.label.trim().toLocaleLowerCase())),r=e.sections().filter(D=>D.seatCount>0&&!i.has(D.label.trim().toLocaleLowerCase())),s=o.length>1?[]:r,a=t.length>1,l=o.length>1,c=s.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.setAttribute("aria-expanded","false");let u='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',f=document.createElement("span");m.innerHTML=u,m.appendChild(f);let b=()=>{for(let D of d.querySelectorAll(":scope > div")){let g=D.querySelector('[aria-pressed="true"]');!g||D.scrollWidth<=D.clientWidth||g.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let D of d.querySelectorAll(":scope > div")){let g=D.querySelector('button[aria-pressed="true"]'),R=g?.textContent?.trim();if(R&&g?.dataset.floor!=="")return R}return a&&(l||c)?v("picker.levelsAndAreas","Levels & zones"):a?v("picker.levels","Levels"):v("picker.areas","Zones")},C=D=>{d.classList.toggle("is-open",D),m.setAttribute("aria-expanded",String(D)),D&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(b),f.textContent=T()};m.addEventListener("click",()=>C(!d.classList.contains("is-open"))),d.addEventListener("keydown",D=>{D.key!=="Escape"||!d.classList.contains("is-open")||(D.preventDefault(),D.stopPropagation(),C(!1),m.focus())});let k=document.createElement("button");k.type="button",k.className="sl-view3d-nav-close",k.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let E=v("picker.closeVenueNavigation","Close venue navigation");k.setAttribute("aria-label",E),k.title=E,k.addEventListener("click",()=>{C(!1),m.focus()}),C(!1),d.appendChild(m);let L=D=>{},Q=D=>{};if(a){let D=document.createElement("div");D.setAttribute("role","group"),D.setAttribute("aria-label",v("picker.levels","Levels"));let g=[];Q=V=>{g.forEach(z=>{z.setAttribute("aria-pressed",String((z.dataset.floor===""?null:Number(z.dataset.floor))===V))})};let R=V=>{e.focusFloor(V)&&(Q(V),L(V))},_=(V,z)=>{let F=document.createElement("button");F.type="button",F.textContent=V,F.dataset.floor=z===null?"":String(z),F.setAttribute("aria-pressed",String(z===null)),F.addEventListener("click",()=>{R(z),C(!1)}),g.push(F),D.appendChild(F)};_(v("picker.allLevels","All levels"),null);for(let V of t)_(V.label||(0,yr.t)("picker.levelNumber",{number:V.index+1}),V.index);d.appendChild(D)}if(l||c){let D=document.createElement("div");D.setAttribute("role","group"),D.setAttribute("aria-label",v("picker.areas","Zones"));let g=l?o.map(_=>({id:_.id,label:_.label||_.id,go:()=>{e.focusZone(_.id)}})):s.map(_=>({id:_.id,label:_.label||_.id,floorIndex:_.floorIndex,go:()=>{e.focusSection(_.id),Number.isFinite(_.floorIndex)&&Q(_.floorIndex)}})),R=_=>{let V=l||_===null?g:g.filter(z=>z.floorIndex===void 0||z.floorIndex===_);if(D.replaceChildren(),!V.length){D.remove();return}if(D.isConnected||d.insertBefore(D,k.isConnected?k:null),!l&&V.length>Ug){let z=document.createElement("select");z.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let F=document.createElement("option");F.value="",F.textContent=v("picker.jumpToSection","Jump to section"),z.appendChild(F);for(let ne of V){let J=document.createElement("option");J.value=ne.id,J.textContent=ne.label,z.appendChild(J)}z.addEventListener("change",()=>{V.find(ne=>ne.id===z.value)?.go()}),D.appendChild(z);return}for(let z of V){let F=document.createElement("button");F.type="button",F.textContent=z.label,F.dataset.area=z.id,F.addEventListener("click",()=>{p=z.label,z.go(),C(!1)}),D.appendChild(F)}};L=R,R(null)}return d.appendChild(k),n.appendChild(d),d}var vr=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",v("picker.savedSeatComparison","Saved seat comparison"));let r=document.createElement("button");r.type="button",r.className="main",r.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",v("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(r,s),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=i>1?(0,yr.t)("picker.compareCount",{count:i}):v("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",i>1?(0,yr.t)("picker.openComparisonOfSeats",{count:i}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function op(n){return!n?.querySelector('[data-ref="zfs"]')}var rp="sl:sheet-hint";function sp(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),450),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),qg(n.root)},700)}function qg(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(rp))return;window.sessionStorage.setItem(rp,"1")}catch{}let e=n.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function ap(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function xr(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],o=new Set(i.map(m=>m.label)),r=xc(n,t,i),s=vt(n.gaQty,i),a=i.reduce((m,u)=>m+n.heldPrice(u)*(u.quantity??1),0),l=i.reduce((m,u)=>m+(u.quantity??1),0),c=e.filter(m=>!o.has(m.label)),d=c.reduce((m,u)=>m+n.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+r+a,p=c.reduce((m,u)=>m+(u.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:o,heldCount:l,total:d,count:p}}function kr(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Sr(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key){for(let i of n.pricesByChannel.values())for(let o of i)o.categoryKey===e.key&&t.push(o.price);t.push(...Wg(n).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var wr=null;function Wg(n){let e=n.controller.doc,t=n.hostObjectPrices();if(wr?.doc!==e||wr.host!==t){let i=new Map;for(let[o,r]of Object.entries({...e?.seatPrices,...t})){let s=n.controller.seatByLabel(o)?.categoryKey??n.controller.tableSelection(o)?.categoryKey;s&&(i.has(s)||i.set(s,[]),i.get(s).push(...typeof r=="number"?[r]:Object.values(r.tiers)))}wr={doc:e,host:t,spread:i}}return wr.spread}var Bi="seatlayer_";function Yg(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function qe(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Xg(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function Qg(n,e){let t=n.event();if(!t)return qe("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function lp(n,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),i=n.find(o=>t(o.key??o.id))??n.find(o=>t(o.label));return i?.key??i?.id??null}function cp(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,o)=>t[o]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,o)=>i+o.price,0)}}function Zg(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.rowKey);s?s.push(r):i.set(r.rowKey,[r])}let o=[];for(let r of i.values()){let s=[...r].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(cp(n,s.slice(d,d+t)));a=l}}return o}function Jg(n,e,t){let i=new Map;for(let r of e){let s=i.get(r.sectionKey);s?s.push(r):i.set(r.sectionKey,[r])}let o=[];for(let r of i.values()){if(r.length<t)continue;let s=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(cp(n,s.slice(0,t)))}return o}function eb(n,e){if(!n.event())return qe("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>i.max)return qe("bad_count",`count must be a whole number between 1 and ${i.max}.`);let r=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?lp(n.categories(),l):null;if(l&&!d)return qe("no_match",`No ticket type called "${l}".`);if(d&&n.categories().find(b=>b.key===d)?.available===0)return qe("sold_out",`"${l}" is sold out.`);let p=c?lp(n.zones(),c):null;if(c&&!p)return qe("no_match",`No zone called "${c}".`);let m=n.seats().filter(b=>b.available);if(!m.length)return qe("sold_out");let u=m.filter(b=>(!d||b.categoryKey===d)&&(!p||b.zoneId===p)&&(a==null||b.price<=a));if(!u.length)return qe("no_match");let f=s?Zg(n,u,o):Jg(n,u,o);return f.length?(f.sort((b,T)=>T.unitPrice!==b.unitPrice?T.unitPrice-b.unitPrice:b.row.localeCompare(T.row)||b.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:f.slice(0,r),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:s}}}):qe(s?"not_enough_together":"no_match")}function dp(n){return{ok:!0,...n.selection()}}function tb(n,e){let t=n.event();if(!t)return qe("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return t.guestsOnly?qe("guests_only","This event is for invited guests."):qe("event_closed","Sales are closed for this event.");let i=Xg(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),dp(n)):qe("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function nb(n,e){let t=async o=>{try{return await o()}catch(r){return qe("error",r instanceof Error?r.message:String(r))}},i=[{name:`${Bi}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Qg(n,e))},{name:`${Bi}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>eb(n,o))},{name:`${Bi}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>tb(n,o))},{name:`${Bi}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>dp(n))}];return e&&i.push({name:`${Bi}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function pp(n,e={}){let t=Yg();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,o=nb(n,!!e.holds),r=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:i.signal,...s?{exposedTo:s}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function hp(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await pp(Vs(n,t),{holds:t,exposedTo:i}),n.destroyed&&Bs(n)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function Bs(n){n.webMcp?.dispose(),n.webMcp=null}function Vs(n,e){let t=(i,o)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let r=i.id.lastIndexOf(":"),s=r<0?NaN:Number(i.id.slice(r+1));return Number.isFinite(s)?s:o};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed,...n.guestsOnly?{guestsOnly:!0}:{}}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let r=Sr(n,o),s=kr(n,o);return{key:o.key,label:o.label??o.key,...s===void 0?{}:{price:s},...r&&r.min!==r.max?{priceRange:r}:{},available:i[o.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),o=[];return n.allSeats().forEach((r,s)=>{if(r.floorId&&i&&r.floorId!==i)return;let a=n.controller.getStatus(r.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,s),categoryKey:r.categoryKey,price:n.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:i=>{let o=n.controller.seatDetails(i);return o?{section:o.sectionLabel??"",row:ve(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:i,total:o,count:r}=xr(n);return{seats:i.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:ve(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:n.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:r,total:o,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?ib(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function ib(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function up(n,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=n.seatByLabel(e.label),i=t?n.toSeat(t).tiers:void 0;return i&&i.length>1?i:null}async function mp(n,e,t,i){let o=n.currentHold(),r=o?.items??[],s=r.find(c=>c.label===e);if(!o||!s||s.tierId===t)return null;let a=r.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await n.api.hold(n.key,a,i,o.holdId);return n.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),n.currentHold()}function $s(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function fp(n,e){rt({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport,revealWaitMs:n.revealWaitMs,handoverMs:n.handoverMs}),e("chart_rendered",$s(n))}var gp=require("@seatlayer/core/core/seatConfidence");function Fe(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function bp(n){let e=(0,gp.seatConfidenceDisclosure)(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Fe(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Fe(e.modeledTarget)}</dd></div>`:"",r=t?`<div><dt>Evidence ID</dt><dd>${Fe(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Fe(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Fe(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Fe(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Fe(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=Eo(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Fe(s)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Fe(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Fe(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Fe(e.headline)}</strong><span>${Fe(e.coverage)} \xB7 ${Fe(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Fe(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Fe(e.reality)}</dd></div><div><dt>Source</dt><dd>${Fe(e.provenance)}</dd></div>`+a+o+r+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function yp(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Tr(n,e,t){let i=n?.querySelector("[data-report]"),o=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function zs(n,e,t=null){let i=n.view3dEl;if(!i)return;Vi(n,!1);let o=e.confidenceEvidence,r=n.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=bp({seat:e,title:r?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(m=>m!==i)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");i.appendChild(s),i.classList.add("has-passport"),n.view3dPassportEl=s;let c=s.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),Vi(n);return}if(m.key!=="Tab")return;let u=d();if(!u.length)return;let f=u[0],b=u[u.length-1];m.shiftKey&&document.activeElement===f?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),f.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let b of l)b.element.inert=b.inert,b.ariaHidden===null?b.element.removeAttribute("aria-hidden"):b.element.setAttribute("aria-hidden",b.ariaHidden);let m=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,u=m?.closest(".sl-confirm,.sl-view3d-compare");u?.isConnected&&(u.inert=!1,u.removeAttribute("aria-hidden")),s.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===s&&(n.view3dPassportEl=null);let f=m??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:f)?.focus()},s.addEventListener("click",m=>{let u=yp(m.target instanceof HTMLElement?m.target:null);u==="close"&&Vi(n),u==="report"&&ob(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function ob(n,e){if(n.api.reportViewEvidence){Tr(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Tr(n.view3dPassportEl,"received",t.report.id)}catch{Tr(n.view3dPassportEl,"failed")}}}function Vi(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function vp(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;hn(n,!1);let t=n.view3dCompareSeatIds.map(u=>n.view3dComparisonSnapshot(u)).filter(u=>!!u);if(t.length<2){n.clearView3dComparison();return}let i=u=>H(u),o=t.some(u=>!!u.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let s=t.map((u,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${i(u.label)}</strong><small>Section ${i(u.section)} \xB7 Row ${i(u.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${i(u.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(u.category)}</dd></div><div><dt>Availability</dt><dd>${i(u.availability)}</dd></div><div><dt>View source</dt><dd>${i(u.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(u.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(u.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(u.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(u.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(u.seat.id)}">Passport</button><button type="button" data-view-seat="${i(u.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(u.seat.id)}"${u.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(u=>u instanceof HTMLElement),c=l.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of l)u.inert=!0,u.setAttribute("aria-hidden","true");e.appendChild(r),e.classList.add("has-comparison"),n.view3dCompareEl=r;let d=r.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=u=>{if(u.key==="Escape"){u.preventDefault(),hn(n);return}if(u.key!=="Tab")return;let f=p();if(!f.length)return;let b=f[0],T=f[f.length-1];u.shiftKey&&document.activeElement===b?(u.preventDefault(),T.focus()):!u.shiftKey&&document.activeElement===T&&(u.preventDefault(),b.focus())};window.addEventListener("keydown",m),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);for(let u of c)u.element.inert=u.inert,u.ariaHidden===null?u.element.removeAttribute("aria-hidden"):u.element.setAttribute("aria-hidden",u.ariaHidden);r.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===r&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>hn(n)),r.querySelectorAll("[data-passport-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.passportSeat,b=f?n.allSeats().find(T=>T.id===f):void 0;b&&zs(n,b,u)})),r.querySelectorAll("[data-view-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.viewSeat;hn(n,!1),f&&n.view3dHandle?.flyToSeat(f)})),r.querySelectorAll("[data-select-seat]").forEach(u=>u.addEventListener("click",()=>{let f=u.dataset.selectSeat;f&&rb(n,f)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function hn(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function rb(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(o=>o.id===e);if(!t)return;if(hn(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var kp=require("@seatlayer/core"),Sp=require("@seatlayer/core/view3d/crossfade/panorama");var js=require("@seatlayer/core");var sb=900,ab=450;function lb(n){switch(n){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function wp(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),n.append(t,o);let r=null,s=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),!a){o.classList.remove("is-shown"),o.textContent="",s=setTimeout(()=>{s=null,n.classList.remove("is-seat-view")},ab);return}n.classList.add("is-seat-view"),o.textContent=lb(a),o.classList.add("is-shown"),r=setTimeout(()=>{r=null,o.classList.remove("is-shown")},sb)},dispose(){r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),t.remove(),o.remove(),n.classList.remove("is-seat-view")}}}var cb=44,db=92;function xp(n,e,t,i={}){let o=n?.sectionLabel,r=ve(n),s=pb(n,e),a=[o,r?(0,js.t)("picker.rowLabel",{label:r}):null,s?(0,js.t)("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?cb:db);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function pb(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(ve(n)),t}var Tp=require("@seatlayer/core/core/seatConfidence");var hb=220;function ub(n,e,t){let i=null,o=null,r=null;return(s,a)=>{n()?.presentSeatHover?.(s,a,e),r=a,s!==o&&(o=s,i&&(clearTimeout(i),i=null),!(!s||!t)&&(i=setTimeout(()=>{if(i=null,o!==s)return;let c=t()?.(s)??null;c&&o===s&&n()?.presentSeatHover?.(s,r,e,c)},hb)))}}function Ep(n){return n.buyerView}function Cp(n,e,t){if(e==="map"){n.exit3d();return}let i=t?.flyToSeatId;if(n.buyerView==="venue3d"){i?(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),n.view3dHandle?.flyToSeat(i)):t?.resetView&&n.view3dHandle?.focusOverview();return}n.enter3d(i)}function Ap(n,e){switch(n.controller.getStatus(e.id)){case"held":if(!Mp(n,e))return"held";break;case"booked":case"not_for_sale":return"sold";default:break}return n.priceBandKeys!=null&&!n.priceBandKeys.has(e.categoryKey)||n.controller.accessibilityFilterDims?.(e)||n.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function Pp(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e),n.syncSelectionTo3d(),Ks(n)}function Ks(n){n.view3dHandle?.setAreaStates&&bo(n,()=>{let e=n.view3dHandle;if(!e?.setAreaStates)return;let t=n.priceBandKeys,i=fo(n.controller);e.setAreaStates(go(n.controller.gaStates(),o=>t!=null&&!t.has(i.get(o)?.categoryKey??""),o=>i.get(o)?.wheelchairPlaces??0))})}function Mp(n,e){return Lp(n,e)!=null}function Lp(n,e){let t=n.controller.currentHold()?.labels;if(!t?.length)return null;if(t.includes(e.label))return e.label;let i=n.controller.tableSelection(e.id)?.label;return i!=null&&t.includes(i)?i:null}function mb(n){return(n.controller.currentHold()?.labels??[]).flatMap(e=>{let t=n.controller.tableSelection(e)?.physicalSeatIds;if(t?.length)return t;let i=n.controller.seatByLabel(e)?.id;return i?[i]:[]})}function Hp(n){if(!n.view3dHandle)return;let e=new Set;for(let t of n.controller.getSelection()){let i=t.physicalSeatIds;if(i?.length)for(let o of i)e.add(o);else e.add(t.id)}for(let t of mb(n))e.add(t);n.view3dHandle.setSelection([...e])}function Rp(n,e){let t=n.view3dHandle;if(!t)return;n.pushAvailabilityTo3d(),n.syncSelectionTo3d();let i=e[0];!i||e.every(r=>r.rowId===i.rowId)&&t.focusRow(i.rowId)||i.sectionId&&t.focusSection(i.sectionId)}async function Ip(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,r=o?await n.buyerAssetUrls.resolve(i):null,s=o?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!s||o&&!r?null:{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:a=>n.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return n.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:n.tf("picker.chartDerivedModel","Chart-derived model")}}function Op(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),n.syncSelectionTo3d();return}let t=n.allSeats().find(l=>l.id===e);if(!t)return;let i=n.controller.tableSelection(e),o=Lp(n,t);if(o!=null){if(n.syncSelectionTo3d(),n.performanceGroup)return;if(n.opts.confirmSelection===!1){n.removeHeldTicket(o);return}if(n.confirmSeat?.id===t.id){n.dismissConfirm();return}n.showConfirm(o===t.label?t:{...t,label:o},"remove");return}if(n.committedSelection().some(l=>i?l.label===i.label:l.id===e)){if(i||n.opts.confirmSelection===!1){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}n.syncSelectionTo3d(),n.showConfirm(t,"remove");return}let s=n.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){n.syncSelectionTo3d();return}if(!n.controller.select([e]).length){n.syncSelectionTo3d(),n.dismissConfirm();return}if(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),n.flashPickedSeat(e),i){n.showTableDialog(i,!1),n.syncSelectionTo3d();return}n.opts.confirmSelection!==!1?n.showConfirm(t):n.syncTray(),n.syncSelectionTo3d()}function _p(n,e){let t=n.allSeats().find(i=>i.id===e);return xp(n.controller.seatDetails(e),t?.displayLabel??t?.label??e,n.tf("picker.viewFromYourSeat","view from your seat"),{narrow:n.root?.dataset.layout==="narrow",shortTail:n.tf("picker.fromYourSeat","from your seat")})}function Np(n,e){if(n.buyerView!=="venue3d")return;let t=n.view3dCompareSeatIds;t.includes(e.id)||(n.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),n.confirmSeat?.id===e.id&&(n.controller.deselect([e.id]),n.dismissConfirm(),n.syncSelectionTo3d(),n.syncTray()),n.view3dCompareChip.sync(),n.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:n.view3dCompareSeatIds.length}),n.view3dCompareSeatIds.length>1?n.openView3dComparison():n.toast(n.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Dp(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function Fp(n,e){let t=n.allSeats().find(f=>f.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),o=n.controller.doc?.categories.find(f=>f.key===t.categoryKey),r=i?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),s=r!=null?n.paidPrice(t.categoryKey,i?.tierId??o?.tiers?.[0]?.id??null,r,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="free"||!a?n.tf("picker.available","Available"):Mp(n,t)?n.tf("picker.heldForYou","Held for you"):n.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?(0,Sp.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):n.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Eo(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=Al({...t.accessibility?.length?{accessibility:t.accessibility}:{},...i?.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{}}),m=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:n.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=(0,Tp.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:ve(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??o?.label??t.categoryKey,price:n.suppressPricing||s==null?"":n.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:u}}async function Bp(n,e){if(n.view3dEl||!n.canOffer3d()||!n.els.map)return;let t=n.controller.doc;if(!t)return;n.buyerView="venue3d",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),n.root?.setAttribute("data-view3d","on"),n.dismissConfirm(),n.syncProjection(),n.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",n.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${n.tf("picker.backToMap","Back to map")}</span>`;let r=o.querySelector("span"),s=c=>{n.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),n.root&&(n.root.dataset.view3dSeat=d?"on":"off");let p=d?n.tf("picker.backToVenue","Back to venue"):n.tf("picker.backToMap","Back to map");r&&(r.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(o),n.view3dBack=o,n.publish3dTopInset(),op(n.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=n.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||n.fsFallback||n.framedFs)),c.addEventListener("click",()=>n.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=n.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),n.els.map.appendChild(i),n.view3dEl=i,n.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++n.view3dGen;try{let c=n.allSeats(),[d,p]=await Promise.all([Pi(),n.controller.loadEventConfiguration()]),m=p?await Xo(p,E=>n.buyerAssetUrls.resolve(E)):null,u=t.theme?.venue3d?.shellAssetUrl,f=await Qo(u,E=>n.buyerAssetUrls.resolve(E));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let b={...mo(n.opts.enable3DCrowd),crowdSeatCeiling:n.max3dSeats()},T={doc:t,seats:c,...b,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...f?{registeredShellGlb:f}:{}};a.textContent=(0,kp.t)("picker.building3d");let C=await d.prepareVenue3D(T);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let k=d.mountVenue3D(i,{...T,prepared:C},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:rn(),navLabels:ho(),...uo(n.opts.touchNavigation3D),seatViewActionLabel:E=>n.allSeats().find(L=>L.id===E)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:E=>n.seatViewCaption(E),onSeatViewStopChange:E=>n.view3dSeatViewChrome?.onStopChange(E),onSeatPick:E=>n.onView3dSeatPick(E),onSeatInspect:E=>n.onView3dSeatPick(E),onObjectPick:E=>{E.kind==="area"&&n.openAreaChooser(E.id,E.point)},onSeatHover:ub(()=>n.controller.getRenderer(),i,()=>{let E=k.captureSeatView;return E?L=>E.call(k,L):void 0}),onSectionFocusChange:E=>{let L=i.querySelector('select[data-locator="section"]'),Q=E??"";!L||L.value===Q||(L.value=Q,L.dispatchEvent(new Event("change")))},onViewTargetChange:E=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!E),s(E),n.opts.onBuyerViewChange?.({view:"venue3d",...E?{seatId:E}:{}})},...n.seatViewEnabled()?{getSeatView:E=>new Promise((L,Q)=>{let D=()=>{n.seatViewFor3d(E).then(R=>{R?L(R):Q(new Error("seat_view_unavailable"))})},g=globalThis.requestIdleCallback;typeof g=="function"?g(D,{timeout:1500}):setTimeout(D,50)})}:{},onAnalytics:(E,L)=>n.emit3dAnalytics(E,L)});n.view3dHandle=k,n.view3dSeatViewChrome=wp(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=ip(n.regions["bottom-left"]??i,k),e&&k.flyToSeat(e)}catch(c){if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;n.opts.onError?.(c),n.toast(n.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),n.exit3d()}}function Vp(n){let e=n.regions["top-left"];if(!n.root||!e)return;let t=()=>{!n.root||n.root.dataset.view3d!=="on"||n.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function $p(n){if(n.buyerView!=="venue3d"&&!n.view3dEl)return;n.view3dGen++,n.buyerView="map",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"map"}),n.root?.removeAttribute("data-view3d"),n.closeSeatConfidencePassport(!1),n.closeView3dComparison(!1),n.view3dCompareChip.remove(),n.view3dSeatViewChrome?.dispose(),n.view3dSeatViewChrome=null,n.view3dBack?.remove(),n.view3dBack=null,n.view3dNav?.remove(),n.view3dNav=null,n.root?.removeAttribute("data-view3d-seat"),n.root?.style.removeProperty("--sl-3d-top-inset");try{n.view3dHandle?.dispose()}catch{}n.view3dHandle=null;let e=n.view3dEl;n.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),n.syncProjection(),n.syncTray();let t=n.view3dReturnSeat;n.view3dReturnSeat=null,t&&n.committedSelection().some(i=>i.id===t.id)&&n.opts.confirmSelection!==!1&&n.showConfirm(t)}var Us=require("@seatlayer/core");var zp=Symbol("seatlayer.performance-group-picker");function Er(n,e){return Object.defineProperty(n,zp,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function Cr(n){return!n||n.surface==="season"}function un(n){return n?.surface==="season"}function jp(n){return n[zp]??null}var $i=require("@seatlayer/core");function Kp(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Ar(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?(0,$i.t)("picker.selectExactMore",{count:n.remaining}):(0,$i.t)("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?(0,$i.t)("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,$i.t)("picker.orphanHint")}var Gs=6e4,Gp=5*6e4,gb=String(Math.round(Gp/6e4));function Up(n){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(n.regions["bottom-center"]??n.els.map).appendChild(e),n.extendEl=e,n.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),n.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),n.els.extendBtn.textContent=qp(n),n.els.extendDismiss.setAttribute("aria-label",n.tf("picker.close","Close")),n.els.extendBtn.addEventListener("click",()=>{n.handleExtend()}),n.els.extendDismiss.addEventListener("click",()=>{n.extendDismissed=!0,n.setExtendPrompt(!1,0)})}function qp(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",gb)}function Wp(n){let e=n.hold?.items??[],t=new Set(e.map(o=>o.label));return n.committedSelection().filter(o=>!t.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0)+vt(n.gaQty,n.hold?.items??[])}function Yp(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Xp(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,o)=>i+(o.quantity??1),0);return n.heldTicketCount()+t+vt(n.gaQty,n.hold?.items??[])}function Qp(n){let e=new Set((n.hold?.items??[]).map(o=>o.label)),t=n.committedSelection().filter(o=>e.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-vt(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function Zp(n,e=n.lastTrayCount,t=n.pendingSelectionCount()){let i=n.els.cta;if(!i)return;if(delete i.dataset.act,n.salesClosed&&!n.finishingHold?.()){i.disabled=!0,i.textContent=n.closedWords?.().cta??n.tf("picker.salesClosedCta","Sales closed");return}if(n.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(n.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(o&&!o.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let r=n.controller.getSelectionValidity(e);if(r&&!r.isValid){i.disabled=!0,i.textContent=Ar(r,(s,a)=>n.tf(s,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&Cr(n.performanceGroup)&&!n.hold&&!n.bestAvailableSoldOut){i.disabled=!1,i.dataset.act="find",i.textContent=n.tf("picker.findBestSeats","Find best seats");return}i.disabled=e===0,i.textContent=n.hold?t?(0,Us.t)("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?bb(n,n.performanceGroup):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function bb(n,e){let t=un(e),i=t?(0,Us.t)("picker.season.holdSeatsForAllDates"):n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances");return(e.performanceCount===1?n.tf(t?"picker.season.holdSeatsForOneDate":"picker.holdSeatsForOnePerformance",i):i).replace("{count}",String(e.performanceCount))}function Jp(n,e){n.ctaPhase=e,n.syncCta()}async function eh(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function th(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function nh(n){if(n.opts.initialHoldId)return n.opts.initialHoldId;if(n.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(n.holdStorageKey())}catch{return null}}function ih(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function oh(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function rh(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let o={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=o,wc(n.gaQty,o.items??[]),n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(o.expiresAt),n.rememberHold(o),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(o,o.seats??[],n.buildHandoff(o)),o}catch(i){let o=i?.status;if(o===404||o===409)n.forgetHold();else if(o===401&&i?.code==="buyer_access_invalid")n.forgetHold(),n.toast(n.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(n.opts.onError?.(i),t)throw i;return null}}async function sh(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function ah(n,e){n.stopHoldTimer(),n.holdExpiresAt=e,n.extendDismissed=!1,n.extendUsed=!1,n.hold&&n.rememberHold(n.hold);let t=n.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${n.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]'),o=()=>{let r=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=Vl(r)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=Gs),n.setExtendPrompt(r>0&&r<=Gs,r),(r<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(o,500),o()}function lh(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function ch(n,e,t){if(!n.extendEl)return;let i=e&&t>0&&n.root?.dataset.layout!=="narrow"&&!!n.api.extend&&!n.extendDismissed&&!n.extendUsed&&!!n.controller.currentHold()&&!n.bookedShown;n.extendEl.classList.toggle("on",i)}function dh(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=Gs,e)}async function ph(n){let e=n.els.extendBtn,t=n.controller.currentHold();if(!(!t||!n.api.extend||n.extendUsed)){e.disabled=!0,e.textContent=n.tf("picker.addingEllipsis","Adding\u2026");try{let i=await n.api.extend(n.controller.key,t.holdId,Gp);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let o=n.controller.currentHold();if(!o)return;n.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},n.holdExpiresAt=o.expiresAt,n.extendUsed=!0,n.extendEl?.classList.remove("on"),n.rememberHold(n.hold),n.emitHoldChange(),n.toast(n.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(i){if(i?.reason==="extend_limit"){n.extendUsed=!0,n.setExtendPrompt(!1,0);return}n.opts.onError?.(i),n.toast(n.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=qp(n)}}}function hh(n,e){if(n.destroyed)return!1;let t=n.hold,i=!!t&&(e===void 0||t.holdId===e);if(i){let o=new Set([...(t.items??[]).map(s=>s.label),...(t.seats??[]).map(s=>s.label),...n.controller.currentHold()?.labels??[]]);n.controller.clearHold(),n.notifyGroupSettled("booked");let r=n.controller.getSelection().filter(s=>o.has(s.label));r.length&&n.controller.deselect(r.map(s=>s.id))}return n.controller.refresh().catch(()=>{}),i}function vb(n){let e=n;return e?.status===404?"ended":e?.status!==409||e.code!=="hold_not_active"?"unknown":e.reason==="booked"?"booked":"ended"}async function uh(n,e){try{return await n(e),!1}catch(t){return vb(t)==="booked"}}var ti=require("@seatlayer/core");function mh(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function fh(n){return wb(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+xb(n.status)}function wb(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let o=n.priceOf(i),r=n.rangeOf(i),s=n.offerOf(i.key),a=mh(s),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(i.label)}</span>`+(s?.offerName?So(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function xb(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(n.unavailable)}</span>`+(n.partial?`<span class="sl-status-item"><i class="sl-status-icon partial" aria-hidden="true"></i>${e(n.partial)}</span>`:"")+"</div>"}function qs(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function gh(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(o=>{let r=n.rangeOf(o),s=n.priceOf(o),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(n.left,o.key)&&n.left[o.key]<=0,c=mh(n.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${n.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${n.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function bh(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(o.length/4),s=[];for(let a=0;a<o.length;a+=r){let l=o.slice(a,a+r),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));s.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return s}function yh(n){if(n.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),n.priceSelect=null,n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=bh((n.controller.doc?.categories??[]).filter(o=>!o.notForSale),n.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",n.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=n.tf("picker.allPrices","All prices"),t.appendChild(i);for(let o of e){let r=document.createElement("option");r.value=o.id,r.textContent=o.label,t.appendChild(r)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function vh(n,e){if(n.focusedCatKey=null,n.priceBandKeys=e?new Set(e):null,n.priceSelect){let t=e?n.priceSelect.value:"all";n.priceSelect.value!==t&&(n.priceSelect.value=t)}n.controller.setCategoryFilter(e),n.controller.focusCategoryFilter(e),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}function wh(n){return{colorOf:e=>n.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>n.catPriceRange(e),priceOf:e=>n.catPrice(e),offerOf:e=>n.offerPrice(e),money:e=>e?n.money(e):n.tf("checkout.free","Free"),esc:Y}}function xh(n,e,t,i=n.legendDeps()){let o=n.els.railScroll,r=e.length>1;if(n.els.rail?.classList.toggle("has",r),!o)return;o.innerHTML=r?gh({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:(0,ti.t)("picker.soldOut"),allWord:n.tf("picker.allPrices","All prices"),allActive:!n.focusedCatKey&&!n.priceBandKeys}):"";let s=e.map(a=>a.key).join("|");n.lastRailSignature!==s&&(n.lastRailSignature=s,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){n.applyPriceBand(null);return}n.focusCategory(a.dataset.cat??"")})}),n.railEdgesBound||(n.railEdgesBound=!0,o.addEventListener("scroll",()=>qs(o),{passive:!0})),requestAnimationFrame(()=>qs(o))}function kh(n){let e=n.controller.doc;if(!e||!n.els.prices)return;let t=n.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);n.syncSoldout(i,t);let o=n.legendDeps(),r=n.suppressPricing,s=r?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;r&&(n.els.pricesSec?.querySelector("span")?.replaceChildren((0,ti.t)("picker.seatCategories")),n.els.pricesInfo?.remove()),n.syncPriceRail(i,t,s);let a=5,l=i.length-a,c=l>1&&!n.pricesExpanded,d=c?i.slice(0,a):i;n.els.prices.classList.toggle("sl-expanded",l>1&&n.pricesExpanded),n.els.prices.innerHTML=fh({...s,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(p,m)=>m?n.tf("picker.showAllSeats","Show all seats"):(0,ti.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?r?(0,ti.t)("picker.showAllCategories"):(0,ti.t)("picker.showAllTicketTypes",{count:i.length}):n.tf("picker.showFewer","Show fewer"):null,status:{legend:n.tf("picker.seatStatusLegend","Seat status legend"),unavailable:n.tf("picker.group.legendUnavailable","Unavailable"),partial:n.partialLegend()}}),n.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>n.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>n.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>n.focusCategory(p.dataset.cat??"");p.addEventListener("click",m),p.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),m())})}),n.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{n.pricesExpanded=!n.pricesExpanded,n.syncPrices()})}function Sh(n,e){if(!e)return;let t=n.focusedCatKey===e?null:e;n.focusedCatKey=t,n.priceBandKeys=t?new Set([t]):null;let i=n.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),n.controller.setCategoryFilter(t?[t]:null),n.controller.focusCategoryFilter(t?[t]:null),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}var ni=require("@seatlayer/core");function Xe(n,e,t){let i=(0,ni.t)(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(o,r)=>r in t?String(t[r]):o):e}function Sb(n){let e=(0,ni.tCount)("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function Tb(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function Eb(n){if(n.length<2)return!1;let e=[...n].sort((t,i)=>t-i);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Cb(n){let e=n.filter(o=>o.objectType==="ga"),t=n.filter(o=>o.objectType!=="ga"),i=[];if(t.length){let o=Sb(t.length),r=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(r.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?Xe("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:r[0],row:s[0],seat:String(t[0].seatNumber??"")}):Eb(a)?Xe("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:r[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?Xe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):Xe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]}))}else r.length===1?i.push(Xe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]})):r.length>1?i.push(Xe("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:Tb(r)})):i.push(o)}for(let o of e)i.push(Xe("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return i.length?i.reduce((o,r)=>Xe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:r})):""}function Th(n){if(!n)return[];let e=new Map((n.seats??[]).map(o=>[o.label,o])),t=n.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let r=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...r?.sectionLabel?{sectionLabel:r.sectionLabel}:{},...r?.rowLabel?{rowLabel:ve(r)??r.rowLabel}:{},...r?.seatNumber?{seatNumber:r.seatNumber}:{}}})}function Eh(n,e){if(!n.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let i=n.seatByLabel(t.label);!i||n.statusOf(i.id)!=="free"||n.flash(i.id,n.accent)}}function Ch(n,e){if(!e.recoverable.length||!n.isConnected)return;let t=n.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>(0,ni.t)("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),o=i?.querySelector(".sl-interrupt-act");if(!i||!o)return;o.classList.add("sl-interrupt-act-secondary");let r=document.createElement("button");r.type="button",r.className="sl-interrupt-act sl-hold-expired-recover",r.textContent=(0,ni.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),r.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(r,o),n.classList.add("has-recovery"),r.focus()}function Ah(n,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let i=document.createElement("div");i.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let r=document.createElement("span");r.className="sl-interrupt-glyph",r.setAttribute("aria-hidden","true"),r.textContent="\u23F1";let s=document.createElement("span");s.textContent=Xe("picker.holdExpiredTitle","Your seats were released"),o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=Xe("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(o,a);let l=Cb(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,i.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=Xe("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=Xe("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>n.restart()),d.appendChild(p),i.appendChild(d),t.appendChild(i),t.addEventListener("pointerdown",m=>{m.target===t&&n.restart()}),t}var St=require("@seatlayer/core");var Ph={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Ab='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Pb='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Mb=8,Lb=8,Hb=88;function Rb(n){let e=n.gap??Mb,t=n.margin??Lb,i=n.min??Hb,o=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-o-e-t),i)}var Pr=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=Pb,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let r of this.stored())this.offeredFree().has(r)&&this.active.add(r);if(this.menu.innerHTML=Fl(o,t.tf("picker.close","Close"))+Bl(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",r=>r.stopPropagation()),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",r=>{r.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.menu.addEventListener("focusin",r=>{let s=r.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:o})=>[i,o])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let o=i.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let r=o.slice(5),s=e.get(r);if(s===void 0)continue;let a=this.countNode(i),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(r,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Rb({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();hs(this.menu,{x:t.left+t.width/2,y:t.top}),gc(this.menu),fc(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,St.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Ab,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:o})=>({key:i,count:o}));let t=this.deps.present;return t?St.ACCESSIBILITY_TYPES.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(St.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:o})=>{let r=t.get(i);return r?[{key:`a11y:${i}`,iconHtml:(0,St.seatTypeIconSvg)(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,Ph[i]??r.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),i=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",i),e.setAttribute("aria-expanded",String(i))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let i=t.slice(5),o=!this.active.has(i);o?this.active.add(i):this.active.delete(i),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=i,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,r.textContent??""));let s=o.querySelector(".sl-info");s?s.after(r):e.after(r),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),r.addEventListener("click",a=>{a.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(i);l&&r.setAttribute("aria-label",this.jumpLabel(i,r.textContent??"",l.label))})}}countText(e){return e>0?(0,St.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Ph[e]??St.ACCESSIBILITY_TYPES.find(i=>i.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var Mh=require("@seatlayer/core"),Ib=250;function Lh(n,e=Ib){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},o=(0,Mh.attachVisibilityCatchUp)(i),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),o(),r&&window.removeEventListener("focus",i)}}var mn=require("@seatlayer/core");var Mr=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=(0,mn.holdRecoveryShape)(e),i=e.lapsedLabels.length,o=i-e.recoverable.length,r=t==="all"?(0,mn.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,mn.tCount)("picker.holdLapsedSomeTaken",o):(0,mn.tCount)("picker.holdLapsedAllTaken",i);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${Y(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${Y(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,mn.tCount)("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var Hh="@seatlayer/pending-checkout/v1";function Ob(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function ii(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let o=window.sessionStorage.getItem(Hh);if(o){let r=null;try{r=JSON.parse(o)}catch{}if(r&&Ob(r.orderId)){let s=Date.now()-Number(r.storedAt);if(s>=0&&s<=144e5){if(r.eventKey&&r.eventKey!==n)return null;i=r.orderId}}}window.sessionStorage.removeItem(Hh)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function Rh(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Ih="https://api.seatlayer.io",_b=10,Nb=250,Oh=6e4,_h=4,Db=10,Fb=40,Bb=220,Ws=["mini","peek","open"],Nh="seatmap.a11y.cb";function lt(n,e,t){return t?{ok:!1,reason:n,message:e,labels:t}:{ok:!1,reason:n,message:e}}function Vb(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Nh);return n==null?null:n==="1"}catch{return null}}function $b(n){try{window.localStorage.setItem(Nh,n?"1":"0")}catch{}}var Tt=class n{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.paintedLocale=null;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.guestsOnly=!1;this.guestsDeadlineStop=null;this.salesInfo=null;this.salesUi=null;this.salesUiLoad=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new vr({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Mr({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.escHandler=null;this.closeModal=null;this.markedSeatIds=new Set;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=jp(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Ih).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Ko({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??jn(e,t),this.pubApi=e.transport?null:i?.api??new Lt(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=td(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Vo(this.api),this.buyerAssetUrls=new Wn(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let r=Kp(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(_b,r)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.baQty=Math.min(this.baQty,this.maxTickets),this.cbSafe=Vb()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Yn(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Rh({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-_h&&t.width>=window.innerWidth-_h}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}fullscreenMeasurementChanged(e,t){let i=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,r=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:o},r}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){wt();let t=cr(v("picker.seatSelection","Seat selection"),bt(void 0,e.theme)["--sl-bg"]),i;try{i=new n({...e,container:t.frame})}catch(s){throw t.teardown(!1),s}i.modalCleanup=()=>{i.modalCleanup=null,t.teardown()};let o=!1,r=()=>{if(o)return;o=!0,i.modalCleanup?.();let s=()=>{i.destroy(),e.onClose?.()};i.hold&&!i.handedOff&&e.holdOnClose!=="keep"?i.release().finally(s):s()};i.closeModal=r,t.onScrimPress(r),i.escHandler=t.trapKeys(s=>{i.tableDialog?(s.preventDefault(),i.cancelTableDialog()):i.confirmSeat?(s.preventDefault(),i.cancelConfirm()):i.bestAvailableConfirm?(s.preventDefault(),i.bestAvailableConfirm=!1,i.syncTray()):(s.preventDefault(),r())});try{let s=i.render();i.els.close?.classList.add("on"),i.els.close?.addEventListener("click",r),await s}catch(s){throw i.destroy(),s}return i.destroyed||t.focusFirst(),i}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;hc({base:(e.apiBase??Ih).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new I.PickerController({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,unselectableAsUnavailable:e.unselectableAsUnavailable,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),seatPriceLabel:t=>{let i=this.seatPriceRangeOf(t.label,t.categoryKey);return i?this.moneyRange(i):void 0},flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:Fn(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>this.openAreaChooser(t,this.lastMapPoint),onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),cd(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=Th(this.hold);let o=this.hold;this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear();let r=this.api.resume,s=t&&!i&&o&&r?uh(a=>r.call(this.api,this.opts.event,a),o.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||i){let a=()=>this.toast((0,I.t)("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");if(!s){a();return}s.then(l=>{if(!(this.destroyed||this.hold)){if(!l){a();return}this.hold=o,this.showBooked()}});return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),s?s.then(a=>{a||this.opts.onHoldExpired?.()}):this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(Oi(this.maxTickets),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onSalesNotice:t=>this.salesNotice(t),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=b=>Math.round((performance.now()-b)*100)/100;this.rendered=!0,wt();let o=performance.now(),r=_o(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=bl(this.opts.container),{root:c,els:d,mapHost:p}=ec(l,(b,T)=>this.tf(b,T),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,this.paintedLocale=(0,I.getLocale)(),this.opts.checkoutBar===!1&&(c.dataset.checkoutBar="off"),No(c,r,b=>{t.loadLocale=i(o),this.destroyed||this.applyActiveLocale(b,s)}),ap(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]);let m=this.performanceGroup?.modalClose;m&&(this.els.close?.classList.add("on"),this.els.close?.addEventListener("click",()=>m()));let u=this.performanceGroup?.subheader;u&&c.querySelector(".sl-head")?.after(u),this.syncFullscreenButtons(),this.wireBuyerShell(c);let f=document.createElement("div");return f.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(f),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(f,t,i,e,c)}async loadAndFinishChart(e,t,i,o,r){this.startRealtime(),this.startIdleClock(r);let s=await this.loadChart(e,t,i);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(o);let a=performance.now();this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,this.salesInfo=s;let l=this.chartFetch.outcome();if(this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,l.state==="resolved"&&l.guestsOnly){this.guestsOnly=!0,this.salesClosed=!0;let{forMs:E}=l.guestsOnly;E!==null&&(this.guestsDeadlineStop=oc(this,E))}if(r.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),s.mode==="test"){let E=document.createElement("div");E.className="sl-testbadge",this.testBadgeEl=E,this.syncTestBadge(),this.regions["top-left"].appendChild(E)}let c=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(r),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,yo(this.els.logo,[this.opts.theme?.logoUrl,c?.logoUrl,this.performanceGroup?.brandLogoUrl,s.posterUrl],this.opts.theme?.brandName??c?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let d=s.startsAt?ko(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=d||null,this.els.meta.textContent=[s.venue,d].filter(Boolean).join(" \xB7 "),this.syncProjection();let p=!!this.controller.doc&&this.controller.getExpandedSeats().some(E=>E.commercial?.restrictedView||E.commercial?.obstructedView);this.buildAccessibilityMenu(p),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),r.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=i(a);let m=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(m),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,f=so(this.opts.event),b=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),T=b??"event",C={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:T,surface:b==="season"?"season_picker":b==="performance_group"?"performance_group_picker":"seat_picker",ms:i(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(E=>E.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:f,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};fp(C,(E,L)=>this.emitAnalytics(E,L));let k=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",$s({...C,performanceProfile:{...C.performanceProfile,...k}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return hp(this)}webMcpHost(e){return Vs(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=Lh(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let r=0,s=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,r=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-r;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-r)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),i())}),e.addEventListener("click",o=>{let r=o.target.closest("[data-sl-info]");if(!r||!e.contains(r))return;o.stopPropagation();let s=r.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),r.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-r.left,y:o.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let i=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),i==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),i=this.els.sheetToggle;i?.setAttribute("aria-expanded",String(e==="open")),i?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=Ws.indexOf(this.sheetState()),i=Math.min(Ws.length-1,Math.max(0,t+e));this.setSheetState(Ws[i])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let o=e.clientHeight,r=i!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:o};let s=this.fullscreenMeasurementChanged(i,o);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),r&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let r=await Vn(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=(0,I.t)("picker.loadingTakingLonger"))});if(this.loadAbort=null,r.outcome==="cancelled"||this.destroyed)return null;let s=r.outcome==="loaded"?r.value:null,a=r.outcome==="loaded"&&!s&&!this.opts.transport?$o(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=i(o),this.destroyed)return null;if(!s){a&&zo({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),rt({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:r.outcome==="timeout"?"load_timeout":r.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:ut(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Xn(this.els.boot,{title:["picker.eventUnavailableTitle","This event isn\u2019t available"],description:["picker.eventUnavailable","Tickets can\u2019t be booked here right now."]});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Xn(this.els.boot,{title:["picker.mapDidNotLoad","The seat map didn\u2019t load"],description:["picker.checkConnection","Check your connection and try again."],action:["picker.accessRetry","Try again"]}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Xn(this.els.boot,{title:["picker.loadingSeatMap","Loading seat map\u2026"],busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},i,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),i=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;rt({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:ut(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Xn(this.els.boot,{title:["picker.restoreUnavailableTitle"],description:["picker.restoreUnavailable"],action:["picker.accessRetry","Try again"]}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Xn(this.els.boot,{title:["picker.restoringSeats"],busy:!0})}}return!1}finally{t.forEach((o,r)=>{i[r]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=ii(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new Pr(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,o)=>this.tf(i,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,I.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let s=e?this.regions["bottom-center"]??this.els.map:i;s&&o.parentElement!==s&&(o.dataset.dock=e?"map":"head",s===i?s.insertBefore(o,this.els.close??null):s.appendChild(o))}let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Up(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${Y(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return this.guestsOnly?Bo():this.salesUi?.words(this)??Gl(this.wordsSalesState(),!!this.opts.readOnly)}wordsSalesState(){return this.salesState==="testable"&&this.salesInfo?.mode==="test"?"live":this.salesState}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=yl().then(e=>(e.translate(I.t,I.tCount),this.salesUi=e,this.destroyed||this.applySalesClosed(),e),()=>null)}salesNotice(e){(this.salesUi||e.state!=="live")&&this.withSalesUi().then(t=>t?.applyNotice(this,e))}tf(e,t){return v(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,o,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,i),r=[...Po(e,t)].join("|");r!==this.baSoldOutSig&&(this.baSoldOutSig=r,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog(),this.salesClosed&&!this.salesUi&&this.withSalesUi();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed&&!this.salesUi?.view(this));let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),i=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);if(this.buyerView==="venue3d"&&this.view3dHandle){Rp(this,i);return}Kc({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,r)=>this.controller.focusSection(o,r),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,r)=>this.scheduleMotion(o,r)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){return Wp(this)}heldTicketCount(){return Yp(this)}totalTicketCount(){return Xp(this)}updateSelectionCapacity(){Qp(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Zp(this,e,t)}setCtaPhase(e){Jp(this,e)}runCheckoutHandoff(e,t){return eh(this,e,t)}holdStorageKey(){return th(this)}rememberedHoldId(){return nh(this)}rememberHold(e){ih(this,e)}forgetHold(){oh(this)}resumeHoldFromServer(e,t=!1){return rh(this,e,t)}restoreRememberedHold(){return sh(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(o=>o.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=np({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return kr(this,e)}catPriceRange(e){return Sr(this,e)}buildPriceFilter(){yh(this)}applyPriceBand(e){vh(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.dataset.slA="picker.venueView",i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])o.addEventListener(r,wo,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=(0,I.effectiveFloorOverview)(e)==="combined"&&(e.floors?.length??0)>1&&o.size===0||i.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,I.t)("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:(0,I.t)("picker.rungLabel.zones"),sections:(0,I.t)("picker.rungLabel.sections"),seats:(0,I.t)("picker.rungLabel.seats")},d={zones:(0,I.t)("picker.rungTip.zones"),sections:(0,I.t)("picker.rungTip.sections"),seats:(0,I.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" data-sl-t="picker.rungLabel.${p}" data-sl-ti="picker.rungTip.${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let m=p.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let i=Cd({floors:this.controller.getFloors(),tf:(o,r)=>this.tf(o,r),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(i),this.floorsEl=i,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&Fc(this.root,e,this.regions);let t=e?Ed(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(i=>i?.isConnected?i.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(i=>t[i]===this.arenaViewportInsets[i])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,i=this.root?.dataset.layout==="narrow",o=0;if(i&&e&&t?.isConnected){let r=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(o=Math.max(0,r.bottom-s.top+8))}this.controller.setFitClearance?.(o)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=gl((0,I.t)("picker.testMode"),(0,I.getLocale)()),e.setAttribute("aria-label",(0,I.t)("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let o=i.dataset.rung===e;i.classList.toggle("on",o),i.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),r=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,s=vd({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!i&&i.disabled!==r||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,i&&(i.disabled=r,i.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?(0,I.t)("picker.priceHint3d"):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!vo()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Oh/2:Oh}syncFloors(){Ad(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new mr({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let i=t.findIndex(o=>o.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=Os(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Dd(t,e.displayLabel??e.label,this.opts.locale,un(this.performanceGroup))}seatPriceRangeOf(e,t){let i=this.controller.doc?.categories.find(r=>r.key===t),o=i?i.tiers?.length?i.tiers.map(r=>this.paidPrice(i.key,r.id??null,r.price,e)):i.price==null?[]:[this.paidPrice(i.key,null,i.price,e)]:[];return o.length?{min:Math.min(...o),max:Math.max(...o)}:void 0}moneyRange(e){return e.max>e.min?`${this.money(e.min)}\u2013${this.money(e.max)}`:this.money(e.min)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let i=this.controller.doc?.categories.find(u=>u.key===e.categoryKey),r=(this.controller.getStatus(e.id)??"free")==="free"?this.tf("picker.statusAvailable","available"):this.controller.currentHold()?.labels.includes(e.label)?this.tf("picker.heldForYou","Held for you").toLocaleLowerCase((0,I.getLocale)()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase((0,I.getLocale)()),s=this.seatPriceRangeOf(e.label,e.categoryKey),a=!this.suppressPricing&&s?this.moneyRange(s):void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=Dt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,I.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,I.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,I.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,I.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=Nl(e,{variable:r,held:t,typeWord:Dt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>s.querySelector(r?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,I.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new br({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),feeNote:e=>this.feeWords().seat(e),paidPrice:(e,t,i,o)=>this.paidPrice(e,t,i,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,packagePrice:e=>this.performanceGroup?.packagePricing?.seatCardPrice(e)??null,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){ep(e,t,this.reducedMotion())}addSeatLabel(e){return tp(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,o=this.controller.getActiveFloorId(),r=e.focalPoint??i?.floors?.find(p=>p.id===o)?.focalPoint??i?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let p,m=null;try{let f=e.viewMeta?.previewUrl;f&&f!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(f),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(f){t===this.seatViewGen&&this.opts.onError?.(f);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!m||!this.root||!this.seatViewEnabled())return;let u={url:p,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};s=u,a=(0,Lr.seatViewDisclosure)(u),l=(0,Lr.isAuthoredSeatView)(u)}else{let p;try{let{generateSeatPanorama:m}=await xo();p=m(e,r,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:p.url,generated:!0},a=(0,I.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,I.t)("picker.viewFromSeat",{label:e.label}),d=Zo({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:rn(),viewFromSeatLabel:c,real360Label:(0,I.t)("picker.real360"),previewLabel:(0,I.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}feeWords(){return fd(hd(this.offerAvailability,this.currency,this.hostPricing),this.currency,e=>this.money(e))}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,I.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,r)=>`${o} ${r}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=dd(e,t);if(i==null)return;let o=6*36e5,r=Math.min(Math.max(i-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Nb}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let i=pr(t);if(!i)return;let o=this.offerAvailability?.bookingFee?.amountMinor;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i),this.setPricing(this.hostPricing),i.bookingFee?.amountMinor!==o&&this.syncTray(),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let i=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?i.find(o=>(o.tierId??null)===t)??i.find(o=>o.tierId==null)??null:i[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(i=>i.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0||Object.keys(this.opts.pricing?.objects??{}).length>0||Object.keys(this.controller.doc?.seatPrices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(i=>{let o=this.catPriceRange(i);return o?[[i.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,o=!i&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!o){e.classList.remove("has"),e.replaceChildren();return}let r=i??o,s=r.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let p=r.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));ns(p)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=To(p,Y);let m=document.createElement("span");m.className="sl-offer-line";let u=[];if(!s&&i&&t.fromPrice!=null&&u.push(this.money(t.fromPrice/100)),!s&&i&&r.remaining!=null&&u.push((0,I.t)("picker.offerRemainingAvailable",{count:r.remaining})),i&&r.endsAt!=null){let k=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?Tl(r.endsAt):null;if(u.push(k??(0,I.t)("picker.offerUntil",{time:ko(r.endsAt,this.eventTimezone,this.opts.locale)})),k){let E=Math.max(1e3,r.endsAt-Date.now()),L=E%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=r.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(L+25,E+25))}}if(o?.startsAt!=null&&u.push((0,I.t)("picker.offerStarts",{time:ko(o.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=u.join(" \xB7 "),s||l.append(c),l.append(d,m),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let f=document.createElement("details");f.className="sl-offer-info";let b=document.createElement("summary");b.setAttribute("aria-label",(0,I.t)("picker.howOfferWorks",{name:d.textContent??""})),b.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=i?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),f.append(b,T),a.append(l,f),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,o){if(o){let s=(0,I.seatPriceFor)(this.opts.pricing?.objects,o,t)??(0,I.seatPriceFor)(this.controller.doc?.seatPrices,o,t);if(s!==void 0)return s}let r=o?this.channelByObject.get(o):void 0;if(r&&e){let s=this.pricesByChannel.get(r)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(s)return s.price}return xt(this.opts.pricing?.prices,e,t,i)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:tr({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return wh(this)}seatCategory(e){return this.controller.seatByLabel(e)?.categoryKey||null}seatPlaces(e){return e.map(t=>{let i=this.controller.seatByLabel(t),o=i?this.controller.seatDetails(i.id):null,r=o?ve(o)||o.rowLabel:null;return{label:t,...o?.sectionLabel?{section:o.sectionLabel}:{},...r?{row:String(r)}:{},...o?.seatNumber!=null?{seat:String(o.seatNumber)}:{}}})}partialLegend(){return this.markedSeatIds.size?this.performanceGroup?.partialWords?.legend??null:null}syncPriceRail(e,t,i=this.legendDeps()){xh(this,e,t,i)}syncPrices(){this.currencyResolved&&kh(this)}focusCategory(e){Sh(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(r=>!e.has(r.label)&&(this.controller.getStatus(r.id)??"free")!=="free");if(!t.length)return;this.controller.deselect(t.map(r=>r.id));let i=this.handedOff&&!this.holdConflicted?(this.hold?.items??this.hold?.seats??[]).map(r=>r.label):[],o=t.find(r=>!i.includes(r.label));o&&this.toast((0,I.t)("picker.seatJustTakenByAnother",{label:o.label}),"error")}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:o,total:r,count:s}=xr(this),a=[],l=new Set;if(!this.salesClosed){let g=this.performanceGroup?.nightSummary?.()??[];g.length&&a.push(Hd(g,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let R=this.performanceGroup?.selectionModeSwitch;R&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${Y(R.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.wordsSalesState(),note:this.guestsOnly?sc():this.salesUi?.note(this),hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,season:un(this.performanceGroup),seated:!!this.controller.doc?.objects?.some(g=>g.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Ul(c)),this.els.trayHint&&(this.els.trayHint.textContent=ql(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!i.length&&!vt(this.gaQty,this.hold?.items??[]);if(Cr(this.performanceGroup)&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let g=(this.controller.doc?.categories??[]).filter(V=>!V.notForSale),R=this.controller.getBestAvailableZones();this.baZone&&!R.some(V=>V.id===this.baZone)&&(this.baZone="");let _=Po(g,this.controller.categoryAvailability());this.baSoldOutSig=[..._].join("|"),this.bestAvailableSoldOut=g.length>0&&_.size===g.length,_.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(jl({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:g.map(V=>_.has(V.key)?{...V,soldOut:!0}:V),zones:R,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(g,R,_,V=1,z,F,ne,J)=>$l({categoryLabel:ne,offerName:J,d:g?this.controller.seatDetails(g):null,area:_==="ga"?t.find(X=>X.id===z):void 0,label:R,objectType:_,quantity:V,identity:F,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=Y,u=[];for(let g of kc(i)){let R=g.objectType==="ga"?`held:ga:${g.objectId}:${g.tierId??""}`:`held:${g.label}`;l.add(R);let _=g.objectType!=="ga"?this.controller.seatByLabel(g.label):null,V=this.performanceGroup?.packagePricing?g.categoryKey||_?.categoryKey||"":g.categoryKey,z=this.controller.doc?.categories.find(B=>B.key===V),F=this.performanceGroup||this.suppressPricing?null:up(this.controller,g),ne=this.performanceGroup?.packagePricing?.seat(g.label,V),J=(g.tierId&&!F?z?.tiers?.find(B=>B.id===g.tierId)?.name:void 0)??ne?.types?.options.find(B=>B.id===ne.types?.selected)?.name,X=this.offerPrice(g.categoryKey,g.tierId??null)?.offerName,xe=g.objectType==="table"?this.controller.tableSelection(g.label):null,ge=_?this.controller.seatDetails(_.id):null,Ce=this.seatViewEnabled()&&!!_&&g.objectType!=="table"&&!!this.deliverableViewReference(_),Ke=m(this.tf("picker.heldForYou","Held for you")),S=(xe?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,I.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+(F?`<select class="tier" data-held-tier="${m(g.label)}" aria-label="${m((0,I.t)("picker.ticketTierFor",{label:g.label}))}">${Ao(F,g.tierId??void 0,m)}</select>`:""),P=this.heldPrice(g)*(g.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!0,seatIds:[],heldLabels:g.labels,removeAria:(0,I.t)("picker.removeHeldTicketLabel",{label:Yo(g,t)}),locateId:_?.id??null,section:ge?.sectionLabel??"",rowLabel:ge&&ve(ge)||"",seatLabel:ge?.seatNumber??g.label,categoryLabel:`${z?.label??V}${J?` \xB7 ${J}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(V)??z?.color??"",identityHtml:p(_?.id??null,g.label,g.objectType,g.quantity??1,g.objectId,xe??void 0,`${z?.label??V}${J?` \xB7 ${J}`:""}`,X),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ke}" title="${Ke}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:S,amount:P,amountText:ne?ne.amountText:this.suppressPricing?"":this.money(P),noteHtml:sn(_??void 0),railHtml:this.performanceGroup?"":as((0,I.t)("picker.removeHeldTicketLabel",{label:Yo(g,t)}),Ce?g.label:null)})}let f=this.seatViewEnabled();for(let g of e.filter(R=>!o.has(R.label))){let R=`seat:${g.id}`;l.add(R);let _=this.controller.doc?.categories.find(S=>S.key===g.categoryKey),V=this.performanceGroup?.packagePricing?.seat(g.label,g.categoryKey),z=V?.types?`<select class="tier" data-season-type="${m(g.label)}" aria-label="${m((0,I.t)("picker.ticketTierFor",{label:g.label}))}">`+Ao(V.types.options,V.types.selected,m)+"</select>":g.tiers&&g.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(g.id)}" aria-label="${m((0,I.t)("picker.ticketTierFor",{label:g.label}))}">`+Ao(g.tiers,g.tierId,m)+"</select>":"",F=g.tiers?.find(S=>S.id===g.tierId)??g.tiers?.[0],ne=this.offerPrice(g.categoryKey,F?.id??null)?.offerName,J=F?.buyerMessage?.trim()||(F?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),X=this.controller.seatDetails(g.id),xe=m(this.tf("picker.selected","Selected")),ge=(0,I.t)("picker.removeSeatLabel",{label:g.label}),Ce=(g.objectType==="table"&&g.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(g.label))}">${m((0,I.t)("picker.guestsCountEdit",{count:g.quantity??1}))}</button>`:"")+z,Ke=this.paidPrice(g.categoryKey,g.tierId??null,g.price,g.label)*(g.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!1,seatIds:[g.id],heldLabels:[],locateId:g.id,section:X?.sectionLabel??"",rowLabel:X&&ve(X)||"",seatLabel:X?.seatNumber??g.label,categoryLabel:_?.label??g.categoryKey,identityHtml:p(g.id,g.label,g.objectType,g.quantity??1,g.objectId,g,_?.label??g.categoryKey,ne),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(g.categoryKey)??_?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${xe}" title="${xe}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Ce,amount:Ke,amountText:V?V.amountText:this.suppressPricing?"":this.money(Ke),removeAria:ge,noteHtml:sn(g)+(J?`<small class="sl-tier-note">${m(J)}</small>`:""),railHtml:as(ge,f&&g.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(g.label)??{})?g.label:null)})}u.length&&a.push(u.map(zl).join("")),t.length&&a.push(Pc(this,t,i)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let b=this.performanceGroup?.selectNight;b&&zd(this.els.tray,g=>b(g)),this.els.tray.querySelectorAll("[data-ba]").forEach(g=>{g.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(g.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",g=>{this.baCat=g.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",g=>{this.baZone=g.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(g=>{g.addEventListener("click",()=>{let R=g.closest(".sl-chip");if(R.dataset.held){this.removeHeldLabels(decodeURIComponent(R.dataset.held).split(`
3540
+ `),R);return}let _=R.dataset.seat.split(" "),V=()=>{this.controller.deselect(_)};if(this.reducedMotion()){V();return}R.classList.remove("sl-enter"),R.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(V,Me.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(g=>{g.addEventListener("click",R=>{R.stopPropagation();let _=decodeURIComponent(g.dataset.tableEdit??""),V=this.controller.tableSelection(_);if(!V)return;let z=i.find(F=>F.label===_&&F.objectType==="table");this.showTableDialog({...V,quantity:z?.quantity??V.quantity},!!z,g)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(g=>{g.addEventListener("change",()=>{let R=g.dataset.seasonType,_=this.performanceGroup?.packagePricing;R&&_?(_.setType(R,g.value),this.syncTray()):g.dataset.heldTier?this.changeHeldTier(g,g.dataset.heldTier):this.controller.setSeatTier(g.dataset.tier,g.value||null)})}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(g=>{g.addEventListener("click",()=>{let R=this.controller.seatByLabel(g.dataset.viewLabel);R&&this.openSeatView(R)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(g=>{let R=()=>this.controller.flashSeat(g.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");g.addEventListener("mouseenter",R),g.addEventListener("focusin",R),g.addEventListener("click",_=>{_.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([g.dataset.locate],{animate:!this.reducedMotion()})||R()})}),Mc(this,this.els.tray,t),this.controller.setGASelection(yc(this.gaQty)),Ks(this),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(g=>{g.disabled=!0});let T=this.pendingSelectionCount(),C=this.lastTrayCount,k=this.lastTrayTotal,E=$d(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat",un(this.performanceGroup)),L=s?this.performanceGroup?.packagePricing?.total([...i.filter(g=>g.objectType!=="ga"),...e.filter(g=>!o.has(g.label))].map(g=>({label:g.label,categoryKey:g.categoryKey||this.controller.seatByLabel(g.label)?.categoryKey||""}))):null;this.els.count.textContent=L?.countText||E||(s?(0,I.tCount)("picker.ticketsCount",s)+(this.suppressPricing?"":this.feeWords().tray(i,s,r)):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=L?L.amountText:s&&!this.suppressPricing?this.money(r):"",this.root?.setAttribute("data-has-selection",String(s>0)),this.sheetState()==="mini"&&s===0?this.setSheetState("mini"):s>C&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=E||(s?(0,I.tCount)("picker.seatsSelectedCount",s):"")),this.syncCta(s,T);let D=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";s!==C&&!D&&this.animateOnce(this.els.count,"sl-value-pop",380),r!==k&&!D&&this.animateOnce(this.els.total,"sl-value-pop",380),C===0&&s>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=s,this.lastTrayTotal=r,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(s,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){od(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(rd),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(sd),ad(this.els.tray?.querySelector("select.sl-ba-cat"))}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}async removeHeldLabels(e,t){let i=e.filter(s=>s&&!this.releasingLabels.has(s));if(!i.length||this.performanceGroup)return!1;let o=i[0];i.forEach(s=>this.releasingLabels.add(s)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,I.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;Sc(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{i.forEach(s=>this.releasingLabels.delete(s)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async holdSelection(){return this.ctaPhase!=="idle"?lt("busy",this.tf("picker.securingSeats","Securing your seats\u2026")):!this.hold&&this.totalTicketCount()===0?lt("nothing_selected",this.tf("picker.selectSeats","Select seats")):this.handleCta(!1)}async handleCta(e=!0,t=e){if(this.salesClosed&&!this.finishingHold())return lt("sales_closed",this.guestsOnly?Bo().toast:this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."));let i=this.controller.getSelectionValidity(this.totalTicketCount());if(i&&!i.isValid){let r=Ar(i,(s,a)=>this.tf(s,a));return this.toast(r,"warning"),lt("selection_invalid",r)}if(this.totalTicketCount()>this.maxTickets){let r=(0,I.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets});return this.toast(r,"warning"),lt("too_many_tickets",r)}let o=this.committedSelection();if(this.hold&&(this.salesClosed||!o.some(r=>!(this.hold.items??[]).some(s=>s.label===r.label))&&!vt(this.gaQty,this.hold.items??[]))){let r=this.hold.seats??o;return this.handedOff=!0,this.holdConflicted=!1,e&&await this.runCheckoutHandoff(this.hold,r),{ok:!0,hold:this.hold,seats:r}}this.holdingLabels=new Set(o.map(r=>r.label)),this.setCtaPhase("holding");try{let r=null,s=vc(this.gaQty,this.controller.currentHold?.()?.items??this.hold?.items??[]),a=this.committedSelection();if(a.length){let d=await this.controller.hold(void 0,this.opts.holdTtlMs);r=d?{holdId:d.holdId,expiresAt:d.expiresAt,seats:d.seats,items:d.items}:null}for(let{areaId:d,tierId:p,qty:m}of s){let u=await this.controller.holdGA(d,m,{tierId:p,ttlMs:this.opts.holdTtlMs});r=u?{holdId:u.holdId,expiresAt:u.expiresAt,seats:u.seats,items:u.items}:r}if(!r){let d=this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");return this.raiseHoldConflict(d),this.setCtaPhase("idle"),this.syncTray(),lt("seats_taken",d)}this.hold=r,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(r.expiresAt),this.flashHeldSeats(r),this.emitHoldChange();let l=this.performanceGroup;return e&&(!l||t&&l.checkoutReady?.(r.holdId)===!0)?(this.handedOff=!0,await this.runCheckoutHandoff(r,r.seats??a)):this.setCtaPhase("idle"),{ok:!0,hold:r,seats:r.seats??a}}catch(r){this.opts.onError?.(r);let s=Rs(r);if(s)return this.toast(s,"warning"),this.setCtaPhase("idle"),lt("paused",s);if(Rn(r)){let m=this.tf("picker.checkConnection","Check your connection and try again.");return this.toast(m,"warning"),this.setCtaPhase("idle"),lt("seats_taken",m)}let a=this.guestRefusalMessage(r);if(a)return this.toast(a,"warning"),this.setCtaPhase("idle"),lt("sales_closed",a);let l=r,c=(l.conflicts??[]).map(m=>m.label).filter(Boolean).slice(0,3);l.reason==="event_closed"&&this.setSalesClosed(!0);let d=l.buyerMessage?l.buyerMessage:l.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):l.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):l.reason==="ticket_option_not_applicable"?(0,I.t)("picker.ticketOptionNotApplicable"):c.length?c.length===1?(0,I.t)("picker.labelsNoLongerAvailable.one",{labels:c.join(", ")}):(0,I.t)("picker.labelsNoLongerAvailable.other",{labels:c.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(d),this.setCtaPhase("idle");let p=l.reason==="event_closed"?"sales_closed":l.reason==="companion_pair_required"||l.reason==="ticket_option_not_applicable"?l.reason:"seats_taken";return lt(p,d,c.length?c:void 0)}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){ah(this,e)}stopHoldTimer(){lh(this)}setExtendPrompt(e,t){ch(this,e,t)}refreshExtendPrompt(){dh(this)}handleExtend(){return ph(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.holdConflicted||this.controller.currentHold()===null&&this.showBooked()}settleBookedHold(e){this.hold?.holdId!==e||this.bookedShown||this.holdConflicted||(this.controller.clearHold(),this.showBooked())}guestRefusalMessage(e){let t=rc(e);return t==="guest_choice_closed"?ac():t!=="guests_only"?null:(lc(this),this.salesClosed=!0,this.applySalesClosed(),Bo().toast)}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}bookedLine(){return this.checkoutMode==="hosted"?this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way."):this.tf("picker.confirmedOnly","confirmed.")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,r)=>o+r.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();if(this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${un(this.performanceGroup)?(0,I.tCount)("picker.season.ticketsConfirmedAcross",i.seats,{performances:i.performances}):(0,I.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,I.tCount)("picker.ticketsCount",t)}</span> ${this.bookedLine()}`),this.els.bookedList){let o=this.controller.getGAAreas();this.els.bookedList.innerHTML=e.lineItems.map(r=>{let s=r.rowLabel&&r.objectType!=="ga"?this.controller.seatDetails(this.controller.seatByLabel(r.label)?.id??""):null,a=Dt({displayType:r.displayType??s?.displayType,rowType:s?.rowType,objectType:s?.objectType??r.objectType}),c=(r.objectType==="ga"?"":[r.sectionLabel,r.rowLabel&&`${a} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 "))||(r.objectType==="ga"?r.displayLabel||Yo(r,o):r.objectType==="table"?`${a} ${r.displayLabel||r.label}`:r.displayLabel||r.label),d=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${Y(c)}${d}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0}this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let r=o?.bookingMode==="free",s=o?.providers?.[0]??null;if(!s&&!r){let a=vl(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:i}),this.opts.onCheckout?.(e,t,i),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:wl(i)});return}await this.openCheckoutPanel(xl(i,s,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await Nn())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:i=>this.money(i),t:I.t,startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>{kl(i)&&(this.paymentOptions=null),i?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(i)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(s=>{let a=this.controller.lineItemDisplay(s),l=s.objectType==="seat"||s.objectType==="booth"?this.controller.seatByLabel(s.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?ve(c):void 0,p=this.controller.doc?.categories.find(f=>f.key===s.categoryKey),m=s.tierId?p?.tiers?.find(f=>f.id===s.tierId)?.name:void 0,u=this.heldPrice(s);return{label:s.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...p?.label?{categoryLabel:p.label}:{},...m?{tierLabel:m}:{},objectId:s.objectId,objectType:s.objectType,categoryKey:s.categoryKey,tierId:s.tierId,unitPrice:u,...gd(s,u),currency:s.currency??this.currency,quantity:s.quantity??1}}),o=i[0]?.currency??this.currency,r=i.reduce((s,a)=>s+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:i,total:r}}emitHoldChange(){let e=this.hold;this.realtime?.watchHold(e?.holdId??null),this.syncSelectionTo3d(),this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let o=this.els.toast;if(!o)return;o.replaceChildren();let r=document.createElement("span");if(r.textContent=e,o.appendChild(r),o.classList.toggle("has-action",!!i),i){let s=document.createElement("button");s.type="button",s.className="sl-toast-action",s.textContent=i.label,s.addEventListener("click",i.onClick,{once:!0}),o.appendChild(s)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let r=i.getBoundingClientRect(),s=r.height||i.offsetHeight||Bb,a=r.height?r.top-this.els.map.getBoundingClientRect().top:o-Ns-s,l=Math.round(o-a+Db);if(l+Fb>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),sp({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Gd(this.tipPos,e,t):null,o=i??Kd(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,o=Os(e.mark,i?.nights?.()),r=o?.states.filter(s=>s.free).length??0;return Rd(o,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(r)??null,pinned:t,words:i?.partialWords})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let i=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor);let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=this.performanceGroup?.packagePricing?.seatCardPrice(e.categoryKey)??null;this.tipEl.innerHTML=jd(e,{price:s?s.price:this.suppressPricing?"":this.money(r),feeNote:s?s.note:this.suppressPricing?"":this.feeWords().seat(r),priceNote:s||!this.suppressPricing?"":this.performanceGroup?.surface==="season"?(0,I.t)("picker.season.includedInPackage"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"),rowTypeWord:Dt(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:o+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${Y(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=i,this.tipEl.classList.toggle("sl-tip-pinned",i),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Wd(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,a=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,a)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let i={};for(let[o,r]of Object.entries(e())){let s=this.controller.idForLabel(o);s&&(i[s]=r,r?this.markedSeatIds.add(s):this.markedSeatIds.delete(s))}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.baQty=Math.min(this.baQty,this.maxTickets),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Mi(this.themeMode),i=bt(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent);for(let[o,r]of Object.entries(i))e.style.setProperty(o,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Io(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(Fn(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Mi(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Mi(this.themeMode),i=bt(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent),o=Fn(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=Zl(i,o);for(let s of Ql)r?e.style.setProperty(s,r[s]):e.style.removeProperty(s)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=pd(e?.prices,this.offerAvailability),i=Object.keys(t).length>0||e?.formatter||e?.objects?{prices:t,...e?.objects?{objects:e.objects}:{},...e?.formatter?{formatter:e.formatter}:{}}:void 0;JSON.stringify(this.opts.pricing??null)!==JSON.stringify(i??null)&&(this.opts.pricing=i,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=tc(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=this.localeGeneration+=1,i=await(0,I.loadLocale)(e);return this.opts.messages&&(0,I.setStringOverrides)(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(this.paintedLocale=e,nc(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons(),()=>this.syncTestBadge()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),$b(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return Ep(this)}setBuyerView(e,t){Cp(this,e,t)}seatState3dFor(e){return Ap(this,e)}pushAvailabilityTo3d(){Pp(this)}syncSelectionTo3d(){Hp(this)}seatViewFor3d(e){return Ip(this,e)}onView3dSeatPick(e){Op(this,e)}openAreaChooser(e,t){let i=this.controller.getGAAreas().find(o=>o.id===e);i&&(this.collapseSheet(),ys(this,i,t))}seatViewCaption(e){return _p(this,e)}saveView3dComparisonSeat(e){Np(this,e)}clearView3dComparison(){Dp(this)}view3dComparisonSnapshot(e){return Fp(this,e)}enter3d(e){return Bp(this,e)}publish3dTopInset(){Vp(this)}exit3d(){$p(this)}openSeatConfidencePassport(e,t=null){zs(this,e,t)}closeSeatConfidencePassport(e=!0){Vi(this,e)}openView3dComparison(){vp(this)}closeView3dComparison(e=!0){hn(this,e)}getCurrentHold(){return this.hold}async markBooked(e){return hh(this,e)}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let i=await mp(this.controller,t,e.value,this.opts.holdTtlMs);i&&(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.startHoldTimer(i.expiresAt),this.emitHoldChange())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){this.opts.onError?.(o);let r=Rs(o);if(r)return this.toast(r,"warning"),null;if(Rn(o))return this.toast(this.tf("picker.checkConnection","Check your connection and try again."),"warning"),null;let s=this.guestRefusalMessage(o);if(s)return this.toast(s,"warning"),null;let a=o?.reason,l=o?.buyerMessage,c=l||(a==="not_enough_together"?(0,I.t)("picker.couldNotFindSeatsTogether",{count:e}):a==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):a==="ticket_option_not_applicable"?(0,I.t)("picker.ticketOptionNotApplicable"):a==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):a==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type."));return this.toast(c,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=Mo(this.controller,t);if(o)throw o;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let r=this.els.tray?.querySelector(".sl-ba-go");r&&(r.disabled=!0,r.classList.add("sl-busy"),r.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(a=>a.commercial?.premium)&&this.toast((0,I.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(r){this.opts.onError?.(r),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new st({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>Td(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,i)=>{i==="booked"&&this.settleBookedHold(t)},sink:{...Hn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}}),onSales:t=>this.salesNotice(t)}}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),at(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Dl(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return xd(this.idlePauseHost,e)}resumeFromIdle(){return Sd(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=Ah({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let i=t.filter(s=>s.objectType!=="ga"),o=[],r=[];for(let s of i){let a=this.controller.seatByLabel(s.label);(a&&this.controller.getStatus(a.id)==="free"?o:r).push(s.label)}Ch(e,{recoverable:o,taken:r,onRecover:s=>this.recoverAfterHoldExpiry(s)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||Eh({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,o)=>this.controller.flashSeat(i,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,Bs(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),at(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function Dh(n){Tt.prewarm(n)}var $t=require("@seatlayer/core");var Fh="seatlayer-performance-group-picker-style";function Bh(){if(document.getElementById(Fh))return;let n=document.createElement("style");n.id=Fh,n.textContent=`
3541
3541
  .sl-pg-root{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3542
3542
  .sl-pg-head{display:grid;gap:8px;padding:16px 18px;border:1px solid var(--sl-line,#dde3ea);border-radius:14px;background:var(--sl-surface,#fff)}
3543
3543
  .sl-pg-head h2{font:700 20px/1.25 inherit;margin:0}.sl-pg-summary{margin:0;color:var(--sl-muted,#627081);font-size:14px}
@@ -3597,7 +3597,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3597
3597
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
3598
3598
  .sl-pg-live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3599
3599
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
3600
- `,document.head.appendChild(n)}var Cb="https://api.seatlayer.io",Ab=6e4,Pb=2e3,Mb=1e3,Lb=36e5,Hb=5e3,Rb=5e3,Ib=15e3,Ob=12e4,_b=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),Te=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Nb(n){return new Promise(e=>setTimeout(e,n))}function Us(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Hb,e*1e3)):1e3}function ii(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function oi(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var qs=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof Te){this.stop();return}if(_o(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Pr=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};this.seededDescriptor=null;if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Cb).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Ab,this.realtimePollMs=Math.max(500,t.realtimePollMs??Pb),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}seedDescriptor(e){e.key===this.groupKey&&Array.isArray(e.performances)&&(this.seededDescriptor=e)}async descriptor(){let e=this.seededDescriptor;this.seededDescriptor=null;let t=e?{performanceGroup:e}:await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=t.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(t.performanceGroup.performances.map(i=>i.eventKey))),t.performanceGroup.revision&&(this.knownRevision=t.performanceGroup.revision),this.activePerformanceKey??=t.performanceGroup.performances[0]?.eventKey??null,t.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new re(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let s=await this.authorized(i,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(s.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!s.ok)return this.throwResponse(s);this.objectsCache=await this.responseJson(s),this.objectsEtag=s.headers.get("ETag")}}if(!this.objectsCache)throw new re(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let s=this.objectsCache;return this.noteAvailability(s,s.salesClosed,s),s}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let s=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!s.length)throw new re(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(s[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,s.every(m=>m.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let m=s.filter(u=>u.seats[p]!=="free").map(u=>u.eventKey);return m.length>0&&m.length<s.length?[[p,m]]:[]})),d={seats:l,partial:c,hidden:[...new Set(s.flatMap(p=>p.hidden??[]))],closed:[...new Set(s.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:s.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let r=o.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!r)throw new re(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(s=>s.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new re(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new re(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new re(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,o){if(this.assertUsable(),o)throw new re(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),s={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(s.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new re(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new re(409,"group_selection_incomplete","group_selection_incomplete");s={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...s,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof Te)throw c;if(c instanceof we)throw this.failOperation(a),c;return this.recover(a,r,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,r,Date.now()+this.recoveryTimeoutMs,Us(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,r,Date.now()+this.recoveryTimeoutMs,Us(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let o=this.operationForHold(i),r=await this.json(`${ii(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),o=await this.json(ii(this.groupKey,i));return this.complete(o.operation)}async extend(e,t,i=12e4){this.assertUsable();let o=this.operationForHold(t),r=Math.max(Mb,Math.min(Lb,Math.round(i))),s=await this.json(`${ii(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(s.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new re(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new qs(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:oi(e.operationId)});let t;try{t=await this.authorized(ii(this.groupKey,e.operationId))}catch(r){return r instanceof Te||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let o=i.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Ob?Ib:Rb;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(ii(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Te?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||_b.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new re(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?oi(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,o=100){let r=o,s=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new Te;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=s,reference:oi(e)}),await Nb(r),this.destroyed)throw new Te;let l;try{l=await this.authorized(ii(this.groupKey,e))}catch(p){if(p instanceof Te)throw p;if(p instanceof we)throw this.recoveryFailed(e,"request_failed"),p;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new re(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));r=Us(l)}throw this.recoveryFailed(e,"deadline"),new re(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:oi(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",r=e.revision??null,s=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:r,revisionChanged:s})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new re(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new re(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let r=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");o.Authorization=r;let s=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(s.status===401||s.status===403||s.status===422)){let a=await s.clone().json().catch(()=>null);if(await this.access.handleFailure(s.status,a?.code??a?.error,r))return this.authorized(e,t,!0)}return s}async json(e,t={}){let i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},r=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(s=>({label:s,status:"held"}))),new re(e.status,o.error??r,r,o.conflicts)}};var ri=require("@seatlayer/core");var si,fn,Ft,ai,$i,Bt,Rh,Mr,Lr=class{constructor(e){this.options=e;M(this,Bt);M(this,si,null);M(this,fn,!1);M(this,Ft,null);M(this,ai,!1);M(this,$i,!1)}get mode(){return h(this,fn)?"hosted":"handoff"}async prepare(){try{x(this,si,await this.options.api.paymentOptions()),x(this,fn,!!h(this,si))}catch(e){x(this,fn,!1),this.options.onError?.(e)}}async open(e,t){if(!h(this,fn)||h(this,ai))return;if(t.selectionMode!=="same_seat"){this.options.announce((0,ri.t)("picker.group.hostedPerPerformance"));return}let i=h(this,si),o=t.seatLabels.length;if(i.bookingMode==="paid"&&!i.providers.length){await w(this,Bt,Mr).call(this,e,t.descriptor,{kind:"unavailable",reason:i.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}x(this,ai,!0);try{let{total:r,currency:s,lines:a}=w(this,Bt,Rh).call(this,t.holdId,t.descriptor);await w(this,Bt,Mr).call(this,e,t.descriptor,{kind:"pay",provider:null,free:i.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:s,total:r,labels:[...t.seatLabels],lines:a}})}finally{x(this,ai,!1)}}resume(e,t,i){let o=ni(t);o?.outcome!=="success"||!o.orderId||w(this,Bt,Mr).call(this,e,i,{kind:"resume",orderId:o.orderId})}destroy(){x(this,$i,!0),h(this,Ft)?.destroy(),x(this,Ft,null)}};si=new WeakMap,fn=new WeakMap,Ft=new WeakMap,ai=new WeakMap,$i=new WeakMap,Bt=new WeakSet,Rh=function(e,t){let i=this.options.api.allocationsForHold(e),o=i.flatMap(a=>a.items)[0]?.currency??t.currency,r=0,s=i.map(a=>{let l=a.items.reduce((d,p)=>d+Math.round(p.unitPrice*100)*(p.quantity??1),0);r+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Qn(c,this.options.locale):null,amount:l/100}});return{total:r/100,currency:o,lines:s}},Mr=async function(e,t,i){let o;try{({mountCheckout:o}=await _n())}catch(s){this.options.onError?.(s),this.options.announce((0,ri.t)("picker.group.checkoutCouldNotOpen"));return}if(h(this,$i)||!e)return;h(this,Ft)?.destroy();let r=this.options.api;x(this,Ft,o({root:e,state:i,eventKey:r.groupKey,event:{name:t.name,detail:(0,ri.t)("picker.group.checkoutDates").replace("{count}",String(t.performanceCount))},formatMoney:(s,a)=>(0,ri.formatMoney)(s,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(s)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async s=>{let a=await r.checkout({operationId:s.holdId,buyerEmail:s.buyerEmail,...s.buyerName?{buyerName:s.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:s=>r.orderStatus(s),onCancel:()=>{x(this,Ft,null)},onConfirmed:s=>this.options.onConfirmed?.(s),onError:s=>this.options.onError?.(s)}))};var Db={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},Fb=3e4;function Bb(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var Ws=class extends Error{constructor(t,i){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="PerformanceGroupPublicSessionRefused"}},Et,Vt,zi,li,Ys=class{constructor(e){this.options=e;M(this,Et,null);M(this,Vt,null);M(this,zi);M(this,li);x(this,zi,e.fetch??globalThis.fetch.bind(globalThis)),x(this,li,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,Et)}async mint(e=!1){if(e&&x(this,Et,null),h(this,Et)&&h(this,Et).expiresAt-Fb>Date.now())return h(this,Et);if(h(this,Vt))return h(this,Vt);let t=(async()=>{let i=await h(this,zi).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(h(this,li)?{origin:h(this,li)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error,s=i.status===403&&r?Db[r]:void 0;throw s?(this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new Ws(s,i.status)):new Error(`performance_group_public_session_failed_${i.status}`)}if(!Bb(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return x(this,Et,o),o})();x(this,Vt,t);try{return await t}finally{h(this,Vt)===t&&x(this,Vt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};Et=new WeakMap,Vt=new WeakMap,zi=new WeakMap,li=new WeakMap;function Ih(n){let e=new Ys(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Oh="https://api.seatlayer.io";function _h(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Hr=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=i=>{this.refusal=this.refusal&&i.reason==="provider_failed"?this.refusal:i,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new De({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):Ih({base:(e.apiBase??Oh).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:i=>{this.refusal=i},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new Pr(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:i=>this.operationChanged(i),onRecoveryState:i=>this.recoveryChanged(i),onAvailability:i=>this.availabilityChanged(i),onSessionEnded:i=>this.sessionEnded(i)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),e.initialDescriptor&&this.api.seedDescriptor(e.initialDescriptor),this.hosted=e.checkout==="hosted"?new Lr({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:i=>this.showStatus("checkout",i),onConfirmed:i=>e.onOrderConfirmed?.(i),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Hh(),await(0,$t.loadLocale)(this.options.locale),this.options.messages&&(0,$t.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw rt({apiBase:this.options.apiBase??Oh,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:ht(this.options.performanceGroup),transport:"pubapi"}),i instanceof we&&this.refusal?new we(this.refusal):i}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(_h(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let s=document.createElement("h2");s.id=`sl-pg-title-${t.key}`,s.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=Rs(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let m=document.createElement("div");m.className="sl-pg-held-summary",m.hidden=!0,s.hidden=a.hidden=c.hidden=this.options.header===!1,r.append(s,a,l,c,m);let u=document.createElement("div");u.className="sl-pg-legend";let f=document.createElement("div");f.className="sl-pg-pane",f.setAttribute("role","group"),f.setAttribute("aria-label",this.copy("picker.group.yourSelection")),f.hidden=!0;let b=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let C=document.createElement("div");C.className="sl-pg-status",C.setAttribute("role","status"),C.setAttribute("aria-live","polite"),C.hidden=!0;let k=document.createElement("p"),E=document.createElement("button");E.type="button",E.hidden=!0,E.textContent=this.copy("picker.group.retry"),E.addEventListener("click",()=>{this.retryRecovery()}),C.append(k,E),T.appendChild(C);let L=document.createElement("div");L.className="sl-pg-live",L.setAttribute("role","status"),L.setAttribute("aria-live","polite"),i.append(o,r),b&&i.append(b),i.append(u,T,f,L),e.appendChild(i),this.root=i,this.progressHost=o,this.legendHost=u,this.paneHost=f,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=m,this.live=L,this.statusHost=C,this.statusCopy=k,this.statusAction=E,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Tt(kr({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,enable3DCrowd:this.options.enable3DCrowd,touchNavigation3D:this.options.touchNavigation3D,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,o)=>{try{this.options.onAnalytics?.(i,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,o)=>this.holdChanged(i,o),onCheckout:(i,o)=>this.checkout(i,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?xd(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,o)=>{this.selectPartialSeat(i,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(o=>o.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,o)=>this.applySeatDates(i,o,!0)}:null,checkoutReady:i=>!this.booked&&this.activeHandoff?.holdId===i}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:hr(t,this.options.locale),time:ur(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Qn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!i?t?.partial??{}:{},r={};for(let s of this.markedLabels)r[s]=null;if(this.markedLabels.clear(),e>0)for(let[s,a]of Object.entries(o))!a.length||a.length>=e||(r[s]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(s));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Qn(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Qn(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),i=t.filter(r=>r>0),o=i.length===t.length&&i.every(r=>r===i[0]);return{seats:t.reduce((r,s)=>r+s,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:o&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Hd(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=Sd({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(r=>r.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Rd({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${hr(r,this.options.locale)} ${ur(r,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Id(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let r=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),s=o[0]?.currency??t.currency;try{return(0,$t.formatMoney)(r,s,void 0,this.options.locale)}catch{return`${s} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Rs(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(r=>t.includes(r)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(r){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(_h(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof Te)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(o,r)=>String(t[r]??`{${r}}`)):i:(0,$t.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((s,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${s.eventKey}`,l.dataset.eventKey=s.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=s.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(s.eventKey)}),l.addEventListener("keydown",m=>this.tabKeydown(m)),r.appendChild(l)}),t.append(i,r,o),this.tabsHost=r,this.prevButton=i,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=i+(o?-1:1);break;case"ArrowLeft":r=i+(o?1:-1);break;case"ArrowDown":r=i+1;break;case"ArrowUp":r=i-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let s=t[r];s.focus({preventScroll:!0}),s.disabled||this.switchPerformance(s.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),o=t[i+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,i=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(r=>r.label),o=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:o}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let r=o.dataset.eventKey,s=this.tabState(r),a=r===this.activePerformanceKey;o.dataset.state=s.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=s.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=s.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??r;o.setAttribute("aria-label",`${d}: ${s.badge} \xB7 ${s.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let i=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let o=this.descriptorValue?.performances.find(r=>r.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){if(this.activeHandoff){this.holdLost();return}this.recovery.kind==="idle"&&this.clearStatus()}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof Te)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof Te)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof Te)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!i||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:r.map(s=>s.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(s=>s.label),...this.mode==="per_performance"?{allocations:r.map(s=>({eventKey:s.eventKey,seatLabels:s.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let i=this.descriptorValue?.performances.find(s=>s.eventKey===t.eventKey),o=document.createElement("p"),r=document.createElement("strong");r.textContent=i?.name??t.eventKey,o.append(r,document.createTextNode(t.items.map(s=>s.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let i=this.handoff(e,t),o=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...i,descriptor:this.descriptorValue})}};var fe=require("@seatlayer/core");var Nh="seatlayer-season-picker-style";function Dh(){if(document.getElementById(Nh))return;let n=document.createElement("style");n.id=Nh,n.textContent=`
3600
+ `,document.head.appendChild(n)}var zb="https://api.seatlayer.io",jb=6e4,Kb=2e3,Gb=1e3,Ub=36e5,qb=5e3,Wb=5e3,Yb=15e3,Xb=12e4,Qb=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),Te=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Zb(n){return new Promise(e=>setTimeout(e,n))}function Ys(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(qb,e*1e3)):1e3}function oi(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function ri(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Xs=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof Te){this.stop();return}if(Fo(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Hr=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};this.seededDescriptor=null;if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??zb).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??jb,this.realtimePollMs=Math.max(500,t.realtimePollMs??Kb),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}seedDescriptor(e){e.key===this.groupKey&&Array.isArray(e.performances)&&(this.seededDescriptor=e)}async descriptor(){let e=this.seededDescriptor;this.seededDescriptor=null;let t=e?{performanceGroup:e}:await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=t.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(t.performanceGroup.performances.map(i=>i.eventKey))),t.performanceGroup.revision&&(this.knownRevision=t.performanceGroup.revision),this.activePerformanceKey??=t.performanceGroup.performances[0]?.eventKey??null,t.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new re(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let s=await this.authorized(i,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(s.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!s.ok)return this.throwResponse(s);this.objectsCache=await this.responseJson(s),this.objectsEtag=s.headers.get("ETag")}}if(!this.objectsCache)throw new re(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let s=this.objectsCache;return this.noteAvailability(s,s.salesClosed,s),s}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let s=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!s.length)throw new re(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(s[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,s.every(m=>m.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let m=s.filter(u=>u.seats[p]!=="free").map(u=>u.eventKey);return m.length>0&&m.length<s.length?[[p,m]]:[]})),d={seats:l,partial:c,hidden:[...new Set(s.flatMap(p=>p.hidden??[]))],closed:[...new Set(s.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:s.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let r=o.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!r)throw new re(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(s=>s.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new re(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new re(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new re(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,o){if(this.assertUsable(),o)throw new re(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),s={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(s.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new re(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new re(409,"group_selection_incomplete","group_selection_incomplete");s={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...s,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof Te)throw c;if(c instanceof we)throw this.failOperation(a),c;return this.recover(a,r,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,r,Date.now()+this.recoveryTimeoutMs,Ys(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,r,Date.now()+this.recoveryTimeoutMs,Ys(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let o=this.operationForHold(i),r=await this.json(`${oi(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),o=await this.json(oi(this.groupKey,i));return this.complete(o.operation)}async extend(e,t,i=12e4){this.assertUsable();let o=this.operationForHold(t),r=Math.max(Gb,Math.min(Ub,Math.round(i))),s=await this.json(`${oi(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(s.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new re(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Xs(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:ri(e.operationId)});let t;try{t=await this.authorized(oi(this.groupKey,e.operationId))}catch(r){return r instanceof Te||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let o=i.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Xb?Yb:Wb;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(oi(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Te?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Qb.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new re(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?ri(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,o=100){let r=o,s=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new Te;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=s,reference:ri(e)}),await Zb(r),this.destroyed)throw new Te;let l;try{l=await this.authorized(oi(this.groupKey,e))}catch(p){if(p instanceof Te)throw p;if(p instanceof we)throw this.recoveryFailed(e,"request_failed"),p;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new re(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));r=Ys(l)}throw this.recoveryFailed(e,"deadline"),new re(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:ri(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",r=e.revision??null,s=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:r,revisionChanged:s})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new re(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new re(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let r=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new Te;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");o.Authorization=r;let s=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(s.status===401||s.status===403||s.status===422)){let a=await s.clone().json().catch(()=>null);if(await this.access.handleFailure(s.status,a?.code??a?.error,r))return this.authorized(e,t,!0)}return s}async json(e,t={}){let i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},r=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(s=>({label:s,status:"held"}))),new re(e.status,o.error??r,r,o.conflicts)}};var si=require("@seatlayer/core");var ai,fn,Ft,li,zi,Bt,Vh,Rr,Ir=class{constructor(e){this.options=e;M(this,Bt);M(this,ai,null);M(this,fn,!1);M(this,Ft,null);M(this,li,!1);M(this,zi,!1)}get mode(){return h(this,fn)?"hosted":"handoff"}async prepare(){try{x(this,ai,await this.options.api.paymentOptions()),x(this,fn,!!h(this,ai))}catch(e){x(this,fn,!1),this.options.onError?.(e)}}async open(e,t){if(!h(this,fn)||h(this,li))return;if(t.selectionMode!=="same_seat"){this.options.announce((0,si.t)("picker.group.hostedPerPerformance"));return}let i=h(this,ai),o=t.seatLabels.length;if(i.bookingMode==="paid"&&!i.providers.length){await w(this,Bt,Rr).call(this,e,t.descriptor,{kind:"unavailable",reason:i.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}x(this,li,!0);try{let{total:r,currency:s,lines:a}=w(this,Bt,Vh).call(this,t.holdId,t.descriptor);await w(this,Bt,Rr).call(this,e,t.descriptor,{kind:"pay",provider:null,free:i.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:s,total:r,labels:[...t.seatLabels],lines:a}})}finally{x(this,li,!1)}}resume(e,t,i){let o=ii(t);o?.outcome!=="success"||!o.orderId||w(this,Bt,Rr).call(this,e,i,{kind:"resume",orderId:o.orderId})}destroy(){x(this,zi,!0),h(this,Ft)?.destroy(),x(this,Ft,null)}};ai=new WeakMap,fn=new WeakMap,Ft=new WeakMap,li=new WeakMap,zi=new WeakMap,Bt=new WeakSet,Vh=function(e,t){let i=this.options.api.allocationsForHold(e),o=i.flatMap(a=>a.items)[0]?.currency??t.currency,r=0,s=i.map(a=>{let l=a.items.reduce((d,p)=>d+Math.round(p.unitPrice*100)*(p.quantity??1),0);r+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Zn(c,this.options.locale):null,amount:l/100}});return{total:r/100,currency:o,lines:s}},Rr=async function(e,t,i){let o;try{({mountCheckout:o}=await Nn())}catch(s){this.options.onError?.(s),this.options.announce((0,si.t)("picker.group.checkoutCouldNotOpen"));return}if(h(this,zi)||!e)return;h(this,Ft)?.destroy();let r=this.options.api;x(this,Ft,o({root:e,state:i,eventKey:r.groupKey,event:{name:t.name,detail:(0,si.t)("picker.group.checkoutDates").replace("{count}",String(t.performanceCount))},formatMoney:(s,a)=>(0,si.formatMoney)(s,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(s)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async s=>{let a=await r.checkout({operationId:s.holdId,buyerEmail:s.buyerEmail,...s.buyerName?{buyerName:s.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:s=>r.orderStatus(s),onCancel:()=>{x(this,Ft,null)},onConfirmed:s=>this.options.onConfirmed?.(s),onError:s=>this.options.onError?.(s)}))};var Jb={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},ey=3e4;function ty(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var Qs=class extends Error{constructor(t,i){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="PerformanceGroupPublicSessionRefused"}},Et,Vt,ji,ci,Zs=class{constructor(e){this.options=e;M(this,Et,null);M(this,Vt,null);M(this,ji);M(this,ci);x(this,ji,e.fetch??globalThis.fetch.bind(globalThis)),x(this,ci,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,Et)}async mint(e=!1){if(e&&x(this,Et,null),h(this,Et)&&h(this,Et).expiresAt-ey>Date.now())return h(this,Et);if(h(this,Vt))return h(this,Vt);let t=(async()=>{let i=await h(this,ji).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(h(this,ci)?{origin:h(this,ci)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error,s=i.status===403&&r?Jb[r]:void 0;throw s?(this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new Qs(s,i.status)):new Error(`performance_group_public_session_failed_${i.status}`)}if(!ty(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return x(this,Et,o),o})();x(this,Vt,t);try{return await t}finally{h(this,Vt)===t&&x(this,Vt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};Et=new WeakMap,Vt=new WeakMap,ji=new WeakMap,ci=new WeakMap;function $h(n){let e=new Zs(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var zh="https://api.seatlayer.io";function jh(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Or=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=i=>{this.refusal=this.refusal&&i.reason==="provider_failed"?this.refusal:i,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new De({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):$h({base:(e.apiBase??zh).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:i=>{this.refusal=i},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new Hr(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:i=>this.operationChanged(i),onRecoveryState:i=>this.recoveryChanged(i),onAvailability:i=>this.availabilityChanged(i),onSessionEnded:i=>this.sessionEnded(i)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),e.initialDescriptor&&this.api.seedDescriptor(e.initialDescriptor),this.hosted=e.checkout==="hosted"?new Ir({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:i=>this.showStatus("checkout",i),onConfirmed:i=>e.onOrderConfirmed?.(i),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Bh(),await(0,$t.loadLocale)(this.options.locale),this.options.messages&&(0,$t.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw rt({apiBase:this.options.apiBase??zh,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:ut(this.options.performanceGroup),transport:"pubapi"}),i instanceof we&&this.refusal?new we(this.refusal):i}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(jh(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let s=document.createElement("h2");s.id=`sl-pg-title-${t.key}`,s.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let p=document.createElement("div");p.innerHTML=_s(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let m=document.createElement("div");m.className="sl-pg-held-summary",m.hidden=!0,s.hidden=a.hidden=c.hidden=this.options.header===!1,r.append(s,a,l,c,m);let u=document.createElement("div");u.className="sl-pg-legend";let f=document.createElement("div");f.className="sl-pg-pane",f.setAttribute("role","group"),f.setAttribute("aria-label",this.copy("picker.group.yourSelection")),f.hidden=!0;let b=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let C=document.createElement("div");C.className="sl-pg-status",C.setAttribute("role","status"),C.setAttribute("aria-live","polite"),C.hidden=!0;let k=document.createElement("p"),E=document.createElement("button");E.type="button",E.hidden=!0,E.textContent=this.copy("picker.group.retry"),E.addEventListener("click",()=>{this.retryRecovery()}),C.append(k,E),T.appendChild(C);let L=document.createElement("div");L.className="sl-pg-live",L.setAttribute("role","status"),L.setAttribute("aria-live","polite"),i.append(o,r),b&&i.append(b),i.append(u,T,f,L),e.appendChild(i),this.root=i,this.progressHost=o,this.legendHost=u,this.paneHost=f,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=m,this.live=L,this.statusHost=C,this.statusCopy=k,this.statusAction=E,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Tt(Er({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,enable3DCrowd:this.options.enable3DCrowd,touchNavigation3D:this.options.touchNavigation3D,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,o)=>{try{this.options.onAnalytics?.(i,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,o)=>this.holdChanged(i,o),onCheckout:(i,o)=>this.checkout(i,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?Pd(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,o)=>{this.selectPartialSeat(i,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(o=>o.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,o)=>this.applySeatDates(i,o,!0)}:null,checkoutReady:i=>!this.booked&&this.activeHandoff?.holdId===i}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:fr(t,this.options.locale),time:gr(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Zn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!i?t?.partial??{}:{},r={};for(let s of this.markedLabels)r[s]=null;if(this.markedLabels.clear(),e>0)for(let[s,a]of Object.entries(o))!a.length||a.length>=e||(r[s]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(s));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Zn(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Zn(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),i=t.filter(r=>r>0),o=i.length===t.length&&i.every(r=>r===i[0]);return{seats:t.reduce((r,s)=>r+s,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:o&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Fd(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=Ld({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(r=>r.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Bd({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${fr(r,this.options.locale)} ${gr(r,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Vd(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let r=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),s=o[0]?.currency??t.currency;try{return(0,$t.formatMoney)(r,s,void 0,this.options.locale)}catch{return`${s} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=_s(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(r=>t.includes(r)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(r){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(jh(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof Te)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(o,r)=>String(t[r]??`{${r}}`)):i:(0,$t.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((s,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${s.eventKey}`,l.dataset.eventKey=s.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=s.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(s.eventKey)}),l.addEventListener("keydown",m=>this.tabKeydown(m)),r.appendChild(l)}),t.append(i,r,o),this.tabsHost=r,this.prevButton=i,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=i+(o?-1:1);break;case"ArrowLeft":r=i+(o?1:-1);break;case"ArrowDown":r=i+1;break;case"ArrowUp":r=i-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let s=t[r];s.focus({preventScroll:!0}),s.disabled||this.switchPerformance(s.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),o=t[i+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,i=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(r=>r.label),o=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:o}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let r=o.dataset.eventKey,s=this.tabState(r),a=r===this.activePerformanceKey;o.dataset.state=s.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=s.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=s.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??r;o.setAttribute("aria-label",`${d}: ${s.badge} \xB7 ${s.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let i=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let o=this.descriptorValue?.performances.find(r=>r.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){if(this.activeHandoff){this.holdLost();return}this.recovery.kind==="idle"&&this.clearStatus()}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof Te)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof Te)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof Te)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!i||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:r.map(s=>s.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(s=>s.label),...this.mode==="per_performance"?{allocations:r.map(s=>({eventKey:s.eventKey,seatLabels:s.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let i=this.descriptorValue?.performances.find(s=>s.eventKey===t.eventKey),o=document.createElement("p"),r=document.createElement("strong");r.textContent=i?.name??t.eventKey,o.append(r,document.createTextNode(t.items.map(s=>s.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let i=this.handoff(e,t),o=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...i,descriptor:this.descriptorValue})}};var fe=require("@seatlayer/core");var Kh="seatlayer-season-picker-style";function Gh(){if(document.getElementById(Kh))return;let n=document.createElement("style");n.id=Kh,n.textContent=`
3601
3601
  .sl-season-root{box-sizing:border-box;margin:0;display:flex;flex-direction:column;height:100%;min-width:0;min-height:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3602
3602
  .sl-season-root *{box-sizing:border-box}
3603
3603
  .sl-season-map{position:relative;flex:1 1 auto;min-width:0;min-height:0}
@@ -3693,4 +3693,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3693
3693
  .sl-season-leave button{min-height:40px;padding:0 16px;border:1px solid var(--sl-line,#dde3ea);border-radius:10px;background:var(--sl-surface,#fff);color:var(--sl-text,#18202b);font:inherit;font-size:14px;font-weight:650;cursor:pointer}
3694
3694
  .sl-season-leave button[data-leave=keep]{border-color:var(--sl-accent,#7357d8);background:var(--sl-accent,#7357d8);color:var(--sl-accent-ink,#fff)}
3695
3695
  .sl-season-leave button:focus-visible{outline:2px solid var(--sl-accent,#7357d8);outline-offset:2px}
3696
- `,document.head.appendChild(n)}var pi=require("@seatlayer/core");var q=class extends Error{constructor(t,i,o){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason),o?.refusals?.length&&(this.refusals=o.refusals),o?.buyerMessage&&(this.buyerMessage=o.buyerMessage)}},ci=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}},di=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}};Wr();var Vb="https://api.seatlayer.io",$b=6e4,zb=5e3,jb=new Set(["seat_unavailable","seat_held_for_renewal"]);function Vh(n){return typeof n=="string"&&jb.has(n)?n:void 0}function Qs(n){return Array.isArray(n)?n.flatMap(e=>{let t=e??{},i=typeof t.eventKey=="string"?t.eventKey:t.eventId,o=Vh(t.code);return typeof i=="string"&&o?[{eventKey:i,code:o}]:[]}):[]}function Kb(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(zb,i*1e3))}function Gb(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let o=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(o),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Fh(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function Ub(n,e){let t=e&&typeof e=="object"?e:{},i=Qs(t.handoff?.allocations??t.operation?.allocations),o=(n.headers.get("Retry-After")??"").trim(),r=o?Number(o):Number.NaN;return{...Number.isFinite(r)&&r>=0?{retryAfterS:Math.ceil(r)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{},...i.length?{refusals:i}:{}}}var qb=/^shc_[a-f0-9]{40}$/,Wb=/^shh_[a-f0-9]{40}$/,Yb=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),Xb=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Xs(n){return Array.isArray(n)?n.some(Xs):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&qb.test(t)||Xs(t))}function ji(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new q(t,502);if(Xs(n))throw new q("unsafe_operation_response",502);let i=n,o=i.allocations,r=new Set,s=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let m=p.eventId,u=p.state;return typeof m!="string"||!m||typeof u!="string"||!Xb.has(u)||r.has(m)?!1:(r.add(m),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&s&&o.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&s&&o.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!Wb.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!Yb.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!s||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new q(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:o.map(p=>{let m=Vh(p.code);return{eventId:p.eventId,state:p.state,...m?{code:m}:{}}})}}function Qb(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(s=>typeof s!="string"||!s)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new q("invalid_best_available_response",502);let i=n,o=new Set(i),r=new Map;for(let s of e){if(!s||typeof s!="object")throw new q("invalid_best_available_response",502);let a=s;if(typeof a.label!="string"||!o.has(a.label)||r.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new q("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(s=>r.get(s))}}function Bh(n){return typeof n=="number"&&Number.isFinite(n)?n:null}async function $h(n,e,t=globalThis.fetch.bind(globalThis)){try{let i=await t(`${n.replace(/\/$/,"")}/pub/seasons/${encodeURIComponent(e)}/prices`,{method:"GET",credentials:"omit"});return i.ok?zh(await i.json()):null}catch{return null}}function zh(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let i of e.packages){if(!i||typeof i!="object")continue;let o=i;if(typeof o.planKey!="string"||!o.planKey||typeof o.planActivationId!="string"||!o.planActivationId||!Array.isArray(o.prices))continue;let r=[],s=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;if(typeof l.categoryKey!="string"||!l.categoryKey)continue;let c=typeof l.priceTypeKey=="string"?l.priceTypeKey:"",d=`${l.categoryKey}\0${c||"adult"}`;s.has(d)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(s.add(d),r.push({categoryKey:l.categoryKey,...c?{priceTypeKey:c,priceTypeLabel:typeof l.priceTypeLabel=="string"?l.priceTypeLabel:c}:{},unitPrice:l.unitPrice}))}r.length&&t.push({planKey:o.planKey,planActivationId:o.planActivationId,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:r,...Number.isInteger(o.datesToCome)&&o.datesToCome>=0?{datesToCome:o.datesToCome,firstDateAt:Bh(o.firstDateAt),lastDateAt:Bh(o.lastDateAt)}:{}})}return t.length?{currency:e.currency,packages:t}:null}function Zb(n){if(!n||typeof n!="object"||Array.isArray(n))throw new q("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=so(e.redirectUrl);if(t&&!i)throw new q("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!i)throw new q("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:i}}function jh(n,e,t){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:i,state:o,code:r})=>({eventKey:i,state:o,...r?{code:r}:{}})),...t?{seats:t}:{}}}var tt,gn,lt,bn,Ki,ct,dt,Be,Qe,Kh,Rr=class{constructor(e,t){M(this,Be);M(this,tt);M(this,gn);M(this,lt);M(this,bn);M(this,Ki);M(this,ct,!1);M(this,dt,null);x(this,tt,e),x(this,gn,(t.apiBase??Vb).replace(/\/$/,"")),x(this,lt,t.access),x(this,bn,t.fetch??globalThis.fetch.bind(globalThis)),x(this,Ki,t.recoveryTimeoutMs??$b),h(this,lt).onRenewed(i=>w(this,Be,Kh).call(this,i))}async descriptor(){let{body:e}=await w(this,Be,Qe).call(this,"GET","");return e.season}async chart(){let{body:e}=await w(this,Be,Qe).call(this,"GET","/chart");return e}async availability(){let{body:e}=await w(this,Be,Qe).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t,i){let o=e.map(a=>{let l=i?.get(a);return l&&l!=="adult"?{label:a,priceTypeKey:l}:{label:a}}),{body:r,response:s}=await w(this,Be,Qe).call(this,"POST","/holds",{operationId:t,labels:[...e],...o.some(a=>"priceTypeKey"in a)?{selections:o}:{}});return{operation:ji(r.operation,{seasonId:h(this,tt),operationId:t}),response:s}}async bestAvailable(e){let{body:t,response:i}=await w(this,Be,Qe).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=ji(t.operation,{seasonId:h(this,tt),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:s}=Qb(t.labels,t.items,e.qty);return{operation:o,labels:r,items:s,response:i}}async operation(e){let{body:t,response:i}=await w(this,Be,Qe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:ji(t.operation,{seasonId:h(this,tt),operationId:e}),response:i}}async release(e,t){let{body:i,response:o}=await w(this,Be,Qe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:ji(i.operation,{seasonId:h(this,tt),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await w(this,Be,Qe).call(this,"GET","/prices"))}catch(t){if(t instanceof q&&t.status===404)return null;throw t}return zh(e)}async checkout(e){let{body:t}=await w(this,Be,Qe).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return Zb(t)}async orderStatus(e){let t=await h(this,bn).call(this,`${h(this,gn)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new q(Fh(i),t.status);if(i===null)throw new q("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await w(this,Be,Qe).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new q("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let o=Date.now(),r=t?{operation:ji(t.operation,{seasonId:h(this,tt),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-o>=h(this,Ki))throw new ci(e);await Gb(Kb(r.response,r.operation),i),r=await this.operation(e)}return r.operation}destroy(){h(this,ct)||(x(this,ct,!0),h(this,lt).onRenewed(void 0),h(this,lt).clear())}};tt=new WeakMap,gn=new WeakMap,lt=new WeakMap,bn=new WeakMap,Ki=new WeakMap,ct=new WeakMap,dt=new WeakMap,Be=new WeakSet,Qe=async function(e,t,i,o=!0){if(h(this,ct))throw new q("season_api_destroyed",409);if(h(this,dt))throw h(this,dt);let r=await h(this,lt).authorization();if(h(this,ct))throw new q("season_api_destroyed",409);if(h(this,dt))throw h(this,dt);if(!r)throw new we({reason:"no_token",retryable:!1});let s=await h(this,bn).call(this,`${h(this,gn)}/pub/seasons/${encodeURIComponent(h(this,tt))}${t}`,{method:e,headers:{Authorization:r,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await s.json().catch(()=>null);if(!s.ok){let l=Fh(a);if(o&&await h(this,lt).handleFailure(s.status,l,r))return w(this,Be,Qe).call(this,e,t,i,!1);let c=h(this,lt).unavailable;throw c?new we(c):new q(l,s.status,Ub(s,a))}if(a===null)throw new q("invalid_json_response",502);return{body:a,response:s}},Kh=async function(e){if(h(this,ct))return;let t=`/pub/seasons/${encodeURIComponent(h(this,tt))}/session/adopt`;for(let i=0;i<2;i++){if(h(this,ct))return;try{if((await h(this,bn).call(this,`${h(this,gn)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){x(this,dt,null);return}}catch{}}if(!h(this,ct))throw x(this,dt,new q("season_session_adopt_failed",409)),h(this,dt)};function Ir(n){if(!(n instanceof q))return(0,pi.t)("season.selectionFailed");let e=new Set((n.refusals??[]).map(t=>t.code));return n.code==="season_sales_not_open"?(0,pi.t)("season.accessSalesNotOpen"):e.has("seat_held_for_renewal")?(0,pi.t)("season.seatHeldForRenewal"):e.has("seat_unavailable")||n.code==="seats_unavailable"?(0,pi.t)("season.seatUnavailable"):n.code==="unknown"?(0,pi.t)("season.selectionFailed"):`Season selection unavailable (${n.code}).`}function _r(n){let e=n.edition?.trim();return e&&!n.name.includes(e)?`${n.name} ${e}`:n.name}function Gh(n){return n.state==="committed"||n.state==="booked"}function Uh(n){return new q(`season_operation_${n.state}`,409,{refusals:Qs(n.allocations)})}var Zs=class{constructor(e,t,i,o){this.transport=e;this.sink=t;this.intervalMs=i;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={};this.priorPartial={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=this.transport.latestAvailability?.partial??{},i=r=>(t[r]??[]).join("|"),o=Object.entries(e.seats).filter(([r,s])=>this.prior[r]!==s||this.priorPartial[r]!==i(r)).map(([r,s])=>({label:r,status:s}));this.prior={...e.seats},this.priorPartial=Object.fromEntries(Object.keys(e.seats).map(r=>[r,i(r)])),o.length&&this.sink.applyStatuses(o)}catch(e){if(_o(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Or=class{constructor(e,t,i,o=!1){this.api=e;this.realtimePollMs=t;this.onSessionEnded=i;this.typed=o;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map;this.seatsByHold=new Map;this.typeRefusal=null;this.types=new Map;this.chartPrefetch=null;this.resumable=null}get latestAvailability(){return this.availabilityValue}typesInPlay(e){return this.typed||e.some(t=>this.types.has(t))}recordSeats(e,t){this.seatsByHold.set(e,t.map(i=>({label:i,priceTypeKey:this.types.get(i)||"adult"})))}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}takeChartPrefetch(){let e=this.chartPrefetch;return this.chartPrefetch=null,e}primeChart(e){e.catch(()=>{}),this.chartPrefetch=e}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new q("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}prepareResume(e){this.resumable=e}async resume(e,t){let i=this.resumable;if(this.resumable=null,!i||i.holdId!==t)throw new q("season_hold_not_found",404);let o=await this.api.waitForTerminal(i.operationId);if(o.state!=="committed"||o.holdId!==t)throw new q("season_hold_not_found",404);if(i.typedSeats)for(let r of i.seats)this.types.set(r.label,r.priceTypeKey);return this.remember(o),this.recordSeats(t,i.seats.map(r=>r.label)),{holdId:t,expiresAt:o.expiresAt,items:i.seats.map(r=>({label:r.label,objectId:r.label,objectType:"seat",categoryKey:"",tierId:null,unitPrice:0,currency:this.descriptorValue?.currency??"USD"}))}}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.takeChartPrefetch()??this.api.chart()]);return this.descriptorValue=t,{doc:i,event:{key:t.key,name:_r(t),venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,o){if(o)throw new q("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let s=t.map(c=>c.label),a=await this.api.hold(s,r,this.types).catch(c=>{throw c instanceof q&&c.code==="price_type_not_offered"?this.typeRefusal=new q(c.code,c.status,{reason:"ticket_option_not_applicable"}):qh(c)}),l=await this.api.waitForTerminal(r,a);if(!Gh(l))throw Uh(l);return this.remember(l),this.recordSeats(l.holdId,s),{holdId:l.holdId,expiresAt:l.expiresAt,items:t.map(c=>({label:c.label,objectId:c.label,objectType:"seat",categoryKey:"",tierId:c.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...c.quantity==null?{}:{quantity:c.quantity}}))}}async release(e,t,i){let o=this.operationForHold(i);if(!o)throw new q("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let s=await this.api.release(o.operationId,r),a=await this.api.waitForTerminal(o.operationId,s);if(a.state==="partial_terminal")throw this.remember(a),new q("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,o){let r=this.nextBestAvailable;this.nextBestAvailable=null;let s=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:s,qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}).catch(d=>{throw qh(d)}),l=await this.api.waitForTerminal(s,a);if(!Gh(l))throw Uh(l);this.remember(l);for(let d of a.labels)this.types.delete(d);this.recordSeats(l.holdId,a.labels);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new Zs(this,t,this.realtimePollMs,this.onSessionEnded)}};function qh(n){return!(n instanceof q)||n.code!=="season_sales_not_open"?n:new q(n.code,n.status,{reason:"event_closed",buyerMessage:Ir(n)})}var te=require("@seatlayer/core"),Jb=["adult","child","concession","senior","student"];function j(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Gi(n){return n===1?(0,te.t)("season.oneDate"):(0,te.t)("season.dateCount").replace("{count}",String(n))}function Js(n){return n===1?(0,te.t)("season.priceForOneDate"):(0,te.t)("season.priceForAllDates").replace("{count}",String(n))}function Ct(n){return n.occurrences.length?n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0).length:n.occurrenceCount}function hi(n,e,t,i){try{return new Intl.DateTimeFormat(t,{...i,...e?{timeZone:e}:{}}).format(n)}catch{return new Intl.DateTimeFormat(t,i).format(n)}}function Wh(n,e,t,i,o){let r={day:"numeric",month:"short",...o?{year:"numeric"}:{}},s=hi(n,t,i,r),a=hi(e,t,i,r);return s===a?s:(0,te.t)("season.dateRange").replace("{from}",s).replace("{to}",a)}function ea(n){let e=n.filter(i=>(i.priceTypeKey??"adult")==="adult"),t=e.length?e:n;return t.length?Math.min(...t.map(i=>i.unitPrice)):null}function Yh(n){return n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0)}function ey(n,e,t){let i=j("div","sl-step-card");t&&(i.dataset.chosen="true"),i.append(j("b","sl-step-card-name",e.name));let o=t?Yh(n.descriptor):null,r=o?o.length:e.datesToCome;if(r!==void 0){let l=o?o.find(p=>p.startsAt!=null)?.startsAt??null:e.firstDateAt??null,c=o?[...o].reverse().find(p=>p.startsAt!=null)?.startsAt??null:e.lastDateAt??null,d=l!=null&&c!=null?Wh(l,c,n.descriptor.timezone,n.locale,!1):"";i.append(j("span","sl-step-card-dates",[Gi(r),d].filter(Boolean).join(" \xB7 ")))}let s=ea(e.prices);if(s!=null){let l=j("span","sl-step-card-price");l.append(j("b",void 0,(0,te.t)("season.fromPrice").replace("{price}",n.money(s))),j("span",void 0,(0,te.t)("season.perSeat"))),i.append(l)}let a=j("button","sl-step-card-choose",t?(0,te.t)("season.chosen"):(0,te.t)("season.choose"));return a.type="button",a.disabled=t||n.loading,a.setAttribute("aria-pressed",String(t)),t||a.addEventListener("click",()=>n.choose(e.planActivationId)),i.append(a),i}function ty(n,e,t){let i=j("div","sl-step-prices"),o=j("div","sl-step-prices-head");o.append(j("b",void 0,(0,te.t)("season.packagePrices").replace("{name}",e.name)),j("span",void 0,`${(0,te.t)("season.perSeat")}, ${Js(t)}`));let r=Jb.filter(d=>e.prices.some(p=>(p.priceTypeKey??"adult")===d)),s=d=>e.prices.find(p=>(p.priceTypeKey??"adult")===d)?.priceTypeLabel??(d==="adult"?(0,te.t)("season.adult"):d),a=[...n.areas.keys()].filter(d=>e.prices.some(p=>p.categoryKey===d));for(let d of e.prices)a.includes(d.categoryKey)||a.push(d.categoryKey);let l=j("table"),c=j("tr");c.append(j("th",void 0,(0,te.t)("season.area")),...r.map(d=>j("th",void 0,s(d)))),l.append(c);for(let d of a){let p=j("tr");p.append(j("th",void 0,n.areas.get(d)??d));for(let m of r){let u=e.prices.find(f=>f.categoryKey===d&&(f.priceTypeKey??"adult")===m);p.append(j("td",void 0,u?n.money(u.unitPrice):"\u2014"))}l.append(p)}return i.append(o,l),i}function ny(n,e){let t=j("li","sl-step-date");e.cancelled?t.dataset.state="cancelled":e.past&&(t.dataset.state="past");let i=n.descriptor.timezone,o=j("span","sl-step-day");e.startsAt!=null&&o.append(j("small",void 0,hi(e.startsAt,i,n.locale,{month:"short"}).toUpperCase()),j("b",void 0,hi(e.startsAt,i,n.locale,{day:"numeric"})));let r=j("span","sl-step-date-text");if(r.append(j("b",void 0,e.name)),e.startsAt!=null){let s=hi(e.startsAt,i,n.locale,{weekday:"short",day:"numeric",month:"short"}),a=hi(e.startsAt,i,n.locale,{hour:"2-digit",minute:"2-digit"});r.append(j("span",void 0,`${s} \xB7 ${a}`))}return t.append(o,r),(e.cancelled||e.past)&&t.append(j("span","sl-step-date-tag",e.cancelled?(0,te.t)("season.cancelled"):(0,te.t)("season.past"))),t}function Xh(n){let{descriptor:e}=n,t=j("div","sl-season-step"),i=j("div","sl-step-body"),o=Yh(e),r=o.length,s=j("div","sl-step-intro");s.append(Qh("package")),n.titled||s.append(j("h2","sl-step-title",n.title));let a=o.find(g=>g.startsAt!=null)?.startsAt??null,l=[...o].reverse().find(g=>g.startsAt!=null)?.startsAt??null,c=[Gi(r),e.venue,a!=null&&l!=null?Wh(a,l,e.timezone,n.locale,!0):""].filter(Boolean).join(" \xB7 "),d=j("p","sl-step-facts");d.append(j("span",void 0,c)),n.onSale===!0&&d.append(j("span","sl-step-onsale",(0,te.t)("season.onSale"))),s.append(d),n.onSale===!1&&s.append(j("p","sl-step-facts sl-step-closed",(0,te.t)("season.accessSalesNotOpen")));let p=j("div","sl-step-promise");p.append(j("b",void 0,(0,te.t)("season.whatYouGet")));let m=j("ul");m.append(j("li",void 0,(0,te.t)("season.sameSeat"))),n.emailTickets&&m.append(j("li",void 0,(0,te.t)("season.emailTickets"))),m.append(j("li",void 0,(0,te.t)("season.payOnce"))),p.append(m);let u=j("div","sl-step-cols"),f=j("div","sl-step-col"),b=j("div","sl-step-col");u.append(f,b),i.append(u),f.append(s,p);let T=n.prices?.packages??[],C=T.find(g=>g.planActivationId===n.chosen)??null;if(T.length){let g=j("div","sl-step-packages");g.append(j("b",void 0,(0,te.t)("season.choosePackage")));let R=j("div","sl-step-cards");n.loading&&R.setAttribute("aria-busy","true"),R.append(...T.map(_=>ey(n,_,_.planActivationId===n.chosen))),g.append(R),f.append(g)}if(C){let g=ty(n,C,r);n.expanded||(g.dataset.more="true"),b.append(g)}let k=j("ul","sl-step-dates");if((n.expanded?e.occurrences:o.slice(0,3)).forEach((g,R)=>{let _=ny(n,g);!n.expanded&&R>0&&(_.dataset.more="true"),k.append(_)}),b.append(k),!n.expanded&&e.occurrences.length>1){let g=j("button","sl-step-all");g.type="button";let R=Gi(e.occurrences.length);g.append(j("span","sl-step-wide",(0,te.t)("season.showAllDates").replace("{dates}",R)),j("span","sl-step-narrow",(0,te.t)("season.showAllDatesPrices").replace("{dates}",R))),g.addEventListener("click",()=>n.expand()),b.append(g)}let L=j("div","sl-step-go"),Q=C?ea(C.prices):null;C&&Q!=null&&L.append(j("span","sl-step-go-price",[(0,te.t)("season.fromPrice").replace("{price}",n.money(Q)),C.name,(0,te.t)("season.perSeat")].join(" \xB7 ")));let D=j("button","sl-step-seats",(0,te.t)("season.chooseSeats"));return D.type="button",D.disabled=n.loading,D.addEventListener("click",()=>n.seats()),L.append(D),t.append(i,L),t}function Qh(n){let e=["package","seats","pay"],t={package:(0,te.t)("season.stepPackage"),seats:(0,te.t)("season.stepSeats"),pay:(0,te.t)("season.stepPay")},i=j("ol","sl-strip-steps");return e.forEach((o,r)=>{let s=r<e.indexOf(n)?"done":o===n?"current":"next",a=j("li");a.dataset.state=s,s==="current"&&a.setAttribute("aria-current","step"),a.append(j("span","sl-strip-n",s==="done"?"\u2713":String(r+1)),document.createTextNode(t[o])),i.append(a)}),i}function Zh(n){let e=j("span","sl-strip-pkg");n.pkg?e.append(j("b",void 0,n.pkg.name),document.createTextNode(` \xB7 ${Gi(n.dates)}`)):e.append(document.createTextNode(Gi(n.dates)));let t=n.pkg?ea(n.pkg.prices):null;t!=null&&e.append(j("span","sl-strip-price",` \xB7 ${(0,te.t)("season.fromPrice").replace("{price}",n.money(t))} ${(0,te.t)("season.perSeat")}`));let i=j("button","sl-strip-change");return i.type="button",i.append(j("span","sl-step-wide",(0,te.t)("season.changePackage")),j("span","sl-step-narrow",(0,te.t)("season.change"))),i.addEventListener("click",()=>n.change()),[Qh(n.step),e,i]}var Ze=require("@seatlayer/core");function Jh(n,e){for(let[t,i]of Object.entries(e))n.style.setProperty(t,i)}function eu(n,e,t,i={}){let o=document.createElement("div");Jh(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let r=document.createElement("div");r.className="sl-season-leave-card";let s=document.createElement("h2");s.id=`sl-season-leave-${Math.random().toString(36).slice(2,10)}`,s.textContent=(0,Ze.t)("season.leaveTitle"),o.setAttribute("aria-labelledby",s.id);let a=document.createElement("p"),l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=(0,Ze.t)("season.leaveRelease");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=(0,Ze.t)("season.leaveKeep"),l.append(c,d),r.append(s,a,l),o.append(r);let p=null,m=()=>{p&&clearInterval(p),p=null,o.remove()},u=()=>{let f=Math.max(0,e-Date.now());if(f<=0){m(),t.lapsed();return}let b=Math.ceil(f/1e3),T=`${Math.floor(b/60)}:${String(b%60).padStart(2,"0")}`;a.textContent=(0,Ze.t)("season.leaveBody").replace("{time}",T)};return c.addEventListener("click",()=>{m(),t.release()}),d.addEventListener("click",()=>{m(),t.keep()}),u(),p=setInterval(u,1e3),n.append(o),d.focus({preventScroll:!0}),{remove:m}}function tu(n){let e=o=>{try{return new Intl.ListFormat(void 0,{type:"conjunction"}).format(o)}catch{return o.join(", ")}},t=[],i=new Map;for(let o of n){if(!o.row||!o.seat){t.push({head:[o.label],seats:[]});continue}let r=`${o.section??""}\0${o.row}`,s=i.get(r);s||(s={head:[o.section??"",`${(0,Ze.t)("picker.row")} ${o.row}`].filter(Boolean),seats:[]},i.set(r,s),t.push(s)),s.seats.push(o.seat)}return t.map(({head:o,seats:r})=>[...o,...r.length===1?[`${(0,Ze.t)("picker.seat")} ${r[0]}`]:[],...r.length>1?[`${(0,Ze.t)("season.seats")} ${e(r)}`]:[]].join(", ")).join("; ")}function nu(n,e,t,i={}){let o=document.createElement("div");Jh(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let r=document.createElement("div");r.className="sl-season-leave-card";let s=document.createElement("h2");s.id=`sl-season-change-${Math.random().toString(36).slice(2,10)}`,s.textContent=(0,Ze.t)("season.changeTitle"),o.setAttribute("aria-labelledby",s.id);let a=document.createElement("p");a.textContent=(0,Ze.t)("season.changeBody").replace("{seats}",e);let l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=(0,Ze.t)("season.changeConfirm");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=(0,Ze.t)("season.changeKeep"),l.append(c,d),r.append(s,a,l),o.append(r);let p=()=>{o.remove()};return c.addEventListener("click",()=>{p(),t.change()}),d.addEventListener("click",()=>{p(),t.keep()}),n.append(o),d.focus({preventScroll:!0}),{remove:p}}var iy=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),oy=3e4;function ry(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(i=>typeof i=="string"&&!!i)}var At,zt,Ui,ui,ta=class{constructor(e){this.options=e;M(this,At,null);M(this,zt,null);M(this,Ui);M(this,ui);x(this,Ui,e.fetch??globalThis.fetch.bind(globalThis)),x(this,ui,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,At)}async mint(e=!1){if(e&&x(this,At,null),h(this,At)&&h(this,At).expiresAt-oy>Date.now())return h(this,At);if(h(this,zt))return h(this,zt);let t=(async()=>{let i=await h(this,Ui).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify({...h(this,ui)?{origin:h(this,ui)}:{},...this.options.planActivationId?{planActivationId:this.options.planActivationId}:{}}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error;if(i.status===403&&r&&iy.has(r)){let s=r;throw this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new di(s,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!ry(o,this.options.season))throw new Error("season_public_session_invalid");return x(this,At,o),o})();x(this,zt,t);try{return await t}finally{h(this,zt)===t&&x(this,zt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};At=new WeakMap,zt=new WeakMap,Ui=new WeakMap,ui=new WeakMap;function iu(n){let e=new ta(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var sy=2500,na=new Map;function ay(){return typeof location<"u"&&new URLSearchParams(location.search).has("seatlayer_checkout")}function ly(n,e){let t=null;try{t=new URL(n)}catch{}if(!t||!/^https?:$/.test(t.protocol))return`"${n}" is not an absolute http(s) URL, so checkout ignores it and onOrderConfirmed does not run`;let i=typeof location>"u"?t.origin:location.origin;return t.origin!==i?`is on ${t.origin}, but this tab keeps the order for ${i}: onOrderConfirmed does not run there`:e==="test"?`brings the buyer back only if ${t.origin} is saved under Embed domains; otherwise onOrderConfirmed does not run`:null}function cy(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}var O,wn,xn,Re,ce,jt,gi,Kt,kn,Sn,Tn,Yi,bi,yi,Xi,me,En,pe,ue,Pt,Gt,Ut,nt,Cn,Me,vi,qt,An,wi,Wt,Yt,Xt,xi,Qi,pt,ki,it,Zi,y,ia,Nr,oa,yn,ra,sa,ru,su,aa,Si,au,la,ca,lu,cu,Dr,du,Fr,Br,mi,pu,da,Vr,fi,hu,uu,mu,fu,pa,$r,gu,qi,bu,zr,ha,ye,Je,yu,Wi,vn,ua=class ua{constructor(e){M(this,y);M(this,O);M(this,wn);M(this,xn);M(this,Re);M(this,ce);M(this,jt);M(this,gi,null);M(this,Kt,0);M(this,kn,null);M(this,Sn,"package");M(this,Tn,null);M(this,Yi,!1);M(this,bi,new Map);M(this,yi,null);M(this,Xi,new AbortController);M(this,me,null);M(this,En,null);M(this,pe,null);M(this,ue,null);M(this,Pt,null);M(this,Gt,null);M(this,Ut,null);M(this,nt,[]);M(this,Cn,new Map);M(this,Me,!1);M(this,vi,!1);M(this,qt,null);M(this,An,null);M(this,wi,null);M(this,Wt,null);M(this,Yt,"handoff");M(this,Xt,null);M(this,xi,!1);M(this,Qi,!1);M(this,pt,null);M(this,ki,null);M(this,it,null);M(this,Zi,null);M(this,Si,new Set);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");x(this,O,e),x(this,wn,cy(e.container)),x(this,jt,!e.buyerAccessToken&&!e.buyerAccessTokenProvider),w(this,y,Nr).call(this,null)}async render(){w(this,y,Wi).call(this),vt(),Dh(),w(this,y,su).call(this),w(this,y,ye).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let e;if(h(this,O).package&&w(this,y,ia).call(this)&&!h(this,it)){if(e=await $h(h(this,O).apiBase??"https://api.seatlayer.io",h(this,O).season,h(this,O).fetch),h(this,Me))return this;let t=e?.packages.find(i=>i.planKey===h(this,O).package);t&&(h(this,Re).destroy(),w(this,y,Nr).call(this,t.planActivationId))}return await w(this,y,oa).call(this,h(this,Kt),e)?(w(this,y,mu).call(this),h(this,it)||h(this,O).initialOperationId||ay()?await this.chooseSeats():w(this,y,yn).call(this),h(this,Me)?this:(w(this,y,fu).call(this),w(this,y,ra).call(this),h(this,O).initialOperationId&&await this.restoreOperation(h(this,O).initialOperationId),this)):this}catch(e){if(h(this,Me))return this;throw w(this,y,Je).call(this,e)}}async choosePackage(e){if(w(this,y,Wi).call(this),(h(this,kn)??h(this,me)?.planActivationId)===e)return;if(!w(this,y,ia).call(this))throw new q("season_package_fixed",409);if(h(this,pe))throw new q("season_hold_open",409);x(this,kn,e);let t=++ka(this,Kt)._;h(this,ue)?.destroy(),x(this,ue,null),x(this,nt,[]),h(this,Cn).clear(),h(this,Re).destroy(),w(this,y,Nr).call(this,e),w(this,y,yn).call(this),w(this,y,ye).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{if(!await w(this,y,oa).call(this,t))return;w(this,y,yn).call(this),w(this,y,ra).call(this)}catch(i){if(h(this,Me)||t!==h(this,Kt))return;throw w(this,y,Je).call(this,i)}}async chooseSeats(){if(w(this,y,Wi).call(this),!(h(this,Sn)==="seats"&&h(this,ue))){if(!h(this,me))throw new Error("seatlayer: render SeasonPicker before using it");x(this,Sn,"seats"),h(this,Tn)?.remove(),x(this,Tn,null),await w(this,y,ru).call(this,h(this,me))}}async holdSameSeat(e,t,i){if(w(this,y,vn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(i)for(let o of e)h(this,ce).types.set(o,i[o]||"adult");if(h(this,ce).typeRefusal=null,h(this,ce).queueOperation(t),h(this,ue).selectObjectsWithoutConfirmation([...e]),w(this,y,ye).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await h(this,ue).handleCta(!0,!1),!h(this,pe))throw h(this,ce).typeRefusal??new q("season_hold_not_created",409);return h(this,pe)}async holdBestAvailable(e,t,i={}){if(w(this,y,vn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=h(this,ue).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(h(this,vi))throw new q("season_best_available_in_progress",409);x(this,vi,!0);let r=null;try{if(r=h(this,ce).queueBestAvailable(t,i),w(this,y,ye).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await h(this,ue).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!h(this,pe))throw new q("season_hold_not_created",409);return h(this,pe)}catch(s){throw w(this,y,Je).call(this,s,t)}finally{r&&h(this,ce).clearBestAvailable(r),x(this,vi,!1)}}async restoreOperation(e){w(this,y,vn).call(this),w(this,y,ye).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await h(this,Re).waitForTerminal(e,void 0,h(this,Xi).signal);return t.state==="aborted"||t.state==="expired"?(x(this,pe,null),h(this,O).onHoldChange?.(null),w(this,y,ye).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(h(this,ce).remember(t),w(this,y,Dr).call(this,t,!1))}catch(t){throw w(this,y,Je).call(this,t,e)}}async markBooked(){w(this,y,vn).call(this);let e=h(this,pe);if(!e)return!1;try{let{operation:t}=await h(this,Re).operation(e.operationId);return t.state!=="booked"?!1:(h(this,ce).remember(t),w(this,y,Dr).call(this,t,!1),!0)}catch(t){throw w(this,y,Je).call(this,t,e.operationId)}}async release(e){w(this,y,vn).call(this);let t=h(this,pe);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");h(this,ce).queueRelease(e),w(this,y,ye).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{h(this,ue)?.getCurrentHold()?.holdId===t.holdId?await h(this,ue).release():(await h(this,ce).release("",[],t.holdId),w(this,y,Fr).call(this)),w(this,y,ye).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw w(this,y,Je).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(w(this,y,vn).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");w(this,y,ye).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await h(this,Re).renewalIntent(e);return w(this,y,ye).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),h(this,O).onRenewalIntent?.(t),t}catch(t){throw w(this,y,Je).call(this,t)}}getDescriptor(){return h(this,me)}getAvailability(){return h(this,En)}getHandoff(){return h(this,pe)}getHeldOrder(){let e=h(this,pe);if(!e)return null;let t=w(this,y,ca).call(this);return{operationId:e.operationId,expiresAt:e.expiresAt,currency:w(this,y,Vr).call(this),seats:t,totalMinor:w(this,y,da).call(this,t)}}destroy(){if(h(this,Me))return;x(this,Me,!0),h(this,Xi).abort(),w(this,y,$r).call(this),h(this,ue)?.destroy(),h(this,Re).destroy(),h(this,wn).replaceChildren(),x(this,Pt,null),x(this,Gt,null),x(this,Ut,null),x(this,me,null),x(this,En,null),x(this,pe,null),x(this,pt,null);let e=h(this,ki);x(this,ki,null),e?.()}close(){h(this,pt)?h(this,pt).call(this):this.destroy()}static async open(e){vt();let t=na.get(e.season)??null;na.delete(e.season);let i=t&&t.expiresAt>Date.now()?t:null,o=!!e.buyerAccessToken||!!e.buyerAccessTokenProvider,r=sr((0,fe.t)("season.popupLabel"),gt(void 0,e.theme)["--sl-bg"]),s;try{s=new ua({...e,...i?.token&&!o?{buyerAccessToken:i.token}:{},container:r.frame})}catch(p){throw r.teardown(!1),p}x(s,it,i),x(s,jt,!o),x(s,ki,()=>r.teardown());let a=!1,l=null,c=()=>{a||(a=!0,l?.remove(),l=null,s.destroy(),e.onClose?.())},d=()=>{var m;if(a||l)return;let p=h(s,pe);if(!p||p.expiresAt<=Date.now()){c();return}l=eu(r.frame,p.expiresAt,{keep:()=>{var u;w(u=s,y,sa).call(u,p),c()},release:()=>{s.release(`sra_${crypto.randomUUID()}`).catch(u=>e.onError?.(u)).finally(c)},lapsed:()=>{l=null,c()}},w(m=s,y,zr).call(m))};x(s,pt,d),x(s,Zi,p=>{setTimeout(()=>{var m;a||l||(w(m=s,y,sa).call(m,p),c())},0)}),r.onScrimPress(d),r.trapKeys(p=>{p.preventDefault(),l?(l.remove(),l=null):d()});try{await s.render()}catch(p){throw a=!0,s.destroy(),p}return h(s,Me)||r.focusFirst(),s}};O=new WeakMap,wn=new WeakMap,xn=new WeakMap,Re=new WeakMap,ce=new WeakMap,jt=new WeakMap,gi=new WeakMap,Kt=new WeakMap,kn=new WeakMap,Sn=new WeakMap,Tn=new WeakMap,Yi=new WeakMap,bi=new WeakMap,yi=new WeakMap,Xi=new WeakMap,me=new WeakMap,En=new WeakMap,pe=new WeakMap,ue=new WeakMap,Pt=new WeakMap,Gt=new WeakMap,Ut=new WeakMap,nt=new WeakMap,Cn=new WeakMap,Me=new WeakMap,vi=new WeakMap,qt=new WeakMap,An=new WeakMap,wi=new WeakMap,Wt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,xi=new WeakMap,Qi=new WeakMap,pt=new WeakMap,ki=new WeakMap,it=new WeakMap,Zi=new WeakMap,y=new WeakSet,ia=function(){return h(this,jt)||!!h(this,O).buyerAccessTokenProvider&&!h(this,O).buyerAccessToken},Nr=function(e){let t=h(this,O),i={onExpired:r=>t.onAccessExpired?.(r),onUnavailable:r=>{let s=h(this,An)&&r.reason==="provider_failed"?h(this,An):r;x(this,An,null),x(this,wi,s.reason==="provider_failed"?null:s),t.onAccessUnavailable?.(s),w(this,y,hu).call(this,s)}},o=t.buyerAccessTokenProvider;if(e&&!h(this,jt)&&o)x(this,qt,null),x(this,xn,new De({provider:r=>o({...r,planActivationId:e}),...i}));else if(h(this,jt)){let{access:r,loader:s}=iu({base:(t.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:t.season,fetch:t.fetch,...e?{planActivationId:e}:{},onRefused:a=>{x(this,An,a)},accessHooks:i});x(this,xn,r),x(this,qt,s)}else x(this,qt,null),x(this,xn,new De({token:t.buyerAccessToken,provider:t.buyerAccessTokenProvider,...i}));x(this,Re,new Rr(t.season,{apiBase:t.apiBase,access:h(this,xn),fetch:t.fetch,recoveryTimeoutMs:t.recoveryTimeoutMs})),x(this,ce,new Or(h(this,Re),Math.max(750,t.realtimePollMs??sy),r=>w(this,y,yu).call(this,r),!!t.priceTypes?.some(r=>r!=="adult")))},oa=async function(e,t){let i=h(this,Re).chart();h(this,ce).primeChart(i),i.then(a=>{h(this,Me)||e!==h(this,Kt)||(x(this,bi,new Map((a.categories??[]).map(l=>[l.key,l.label||l.key]))),x(this,yi,a.theme??null),h(this,Sn)==="package"&&w(this,y,yn).call(this))},()=>{});let[o,r,s]=await Promise.all([h(this,Re).descriptor(),h(this,Re).availability(),t!==void 0?Promise.resolve(t):h(this,Re).prices().catch(()=>null)]);return h(this,Me)||e!==h(this,Kt)?!1:(x(this,me,o),x(this,kn,o.planActivationId),x(this,En,r),x(this,Wt,s),x(this,Yt,h(this,O).checkout==="hosted"&&o.checkoutMode!=="server"&&s?"hosted":"handoff"),h(this,ce).prime(o,r),!0)},yn=function(){let e=h(this,me);if(!h(this,Gt)||!e||h(this,Me))return;x(this,Sn,"package");let t=h(this,kn)??e.planActivationId,i=document.createElement("div");i.className="sl-picker sl-step-frame";let o=w(this,y,zr).call(this);for(let[s,a]of Object.entries(o))i.style.setProperty(s,a);let r=h(this,pt);if(r){let s=document.createElement("div");s.className="sl-head";let a=document.createElement("div");a.className="sl-logo",fo(a,[h(this,O).theme?.logoUrl,h(this,yi)?.logoUrl,e.orgLogoUrl],"");let l=document.createElement("div");l.className="sl-head-info";let c=document.createElement("div");c.className="sl-head-name",c.textContent=_r(e),l.append(c);let d=document.createElement("button");d.type="button",d.className="sl-close on",d.setAttribute("aria-label",(0,fe.t)("picker.close")),d.innerHTML='<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',d.addEventListener("click",()=>r()),s.append(a,l,d),i.append(s)}i.append(Xh({descriptor:e,prices:h(this,Wt),chosen:t,loading:t!==e.planActivationId,expanded:h(this,Yi),areas:h(this,bi),emailTickets:h(this,Yt)==="hosted"||h(this,O).ticketsByEmail===!0,onSale:w(this,y,du).call(this,e),titled:!!r,title:_r(e),locale:h(this,O).locale,money:s=>w(this,y,fi).call(this,s),choose:s=>{this.choosePackage(s).catch(a=>w(this,y,Je).call(this,a))},expand:()=>{x(this,Yi,!0),w(this,y,yn).call(this)},seats:()=>{this.chooseSeats().catch(s=>w(this,y,Je).call(this,s))}})),h(this,Tn)?.remove(),h(this,Gt).append(i),x(this,Tn,i)},ra=function(){let e=h(this,En)?.freeCount??0;w(this,y,ye).call(this,{kind:"ready",message:`${e} seat${e===1?"":"s"} available for every included performance.`})},sa=function(e){let t=h(this,qt)?.session,i=h(this,ce).seatsByHold.get(e.holdId),o=h(this,ue)?.getCurrentHold(),r=o?.holdId===e.holdId?[...new Set((o.items??[]).map(a=>a.label))]:[],s=i??r.map(a=>({label:a,priceTypeKey:"adult"}));na.set(h(this,O).season,{operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,seats:s,typedSeats:h(this,ce).typesInPlay(s.map(a=>a.label)),token:t?{token:t.token,expiresAt:t.expiresAt}:h(this,it)?.token??null})},ru=async function(e){h(this,it)&&h(this,ce).prepareResume(h(this,it));let t=new Tt(kr({container:h(this,Gt),event:e.key,apiBase:h(this,O).apiBase,transport:h(this,ce),hideEventDetails:!0,...h(this,it)?{initialHoldId:h(this,it).holdId}:{},maxSelection:h(this,O).maxSelection,selectedObjects:h(this,O).selectedObjects,selectableObjects:h(this,O).selectableObjects,numberOfPlacesToSelect:h(this,O).numberOfPlacesToSelect,selectionValidators:h(this,O).selectionValidators,locale:h(this,O).locale,messages:h(this,O).messages,languages:h(this,O).languages,colorblindSafe:h(this,O).colorblindSafe,initialView:h(this,O).initialView,enable3D:h(this,O).enable3D,max3DSeats:h(this,O).max3DSeats,enable3DCrowd:h(this,O).enable3DCrowd,touchNavigation3D:h(this,O).touchNavigation3D,hideBadge:h(this,O).hideBadge,theme:h(this,O).theme,confirmSelection:h(this,O).confirmSelection,seatView:h(this,O).seatView,onBuyerViewChange:h(this,O).onBuyerViewChange,onAnalytics:(i,o)=>{try{h(this,O).onAnalytics?.(i,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:Ct(e)})}catch{}},onSelectionChange:i=>{x(this,nt,i.map(o=>o.label)),x(this,Cn,new Map(i.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),h(this,O).onSelectionChange?.(i)},onSelectionValidityChange:h(this,O).onSelectionValidityChange,onHoldChange:i=>{if(!i){w(this,y,Fr).call(this);return}let o=h(this,ce).operationForHold(i.holdId);o&&w(this,y,Dr).call(this,o,!0)},onCheckout:()=>{var i;h(this,pe)&&(h(this,O).onContinue?.(h(this,pe)),h(this,Yt)==="hosted"?w(this,y,uu).call(this,h(this,pe)):(i=h(this,Zi))==null||i.call(this,h(this,pe)))},onHoldExpired:()=>{w(this,y,Fr).call(this),w(this,y,ye).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),h(this,O).onHoldExpired?.()},onError:i=>w(this,y,Je).call(this,i)},{surface:"season",performanceCount:Ct(e),selectionMode:"same_seat",suppressPricing:!0,packagePricing:w(this,y,Br).call(this)?w(this,y,cu).call(this):null,modalClose:h(this,pt),subheader:w(this,y,gu).call(this),brandLogoUrl:e.orgLogoUrl??null,brandAccent:e.orgAccent??null,nights:()=>w(this,y,aa).call(this),seatMarks:()=>w(this,y,au).call(this),partialWords:{title:(0,fe.t)("season.partlyFreeTitle"),advice:(0,fe.t)("season.partlyFreeAdvice"),legend:(0,fe.t)("season.partlyFreeLegend")},groupSelectionSummary:()=>{let i=h(this,nt).length;return i?{seats:i,performances:Ct(e),performancesChosen:Ct(e),perPerformance:i}:null},checkoutReady:i=>h(this,pe)?.holdId===i}));x(this,ue,t),await t.render()},su=function(){h(this,wn).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection"),h(this,pt)&&(e.dataset.placement="popup");let t=document.createElement("div");t.className="sl-season-map";let i=document.createElement("p");i.className="sl-season-status",i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),e.append(i,t),h(this,wn).append(e),x(this,Pt,e),x(this,Gt,t),x(this,Ut,i)},aa=function(){let e=h(this,me);if(!e)return[];let t=e.timezone?{timeZone:e.timezone}:{},i=o=>{if(o==null)return(0,fe.t)("season.dateToBeAnnounced");try{return new Intl.DateTimeFormat(h(this,O).locale,{weekday:"short",day:"numeric",month:"short",...t}).format(new Date(o))}catch{return new Date(o).toDateString()}};return e.occurrences.filter(o=>o.past!==!0&&o.cancelled!==!0).map(o=>({eventKey:o.eventKey,name:o.name,shortDate:i(o.startsAt)}))},Si=new WeakMap,au=function(){let e=new Set(w(this,y,aa).call(this).map(o=>o.eventKey)),t={};for(let o of h(this,Si))t[o]=null;h(this,Si).clear();let i=h(this,ce).latestAvailability?.partial??{};if(e.size)for(let[o,r]of Object.entries(i)){let s=r.filter(a=>e.has(a));!s.length||s.length>=e.size||(t[o]={kind:"partial",fraction:(e.size-s.length)/e.size,data:{blockedEventKeys:s}},h(this,Si).add(o))}return t},la=function(e){let t=w(this,y,Br).call(this)?.prices.find(i=>(i.priceTypeKey||"adult")===e);return v(`season.priceType.${e}`,t?.priceTypeLabel||e.charAt(0).toUpperCase()+e.slice(1))},ca=function(){let e=w(this,y,pu).call(this);return(h(this,ue)?.seatPlaces(e)??e.map(i=>({label:i}))).map(i=>{let o=h(this,Cn).get(i.label)??h(this,ue)?.seatCategory(i.label)??null,r=h(this,ce).types.get(i.label),s=h(this,ce).typed||!!r&&r!=="adult";return{label:i.label,section:i.section||null,row:i.row||null,seat:i.seat||null,categoryKey:o,area:o?h(this,bi).get(o)??o:null,priceType:r||"adult",priceTypeName:s?w(this,y,la).call(this,r||"adult"):null,priceMinor:o?w(this,y,mi).call(this,o,r):null}})},lu=function(e,t){return e.map(i=>{let o=i.row&&i.seat?[i.section,`${v("picker.row","Row")} ${i.row}`,`${v("picker.seat","Seat")} ${i.seat}`].filter(Boolean).join(" \xB7 "):i.label,r=[i.area,i.priceTypeName].filter(Boolean).join(" \xB7 ");return{label:o,...r?{detail:r}:{},amount:i.priceMinor==null?null:(0,fe.fromMinorUnits)(i.priceMinor,t)}})},cu=function(){let e=h(this,ce).types,t=[...new Set(h(this,O).priceTypes??["adult"])],i=a=>t.filter(l=>w(this,y,mi).call(this,a,l)!=null),o=a=>w(this,y,la).call(this,a),r=(a,l)=>{let c=e.get(a);if(c)return c;let d=i(l),p=d.includes("adult")?"adult":d[0];return p&&p!=="adult"&&e.set(a,p),p??"adult"},s=()=>Js(h(this,me)?Ct(h(this,me)):0);return{seat:(a,l)=>{let c=r(a,l),d=w(this,y,mi).call(this,l,c),p=h(this,ce).typed?i(l):[];return{amountText:d==null?"":w(this,y,fi).call(this,d),types:p.length>1?{options:p.map(m=>({id:m,name:o(m)})),selected:c}:null}},total:a=>{let l=0;for(let{label:c,categoryKey:d}of a){let p=w(this,y,mi).call(this,d,r(c,d));if(p==null)return null;l+=p}return{amountText:w(this,y,fi).call(this,l),countText:`${(0,fe.tCount)("picker.seatCount",a.length)} \xB7 ${s()}`}},setType:(a,l)=>{t.includes(l)&&e.set(a,l)},seatCardPrice:a=>{let l=i(a),c=w(this,y,mi).call(this,a,l.includes("adult")?"adult":l[0]);return c==null?null:{price:w(this,y,fi).call(this,c),note:s()}}}},Dr=function(e,t){if(e.state==="booked")return x(this,pe,null),h(this,ce).forget(e.holdId),h(this,ue)?.notifyGroupSettled("booked"),w(this,y,ye).call(this,{kind:"booked",message:`Your Season booking is complete for ${ou(Ct(h(this,me)))}. No further checkout action is needed.`,operationId:e.operationId}),h(this,O).onHoldChange?.(null),null;if(e.state==="partial_terminal")return x(this,pe,null),x(this,nt,[]),h(this,ce).forget(e.holdId),h(this,ue)?.notifyGroupSettled("lost"),w(this,y,ye).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),h(this,O).onHoldChange?.(null),null;if(e.state!=="committed")return x(this,pe,null),h(this,ce).forget(e.holdId),h(this,ue)?.notifyGroupSettled("lost"),w(this,y,ye).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),h(this,O).onHoldChange?.(null),null;let i=jh(h(this,me),e,h(this,ce).seatsByHold.get(e.holdId)),o=h(this,pe)?.holdId!==i.holdId;return x(this,pe,i),h(this,O).onHoldChange?.(i),w(this,y,ye).call(this,{kind:"held",message:`Your seats are held for ${ou(Ct(h(this,me)))}. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&h(this,O).onHold?.(i),i},du=function(e){return e.salesState?e.salesState==="open":h(this,qt)?.session?!0:null},Fr=function(){x(this,pe,null),x(this,nt,[]),h(this,O).onHoldChange?.(null)},Br=function(){let e=h(this,me)?.planActivationId;return h(this,Wt)?.packages.find(t=>t.planActivationId===e)??null},mi=function(e,t="adult"){let i=w(this,y,Br).call(this)?.prices.find(o=>o.categoryKey===e&&(o.priceTypeKey||"adult")===t);return i?i.unitPrice:null},pu=function(){return h(this,pe)?.seats?.map(e=>e.label)??h(this,nt)},da=function(e){if(!e.length)return null;let t=0;for(let i of e){if(i.priceMinor==null)return null;t+=i.priceMinor}return t},Vr=function(){return h(this,Wt)?.currency??h(this,me)?.currency??"USD"},fi=function(e,t=w(this,y,Vr).call(this)){let i=(0,fe.fromMinorUnits)(e,t),o=Number.isInteger(i);return(0,fe.formatMoney)(i,t,{locale:h(this,O).locale,fallback:(r,s)=>`${r} ${s}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},hu=function(e){let t=e.reason==="audience_not_public"?(0,fe.t)("season.accessNotPublic"):e.reason==="sales_not_open"?(0,fe.t)("season.accessSalesNotOpen"):e.reason==="origin_not_allowed"?(0,fe.t)("season.accessOriginNotAllowed"):(0,fe.t)("season.accessUnavailable");w(this,y,ye).call(this,{kind:"failed",message:t})},uu=async function(e){if(!h(this,xi)){x(this,xi,!0);try{let t=w(this,y,Vr).call(this),i=w(this,y,ca).call(this),o=w(this,y,da).call(this,i);if(o==null){w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.checkoutNotPriced"),operationId:e.operationId});return}await w(this,y,pa).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,fe.fromMinorUnits)(o,t),labels:i.map(r=>r.label),lines:w(this,y,lu).call(this,i,t)}})}finally{x(this,xi,!1)}}},mu=function(){let e=h(this,O).returnUrl;if(h(this,Qi)||!e||!h(this,me))return;x(this,Qi,!0);let t=h(this,Yt)==="hosted"?ly(e,h(this,me).mode):"is not used: this picker takes no payment and hands the held seats to onContinue";t&&console.warn(`seatlayer: SeasonPicker returnUrl ${t}.`)},fu=function(){if(h(this,Yt)!=="hosted")return;let e=ni(h(this,O).season);e?.outcome!=="success"||!e.orderId||w(this,y,pa).call(this,{kind:"resume",orderId:e.orderId})},pa=async function(e){let t;try{({mountCheckout:t}=await _n())}catch(a){h(this,O).onError?.(a),w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.checkoutCouldNotBeOpened")});return}let i=h(this,ue)?.root;if(h(this,Me)||!i)return;w(this,y,$r).call(this);let o=h(this,me)?.buyer,r=h(this,O).buyerEmail||o?.email||void 0,s=h(this,O).buyerName||o?.name||void 0;x(this,Xt,t({root:i,state:e,eventKey:h(this,O).season,formatMoney:(a,l)=>(0,fe.formatMoney)(a,l,{locale:h(this,O).locale,fallback:(c,d)=>`${c} ${d}`,...Number.isInteger(a)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:a=>h(this,Re).checkout({operationId:a.holdId,buyerEmail:a.buyerEmail,...a.buyerName?{buyerName:a.buyerName}:{},...h(this,O).returnUrl?{returnUrl:h(this,O).returnUrl}:{}}),orderStatus:a=>h(this,Re).orderStatus(a),...r||s?{buyer:{email:r,name:s}}:{},onCancel:()=>{x(this,Xt,null),w(this,y,qi).call(this)},onConfirmed:a=>{h(this,O).onOrderConfirmed?.(a),w(this,y,ye).call(this,{kind:"booked",message:(0,fe.t)("season.orderConfirmed")})},onError:a=>h(this,O).onError?.(a)})),w(this,y,qi).call(this)},$r=function(){h(this,Xt)?.destroy(),x(this,Xt,null),w(this,y,qi).call(this)},gu=function(){let e=document.createElement("div");return e.className="sl-season-strip",x(this,gi,e),w(this,y,qi).call(this),e},qi=function(){let e=h(this,gi),t=h(this,me);!e||!t||e.replaceChildren(...Zh({step:h(this,Xt)?"pay":"seats",pkg:h(this,Wt)?.packages.find(i=>i.planActivationId===t.planActivationId)??null,dates:Ct(t),money:i=>w(this,y,fi).call(this,i),change:()=>w(this,y,bu).call(this)}))},bu=function(){let e=h(this,pe);if(!e){w(this,y,ha).call(this);return}if(!h(this,Pt))return;let t=e.seats?.map(o=>o.label)??h(this,nt),i=h(this,ue)?.seatPlaces(t)??t.map(o=>({label:o}));nu(h(this,Pt),tu(i),{keep:()=>{},change:()=>{this.release(`sra_${crypto.randomUUID()}`).then(()=>w(this,y,ha).call(this),o=>w(this,y,Je).call(this,o))}},w(this,y,zr).call(this))},zr=function(){return gt(h(this,yi)??void 0,h(this,O).theme,void 0,h(this,me)?.orgAccent)},ha=function(){h(this,Me)||(w(this,y,$r).call(this),h(this,ue)?.destroy(),x(this,ue,null),x(this,gi,null),x(this,nt,[]),h(this,Cn).clear(),w(this,y,yn).call(this))},ye=function(e,t=!1){h(this,Ut)&&(h(this,Ut).textContent=e.message,h(this,Ut).dataset.kind=e.kind),h(this,Pt)&&(h(this,Pt).dataset.busy=String(t)),h(this,O).onStatusChange?.(e)},Je=function(e,t){if(h(this,Me)||e instanceof q&&e.code==="season_api_destroyed")return e;let i=e instanceof we&&e.reason==="provider_failed"&&h(this,wi)?new we(h(this,wi)):e;return i instanceof we?(h(this,O).onError?.(i),i):(w(this,y,ye).call(this,{kind:"failed",message:Ir(i),operationId:t}),h(this,O).onError?.(i),i)},yu=function(e){h(this,Me)||(e instanceof we||w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.sessionEnded")}),h(this,O).onError?.(e))},Wi=function(){if(h(this,Me))throw new Error("seatlayer: SeasonPicker was destroyed")},vn=function(){if(w(this,y,Wi).call(this),!h(this,me)||!h(this,ue))throw new Error("seatlayer: render SeasonPicker before using it")};var jr=ua;function ou(n){return n===1?"1 date":`all ${n} dates`}function vu(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,o=null,r=null,s=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,o=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),n.style.width="100vw",n.style.height="100vh",n.style.width="100dvw",n.style.height="100dvh";let u=document.documentElement;r=u.style.overflow,u.style.overflow="hidden",document.body&&(s=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{i&&(i=!1,o===null?n.removeAttribute("style"):n.setAttribute("style",o),o=null,a&&(n.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),s!==null&&document.body&&(document.body.style.overflow=s,s=null),l&&(window.removeEventListener("keydown",l),l=null))},m=u=>{if(u.source!==n.contentWindow||t&&u.origin!==t||!u.data||typeof u.data!="object")return;let f=u.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(a=`${Math.round(f.px)}px`,i||(n.style.height=a));return}f.type==="seatlayer:fullscreen"&&(typeof f.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(f.background)&&(c=f.background,i&&(n.style.background=c)),f.on===!0?d():f.on===!1&&p())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,prewarmSeatPicker,shortOperationReference,ticketOfferPrices});
3696
+ `,document.head.appendChild(n)}var hi=require("@seatlayer/core");var q=class extends Error{constructor(t,i,o){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason),o?.refusals?.length&&(this.refusals=o.refusals),o?.buyerMessage&&(this.buyerMessage=o.buyerMessage)}},di=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}},pi=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}};Qr();var ny="https://api.seatlayer.io",iy=6e4,oy=5e3,ry=new Set(["seat_unavailable","seat_held_for_renewal"]);function Wh(n){return typeof n=="string"&&ry.has(n)?n:void 0}function ea(n){return Array.isArray(n)?n.flatMap(e=>{let t=e??{},i=typeof t.eventKey=="string"?t.eventKey:t.eventId,o=Wh(t.code);return typeof i=="string"&&o?[{eventKey:i,code:o}]:[]}):[]}function sy(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(oy,i*1e3))}function ay(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let o=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(o),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Uh(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function ly(n,e){let t=e&&typeof e=="object"?e:{},i=ea(t.handoff?.allocations??t.operation?.allocations),o=(n.headers.get("Retry-After")??"").trim(),r=o?Number(o):Number.NaN;return{...Number.isFinite(r)&&r>=0?{retryAfterS:Math.ceil(r)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{},...i.length?{refusals:i}:{}}}var cy=/^shc_[a-f0-9]{40}$/,dy=/^shh_[a-f0-9]{40}$/,py=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),hy=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Js(n){return Array.isArray(n)?n.some(Js):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&cy.test(t)||Js(t))}function Ki(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new q(t,502);if(Js(n))throw new q("unsafe_operation_response",502);let i=n,o=i.allocations,r=new Set,s=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let m=p.eventId,u=p.state;return typeof m!="string"||!m||typeof u!="string"||!hy.has(u)||r.has(m)?!1:(r.add(m),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&s&&o.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&s&&o.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!dy.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!py.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!s||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new q(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:o.map(p=>{let m=Wh(p.code);return{eventId:p.eventId,state:p.state,...m?{code:m}:{}}})}}function uy(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(s=>typeof s!="string"||!s)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new q("invalid_best_available_response",502);let i=n,o=new Set(i),r=new Map;for(let s of e){if(!s||typeof s!="object")throw new q("invalid_best_available_response",502);let a=s;if(typeof a.label!="string"||!o.has(a.label)||r.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new q("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(s=>r.get(s))}}function qh(n){return typeof n=="number"&&Number.isFinite(n)?n:null}async function Yh(n,e,t=globalThis.fetch.bind(globalThis)){try{let i=await t(`${n.replace(/\/$/,"")}/pub/seasons/${encodeURIComponent(e)}/prices`,{method:"GET",credentials:"omit"});return i.ok?Xh(await i.json()):null}catch{return null}}function Xh(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let i of e.packages){if(!i||typeof i!="object")continue;let o=i;if(typeof o.planKey!="string"||!o.planKey||typeof o.planActivationId!="string"||!o.planActivationId||!Array.isArray(o.prices))continue;let r=[],s=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;if(typeof l.categoryKey!="string"||!l.categoryKey)continue;let c=typeof l.priceTypeKey=="string"?l.priceTypeKey:"",d=`${l.categoryKey}\0${c||"adult"}`;s.has(d)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(s.add(d),r.push({categoryKey:l.categoryKey,...c?{priceTypeKey:c,priceTypeLabel:typeof l.priceTypeLabel=="string"?l.priceTypeLabel:c}:{},unitPrice:l.unitPrice}))}r.length&&t.push({planKey:o.planKey,planActivationId:o.planActivationId,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:r,...Number.isInteger(o.datesToCome)&&o.datesToCome>=0?{datesToCome:o.datesToCome,firstDateAt:qh(o.firstDateAt),lastDateAt:qh(o.lastDateAt)}:{}})}return t.length?{currency:e.currency,packages:t}:null}function my(n){if(!n||typeof n!="object"||Array.isArray(n))throw new q("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=co(e.redirectUrl);if(t&&!i)throw new q("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!i)throw new q("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:i}}function Qh(n,e,t){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:i,state:o,code:r})=>({eventKey:i,state:o,...r?{code:r}:{}})),...t?{seats:t}:{}}}var tt,gn,ct,bn,Gi,dt,pt,Be,Qe,Zh,_r=class{constructor(e,t){M(this,Be);M(this,tt);M(this,gn);M(this,ct);M(this,bn);M(this,Gi);M(this,dt,!1);M(this,pt,null);x(this,tt,e),x(this,gn,(t.apiBase??ny).replace(/\/$/,"")),x(this,ct,t.access),x(this,bn,t.fetch??globalThis.fetch.bind(globalThis)),x(this,Gi,t.recoveryTimeoutMs??iy),h(this,ct).onRenewed(i=>w(this,Be,Zh).call(this,i))}async descriptor(){let{body:e}=await w(this,Be,Qe).call(this,"GET","");return e.season}async chart(){let{body:e}=await w(this,Be,Qe).call(this,"GET","/chart");return e}async availability(){let{body:e}=await w(this,Be,Qe).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t,i){let o=e.map(a=>{let l=i?.get(a);return l&&l!=="adult"?{label:a,priceTypeKey:l}:{label:a}}),{body:r,response:s}=await w(this,Be,Qe).call(this,"POST","/holds",{operationId:t,labels:[...e],...o.some(a=>"priceTypeKey"in a)?{selections:o}:{}});return{operation:Ki(r.operation,{seasonId:h(this,tt),operationId:t}),response:s}}async bestAvailable(e){let{body:t,response:i}=await w(this,Be,Qe).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=Ki(t.operation,{seasonId:h(this,tt),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:s}=uy(t.labels,t.items,e.qty);return{operation:o,labels:r,items:s,response:i}}async operation(e){let{body:t,response:i}=await w(this,Be,Qe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Ki(t.operation,{seasonId:h(this,tt),operationId:e}),response:i}}async release(e,t){let{body:i,response:o}=await w(this,Be,Qe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Ki(i.operation,{seasonId:h(this,tt),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await w(this,Be,Qe).call(this,"GET","/prices"))}catch(t){if(t instanceof q&&t.status===404)return null;throw t}return Xh(e)}async checkout(e){let{body:t}=await w(this,Be,Qe).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return my(t)}async orderStatus(e){let t=await h(this,bn).call(this,`${h(this,gn)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new q(Uh(i),t.status);if(i===null)throw new q("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await w(this,Be,Qe).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new q("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let o=Date.now(),r=t?{operation:Ki(t.operation,{seasonId:h(this,tt),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-o>=h(this,Gi))throw new di(e);await ay(sy(r.response,r.operation),i),r=await this.operation(e)}return r.operation}destroy(){h(this,dt)||(x(this,dt,!0),h(this,ct).onRenewed(void 0),h(this,ct).clear())}};tt=new WeakMap,gn=new WeakMap,ct=new WeakMap,bn=new WeakMap,Gi=new WeakMap,dt=new WeakMap,pt=new WeakMap,Be=new WeakSet,Qe=async function(e,t,i,o=!0){if(h(this,dt))throw new q("season_api_destroyed",409);if(h(this,pt))throw h(this,pt);let r=await h(this,ct).authorization();if(h(this,dt))throw new q("season_api_destroyed",409);if(h(this,pt))throw h(this,pt);if(!r)throw new we({reason:"no_token",retryable:!1});let s=await h(this,bn).call(this,`${h(this,gn)}/pub/seasons/${encodeURIComponent(h(this,tt))}${t}`,{method:e,headers:{Authorization:r,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await s.json().catch(()=>null);if(!s.ok){let l=Uh(a);if(o&&await h(this,ct).handleFailure(s.status,l,r))return w(this,Be,Qe).call(this,e,t,i,!1);let c=h(this,ct).unavailable;throw c?new we(c):new q(l,s.status,ly(s,a))}if(a===null)throw new q("invalid_json_response",502);return{body:a,response:s}},Zh=async function(e){if(h(this,dt))return;let t=`/pub/seasons/${encodeURIComponent(h(this,tt))}/session/adopt`;for(let i=0;i<2;i++){if(h(this,dt))return;try{if((await h(this,bn).call(this,`${h(this,gn)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){x(this,pt,null);return}}catch{}}if(!h(this,dt))throw x(this,pt,new q("season_session_adopt_failed",409)),h(this,pt)};function Nr(n){if(!(n instanceof q))return(0,hi.t)("season.selectionFailed");let e=new Set((n.refusals??[]).map(t=>t.code));return n.code==="season_sales_not_open"?(0,hi.t)("season.accessSalesNotOpen"):e.has("seat_held_for_renewal")?(0,hi.t)("season.seatHeldForRenewal"):e.has("seat_unavailable")||n.code==="seats_unavailable"?(0,hi.t)("season.seatUnavailable"):n.code==="unknown"?(0,hi.t)("season.selectionFailed"):`Season selection unavailable (${n.code}).`}function Fr(n){let e=n.edition?.trim();return e&&!n.name.includes(e)?`${n.name} ${e}`:n.name}function Jh(n){return n.state==="committed"||n.state==="booked"}function eu(n){return new q(`season_operation_${n.state}`,409,{refusals:ea(n.allocations)})}var ta=class{constructor(e,t,i,o){this.transport=e;this.sink=t;this.intervalMs=i;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={};this.priorPartial={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=this.transport.latestAvailability?.partial??{},i=r=>(t[r]??[]).join("|"),o=Object.entries(e.seats).filter(([r,s])=>this.prior[r]!==s||this.priorPartial[r]!==i(r)).map(([r,s])=>({label:r,status:s}));this.prior={...e.seats},this.priorPartial=Object.fromEntries(Object.keys(e.seats).map(r=>[r,i(r)])),o.length&&this.sink.applyStatuses(o)}catch(e){if(Fo(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Dr=class{constructor(e,t,i,o=!1){this.api=e;this.realtimePollMs=t;this.onSessionEnded=i;this.typed=o;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map;this.seatsByHold=new Map;this.typeRefusal=null;this.types=new Map;this.chartPrefetch=null;this.resumable=null}get latestAvailability(){return this.availabilityValue}typesInPlay(e){return this.typed||e.some(t=>this.types.has(t))}recordSeats(e,t){this.seatsByHold.set(e,t.map(i=>({label:i,priceTypeKey:this.types.get(i)||"adult"})))}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}takeChartPrefetch(){let e=this.chartPrefetch;return this.chartPrefetch=null,e}primeChart(e){e.catch(()=>{}),this.chartPrefetch=e}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new q("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}prepareResume(e){this.resumable=e}async resume(e,t){let i=this.resumable;if(this.resumable=null,!i||i.holdId!==t)throw new q("season_hold_not_found",404);let o=await this.api.waitForTerminal(i.operationId);if(o.state!=="committed"||o.holdId!==t)throw new q("season_hold_not_found",404);if(i.typedSeats)for(let r of i.seats)this.types.set(r.label,r.priceTypeKey);return this.remember(o),this.recordSeats(t,i.seats.map(r=>r.label)),{holdId:t,expiresAt:o.expiresAt,items:i.seats.map(r=>({label:r.label,objectId:r.label,objectType:"seat",categoryKey:"",tierId:null,unitPrice:0,currency:this.descriptorValue?.currency??"USD"}))}}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.takeChartPrefetch()??this.api.chart()]);return this.descriptorValue=t,{doc:i,event:{key:t.key,name:Fr(t),venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,o){if(o)throw new q("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let s=t.map(c=>c.label),a=await this.api.hold(s,r,this.types).catch(c=>{throw c instanceof q&&c.code==="price_type_not_offered"?this.typeRefusal=new q(c.code,c.status,{reason:"ticket_option_not_applicable"}):tu(c)}),l=await this.api.waitForTerminal(r,a);if(!Jh(l))throw eu(l);return this.remember(l),this.recordSeats(l.holdId,s),{holdId:l.holdId,expiresAt:l.expiresAt,items:t.map(c=>({label:c.label,objectId:c.label,objectType:"seat",categoryKey:"",tierId:c.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...c.quantity==null?{}:{quantity:c.quantity}}))}}async release(e,t,i){let o=this.operationForHold(i);if(!o)throw new q("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let s=await this.api.release(o.operationId,r),a=await this.api.waitForTerminal(o.operationId,s);if(a.state==="partial_terminal")throw this.remember(a),new q("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,o){let r=this.nextBestAvailable;this.nextBestAvailable=null;let s=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:s,qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}).catch(d=>{throw tu(d)}),l=await this.api.waitForTerminal(s,a);if(!Jh(l))throw eu(l);this.remember(l);for(let d of a.labels)this.types.delete(d);this.recordSeats(l.holdId,a.labels);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new ta(this,t,this.realtimePollMs,this.onSessionEnded)}};function tu(n){return!(n instanceof q)||n.code!=="season_sales_not_open"?n:new q(n.code,n.status,{reason:"event_closed",buyerMessage:Nr(n)})}var te=require("@seatlayer/core"),fy=["adult","child","concession","senior","student"];function j(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Ui(n){return n===1?(0,te.t)("season.oneDate"):(0,te.t)("season.dateCount").replace("{count}",String(n))}function na(n){return n===1?(0,te.t)("season.priceForOneDate"):(0,te.t)("season.priceForAllDates").replace("{count}",String(n))}function Ct(n){return n.occurrences.length?n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0).length:n.occurrenceCount}function ui(n,e,t,i){try{return new Intl.DateTimeFormat(t,{...i,...e?{timeZone:e}:{}}).format(n)}catch{return new Intl.DateTimeFormat(t,i).format(n)}}function nu(n,e,t,i,o){let r={day:"numeric",month:"short",...o?{year:"numeric"}:{}},s=ui(n,t,i,r),a=ui(e,t,i,r);return s===a?s:(0,te.t)("season.dateRange").replace("{from}",s).replace("{to}",a)}function ia(n){let e=n.filter(i=>(i.priceTypeKey??"adult")==="adult"),t=e.length?e:n;return t.length?Math.min(...t.map(i=>i.unitPrice)):null}function iu(n){return n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0)}function gy(n,e,t){let i=j("div","sl-step-card");t&&(i.dataset.chosen="true"),i.append(j("b","sl-step-card-name",e.name));let o=t?iu(n.descriptor):null,r=o?o.length:e.datesToCome;if(r!==void 0){let l=o?o.find(p=>p.startsAt!=null)?.startsAt??null:e.firstDateAt??null,c=o?[...o].reverse().find(p=>p.startsAt!=null)?.startsAt??null:e.lastDateAt??null,d=l!=null&&c!=null?nu(l,c,n.descriptor.timezone,n.locale,!1):"";i.append(j("span","sl-step-card-dates",[Ui(r),d].filter(Boolean).join(" \xB7 ")))}let s=ia(e.prices);if(s!=null){let l=j("span","sl-step-card-price");l.append(j("b",void 0,(0,te.t)("season.fromPrice").replace("{price}",n.money(s))),j("span",void 0,(0,te.t)("season.perSeat"))),i.append(l)}let a=j("button","sl-step-card-choose",t?(0,te.t)("season.chosen"):(0,te.t)("season.choose"));return a.type="button",a.disabled=t||n.loading,a.setAttribute("aria-pressed",String(t)),t||a.addEventListener("click",()=>n.choose(e.planActivationId)),i.append(a),i}function by(n,e,t){let i=j("div","sl-step-prices"),o=j("div","sl-step-prices-head");o.append(j("b",void 0,(0,te.t)("season.packagePrices").replace("{name}",e.name)),j("span",void 0,`${(0,te.t)("season.perSeat")}, ${na(t)}`));let r=fy.filter(d=>e.prices.some(p=>(p.priceTypeKey??"adult")===d)),s=d=>e.prices.find(p=>(p.priceTypeKey??"adult")===d)?.priceTypeLabel??(d==="adult"?(0,te.t)("season.adult"):d),a=[...n.areas.keys()].filter(d=>e.prices.some(p=>p.categoryKey===d));for(let d of e.prices)a.includes(d.categoryKey)||a.push(d.categoryKey);let l=j("table"),c=j("tr");c.append(j("th",void 0,(0,te.t)("season.area")),...r.map(d=>j("th",void 0,s(d)))),l.append(c);for(let d of a){let p=j("tr");p.append(j("th",void 0,n.areas.get(d)??d));for(let m of r){let u=e.prices.find(f=>f.categoryKey===d&&(f.priceTypeKey??"adult")===m);p.append(j("td",void 0,u?n.money(u.unitPrice):"\u2014"))}l.append(p)}return i.append(o,l),i}function yy(n,e){let t=j("li","sl-step-date");e.cancelled?t.dataset.state="cancelled":e.past&&(t.dataset.state="past");let i=n.descriptor.timezone,o=j("span","sl-step-day");e.startsAt!=null&&o.append(j("small",void 0,ui(e.startsAt,i,n.locale,{month:"short"}).toUpperCase()),j("b",void 0,ui(e.startsAt,i,n.locale,{day:"numeric"})));let r=j("span","sl-step-date-text");if(r.append(j("b",void 0,e.name)),e.startsAt!=null){let s=ui(e.startsAt,i,n.locale,{weekday:"short",day:"numeric",month:"short"}),a=ui(e.startsAt,i,n.locale,{hour:"2-digit",minute:"2-digit"});r.append(j("span",void 0,`${s} \xB7 ${a}`))}return t.append(o,r),(e.cancelled||e.past)&&t.append(j("span","sl-step-date-tag",e.cancelled?(0,te.t)("season.cancelled"):(0,te.t)("season.past"))),t}function ou(n){let{descriptor:e}=n,t=j("div","sl-season-step"),i=j("div","sl-step-body"),o=iu(e),r=o.length,s=j("div","sl-step-intro");s.append(ru("package")),n.titled||s.append(j("h2","sl-step-title",n.title));let a=o.find(g=>g.startsAt!=null)?.startsAt??null,l=[...o].reverse().find(g=>g.startsAt!=null)?.startsAt??null,c=[Ui(r),e.venue,a!=null&&l!=null?nu(a,l,e.timezone,n.locale,!0):""].filter(Boolean).join(" \xB7 "),d=j("p","sl-step-facts");d.append(j("span",void 0,c)),n.onSale===!0&&d.append(j("span","sl-step-onsale",(0,te.t)("season.onSale"))),s.append(d),n.onSale===!1&&s.append(j("p","sl-step-facts sl-step-closed",(0,te.t)("season.accessSalesNotOpen")));let p=j("div","sl-step-promise");p.append(j("b",void 0,(0,te.t)("season.whatYouGet")));let m=j("ul");m.append(j("li",void 0,(0,te.t)("season.sameSeat"))),n.emailTickets&&m.append(j("li",void 0,(0,te.t)("season.emailTickets"))),m.append(j("li",void 0,(0,te.t)("season.payOnce"))),p.append(m);let u=j("div","sl-step-cols"),f=j("div","sl-step-col"),b=j("div","sl-step-col");u.append(f,b),i.append(u),f.append(s,p);let T=n.prices?.packages??[],C=T.find(g=>g.planActivationId===n.chosen)??null;if(T.length){let g=j("div","sl-step-packages");g.append(j("b",void 0,(0,te.t)("season.choosePackage")));let R=j("div","sl-step-cards");n.loading&&R.setAttribute("aria-busy","true"),R.append(...T.map(_=>gy(n,_,_.planActivationId===n.chosen))),g.append(R),f.append(g)}if(C){let g=by(n,C,r);n.expanded||(g.dataset.more="true"),b.append(g)}let k=j("ul","sl-step-dates");if((n.expanded?e.occurrences:o.slice(0,3)).forEach((g,R)=>{let _=yy(n,g);!n.expanded&&R>0&&(_.dataset.more="true"),k.append(_)}),b.append(k),!n.expanded&&e.occurrences.length>1){let g=j("button","sl-step-all");g.type="button";let R=Ui(e.occurrences.length);g.append(j("span","sl-step-wide",(0,te.t)("season.showAllDates").replace("{dates}",R)),j("span","sl-step-narrow",(0,te.t)("season.showAllDatesPrices").replace("{dates}",R))),g.addEventListener("click",()=>n.expand()),b.append(g)}let L=j("div","sl-step-go"),Q=C?ia(C.prices):null;C&&Q!=null&&L.append(j("span","sl-step-go-price",[(0,te.t)("season.fromPrice").replace("{price}",n.money(Q)),C.name,(0,te.t)("season.perSeat")].join(" \xB7 ")));let D=j("button","sl-step-seats",(0,te.t)("season.chooseSeats"));return D.type="button",D.disabled=n.loading,D.addEventListener("click",()=>n.seats()),L.append(D),t.append(i,L),t}function ru(n){let e=["package","seats","pay"],t={package:(0,te.t)("season.stepPackage"),seats:(0,te.t)("season.stepSeats"),pay:(0,te.t)("season.stepPay")},i=j("ol","sl-strip-steps");return e.forEach((o,r)=>{let s=r<e.indexOf(n)?"done":o===n?"current":"next",a=j("li");a.dataset.state=s,s==="current"&&a.setAttribute("aria-current","step"),a.append(j("span","sl-strip-n",s==="done"?"\u2713":String(r+1)),document.createTextNode(t[o])),i.append(a)}),i}function su(n){let e=j("span","sl-strip-pkg");n.pkg?e.append(j("b",void 0,n.pkg.name),document.createTextNode(` \xB7 ${Ui(n.dates)}`)):e.append(document.createTextNode(Ui(n.dates)));let t=n.pkg?ia(n.pkg.prices):null;t!=null&&e.append(j("span","sl-strip-price",` \xB7 ${(0,te.t)("season.fromPrice").replace("{price}",n.money(t))} ${(0,te.t)("season.perSeat")}`));let i=j("button","sl-strip-change");return i.type="button",i.append(j("span","sl-step-wide",(0,te.t)("season.changePackage")),j("span","sl-step-narrow",(0,te.t)("season.change"))),i.addEventListener("click",()=>n.change()),[ru(n.step),e,i]}var Ze=require("@seatlayer/core");function au(n,e){for(let[t,i]of Object.entries(e))n.style.setProperty(t,i)}function lu(n,e,t,i={}){let o=document.createElement("div");au(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let r=document.createElement("div");r.className="sl-season-leave-card";let s=document.createElement("h2");s.id=`sl-season-leave-${Math.random().toString(36).slice(2,10)}`,s.textContent=(0,Ze.t)("season.leaveTitle"),o.setAttribute("aria-labelledby",s.id);let a=document.createElement("p"),l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=(0,Ze.t)("season.leaveRelease");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=(0,Ze.t)("season.leaveKeep"),l.append(c,d),r.append(s,a,l),o.append(r);let p=null,m=()=>{p&&clearInterval(p),p=null,o.remove()},u=()=>{let f=Math.max(0,e-Date.now());if(f<=0){m(),t.lapsed();return}let b=Math.ceil(f/1e3),T=`${Math.floor(b/60)}:${String(b%60).padStart(2,"0")}`;a.textContent=(0,Ze.t)("season.leaveBody").replace("{time}",T)};return c.addEventListener("click",()=>{m(),t.release()}),d.addEventListener("click",()=>{m(),t.keep()}),u(),p=setInterval(u,1e3),n.append(o),d.focus({preventScroll:!0}),{remove:m}}function cu(n){let e=o=>{try{return new Intl.ListFormat(void 0,{type:"conjunction"}).format(o)}catch{return o.join(", ")}},t=[],i=new Map;for(let o of n){if(!o.row||!o.seat){t.push({head:[o.label],seats:[]});continue}let r=`${o.section??""}\0${o.row}`,s=i.get(r);s||(s={head:[o.section??"",`${(0,Ze.t)("picker.row")} ${o.row}`].filter(Boolean),seats:[]},i.set(r,s),t.push(s)),s.seats.push(o.seat)}return t.map(({head:o,seats:r})=>[...o,...r.length===1?[`${(0,Ze.t)("picker.seat")} ${r[0]}`]:[],...r.length>1?[`${(0,Ze.t)("season.seats")} ${e(r)}`]:[]].join(", ")).join("; ")}function du(n,e,t,i={}){let o=document.createElement("div");au(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let r=document.createElement("div");r.className="sl-season-leave-card";let s=document.createElement("h2");s.id=`sl-season-change-${Math.random().toString(36).slice(2,10)}`,s.textContent=(0,Ze.t)("season.changeTitle"),o.setAttribute("aria-labelledby",s.id);let a=document.createElement("p");a.textContent=(0,Ze.t)("season.changeBody").replace("{seats}",e);let l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=(0,Ze.t)("season.changeConfirm");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=(0,Ze.t)("season.changeKeep"),l.append(c,d),r.append(s,a,l),o.append(r);let p=()=>{o.remove()};return c.addEventListener("click",()=>{p(),t.change()}),d.addEventListener("click",()=>{p(),t.keep()}),n.append(o),d.focus({preventScroll:!0}),{remove:p}}var vy=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),wy=3e4;function xy(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(i=>typeof i=="string"&&!!i)}var At,zt,qi,mi,oa=class{constructor(e){this.options=e;M(this,At,null);M(this,zt,null);M(this,qi);M(this,mi);x(this,qi,e.fetch??globalThis.fetch.bind(globalThis)),x(this,mi,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,At)}async mint(e=!1){if(e&&x(this,At,null),h(this,At)&&h(this,At).expiresAt-wy>Date.now())return h(this,At);if(h(this,zt))return h(this,zt);let t=(async()=>{let i=await h(this,qi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify({...h(this,mi)?{origin:h(this,mi)}:{},...this.options.planActivationId?{planActivationId:this.options.planActivationId}:{}}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let r=o?.code??o?.error;if(i.status===403&&r&&vy.has(r)){let s=r;throw this.options.onRefused?.({reason:s,code:r,status:i.status,retryable:s==="sales_not_open"}),new pi(s,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!xy(o,this.options.season))throw new Error("season_public_session_invalid");return x(this,At,o),o})();x(this,zt,t);try{return await t}finally{h(this,zt)===t&&x(this,zt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};At=new WeakMap,zt=new WeakMap,qi=new WeakMap,mi=new WeakMap;function pu(n){let e=new oa(n);return{access:new De({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var ky=2500,ra=new Map;function Sy(){return typeof location<"u"&&new URLSearchParams(location.search).has("seatlayer_checkout")}function Ty(n,e){let t=null;try{t=new URL(n)}catch{}if(!t||!/^https?:$/.test(t.protocol))return`"${n}" is not an absolute http(s) URL, so checkout ignores it and onOrderConfirmed does not run`;let i=typeof location>"u"?t.origin:location.origin;return t.origin!==i?`is on ${t.origin}, but this tab keeps the order for ${i}: onOrderConfirmed does not run there`:e==="test"?`brings the buyer back only if ${t.origin} is saved under Embed domains; otherwise onOrderConfirmed does not run`:null}function Ey(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}var O,wn,xn,Re,ce,jt,bi,Kt,kn,Sn,Tn,Xi,yi,vi,Qi,me,En,pe,ue,Pt,Gt,Ut,nt,Cn,Ee,wi,qt,An,xi,Wt,Yt,Xt,ki,Zi,ht,Si,it,Ji,y,sa,Br,aa,yn,la,ca,uu,mu,da,Ti,fu,pa,ha,gu,bu,Vr,yu,$r,zr,fi,vu,ua,jr,gi,wu,xu,ku,Su,ma,Kr,Tu,Wi,Eu,Gr,fa,ye,Je,Cu,Yi,vn,ga=class ga{constructor(e){M(this,y);M(this,O);M(this,wn);M(this,xn);M(this,Re);M(this,ce);M(this,jt);M(this,bi,null);M(this,Kt,0);M(this,kn,null);M(this,Sn,"package");M(this,Tn,null);M(this,Xi,!1);M(this,yi,new Map);M(this,vi,null);M(this,Qi,new AbortController);M(this,me,null);M(this,En,null);M(this,pe,null);M(this,ue,null);M(this,Pt,null);M(this,Gt,null);M(this,Ut,null);M(this,nt,[]);M(this,Cn,new Map);M(this,Ee,!1);M(this,wi,!1);M(this,qt,null);M(this,An,null);M(this,xi,null);M(this,Wt,null);M(this,Yt,"handoff");M(this,Xt,null);M(this,ki,!1);M(this,Zi,!1);M(this,ht,null);M(this,Si,null);M(this,it,null);M(this,Ji,null);M(this,Ti,new Set);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");x(this,O,e),x(this,wn,Ey(e.container)),x(this,jt,!e.buyerAccessToken&&!e.buyerAccessTokenProvider),w(this,y,Br).call(this,null)}async render(){w(this,y,Yi).call(this),wt(),Gh(),w(this,y,mu).call(this),w(this,y,ye).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let e;if(h(this,O).package&&w(this,y,sa).call(this)&&!h(this,it)){if(e=await Yh(h(this,O).apiBase??"https://api.seatlayer.io",h(this,O).season,h(this,O).fetch),h(this,Ee))return this;let t=e?.packages.find(i=>i.planKey===h(this,O).package);t&&(h(this,Re).destroy(),w(this,y,Br).call(this,t.planActivationId))}return await w(this,y,aa).call(this,h(this,Kt),e)?(w(this,y,ku).call(this),h(this,it)||h(this,O).initialOperationId||Sy()?await this.chooseSeats():w(this,y,yn).call(this),h(this,Ee)?this:(w(this,y,Su).call(this),w(this,y,la).call(this),h(this,O).initialOperationId&&await this.restoreOperation(h(this,O).initialOperationId),this)):this}catch(e){if(h(this,Ee))return this;throw w(this,y,Je).call(this,e)}}async choosePackage(e){if(w(this,y,Yi).call(this),(h(this,kn)??h(this,me)?.planActivationId)===e)return;if(!w(this,y,sa).call(this))throw new q("season_package_fixed",409);if(h(this,pe))throw new q("season_hold_open",409);x(this,kn,e);let t=++Ea(this,Kt)._;h(this,ue)?.destroy(),x(this,ue,null),x(this,nt,[]),h(this,Cn).clear(),h(this,Re).destroy(),w(this,y,Br).call(this,e),w(this,y,yn).call(this),w(this,y,ye).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{if(!await w(this,y,aa).call(this,t))return;w(this,y,yn).call(this),w(this,y,la).call(this)}catch(i){if(h(this,Ee)||t!==h(this,Kt))return;throw w(this,y,Je).call(this,i)}}async chooseSeats(){if(w(this,y,Yi).call(this),!(h(this,Sn)==="seats"&&h(this,ue))){if(!h(this,me))throw new Error("seatlayer: render SeasonPicker before using it");x(this,Sn,"seats"),h(this,Tn)?.remove(),x(this,Tn,null),await w(this,y,uu).call(this,h(this,me))}}async holdSameSeat(e,t,i){if(w(this,y,vn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(i)for(let o of e)h(this,ce).types.set(o,i[o]||"adult");if(h(this,ce).typeRefusal=null,h(this,ce).queueOperation(t),h(this,ue).selectObjectsWithoutConfirmation([...e]),w(this,y,ye).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await h(this,ue).handleCta(!0,!1),!h(this,pe))throw h(this,ce).typeRefusal??new q("season_hold_not_created",409);return h(this,pe)}async holdBestAvailable(e,t,i={}){if(w(this,y,vn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=h(this,ue).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(h(this,wi))throw new q("season_best_available_in_progress",409);x(this,wi,!0);let r=null;try{if(r=h(this,ce).queueBestAvailable(t,i),w(this,y,ye).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await h(this,ue).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!h(this,pe))throw new q("season_hold_not_created",409);return h(this,pe)}catch(s){throw w(this,y,Je).call(this,s,t)}finally{r&&h(this,ce).clearBestAvailable(r),x(this,wi,!1)}}async restoreOperation(e){w(this,y,vn).call(this),w(this,y,ye).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await h(this,Re).waitForTerminal(e,void 0,h(this,Qi).signal);return t.state==="aborted"||t.state==="expired"?(x(this,pe,null),h(this,O).onHoldChange?.(null),w(this,y,ye).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(h(this,ce).remember(t),w(this,y,Vr).call(this,t,!1))}catch(t){throw w(this,y,Je).call(this,t,e)}}async markBooked(){if(h(this,Ee))return!1;w(this,y,vn).call(this);let e=h(this,pe);if(!e)return!1;try{let{operation:t}=await h(this,Re).operation(e.operationId);return t.state!=="booked"?!1:(h(this,ce).remember(t),w(this,y,Vr).call(this,t,!1),!0)}catch(t){throw w(this,y,Je).call(this,t,e.operationId)}}async release(e){w(this,y,vn).call(this);let t=h(this,pe);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");h(this,ce).queueRelease(e),w(this,y,ye).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{h(this,ue)?.getCurrentHold()?.holdId===t.holdId?await h(this,ue).release():(await h(this,ce).release("",[],t.holdId),w(this,y,$r).call(this)),w(this,y,ye).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw w(this,y,Je).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(w(this,y,vn).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");w(this,y,ye).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await h(this,Re).renewalIntent(e);return w(this,y,ye).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),h(this,O).onRenewalIntent?.(t),t}catch(t){throw w(this,y,Je).call(this,t)}}getDescriptor(){return h(this,me)}getAvailability(){return h(this,En)}getHandoff(){return h(this,pe)}getHeldOrder(){let e=h(this,pe);if(!e)return null;let t=w(this,y,ha).call(this);return{operationId:e.operationId,expiresAt:e.expiresAt,currency:w(this,y,jr).call(this),seats:t,totalMinor:w(this,y,ua).call(this,t)}}destroy(){if(h(this,Ee))return;x(this,Ee,!0),h(this,Qi).abort(),w(this,y,Kr).call(this),h(this,ue)?.destroy(),h(this,Re).destroy(),h(this,wn).replaceChildren(),x(this,Pt,null),x(this,Gt,null),x(this,Ut,null),x(this,me,null),x(this,En,null),x(this,pe,null),x(this,ht,null);let e=h(this,Si);x(this,Si,null),e?.()}close(){h(this,ht)?h(this,ht).call(this):this.destroy()}static async open(e){wt();let t=ra.get(e.season)??null;ra.delete(e.season);let i=t&&t.expiresAt>Date.now()?t:null,o=!!e.buyerAccessToken||!!e.buyerAccessTokenProvider,r=cr((0,fe.t)("season.popupLabel"),bt(void 0,e.theme)["--sl-bg"]),s;try{s=new ga({...e,...i?.token&&!o?{buyerAccessToken:i.token}:{},container:r.frame})}catch(p){throw r.teardown(!1),p}x(s,it,i),x(s,jt,!o),x(s,Si,()=>r.teardown());let a=!1,l=null,c=()=>{a||(a=!0,l?.remove(),l=null,s.destroy(),e.onClose?.())},d=()=>{var m;if(a||l)return;let p=h(s,pe);if(!p||p.expiresAt<=Date.now()){c();return}l=lu(r.frame,p.expiresAt,{keep:()=>{var u;w(u=s,y,ca).call(u,p),c()},release:()=>{s.release(`sra_${crypto.randomUUID()}`).catch(u=>e.onError?.(u)).finally(c)},lapsed:()=>{l=null,c()}},w(m=s,y,Gr).call(m))};x(s,ht,d),x(s,Ji,p=>{setTimeout(()=>{var m;a||l||(w(m=s,y,ca).call(m,p),c())},0)}),r.onScrimPress(d),r.trapKeys(p=>{p.preventDefault(),l?(l.remove(),l=null):d()});try{await s.render()}catch(p){throw a=!0,s.destroy(),p}return h(s,Ee)||r.focusFirst(),s}};O=new WeakMap,wn=new WeakMap,xn=new WeakMap,Re=new WeakMap,ce=new WeakMap,jt=new WeakMap,bi=new WeakMap,Kt=new WeakMap,kn=new WeakMap,Sn=new WeakMap,Tn=new WeakMap,Xi=new WeakMap,yi=new WeakMap,vi=new WeakMap,Qi=new WeakMap,me=new WeakMap,En=new WeakMap,pe=new WeakMap,ue=new WeakMap,Pt=new WeakMap,Gt=new WeakMap,Ut=new WeakMap,nt=new WeakMap,Cn=new WeakMap,Ee=new WeakMap,wi=new WeakMap,qt=new WeakMap,An=new WeakMap,xi=new WeakMap,Wt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,ki=new WeakMap,Zi=new WeakMap,ht=new WeakMap,Si=new WeakMap,it=new WeakMap,Ji=new WeakMap,y=new WeakSet,sa=function(){return h(this,jt)||!!h(this,O).buyerAccessTokenProvider&&!h(this,O).buyerAccessToken},Br=function(e){let t=h(this,O),i={onExpired:r=>t.onAccessExpired?.(r),onUnavailable:r=>{let s=h(this,An)&&r.reason==="provider_failed"?h(this,An):r;x(this,An,null),x(this,xi,s.reason==="provider_failed"?null:s),t.onAccessUnavailable?.(s),w(this,y,wu).call(this,s)}},o=t.buyerAccessTokenProvider;if(e&&!h(this,jt)&&o)x(this,qt,null),x(this,xn,new De({provider:r=>o({...r,planActivationId:e}),...i}));else if(h(this,jt)){let{access:r,loader:s}=pu({base:(t.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:t.season,fetch:t.fetch,...e?{planActivationId:e}:{},onRefused:a=>{x(this,An,a)},accessHooks:i});x(this,xn,r),x(this,qt,s)}else x(this,qt,null),x(this,xn,new De({token:t.buyerAccessToken,provider:t.buyerAccessTokenProvider,...i}));x(this,Re,new _r(t.season,{apiBase:t.apiBase,access:h(this,xn),fetch:t.fetch,recoveryTimeoutMs:t.recoveryTimeoutMs})),x(this,ce,new Dr(h(this,Re),Math.max(750,t.realtimePollMs??ky),r=>w(this,y,Cu).call(this,r),!!t.priceTypes?.some(r=>r!=="adult")))},aa=async function(e,t){let i=h(this,Re).chart();h(this,ce).primeChart(i),i.then(a=>{h(this,Ee)||e!==h(this,Kt)||(x(this,yi,new Map((a.categories??[]).map(l=>[l.key,l.label||l.key]))),x(this,vi,a.theme??null),h(this,Sn)==="package"&&w(this,y,yn).call(this))},()=>{});let[o,r,s]=await Promise.all([h(this,Re).descriptor(),h(this,Re).availability(),t!==void 0?Promise.resolve(t):h(this,Re).prices().catch(()=>null)]);return h(this,Ee)||e!==h(this,Kt)?!1:(x(this,me,o),x(this,kn,o.planActivationId),x(this,En,r),x(this,Wt,s),x(this,Yt,h(this,O).checkout==="hosted"&&o.checkoutMode!=="server"&&s?"hosted":"handoff"),h(this,ce).prime(o,r),!0)},yn=function(){let e=h(this,me);if(!h(this,Gt)||!e||h(this,Ee))return;x(this,Sn,"package");let t=h(this,kn)??e.planActivationId,i=document.createElement("div");i.className="sl-picker sl-step-frame";let o=w(this,y,Gr).call(this);for(let[s,a]of Object.entries(o))i.style.setProperty(s,a);let r=h(this,ht);if(r){let s=document.createElement("div");s.className="sl-head";let a=document.createElement("div");a.className="sl-logo",yo(a,[h(this,O).theme?.logoUrl,h(this,vi)?.logoUrl,e.orgLogoUrl],"");let l=document.createElement("div");l.className="sl-head-info";let c=document.createElement("div");c.className="sl-head-name",c.textContent=Fr(e),l.append(c);let d=document.createElement("button");d.type="button",d.className="sl-close on",d.setAttribute("aria-label",(0,fe.t)("picker.close")),d.innerHTML='<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',d.addEventListener("click",()=>r()),s.append(a,l,d),i.append(s)}i.append(ou({descriptor:e,prices:h(this,Wt),chosen:t,loading:t!==e.planActivationId,expanded:h(this,Xi),areas:h(this,yi),emailTickets:h(this,Yt)==="hosted"||h(this,O).ticketsByEmail===!0,onSale:w(this,y,yu).call(this,e),titled:!!r,title:Fr(e),locale:h(this,O).locale,money:s=>w(this,y,gi).call(this,s),choose:s=>{this.choosePackage(s).catch(a=>w(this,y,Je).call(this,a))},expand:()=>{x(this,Xi,!0),w(this,y,yn).call(this)},seats:()=>{this.chooseSeats().catch(s=>w(this,y,Je).call(this,s))}})),h(this,Tn)?.remove(),h(this,Gt).append(i),x(this,Tn,i)},la=function(){let e=h(this,En)?.freeCount??0;w(this,y,ye).call(this,{kind:"ready",message:`${e} seat${e===1?"":"s"} available for every included performance.`})},ca=function(e){let t=h(this,qt)?.session,i=h(this,ce).seatsByHold.get(e.holdId),o=h(this,ue)?.getCurrentHold(),r=o?.holdId===e.holdId?[...new Set((o.items??[]).map(a=>a.label))]:[],s=i??r.map(a=>({label:a,priceTypeKey:"adult"}));ra.set(h(this,O).season,{operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,seats:s,typedSeats:h(this,ce).typesInPlay(s.map(a=>a.label)),token:t?{token:t.token,expiresAt:t.expiresAt}:h(this,it)?.token??null})},uu=async function(e){h(this,it)&&h(this,ce).prepareResume(h(this,it));let t=new Tt(Er({container:h(this,Gt),event:e.key,apiBase:h(this,O).apiBase,transport:h(this,ce),hideEventDetails:!0,...h(this,it)?{initialHoldId:h(this,it).holdId}:{},maxSelection:h(this,O).maxSelection,selectedObjects:h(this,O).selectedObjects,selectableObjects:h(this,O).selectableObjects,numberOfPlacesToSelect:h(this,O).numberOfPlacesToSelect,selectionValidators:h(this,O).selectionValidators,locale:h(this,O).locale,messages:h(this,O).messages,languages:h(this,O).languages,colorblindSafe:h(this,O).colorblindSafe,initialView:h(this,O).initialView,enable3D:h(this,O).enable3D,max3DSeats:h(this,O).max3DSeats,enable3DCrowd:h(this,O).enable3DCrowd,touchNavigation3D:h(this,O).touchNavigation3D,hideBadge:h(this,O).hideBadge,theme:h(this,O).theme,confirmSelection:h(this,O).confirmSelection,seatView:h(this,O).seatView,onBuyerViewChange:h(this,O).onBuyerViewChange,onAnalytics:(i,o)=>{try{h(this,O).onAnalytics?.(i,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:Ct(e)})}catch{}},onSelectionChange:i=>{x(this,nt,i.map(o=>o.label)),x(this,Cn,new Map(i.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),h(this,O).onSelectionChange?.(i)},onSelectionValidityChange:h(this,O).onSelectionValidityChange,onHoldChange:i=>{if(!i){w(this,y,$r).call(this);return}let o=h(this,ce).operationForHold(i.holdId);o&&w(this,y,Vr).call(this,o,!0)},onCheckout:()=>{var i;h(this,pe)&&(h(this,O).onContinue?.(h(this,pe)),h(this,Yt)==="hosted"?w(this,y,xu).call(this,h(this,pe)):(i=h(this,Ji))==null||i.call(this,h(this,pe)))},onHoldExpired:()=>{w(this,y,$r).call(this),w(this,y,ye).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),h(this,O).onHoldExpired?.()},onError:i=>w(this,y,Je).call(this,i)},{surface:"season",performanceCount:Ct(e),selectionMode:"same_seat",suppressPricing:!0,packagePricing:w(this,y,zr).call(this)?w(this,y,bu).call(this):null,modalClose:h(this,ht),subheader:w(this,y,Tu).call(this),brandLogoUrl:e.orgLogoUrl??null,brandAccent:e.orgAccent??null,nights:()=>w(this,y,da).call(this),seatMarks:()=>w(this,y,fu).call(this),partialWords:{title:(0,fe.t)("season.partlyFreeTitle"),advice:(0,fe.t)("season.partlyFreeAdvice"),legend:(0,fe.t)("season.partlyFreeLegend")},groupSelectionSummary:()=>{let i=h(this,nt).length;return i?{seats:i,performances:Ct(e),performancesChosen:Ct(e),perPerformance:i}:null},checkoutReady:i=>h(this,pe)?.holdId===i}));x(this,ue,t),await t.render()},mu=function(){h(this,wn).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection"),h(this,ht)&&(e.dataset.placement="popup");let t=document.createElement("div");t.className="sl-season-map";let i=document.createElement("p");i.className="sl-season-status",i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),e.append(i,t),h(this,wn).append(e),x(this,Pt,e),x(this,Gt,t),x(this,Ut,i)},da=function(){let e=h(this,me);if(!e)return[];let t=e.timezone?{timeZone:e.timezone}:{},i=o=>{if(o==null)return(0,fe.t)("season.dateToBeAnnounced");try{return new Intl.DateTimeFormat(h(this,O).locale,{weekday:"short",day:"numeric",month:"short",...t}).format(new Date(o))}catch{return new Date(o).toDateString()}};return e.occurrences.filter(o=>o.past!==!0&&o.cancelled!==!0).map(o=>({eventKey:o.eventKey,name:o.name,shortDate:i(o.startsAt)}))},Ti=new WeakMap,fu=function(){let e=new Set(w(this,y,da).call(this).map(o=>o.eventKey)),t={};for(let o of h(this,Ti))t[o]=null;h(this,Ti).clear();let i=h(this,ce).latestAvailability?.partial??{};if(e.size)for(let[o,r]of Object.entries(i)){let s=r.filter(a=>e.has(a));!s.length||s.length>=e.size||(t[o]={kind:"partial",fraction:(e.size-s.length)/e.size,data:{blockedEventKeys:s}},h(this,Ti).add(o))}return t},pa=function(e){let t=w(this,y,zr).call(this)?.prices.find(i=>(i.priceTypeKey||"adult")===e);return v(`season.priceType.${e}`,t?.priceTypeLabel||e.charAt(0).toUpperCase()+e.slice(1))},ha=function(){let e=w(this,y,vu).call(this);return(h(this,ue)?.seatPlaces(e)??e.map(i=>({label:i}))).map(i=>{let o=h(this,Cn).get(i.label)??h(this,ue)?.seatCategory(i.label)??null,r=h(this,ce).types.get(i.label),s=h(this,ce).typed||!!r&&r!=="adult";return{label:i.label,section:i.section||null,row:i.row||null,seat:i.seat||null,categoryKey:o,area:o?h(this,yi).get(o)??o:null,priceType:r||"adult",priceTypeName:s?w(this,y,pa).call(this,r||"adult"):null,priceMinor:o?w(this,y,fi).call(this,o,r):null}})},gu=function(e,t){return e.map(i=>{let o=i.row&&i.seat?[i.section,`${v("picker.row","Row")} ${i.row}`,`${v("picker.seat","Seat")} ${i.seat}`].filter(Boolean).join(" \xB7 "):i.label,r=[i.area,i.priceTypeName].filter(Boolean).join(" \xB7 ");return{label:o,...r?{detail:r}:{},amount:i.priceMinor==null?null:(0,fe.fromMinorUnits)(i.priceMinor,t)}})},bu=function(){let e=h(this,ce).types,t=[...new Set(h(this,O).priceTypes??["adult"])],i=a=>t.filter(l=>w(this,y,fi).call(this,a,l)!=null),o=a=>w(this,y,pa).call(this,a),r=(a,l)=>{let c=e.get(a);if(c)return c;let d=i(l),p=d.includes("adult")?"adult":d[0];return p&&p!=="adult"&&e.set(a,p),p??"adult"},s=()=>na(h(this,me)?Ct(h(this,me)):0);return{seat:(a,l)=>{let c=r(a,l),d=w(this,y,fi).call(this,l,c),p=h(this,ce).typed?i(l):[];return{amountText:d==null?"":w(this,y,gi).call(this,d),types:p.length>1?{options:p.map(m=>({id:m,name:o(m)})),selected:c}:null}},total:a=>{let l=0;for(let{label:c,categoryKey:d}of a){let p=w(this,y,fi).call(this,d,r(c,d));if(p==null)return null;l+=p}return{amountText:w(this,y,gi).call(this,l),countText:`${(0,fe.tCount)("picker.seatCount",a.length)} \xB7 ${s()}`}},setType:(a,l)=>{t.includes(l)&&e.set(a,l)},seatCardPrice:a=>{let l=i(a),c=w(this,y,fi).call(this,a,l.includes("adult")?"adult":l[0]);return c==null?null:{price:w(this,y,gi).call(this,c),note:s()}}}},Vr=function(e,t){if(e.state==="booked")return x(this,pe,null),h(this,ce).forget(e.holdId),h(this,ue)?.notifyGroupSettled("booked"),w(this,y,ye).call(this,{kind:"booked",message:`Your Season booking is complete for ${hu(Ct(h(this,me)))}. No further checkout action is needed.`,operationId:e.operationId}),h(this,O).onHoldChange?.(null),null;if(e.state==="partial_terminal")return x(this,pe,null),x(this,nt,[]),h(this,ce).forget(e.holdId),h(this,ue)?.notifyGroupSettled("lost"),w(this,y,ye).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),h(this,O).onHoldChange?.(null),null;if(e.state!=="committed")return x(this,pe,null),h(this,ce).forget(e.holdId),h(this,ue)?.notifyGroupSettled("lost"),w(this,y,ye).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),h(this,O).onHoldChange?.(null),null;let i=Qh(h(this,me),e,h(this,ce).seatsByHold.get(e.holdId)),o=h(this,pe)?.holdId!==i.holdId;return x(this,pe,i),h(this,O).onHoldChange?.(i),w(this,y,ye).call(this,{kind:"held",message:`Your seats are held for ${hu(Ct(h(this,me)))}. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&h(this,O).onHold?.(i),i},yu=function(e){return e.salesState?e.salesState==="open":h(this,qt)?.session?!0:null},$r=function(){x(this,pe,null),x(this,nt,[]),h(this,O).onHoldChange?.(null)},zr=function(){let e=h(this,me)?.planActivationId;return h(this,Wt)?.packages.find(t=>t.planActivationId===e)??null},fi=function(e,t="adult"){let i=w(this,y,zr).call(this)?.prices.find(o=>o.categoryKey===e&&(o.priceTypeKey||"adult")===t);return i?i.unitPrice:null},vu=function(){return h(this,pe)?.seats?.map(e=>e.label)??h(this,nt)},ua=function(e){if(!e.length)return null;let t=0;for(let i of e){if(i.priceMinor==null)return null;t+=i.priceMinor}return t},jr=function(){return h(this,Wt)?.currency??h(this,me)?.currency??"USD"},gi=function(e,t=w(this,y,jr).call(this)){let i=(0,fe.fromMinorUnits)(e,t),o=Number.isInteger(i);return(0,fe.formatMoney)(i,t,{locale:h(this,O).locale,fallback:(r,s)=>`${r} ${s}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},wu=function(e){let t=e.reason==="audience_not_public"?(0,fe.t)("season.accessNotPublic"):e.reason==="sales_not_open"?(0,fe.t)("season.accessSalesNotOpen"):e.reason==="origin_not_allowed"?(0,fe.t)("season.accessOriginNotAllowed"):(0,fe.t)("season.accessUnavailable");w(this,y,ye).call(this,{kind:"failed",message:t})},xu=async function(e){if(!h(this,ki)){x(this,ki,!0);try{let t=w(this,y,jr).call(this),i=w(this,y,ha).call(this),o=w(this,y,ua).call(this,i);if(o==null){w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.checkoutNotPriced"),operationId:e.operationId});return}await w(this,y,ma).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,fe.fromMinorUnits)(o,t),labels:i.map(r=>r.label),lines:w(this,y,gu).call(this,i,t)}})}finally{x(this,ki,!1)}}},ku=function(){let e=h(this,O).returnUrl;if(h(this,Zi)||!e||!h(this,me))return;x(this,Zi,!0);let t=h(this,Yt)==="hosted"?Ty(e,h(this,me).mode):"is not used: this picker takes no payment and hands the held seats to onContinue";t&&console.warn(`seatlayer: SeasonPicker returnUrl ${t}.`)},Su=function(){if(h(this,Yt)!=="hosted")return;let e=ii(h(this,O).season);e?.outcome!=="success"||!e.orderId||w(this,y,ma).call(this,{kind:"resume",orderId:e.orderId})},ma=async function(e){let t;try{({mountCheckout:t}=await Nn())}catch(a){h(this,O).onError?.(a),w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.checkoutCouldNotBeOpened")});return}let i=h(this,ue)?.root;if(h(this,Ee)||!i)return;w(this,y,Kr).call(this);let o=h(this,me)?.buyer,r=h(this,O).buyerEmail||o?.email||void 0,s=h(this,O).buyerName||o?.name||void 0;x(this,Xt,t({root:i,state:e,eventKey:h(this,O).season,formatMoney:(a,l)=>(0,fe.formatMoney)(a,l,{locale:h(this,O).locale,fallback:(c,d)=>`${c} ${d}`,...Number.isInteger(a)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:a=>h(this,Re).checkout({operationId:a.holdId,buyerEmail:a.buyerEmail,...a.buyerName?{buyerName:a.buyerName}:{},...h(this,O).returnUrl?{returnUrl:h(this,O).returnUrl}:{}}),orderStatus:a=>h(this,Re).orderStatus(a),...r||s?{buyer:{email:r,name:s}}:{},onCancel:()=>{x(this,Xt,null),w(this,y,Wi).call(this)},onConfirmed:a=>{h(this,O).onOrderConfirmed?.(a),w(this,y,ye).call(this,{kind:"booked",message:(0,fe.t)("season.orderConfirmed")})},onError:a=>h(this,O).onError?.(a)})),w(this,y,Wi).call(this)},Kr=function(){h(this,Xt)?.destroy(),x(this,Xt,null),w(this,y,Wi).call(this)},Tu=function(){let e=document.createElement("div");return e.className="sl-season-strip",x(this,bi,e),w(this,y,Wi).call(this),e},Wi=function(){let e=h(this,bi),t=h(this,me);!e||!t||e.replaceChildren(...su({step:h(this,Xt)?"pay":"seats",pkg:h(this,Wt)?.packages.find(i=>i.planActivationId===t.planActivationId)??null,dates:Ct(t),money:i=>w(this,y,gi).call(this,i),change:()=>w(this,y,Eu).call(this)}))},Eu=function(){let e=h(this,pe);if(!e){w(this,y,fa).call(this);return}if(!h(this,Pt))return;let t=e.seats?.map(o=>o.label)??h(this,nt),i=h(this,ue)?.seatPlaces(t)??t.map(o=>({label:o}));du(h(this,Pt),cu(i),{keep:()=>{},change:()=>{this.release(`sra_${crypto.randomUUID()}`).then(()=>w(this,y,fa).call(this),o=>w(this,y,Je).call(this,o))}},w(this,y,Gr).call(this))},Gr=function(){return bt(h(this,vi)??void 0,h(this,O).theme,void 0,h(this,me)?.orgAccent)},fa=function(){h(this,Ee)||(w(this,y,Kr).call(this),h(this,ue)?.destroy(),x(this,ue,null),x(this,bi,null),x(this,nt,[]),h(this,Cn).clear(),w(this,y,yn).call(this))},ye=function(e,t=!1){h(this,Ut)&&(h(this,Ut).textContent=e.message,h(this,Ut).dataset.kind=e.kind),h(this,Pt)&&(h(this,Pt).dataset.busy=String(t)),h(this,O).onStatusChange?.(e)},Je=function(e,t){if(h(this,Ee)||e instanceof q&&e.code==="season_api_destroyed")return e;let i=e instanceof we&&e.reason==="provider_failed"&&h(this,xi)?new we(h(this,xi)):e;return i instanceof we?(h(this,O).onError?.(i),i):(w(this,y,ye).call(this,{kind:"failed",message:Nr(i),operationId:t}),h(this,O).onError?.(i),i)},Cu=function(e){h(this,Ee)||(e instanceof we||w(this,y,ye).call(this,{kind:"failed",message:(0,fe.t)("season.sessionEnded")}),h(this,O).onError?.(e))},Yi=function(){if(h(this,Ee))throw new Error("seatlayer: SeasonPicker was destroyed")},vn=function(){if(w(this,y,Yi).call(this),!h(this,me)||!h(this,ue))throw new Error("seatlayer: render SeasonPicker before using it")};var Ur=ga;function hu(n){return n===1?"1 date":`all ${n} dates`}function Au(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,o=null,r=null,s=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,o=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),n.style.width="100vw",n.style.height="100vh",n.style.width="100dvw",n.style.height="100dvh";let u=document.documentElement;r=u.style.overflow,u.style.overflow="hidden",document.body&&(s=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{i&&(i=!1,o===null?n.removeAttribute("style"):n.setAttribute("style",o),o=null,a&&(n.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),s!==null&&document.body&&(document.body.style.overflow=s,s=null),l&&(window.removeEventListener("keydown",l),l=null))},m=u=>{if(u.source!==n.contentWindow||t&&u.origin!==t||!u.data||typeof u.data!="object")return;let f=u.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(a=`${Math.round(f.px)}px`,i||(n.style.height=a));return}f.type==="seatlayer:fullscreen"&&(typeof f.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(f.background)&&(c=f.background,i&&(n.style.background=c)),f.on===!0?d():f.on===!1&&p())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),p()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,prewarmSeatPicker,shortOperationReference,ticketOfferPrices});