@seatlayer/js 0.59.0 → 0.61.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 ai=Object.create;var Me=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var di=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var pt=r=>{throw TypeError(r)};var hi=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(i){throw t=[i],i}};var ht=(r,e)=>{for(var t in e)Me(r,t,{get:e[t],enumerable:!0})},ut=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ci(e))!pi.call(r,s)&&s!==t&&Me(r,s,{get:()=>e[s],enumerable:!(i=li(e,s))||i.enumerable});return r};var mt=(r,e,t)=>(t=r!=null?ai(di(r)):{},ut(e||!r||!r.__esModule?Me(t,"default",{value:r,enumerable:!0}):t,r)),ui=r=>ut(Me({},"__esModule",{value:!0}),r);var qe=(r,e,t)=>e.has(r)||pt("Cannot "+t);var O=(r,e,t)=>(qe(r,e,"read from private field"),t?t.call(r):e.get(r)),j=(r,e,t)=>e.has(r)?pt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,i)=>(qe(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),N=(r,e,t)=>(qe(r,e,"access private method"),t);var Ot={};ht(Ot,{errorCopy:()=>et,mountCheckout:()=>Ji,unavailableCopy:()=>Rt});function Qi(){if(typeof document>"u"||document.getElementById(Ht))return;let r=document.createElement("style");r.id=Ht,r.textContent=Xi,document.head.appendChild(r)}function Rt(r,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return r==="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."}:r==="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 \u2014 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 et(r){switch(r){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 \u2014 please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged \u2014 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 updates their SeatLayer balance. Nothing was charged \u2014 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 \u2014 please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";default:return"We could not start the payment. Nothing was charged \u2014 please try again."}}function Zi(){let r=window.Razorpay;return r?Promise.resolve(r):new Promise((e,t)=>{let i=document.querySelector(`script[src="${Mt}"]`),s=i??document.createElement("script"),n=()=>{let o=window.Razorpay;o?e(o):t(new Error("razorpay_unavailable"))};s.addEventListener("load",n,{once:!0}),s.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!i&&(s.src=Mt,s.async=!0,document.head.appendChild(s))})}function P(r,e,t){let i=document.createElement(r);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function Ji(r){Qi();let e=!0,t=!1,i=P("div","sl-hco");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let s=P("div","sl-hco-card");i.appendChild(s);let n=()=>{e=!1,i.remove(),document.removeEventListener("keydown",a,!0)},o=()=>{n(),r.onCancel()};function a(T){T.key!=="Escape"||!i.isConnected||(T.stopPropagation(),T.preventDefault(),o())}document.addEventListener("keydown",a,!0);let l=P("h2","sl-hco-title","Checkout"),c=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=c,i.setAttribute("aria-labelledby",c);let h=(...T)=>{s.replaceChildren(l,...T)},p=T=>{if(!e)return;let $=P("p","sl-hco-status sl-hco-error",T);$.setAttribute("role","alert");let R=P("button","sl-hco-back","Back to seats");R.type="button",R.addEventListener("click",o),h($,R)},d=T=>{if(!e)return;let $=P("p","sl-hco-status",T);$.setAttribute("role","status"),h($)},f=async T=>{d("Payment received \u2014 confirming your seats\u2026");let $=Date.now()+9e4;for(;e&&Date.now()<$;){try{let R=await r.orderStatus(T);if(!e)return;if(R.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let ge=P("p","sl-hco-status",`${R.seatCount} ${R.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Le=P("dl","sl-hco-receipt"),dt=(R.tickets??[]).map(re=>re.label);dt.length&&Le.append(P("dt",void 0,"Seats"),P("dd",void 0,dt.join(", "))),Le.append(P("dt",void 0,"Paid"),P("dd",void 0,`${R.amountFormatted} ${R.currency}`),P("dt",void 0,"Order"),P("dd","sl-hco-ref",R.orderId));let Pe=P("button","sl-hco-back","Close");if(Pe.type="button",Pe.addEventListener("click",o),R.ticketUrl){let re=P("a","sl-hco-tickets","View tickets & QR codes");re.href=R.ticketUrl,re.target="_blank",re.rel="noreferrer",h(ge,Le,re,Pe)}else h(ge,Le,Pe);r.onConfirmed(R);return}if(R.status==="failed"||R.status==="expired"){p(R.status==="expired"?"Your seats were released before payment completed. Nothing was charged \u2014 please pick again.":"The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(R=>setTimeout(R,2e3))}!e||t||p("Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly \u2014 you do not need to pay again.")};if(r.state.kind==="unavailable"){let T=Rt(r.state.reason,r.state.seatCount);l.textContent=T.title;let $=P("p","sl-hco-label","Seats held"),R=P("button","sl-hco-back","Back to seat map");return R.type="button",R.addEventListener("click",o),s.replaceChildren($,l,P("p","sl-hco-status",T.body),P("p","sl-hco-note",T.detail),R),r.root.appendChild(i),R.focus(),{destroy:n}}if(r.state.kind==="resume")return r.root.appendChild(i),f(r.state.orderId),{destroy:n};let{order:m,provider:g}=r.state,w=P("div","sl-hco-summary"),k=P("div","sl-hco-seats");for(let T of m.labels)k.appendChild(P("span","sl-hco-seat",T));let x=r.formatMoney(m.total,m.currency),y=P("div","sl-hco-total");y.append(P("span",void 0,"Total"),P("strong",void 0,x)),w.append(k,y);let E=P("form","sl-hco-form"),u=P("label","sl-hco-label","Email \u2014 your tickets go here"),b=P("input","sl-hco-input");b.type="email",b.required=!0,b.autocomplete="email",b.placeholder="you@example.com",b.id=`${c}-email`,u.htmlFor=b.id;let C=P("label","sl-hco-label","Name (optional)"),A=P("input","sl-hco-input");A.type="text",A.autocomplete="name",A.placeholder="Your name",A.id=`${c}-name`,C.htmlFor=A.id;let H=P("button","sl-hco-pay",`Pay ${x}`);H.type="submit",H.disabled=!0;let L=P("button","sl-hco-back","Back to seats");L.type="button",L.addEventListener("click",o);let M=new Date(m.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),_=P("p","sl-hco-note",`Your seats are held until ${M}. Payment is handled by ${g==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),K=P("p","sl-hco-note");K.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let W=P("a",void 0,"Privacy Policy");W.href="https://seatlayer.io/privacy/",W.target="_blank",W.rel="noreferrer",K.appendChild(W);let se=()=>/.+@.+\..+/.test(b.value.trim());b.addEventListener("input",()=>{H.disabled=!se()});let fe=async()=>{d("Opening secure payment\u2026");try{let T=await r.startSession({holdId:m.holdId,buyerEmail:b.value.trim(),...A.value.trim()?{buyerName:A.value.trim()}:{}});if(!e)return;if(T.redirectUrl){d("Taking you to secure payment\u2026"),window.location.assign(T.redirectUrl);return}if(T.clientPayload){let $=T.clientPayload,R=await Zi();if(!e)return;d("Waiting for payment\u2026"),new R({key:$.key,order_id:$.orderId,amount:$.amount,currency:$.currency,name:$.name,prefill:$.prefill,handler:()=>{f(T.orderId)},modal:{ondismiss:()=>{e&&be()}}}).open();return}p(et("gateway_unavailable"))}catch(T){r.onError?.(T),p(et(T?.code))}};E.addEventListener("submit",T=>{T.preventDefault(),se()&&fe()}),E.append(u,b,C,A,K,H,L,_);let be=()=>{l.textContent="Checkout",h(w,E),H.disabled=!se()};return be(),r.root.appendChild(i),b.focus(),{destroy:n}}var Mt,Ht,Xi,It=hi(()=>{"use strict";Mt="https://checkout.razorpay.com/v1/checkout.js",Ht="seatlayer-checkout-style",Xi=`
1
+ "use strict";var Di=Object.create;var Fe=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var _i=Object.getOwnPropertyNames;var ji=Object.getPrototypeOf,Ni=Object.prototype.hasOwnProperty;var St=r=>{throw TypeError(r)};var Vi=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(i){throw t=[i],i}};var Tt=(r,e)=>{for(var t in e)Fe(r,t,{get:e[t],enumerable:!0})},Et=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of _i(e))!Ni.call(r,s)&&s!==t&&Fe(r,s,{get:()=>e[s],enumerable:!(i=Fi(e,s))||i.enumerable});return r};var Ct=(r,e,t)=>(t=r!=null?Di(ji(r)):{},Et(e||!r||!r.__esModule?Fe(t,"default",{value:r,enumerable:!0}):t,r)),qi=r=>Et(Fe({},"__esModule",{value:!0}),r);var et=(r,e,t)=>e.has(r)||St("Cannot "+t);var O=(r,e,t)=>(et(r,e,"read from private field"),t?t.call(r):e.get(r)),q=(r,e,t)=>e.has(r)?St("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),z=(r,e,t,i)=>(et(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),K=(r,e,t)=>(et(r,e,"access private method"),t);var oi={};Tt(oi,{errorCopy:()=>ut,mountCheckout:()=>$s,unavailableCopy:()=>ai});function Os(){if(typeof document>"u"||document.getElementById(ni))return;let r=document.createElement("style");r.id=ni,r.textContent=Rs,document.head.appendChild(r)}function ai(r,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return r==="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."}:r==="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 \u2014 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 ut(r){switch(r){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 \u2014 please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged \u2014 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 updates their SeatLayer balance. Nothing was charged \u2014 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 \u2014 please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";default:return"We could not start the payment. Nothing was charged \u2014 please try again."}}function Is(){let r=window.Razorpay;return r?Promise.resolve(r):new Promise((e,t)=>{let i=document.querySelector(`script[src="${ri}"]`),s=i??document.createElement("script"),n=()=>{let a=window.Razorpay;a?e(a):t(new Error("razorpay_unavailable"))};s.addEventListener("load",n,{once:!0}),s.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!i&&(s.src=ri,s.async=!0,document.head.appendChild(s))})}function P(r,e,t){let i=document.createElement(r);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function $s(r){Os();let e=!0,t=!1,i=P("div","sl-hco");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let s=P("div","sl-hco-card");i.appendChild(s);let n=()=>{e=!1,i.remove(),document.removeEventListener("keydown",o,!0)},a=()=>{n(),r.onCancel()};function o(C){C.key!=="Escape"||!i.isConnected||(C.stopPropagation(),C.preventDefault(),a())}document.addEventListener("keydown",o,!0);let l=P("h2","sl-hco-title","Checkout"),c=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=c,i.setAttribute("aria-labelledby",c);let h=(...C)=>{s.replaceChildren(l,...C)},p=C=>{if(!e)return;let D=P("p","sl-hco-status sl-hco-error",C);D.setAttribute("role","alert");let R=P("button","sl-hco-back","Back to seats");R.type="button",R.addEventListener("click",a),h(D,R)},d=C=>{if(!e)return;let D=P("p","sl-hco-status",C);D.setAttribute("role","status"),h(D)},f=async C=>{d("Payment received \u2014 confirming your seats\u2026");let D=Date.now()+9e4;for(;e&&Date.now()<D;){try{let R=await r.orderStatus(C);if(!e)return;if(R.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let Te=P("p","sl-hco-status",`${R.seatCount} ${R.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Be=P("dl","sl-hco-receipt"),kt=(R.tickets??[]).map(le=>le.label);kt.length&&Be.append(P("dt",void 0,"Seats"),P("dd",void 0,kt.join(", "))),Be.append(P("dt",void 0,"Paid"),P("dd",void 0,`${R.amountFormatted} ${R.currency}`),P("dt",void 0,"Order"),P("dd","sl-hco-ref",R.orderId));let De=P("button","sl-hco-back","Close");if(De.type="button",De.addEventListener("click",a),R.ticketUrl){let le=P("a","sl-hco-tickets","View tickets & QR codes");le.href=R.ticketUrl,le.target="_blank",le.rel="noreferrer",h(Te,Be,le,De)}else h(Te,Be,De);r.onConfirmed(R);return}if(R.status==="failed"||R.status==="expired"){p(R.status==="expired"?"Your seats were released before payment completed. Nothing was charged \u2014 please pick again.":"The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(R=>setTimeout(R,2e3))}!e||t||p("Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly \u2014 you do not need to pay again.")};if(r.state.kind==="unavailable"){let C=ai(r.state.reason,r.state.seatCount);l.textContent=C.title;let D=P("p","sl-hco-label","Seats held"),R=P("button","sl-hco-back","Back to seat map");return R.type="button",R.addEventListener("click",a),s.replaceChildren(D,l,P("p","sl-hco-status",C.body),P("p","sl-hco-note",C.detail),R),r.root.appendChild(i),R.focus(),{destroy:n}}if(r.state.kind==="resume")return r.root.appendChild(i),f(r.state.orderId),{destroy:n};let{order:m,provider:g}=r.state,S=P("div","sl-hco-summary"),k=P("div","sl-hco-seats");for(let C of m.labels)k.appendChild(P("span","sl-hco-seat",C));let w=r.formatMoney(m.total,m.currency),y=P("div","sl-hco-total");y.append(P("span",void 0,"Total"),P("strong",void 0,w)),S.append(k,y);let E=P("form","sl-hco-form"),u=P("label","sl-hco-label","Email \u2014 your tickets go here"),v=P("input","sl-hco-input");v.type="email",v.required=!0,v.autocomplete="email",v.placeholder="you@example.com",v.id=`${c}-email`,u.htmlFor=v.id;let x=P("label","sl-hco-label","Name (optional)"),A=P("input","sl-hco-input");A.type="text",A.autocomplete="name",A.placeholder="Your name",A.id=`${c}-name`,x.htmlFor=A.id;let L=P("button","sl-hco-pay",`Pay ${w}`);L.type="submit",L.disabled=!0;let $=P("button","sl-hco-back","Back to seats");$.type="button",$.addEventListener("click",a);let H=new Date(m.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),B=P("p","sl-hco-note",`Your seats are held until ${H}. Payment is handled by ${g==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),G=P("p","sl-hco-note");G.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let V=P("a",void 0,"Privacy Policy");V.href="https://seatlayer.io/privacy/",V.target="_blank",V.rel="noreferrer",G.appendChild(V);let oe=()=>/.+@.+\..+/.test(v.value.trim());v.addEventListener("input",()=>{L.disabled=!oe()});let ke=async()=>{d("Opening secure payment\u2026");try{let C=await r.startSession({holdId:m.holdId,buyerEmail:v.value.trim(),...A.value.trim()?{buyerName:A.value.trim()}:{}});if(!e)return;if(C.redirectUrl){d("Taking you to secure payment\u2026"),window.location.assign(C.redirectUrl);return}if(C.clientPayload){let D=C.clientPayload,R=await Is();if(!e)return;d("Waiting for payment\u2026"),new R({key:D.key,order_id:D.orderId,amount:D.amount,currency:D.currency,name:D.name,prefill:D.prefill,handler:()=>{f(C.orderId)},modal:{ondismiss:()=>{e&&Se()}}}).open();return}p(ut("gateway_unavailable"))}catch(C){r.onError?.(C),p(ut(C?.code))}};E.addEventListener("submit",C=>{C.preventDefault(),oe()&&ke()}),E.append(u,v,x,A,G,L,$,B);let Se=()=>{l.textContent="Checkout",h(S,E),L.disabled=!oe()};return Se(),r.root.appendChild(i),v.focus(),{destroy:n}}var ri,ni,Rs,li=Vi(()=>{"use strict";ri="https://checkout.razorpay.com/v1/checkout.js",ni="seatlayer-checkout-style",Rs=`
2
2
  /* The card is centred, but max-height:100% lets a long form reach the bottom
3
3
  edge \u2014 and on the hosted buyer page that edge is the phone's edge, with the
4
4
  Pay button last in the scroll. Reserve the home-indicator gutter here too.
@@ -38,7 +38,7 @@
38
38
  .sl-hco-tickets{display:block;width:100%;margin-top:14px;padding:12px;font:inherit;font-size:15px;
39
39
  font-weight:650;text-align:center;text-decoration:none;color:var(--sl-accent-ink);
40
40
  background:var(--sl-accent);border-radius:calc(var(--sl-radius) * .55)}
41
- `});var ls={};ht(ls,{ApiError:()=>J,BuyerAccessContext:()=>ve,BuyerAccessUnavailableError:()=>de,BuyerRealtimeClient:()=>q,EmbeddedDesigner:()=>Ie,SEATING_CHART_CALLBACK_PROPS:()=>Xe,SEATING_CHART_HANDLE_METHODS:()=>We,SEATING_CHART_IDENTITY_PROPS:()=>Ge,SEATING_CHART_VALUE_PROPS:()=>Ye,SeatPicker:()=>Ue,SeatingChart:()=>Oe,attachPickerFrame:()=>oi,bindSeatingChartHandle:()=>yt,buildSeatingChartOptions:()=>xt,createBuyerAccessContext:()=>pe,createControllerSink:()=>ne,parseTicketOfferAvailability:()=>ze,ticketOfferPrices:()=>Be});module.exports=ui(ls);var F=require("@seatlayer/core");var Z="seatlayer.v1";function mi(r){let e=typeof r.default=="string"?r.default:"free",t={};if(r.seats&&typeof r.seats=="object")for(let[i,s]of Object.entries(r.seats))typeof s=="string"&&s!==e&&(t[i]=s);return{default:e,exceptions:t}}function fi(r,e){if(!r||r.default!==e.default)return null;let t=[];for(let[i,s]of Object.entries(e.exceptions))r.exceptions[i]!==s&&t.push({label:i,status:s});for(let i of Object.keys(r.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function bi(r,e){for(let t of e)t.status===r.default?delete r.exceptions[t.label]:r.exceptions[t.label]=t.status}function ft(r){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var q=class{constructor(e){this.ws=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.opts=e,ft(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();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.start()}async connect(){if(this.stopped)return;let e=[Z];if(this.opts.mintTicket){let n;try{n=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;n?.protocols?.length?(e=[...n.protocols],e.includes(Z)||e.unshift(Z)):n?.ticket&&(e=[Z,`tkt.${n.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;ft(i);let s;try{s=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=s,s.onopen=()=>{this.ws===s&&(this.attempt=0,this.v1=s.protocol===Z,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.opts.sink.resync())},s.onmessage=n=>{if(this.ws!==s)return;let o;try{o=JSON.parse(typeof n.data=="string"?n.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},s.onclose=n=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),n?.code===4401){this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.close()}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(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],s=Array.isArray(e.closed)?e.closed:[],n=i.join("\0"),o=s.join("\0");(n!==this.hidden||o!==this.closedSections)&&(this.hidden=n,this.closedSections=o,this.opts.sink.onSections?.(i,s))}if(t!=="hidden"){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=mi(e),s=fi(this.projection,i);this.projection=i,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.status}));if(!i.length)return;this.projection&&bi(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.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}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{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}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 gi(r){return r==="blocked"?"not_for_sale":r==="held"||r==="booked"||r==="free"||r==="not_for_sale"?r:"free"}function ne(r,e={}){let t=i=>{let s=r.tableSelection(i);if(s)return s.physicalSeatIds;let n=r.idForLabel(i);return n?[n]:[]};return{applyStatuses(i){let s=r.currentHold()?.labels??[],n={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(r.getSelection().map(c=>[c.label,c.id]));for(let c of i){let h=t(c.label);if(!h.length)continue;let p=gi(c.status);if(n[p].push(...h),e.flashOnLiveChange&&p!=="free"&&!s.includes(c.label)&&h.some(d=>r.getStatus(d)==="free")){let d=p==="held"?"#f4b740":"#f43f5e";for(let f of h)o.push({id:f,color:d})}p!=="free"&&!s.includes(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])n[c].length&&r.setStatus(n[c],c);for(let c of o)r.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&r.deselect(c);let h=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,h?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await r.refresh()},onSections(i,s){r.refresh(),e.onSections?.(i,s)}}}var J=class extends Error{constructor(e,t,i,s,n,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=s,this.reason=n,this.retryAfterS=o}},bt=10,gt=1;function vt(r,e){let t=(r??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var vi={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},oe=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let s=t.method??"GET",n={},o;t.body!==void 0&&(n["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");a&&(n.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:s,headers:n,body:o,credentials:"omit"}),h=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let p=h,d=p?.code??p?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,d)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let m=d?vi[d]:void 0,g=p?.conflicts?.map(w=>w.label)??t.labels??[];m&&this.onObjectUnavailable?.({labels:g,reason:m,code:d})}let f;if(l.status===429&&(f=vt(l.headers.get("Retry-After"),p?.retryAfterSeconds)??gt,s==="GET"&&!i.rateLimit&&f<=bt))return await new Promise(m=>setTimeout(m,f*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new J(l.status,p?.error??`request_failed_${l.status}`,d,p?.conflicts,p?.reason,f)}return h}async requestBlob(e,t={}){let i={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(i.Authorization=s);let n=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(n.ok)return n.blob();let a=(n.headers.get("content-type")??"").includes("application/json")?await n.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(n.status===401||n.status===403||n.status===422)&&await this.access.handleFailure(n.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(n.status===429&&(c=vt(n.headers.get("Retry-After"),a?.retryAfterSeconds)??gt,!t.rateLimit&&c<=bt))return await new Promise(h=>setTimeout(h,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new J(n.status,a?.error??`request_failed_${n.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new J(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,s){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{}},labels:t.map(n=>n.label)})}bestAvailable(e,t,i,s,n){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...n?{ttlMs:n}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}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${t?"?live=1":""}`)}startCheckout(e,t){return 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}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Z]}createRealtime(e,t){return this.accessScoped?null:new q({url:this.subscribeUrl(e),sink:t})}};var de=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}},yi=new Set(["buyer_access_expired"]),xi=new Set(["paused","provider_failed","channel_denied"]);function wi(r,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_mode_mismatch":return"mode_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return r===401?"invalid":null}function ki(r,e){return r===401&&!!e&&yi.has(e)}var Si=3e4,z,B,le,ye,X,G,ce,xe,we,ke,D,Ke,He,ae,ve=class{constructor(e){j(this,D);j(this,z,null);j(this,B,0);j(this,le);j(this,ye);j(this,X,null);j(this,G,null);j(this,ce,null);j(this,xe);j(this,we);j(this,ke,!1);if(I(this,le,e.provider),I(this,ye,e.skewMs??Si),I(this,xe,e.onExpired),I(this,we,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;N(this,D,Ke).call(this,t)}I(this,ke,!!O(this,le)||!!O(this,z))}get configured(){return O(this,ke)}get unavailable(){return O(this,G)}get hasToken(){return!!O(this,z)&&(O(this,B)===0||O(this,B)>Date.now())}get expiresAt(){return O(this,B)}async authorization(e="initial"){if(!this.configured)return null;if(O(this,G))throw new de(O(this,G));let t=Date.now();if(!O(this,z)||O(this,B)>0&&O(this,B)-O(this,ye)<=t){let s=!!O(this,z)&&O(this,B)>0&&O(this,B)<=t,n=O(this,z)?s?"expired":"expiring":e,o=await N(this,D,He).call(this,n);if(!o)throw new de(O(this,G)??O(this,ce)??N(this,D,ae).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${O(this,z)}`}async handleFailure(e,t){var s;if(!this.configured)return!1;if(ki(e,t)){I(this,z,null),I(this,B,0);let n=await N(this,D,He).call(this,"unauthorized",t);return(s=O(this,xe))==null||s.call(this,{reason:"unauthorized",code:t,refreshed:!!n}),!!n}let i=wi(e,t);return i&&N(this,D,ae).call(this,i,t,e),!1}async refresh(e="manual"){return I(this,G,null),I(this,ce,null),I(this,z,null),I(this,B,0),!!await N(this,D,He).call(this,e)}clear(){I(this,z,null),I(this,B,0),I(this,X,null)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};z=new WeakMap,B=new WeakMap,le=new WeakMap,ye=new WeakMap,X=new WeakMap,G=new WeakMap,ce=new WeakMap,xe=new WeakMap,we=new WeakMap,ke=new WeakMap,D=new WeakSet,Ke=function(e){return!e||typeof e.token!="string"||!e.token?null:(I(this,z,e.token),I(this,B,typeof e.expiresAt=="number"?e.expiresAt:0),O(this,z))},He=function(e,t){if(O(this,X))return O(this,X);let i=O(this,le);if(!i)return N(this,D,ae).call(this,"no_token",t),Promise.resolve(null);let s=(async()=>{try{let n=await i({reason:e}),o=N(this,D,Ke).call(this,n);return o||(N(this,D,ae).call(this,"provider_failed",t),null)}catch{return N(this,D,ae).call(this,"provider_failed",t),null}finally{I(this,X,null)}})();return I(this,X,s),s},ae=function(e,t,i){var n;let s={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return I(this,ce,s),xi.has(e)||(I(this,G,s),I(this,z,null),I(this,B,0)),(n=O(this,we))==null||n.call(this,s),s};function pe(r,e={}){return!r.buyerAccessTokenProvider&&!r.buyerAccessToken?null:new ve({provider:r.buyerAccessTokenProvider,token:r.buyerAccessToken,...e})}var Re='<svg viewBox="0 0 64 56" width="12" height="11" fill="none" aria-hidden="true" focusable="false" style="display:block"><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740"/><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740" transform="translate(64 0) scale(-1 1)"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/></svg>';var Ci="https://api.seatlayer.io",Ti=10;function Ei(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}var Oe=class{constructor(e){this.mount=null;this.hostEl=null;this.rendered=!1;this.mode_=null;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.realtime=null;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.publicKey=e.publicKey,this.access=pe(e,{onExpired:i=>this.opts.onAccessExpired?.(i),onUnavailable:i=>this.opts.onAccessUnavailable?.(i)});let t=new oe((e.apiBase??Ci).replace(/\/+$/,""),{access:this.access??void 0,onObjectUnavailable:i=>this.opts.onSelectedObjectUnavailable?.(i)});this.api=t,this.controller=new F.PickerController({transport:t,eventKey:e.event,maxSelection:e.maxSelection??Ti,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:i=>this.opts.onSelectionChange?.(i),onSelectionValidityChange:i=>this.opts.onSelectionValidityChange?.(i),onSelectionValid:i=>this.opts.onSelectionValid?.(i),onSelectionInvalid:i=>this.opts.onSelectionInvalid?.(i),onSelectionLimit:i=>this.opts.onSelectionLimit?.(i),onHold:i=>this.opts.onHold?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldRestored:i=>this.opts.onHoldRestored?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:i=>{let s=this.controller.getGAAreas().find(n=>n.id===i);s&&this.opts.onGAClick?.(s)},onError:i=>this.opts.onError?.(i),onDeckTap:i=>this.opts.onDeckTap?.(i),onHint:i=>this.opts.onHint?.(i),flashOnLiveChange:!0,onSeatHover:i=>{this.opts.onSeatHover?.(i),this.opts.seatTooltip!==!1&&this.updateTooltip(i)},colorblindSafe:e.colorblindSafe})}async render(){if(this.rendered)return this;this.rendered=!0,await(0,F.loadLocale)(this.opts.locale),this.opts.messages&&(0,F.setStringOverrides)(this.opts.messages),this.mount=Ei(this.opts.container);let e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="relative",this.mount.appendChild(e),this.hostEl=e;let t=await this.controller.render(e);if(!t)return this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(e),this;if(this.controller.setViewMode(this.opts.initialView??"flat"),this.startRealtime(),this.mode_=t.mode==="test"?"test":"live",this.opts.seatTooltip!==!1){let i=document.createElement("div");i.setAttribute("role","tooltip"),i.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);',e.appendChild(i),this.tipEl=i,this.onTipMove=s=>{let n=e.getBoundingClientRect();this.tipPos={x:s.clientX-n.left,y:s.clientY-n.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},e.addEventListener("mousemove",this.onTipMove)}if(t.mode==="test"){e.style.overflow="hidden";let i=document.createElement("div");i.textContent=(0,F.t)("picker.testMode"),i.setAttribute("aria-label",(0,F.t)("picker.testMode")),i.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;",e.appendChild(i)}return this.buildBadge(e),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,F.t)("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);',t.innerHTML='<span aria-hidden="true" style="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee">'+Re+`</span><span>${(0,F.t)("picker.poweredBy")}</span>`,e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,n=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),n<8&&(n=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,n)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,F.formatMoney)(e.price,e.currency,{locale:this.opts.locale,fallback:(s,n)=>`${s} ${n}`}),i=e.status==="free"?"":`<div style="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700">${e.status==="held"?(0,F.t)("map.statusHeld"):(0,F.t)("map.statusTaken")}</div>`;this.tipEl.innerHTML=`<div style="font-weight:700;font-size:13px">${e.label}</div><div style="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc"><span style="width:9px;height:9px;border-radius:50%;flex:none;background:${e.categoryColor}"></span><span>${e.categoryLabel}</span><span style="margin-left:auto;font-weight:700;color:#fff">${t}</span></div>`+i,this.tipEl.style.display="block",this.placeTooltip()}getMode(){return this.mode_}getSelection(){return this.controller.getSelection()}selectObjects(e){return this.controller.select(e)}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.controller.clearSelection()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.controller.setMaxSelection(e)}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 s=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(s?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:s?"selection_count_mismatch":"selection_invalid",selection:t})}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}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}}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(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,i={}){let s=await this.controller.holdGA(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,i={}){let s=await this.controller.bestAvailable(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}this.controller.setFloor(e)}setColorblindSafe(e){this.controller.setColorblindSafe(e)}setViewMode(e){this.controller.setViewMode(e)}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.controller.zoomIn()}zoomOut(){this.controller.zoomOut()}zoomToFit(){this.controller.zoomToFit()}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new q({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:ne(this.controller,{flashOnLiveChange:!0,onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),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="The seat map didn\u2019t load.",t.appendChild(i);let s=document.createElement("button");s.type="button",s.textContent="Try again",s.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;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(n=>this.opts.onError?.(n))}),t.appendChild(s),e.appendChild(t)}destroy(){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.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}};var We=["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"],Ai={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 yt(r){let e={};for(let t of We)e[t]=(...i)=>{let s=r();return s?s[t](...i):Ai[t]()};return e}var Ge=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Ye=[...Ge,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Xe=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function xt(r,e,t){let i={container:r};for(let s of Ye)i[s]=e[s];for(let s of Xe)i[s]=t[s];return i}var Li=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Pi=2e4,Mi=480,Hi=180*1e3,Ri=900*1e3,Oi=.8,Ii=30*1e3,$i=1e5,zi=4,Bi=50;function Qe(r){if(typeof r!="string")return r;let e=document.querySelector(r);if(!e)throw new Error(`EmbeddedDesigner container not found: ${r}`);return e}function Di(r){let e=(r??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Fi={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."}},Ie=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.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"||!Li.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},s=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",n=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(s||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(s||i.workspaceId!==void 0);if(n||o){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=Di(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=Qe(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 s=this.options.loadingTimeoutMs??Pi;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}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,s=t.style.getPropertyValue("height"),n=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${$i}px`,"important");let a=i();return s?t.style.setProperty("height",s,n):t.style.removeProperty("height"),!(a-o>zi)&&o>=Bi?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??Mi;if(this.fillMode==="container"&&this.containerEl){let s=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));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,s]of Object.entries(e))this.frame.style.setProperty(i,s,"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<Ri?t*Oi:t-Hi,s=Math.max(Ii,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Qe(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=Qe(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 s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(s):this.buildErrorCard(s,i??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
41
+ `});var Vs={};Tt(Vs,{ApiError:()=>re,BuyerAccessContext:()=>Ee,BuyerAccessUnavailableError:()=>me,BuyerRealtimeClient:()=>Y,EmbeddedDesigner:()=>qe,SEATING_CHART_CALLBACK_PROPS:()=>lt,SEATING_CHART_HANDLE_METHODS:()=>nt,SEATING_CHART_IDENTITY_PROPS:()=>at,SEATING_CHART_VALUE_PROPS:()=>ot,SeatPicker:()=>Je,SeatingChart:()=>Ve,attachPickerFrame:()=>Bi,bindSeatingChartHandle:()=>qt,buildSeatingChartOptions:()=>Ut,createBuyerAccessContext:()=>fe,createControllerSink:()=>ce,parseTicketOfferAvailability:()=>Ge,ticketOfferPrices:()=>Ke});module.exports=qi(Vs);var M=require("@seatlayer/core");var se="seatlayer.v1";function Ui(r){let e=typeof r.default=="string"?r.default:"free",t={};if(r.seats&&typeof r.seats=="object")for(let[i,s]of Object.entries(r.seats))typeof s=="string"&&s!==e&&(t[i]=s);return{default:e,exceptions:t}}function Gi(r,e){if(!r||r.default!==e.default)return null;let t=[];for(let[i,s]of Object.entries(e.exceptions))r.exceptions[i]!==s&&t.push({label:i,status:s});for(let i of Object.keys(r.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Ki(r,e){for(let t of e)t.status===r.default?delete r.exceptions[t.label]:r.exceptions[t.label]=t.status}function At(r){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Y=class{constructor(e){this.ws=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.opts=e,At(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();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.start()}async connect(){if(this.stopped)return;let e=[se];if(this.opts.mintTicket){let n;try{n=await this.opts.mintTicket()}catch(a){this.reportIfAccessError(a),this.scheduleReconnect();return}if(this.stopped)return;n?.protocols?.length?(e=[...n.protocols],e.includes(se)||e.unshift(se)):n?.ticket&&(e=[se,`tkt.${n.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;At(i);let s;try{s=(this.opts.socketFactory??((a,o)=>new WebSocket(a,o)))(i,e)}catch{this.scheduleReconnect();return}this.ws=s,s.onopen=()=>{this.ws===s&&(this.attempt=0,this.v1=s.protocol===se,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.opts.sink.resync())},s.onmessage=n=>{if(this.ws!==s)return;let a;try{a=JSON.parse(typeof n.data=="string"?n.data:"")}catch{return}!a||typeof a!="object"||this.handleFrame(a)},s.onclose=n=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),n?.code===4401){this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.close()}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(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],s=Array.isArray(e.closed)?e.closed:[],n=i.join("\0"),a=s.join("\0");(n!==this.hidden||a!==this.closedSections)&&(this.hidden=n,this.closedSections=a,this.opts.sink.onSections?.(i,s))}if(t!=="hidden"){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=Ui(e),s=Gi(this.projection,i);this.projection=i,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.status}));if(!i.length)return;this.projection&&Ki(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.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}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{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}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 Wi(r){return r==="blocked"?"not_for_sale":r==="held"||r==="booked"||r==="free"||r==="not_for_sale"?r:"free"}function ce(r,e={}){let t=i=>{let s=r.tableSelection(i);if(s)return s.physicalSeatIds;let n=r.idForLabel(i);return n?[n]:[]};return{applyStatuses(i){let s=r.currentHold()?.labels??[],n={free:[],held:[],booked:[],not_for_sale:[]},a=[],o=[],l=new Map(r.getSelection().map(c=>[c.label,c.id]));for(let c of i){let h=t(c.label);if(!h.length)continue;let p=Wi(c.status);if(n[p].push(...h),e.flashOnLiveChange&&p!=="free"&&!s.includes(c.label)&&h.some(d=>r.getStatus(d)==="free")){let d=p==="held"?"#f4b740":"#f43f5e";for(let f of h)a.push({id:f,color:d})}p!=="free"&&!s.includes(c.label)&&l.has(c.label)&&o.push(c.label)}for(let c of["free","held","booked","not_for_sale"])n[c].length&&r.setStatus(n[c],c);for(let c of a)r.flashSeat(c.id,c.color);if(o.length){let c=o.flatMap(p=>t(p));c.length&&r.deselect(c);let h=i.some(p=>p.status==="blocked"&&o.includes(p.label));e.onSelectedObjectUnavailable?.(o,h?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await r.refresh()},onSections(i,s){r.refresh(),e.onSections?.(i,s)}}}var re=class extends Error{constructor(e,t,i,s,n,a){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=s,this.reason=n,this.retryAfterS=a}},Lt=10,Pt=1;function Mt(r,e){let t=(r??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var Yi={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},de=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let s=t.method??"GET",n={},a;t.body!==void 0&&(n["Content-Type"]="application/json",a=JSON.stringify(t.body));let o=await this.access?.authorization(i.auth?"unauthorized":"initial");o&&(n.Authorization=o);let l=await fetch(`${this.base}${e}`,{method:s,headers:n,body:a,credentials:"omit"}),h=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let p=h,d=p?.code??p?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,d)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let m=d?Yi[d]:void 0,g=p?.conflicts?.map(S=>S.label)??t.labels??[];m&&this.onObjectUnavailable?.({labels:g,reason:m,code:d})}let f;if(l.status===429&&(f=Mt(l.headers.get("Retry-After"),p?.retryAfterSeconds)??Pt,s==="GET"&&!i.rateLimit&&f<=Lt))return await new Promise(m=>setTimeout(m,f*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new re(l.status,p?.error??`request_failed_${l.status}`,d,p?.conflicts,p?.reason,f)}return h}async requestBlob(e,t={}){let i={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(i.Authorization=s);let n=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(n.ok)return n.blob();let o=(n.headers.get("content-type")??"").includes("application/json")?await n.json().catch(()=>null):null,l=o?.code??o?.error;if(this.access?.configured&&(n.status===401||n.status===403||n.status===422)&&await this.access.handleFailure(n.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(n.status===429&&(c=Mt(n.headers.get("Retry-After"),o?.retryAfterSeconds)??Pt,!t.rateLimit&&c<=Lt))return await new Promise(h=>setTimeout(h,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new re(n.status,o?.error??`request_failed_${n.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}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"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,s){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{}},labels:t.map(n=>n.label)})}bestAvailable(e,t,i,s,n){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...n?{ttlMs:n}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}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${t?"?live=1":""}`)}startCheckout(e,t){return 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}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[se]}createRealtime(e,t){return this.accessScoped?null:new Y({url:this.subscribeUrl(e),sink:t})}};var me=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}},Qi=new Set(["buyer_access_expired"]),Xi=new Set(["paused","provider_failed","channel_denied"]);function Zi(r,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_mode_mismatch":return"mode_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return r===401?"invalid":null}function Ji(r,e){return r===401&&!!e&&Qi.has(e)}var es=3e4,_,j,he,Ce,ee,Q,ue,Ae,Le,Pe,N,tt,_e,pe,Ee=class{constructor(e){q(this,N);q(this,_,null);q(this,j,0);q(this,he);q(this,Ce);q(this,ee,null);q(this,Q,null);q(this,ue,null);q(this,Ae);q(this,Le);q(this,Pe,!1);if(z(this,he,e.provider),z(this,Ce,e.skewMs??es),z(this,Ae,e.onExpired),z(this,Le,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;K(this,N,tt).call(this,t)}z(this,Pe,!!O(this,he)||!!O(this,_))}get configured(){return O(this,Pe)}get unavailable(){return O(this,Q)}get hasToken(){return!!O(this,_)&&(O(this,j)===0||O(this,j)>Date.now())}get expiresAt(){return O(this,j)}async authorization(e="initial"){if(!this.configured)return null;if(O(this,Q))throw new me(O(this,Q));let t=Date.now();if(!O(this,_)||O(this,j)>0&&O(this,j)-O(this,Ce)<=t){let s=!!O(this,_)&&O(this,j)>0&&O(this,j)<=t,n=O(this,_)?s?"expired":"expiring":e,a=await K(this,N,_e).call(this,n);if(!a)throw new me(O(this,Q)??O(this,ue)??K(this,N,pe).call(this,"provider_failed"));return`Bearer ${a}`}return`Bearer ${O(this,_)}`}async handleFailure(e,t){var s;if(!this.configured)return!1;if(Ji(e,t)){z(this,_,null),z(this,j,0);let n=await K(this,N,_e).call(this,"unauthorized",t);return(s=O(this,Ae))==null||s.call(this,{reason:"unauthorized",code:t,refreshed:!!n}),!!n}let i=Zi(e,t);return i&&K(this,N,pe).call(this,i,t,e),!1}async refresh(e="manual"){return z(this,Q,null),z(this,ue,null),z(this,_,null),z(this,j,0),!!await K(this,N,_e).call(this,e)}clear(){z(this,_,null),z(this,j,0),z(this,ee,null)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};_=new WeakMap,j=new WeakMap,he=new WeakMap,Ce=new WeakMap,ee=new WeakMap,Q=new WeakMap,ue=new WeakMap,Ae=new WeakMap,Le=new WeakMap,Pe=new WeakMap,N=new WeakSet,tt=function(e){return!e||typeof e.token!="string"||!e.token?null:(z(this,_,e.token),z(this,j,typeof e.expiresAt=="number"?e.expiresAt:0),O(this,_))},_e=function(e,t){if(O(this,ee))return O(this,ee);let i=O(this,he);if(!i)return K(this,N,pe).call(this,"no_token",t),Promise.resolve(null);let s=(async()=>{try{let n=await i({reason:e}),a=K(this,N,tt).call(this,n);return a||(K(this,N,pe).call(this,"provider_failed",t),null)}catch{return K(this,N,pe).call(this,"provider_failed",t),null}finally{z(this,ee,null)}})();return z(this,ee,s),s},pe=function(e,t,i){var n;let s={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return z(this,ue,s),Xi.has(e)||(z(this,Q,s),z(this,_,null),z(this,j,0)),(n=O(this,Le))==null||n.call(this,s),s};function fe(r,e={}){return!r.buyerAccessTokenProvider&&!r.buyerAccessToken?null:new Ee({provider:r.buyerAccessTokenProvider,token:r.buyerAccessToken,...e})}var F=require("@seatlayer/core"),I=r=>String(r??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function ge(r,e){let t=0;for(let i of r.get(e)?.values()??[])t+=i;return t}function Ht(r){let e=[];for(let[t,i]of r)for(let[s,n]of i)n>0&&e.push({areaId:t,tierId:s,qty:n});return e}function Rt(r){let e=new Map;for(let t of r.keys())e.set(t,ge(r,t));return e}function Me(r,e,t,i){let s=r.get(e)??new Map;i>0?s.set(t,i):s.delete(t),s.size?r.set(e,s):r.delete(e)}function Ot(r){let e=new Map;for(let t of r)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function be(r,e){let t=Ot(e),i=0;for(let s of r.keys())i+=Math.max(0,ge(r,s)-(t.get(s)??0));return i}function It(r,e,t){let i=Ot(t),s=0;for(let n of e){let a=r.gaQty.get(n.id);if(!a)continue;let o=i.get(n.id)??0;for(let[l,c]of a){let h=Math.max(0,c-o);o=Math.max(0,o-c),s+=h*r.paidPrice(n.categoryKey,l,ts(n,l),n.id)}}return s}function ts(r,e){return e?r.tiers?.find(t=>t.id===e)?.price??r.price:r.price}function $t(r){let e=[],t=new Map;for(let i of r){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let s=`${i.objectId}\0${i.tierId??""}`,n=t.get(s);if(n){n.quantity=(n.quantity??0)+(i.quantity??1),n.labels.push(i.label);continue}let a={...i,quantity:i.quantity??1,labels:[i.label]};t.set(s,a),e.push(a)}return e}function zt(r,e,t){let i=new Set(t);for(let s of e)s.objectType==="ga"&&s.objectId&&i.has(s.label)&&Me(r,s.objectId,s.tierId??null,0)}function Bt(r,e){if(r.objectType!=="ga")return r.label;let t=e.find(i=>i.id===r.objectId);return t?.displayLabel??t?.label??r.label}function is(r){let e=new Map;for(let t of r){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 je(r){let e=r.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:r.displayType??(0,F.t)("picker.generalAdmission"),price:r.price}]}function Dt(r,e){let t=r.totalTicketCount()-ge(r.gaQty,e.id);return Math.max(0,Math.min(e.available,r.maxTickets-t))}function st(r,e,t,i){if(X(r,!1),r.salesClosed){r.toast(r.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let s=je(e),n=r.gaQty.get(e.id),a=ge(r.gaQty,e.id)>0,o=Dt(r,e);if(o<=0&&!a){r.toast(e.available>0?(0,F.t)("picker.maxTicketsForOrder",{count:r.maxTickets}):r.tf("picker.soldOutTitle","Sold out"),"warning");return}if(r.onGAPromptHook){let d={};for(let[m,g]of n??[])d[m??""]=g;if(r.onGAPromptHook({area:e,selected:d,min:0,max:o,tiers:s,confirm:m=>{as(r,e,s,m,o)},cancel:()=>X(r)})===!0)return}let l=new Map;for(let d of s)l.set(d.id,n?.get(d.id)??0);!a&&o>0&&l.set(s[0].id,1);let c={area:e,tiers:s,draft:l,max:o,reopened:a},h=r.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=h?"sl-ga-scrim":"sl-ga-pop-layer",p.innerHTML=ss(r,c,h),r.root?.appendChild(p),r.gaPromptEl=p,r.gaPromptReturnFocus=i??document.activeElement,h||os(r,p,t),r.reducedMotion()&&(p.dataset.motion="reduced"),_t(r,c),rs(r,p,c),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function ss(r,e,t){let{area:i,tiers:s}=e,n=s.length>1,a=i.displayLabel??i.label,o=s.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${I(l.id??"")}"><div class="sl-ga-prompt-label"><span>${I(n?l.label:r.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(n?`<small>${I(r.money(r.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${I(n?l.label:a)}"><button type="button" data-ga-step="-1" aria-label="${I(r.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${I(r.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="${I((0,F.t)("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${I(i.displayType??r.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${I(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="${I((0,F.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${o}`+(s.length>1?`<div class="sl-ga-prompt-total"><span>${I(r.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>${I(r.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${I((0,F.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function rt(r){let e=0;for(let t of r.draft.values())e+=t;return e}function Ft(r,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*r.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function _t(r,e){let t=r.gaPromptEl;if(!t)return;let i=rt(e),s=Ft(r,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let h=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(h)??0,d=c.querySelector("[data-ga-qty]");d&&(d.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(f=>{f.disabled=Number(f.dataset.gaStep)<0?p<=0:i>=e.max})});let n=t.querySelector("[data-ga-sub]");n&&(n.textContent=`${r.money(r.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,F.tCount)("picker.leftCount",e.area.available)}`);let a=t.querySelector("[data-ga-total]");a&&(a.textContent=r.money(s));let o=t.querySelector("[data-ga-hint]");o&&(o.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?(0,F.tCount)("picker.leftCount",e.area.available):(0,F.t)("picker.maxTicketsForOrder",{count:r.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,F.tCount)("picker.gaUpdate",i,{count:i}):(0,F.tCount)("picker.gaAdd",i,{count:i,price:r.money(s)}),l.disabled=i<=0&&!e.reopened)}function rs(r,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest("[data-ga-tier]");if(!s)return;let n=s.dataset.gaTier?s.dataset.gaTier:null,a=Number(i.dataset.gaStep),o=t.draft.get(n)??0,l=t.max-rt(t);t.draft.set(n,Math.max(0,o+(a>0?Math.min(1,l):-1))),_t(r,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>X(r))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{r.gaQty.delete(t.area.id),X(r),r.syncTray(),it(r,(0,F.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{ns(r,t)}),e.addEventListener("mousedown",i=>{i.target===e&&X(r)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),X(r);return}if(i.key!=="Tab")return;let s=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!s.length)return;let n=s[0],a=s[s.length-1];i.shiftKey&&document.activeElement===n?(i.preventDefault(),a.focus()):!i.shiftKey&&document.activeElement===a&&(i.preventDefault(),n.focus())})}function ns(r,e){let t=rt(e),i=Ft(r,e);for(let n of e.tiers)Me(r.gaQty,e.area.id,n.id,e.draft.get(n.id)??0);X(r),r.syncTray();let s=e.area.displayLabel??e.area.label;t>0?it(r,(0,F.tCount)("picker.gaAdded",t,{count:t,area:s,price:r.money(i)})):it(r,(0,F.t)("picker.gaRemoved",{area:s}))}function as(r,e,t,i,s){if(typeof i=="number")Me(r.gaQty,e.id,t[0].id,Math.max(0,Math.min(s,Math.floor(i))));else{r.gaQty.delete(e.id);let n=s;for(let a of t){let o=Math.max(0,Math.floor(i[a.id??""]??0)),l=Math.min(o,n);n-=l,Me(r.gaQty,e.id,a.id,l)}}r.syncTray()}function X(r,e=!0){let t=r.gaPromptReturnFocus;r.gaPromptEl?.remove(),r.gaPromptEl=null,r.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:r.root)?.focus())}function os(r,e,t){let i=r.root,s=e.querySelector(".sl-ga-pop");if(!i||!s||!t)return;let n=i.getBoundingClientRect(),a=t.x-n.left,o=t.y-n.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${o}px`),requestAnimationFrame(()=>{let l=s.offsetWidth||260,c=s.offsetHeight||220,h=Math.max(8,Math.min(n.width-l-8,a-l/2)),p=o-c-14,d=p>=8?p:Math.min(n.height-c-8,o+14);s.style.left=`${h}px`,s.style.top=`${Math.max(8,d)}px`,s.dataset.side=p>=8?"above":"below",s.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,a-h))}px`)})}function it(r,e){r.srEl&&(r.srEl.textContent=e)}function jt(r,e,t=[]){let i=[],s=is(t);for(let a of e){let o=r.gaQty.get(a.id);if(!o)continue;let l=je(a);for(let c of l){let h=(o.get(c.id)??0)-(s.get(`${a.id}\0${c.id??""}`)??0);if(h<=0)continue;let p=r.paidPrice(a.categoryKey,c.id,c.price,a.id);i.push(`<div class="sl-ga" data-ga="${I(a.id)}" data-ga-row-tier="${I(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${I(a.displayLabel??a.label)}</div><div class="sl-ga-sub">${I(l.length>1?c.label:a.displayType??r.tf("picker.generalAdmission","General admission"))} \xB7 ${I(r.money(p))} \xB7 ${I((0,F.tCount)("picker.leftCount",a.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${I(r.tf("picker.fewer","Fewer"))}">\u2212</button><span>${h}</span><button type="button" data-d="1" aria-label="${I(r.tf("picker.more","More"))}">+</button></div></div>`)}}let n=e.filter(a=>ge(r.gaQty,a.id)<=0&&!t.some(o=>o.objectId===a.id));return n.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="${r.gaAreasExpanded}"><span>${I(r.tf("picker.gaAreasHeading","Areas"))}</span><small>${n.length}</small></button>`+(r.gaAreasExpanded?`<div class="sl-ga-areas-list">${n.map(a=>`<button type="button" class="sl-ga-area-open" data-ga-open="${I(a.id)}"${a.available<=0?" disabled":""}><span class="name">${I(a.displayLabel??a.label)}<small>${I(a.displayType??r.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${I(r.money(r.paidPrice(a.categoryKey,null,a.price,a.id)))} \xB7 ${I(a.available>0?(0,F.tCount)("picker.leftCount",a.available):r.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Nt(r,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest(".sl-ga");if(!s?.dataset.ga)return;let n=t.find(c=>c.id===s.dataset.ga);if(!n)return;let a=s.dataset.gaRowTier?s.dataset.gaRowTier:null,o=Number(i.dataset.d),l=r.gaQty.get(n.id)?.get(a)??0;if(o>0&&Dt(r,n)-ge(r.gaQty,n.id)<=0){r.toast((0,F.t)("picker.maxTicketsForOrder",{count:r.maxTickets}),"warning");return}Me(r.gaQty,n.id,a,Math.max(0,l+o)),r.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{r.gaAreasExpanded=!r.gaAreasExpanded,r.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let s=t.find(n=>n.id===i.dataset.gaOpen);s&&st(r,s,null,i)})})}var Ne='<svg viewBox="0 0 64 56" width="12" height="11" fill="none" aria-hidden="true" focusable="false" style="display:block"><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740"/><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740" transform="translate(64 0) scale(-1 1)"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/></svg>';var ls="https://api.seatlayer.io",Vt=10;function cs(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}var Ve=class{constructor(e){this.mount=null;this.hostEl=null;this.eventLocale=null;this.rendered=!1;this.mode_=null;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.realtime=null;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.publicKey=e.publicKey,this.access=fe(e,{onExpired:i=>this.opts.onAccessExpired?.(i),onUnavailable:i=>this.opts.onAccessUnavailable?.(i)});let t=new de((e.apiBase??ls).replace(/\/+$/,""),{access:this.access??void 0,onObjectUnavailable:i=>this.opts.onSelectedObjectUnavailable?.(i)});this.api=t,this.controller=new M.PickerController({transport:t,eventKey:e.event,maxSelection:e.maxSelection??Vt,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,onSelectionChange:i=>this.opts.onSelectionChange?.(i),onSelectionValidityChange:i=>this.opts.onSelectionValidityChange?.(i),onSelectionValid:i=>this.opts.onSelectionValid?.(i),onSelectionInvalid:i=>this.opts.onSelectionInvalid?.(i),onSelectionLimit:i=>this.opts.onSelectionLimit?.(i),onHold:i=>this.opts.onHold?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldRestored:i=>this.opts.onHoldRestored?.({holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:i=>{let s=this.controller.getGAAreas().find(n=>n.id===i);s&&(this.opts.onGAClick?.(s),this.opts.onGAPrompt?.({area:s,selected:{},min:0,max:Math.max(0,Math.min(s.available,(this.opts.maxSelection??Vt)-this.controller.getSelection().length)),tiers:je(s),confirm:n=>{let a=typeof n=="number"?n:Object.values(n).reduce((o,l)=>o+l,0);this.holdGA(s.id,a)},cancel:()=>{}}))},onError:i=>this.opts.onError?.(i),onDeckTap:i=>this.opts.onDeckTap?.(i),onHint:i=>this.opts.onHint?.(i),flashOnLiveChange:!0,onSeatHover:i=>{this.opts.onSeatHover?.(i),this.opts.seatTooltip!==!1&&this.updateTooltip(i)},colorblindSafe:e.colorblindSafe})}async render(){if(this.rendered)return this;this.rendered=!0,await(0,M.loadLocale)(this.opts.locale),this.opts.messages&&(0,M.setStringOverrides)(this.opts.messages),this.mount=cs(this.opts.container);let e=document.createElement("div");e.lang=(0,M.getLocale)(),e.dir=(0,M.localeDirection)(),e.style.width="100%",e.style.height="100%",e.style.position="relative",this.mount.appendChild(e),this.hostEl=e;let t=await this.controller.render(e);if(!t)return this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(e),this;if(this.eventLocale=t.locale??null,!this.opts.locale&&this.eventLocale&&await this.setLocale(this.eventLocale),this.buildLanguageSwitcher(e),this.controller.setViewMode(this.opts.initialView??"flat"),this.startRealtime(),this.mode_=t.mode==="test"?"test":"live",this.opts.seatTooltip!==!1){let i=document.createElement("div");i.setAttribute("role","tooltip"),i.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);',e.appendChild(i),this.tipEl=i,this.onTipMove=s=>{let n=e.getBoundingClientRect();this.tipPos={x:s.clientX-n.left,y:s.clientY-n.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},e.addEventListener("mousemove",this.onTipMove)}if(t.mode==="test"){e.style.overflow="hidden";let i=document.createElement("div");i.dataset.slI18n="testMode",i.textContent=(0,M.t)("picker.testMode"),i.setAttribute("aria-label",(0,M.t)("picker.testMode")),i.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;",e.appendChild(i)}return this.buildBadge(e),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.dataset.slI18n="badge",t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,M.t)("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);',t.innerHTML='<span aria-hidden="true" style="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee">'+Ne+`</span><span>${(0,M.t)("picker.poweredBy")}</span>`,e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,n=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),n<8&&(n=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,n)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,M.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(s,n)=>`${s} ${n}`}),i=e.status==="free"?"":`<div style="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700">${e.status==="held"?(0,M.t)("map.statusHeld"):(0,M.t)("map.statusTaken")}</div>`;this.tipEl.innerHTML=`<div style="font-weight:700;font-size:13px">${e.label}</div><div style="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc"><span style="width:9px;height:9px;border-radius:50%;flex:none;background:${e.categoryColor}"></span><span>${e.categoryLabel}</span><span style="margin-left:auto;font-weight:700;color:#fff">${t}</span></div>`+i,this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(s=>(0,M.resolveLocale)(s)).filter((s,n,a)=>a.indexOf(s)===n);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,M.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 s of t){let n=document.createElement("option");n.value=s,n.textContent=M.LOCALE_NAMES[s]??s,n.selected=s===(0,M.getLocale)(),i.appendChild(n)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i)}async setLocale(e){let t=(0,M.getLocale)(),i=await(0,M.loadLocale)(e);if(this.opts.messages&&(0,M.setStringOverrides)(this.opts.messages),i===t)return i;if(this.hostEl){this.hostEl.lang=i,this.hostEl.dir=(0,M.localeDirection)();for(let s of this.hostEl.querySelectorAll("[data-sl-i18n]"))if(s.dataset.slI18n==="testMode")s.textContent=(0,M.t)("picker.testMode"),s.setAttribute("aria-label",(0,M.t)("picker.testMode"));else if(s.dataset.slI18n==="badge"){s.setAttribute("aria-label",(0,M.t)("picker.poweredBy"));let n=s.querySelector("span:last-child");n&&(n.textContent=(0,M.t)("picker.poweredBy"))}}return this.controller.refreshMapCopy(),i}getMode(){return this.mode_}getSelection(){return this.controller.getSelection()}selectObjects(e){return this.controller.select(e)}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.controller.clearSelection()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.controller.setMaxSelection(e)}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 s=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(s?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:s?"selection_count_mismatch":"selection_invalid",selection:t})}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}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}}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(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,i={}){let s=await this.controller.holdGA(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,i={}){let s=await this.controller.bestAvailable(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}this.controller.setFloor(e)}setColorblindSafe(e){this.controller.setColorblindSafe(e)}setViewMode(e){this.controller.setViewMode(e)}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.controller.zoomIn()}zoomOut(){this.controller.zoomOut()}zoomToFit(){this.controller.zoomToFit()}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Y({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:ce(this.controller,{flashOnLiveChange:!0,onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),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="The seat map didn\u2019t load.",t.appendChild(i);let s=document.createElement("button");s.type="button",s.textContent="Try again",s.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;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(n=>this.opts.onError?.(n))}),t.appendChild(s),e.appendChild(t)}destroy(){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.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}};var nt=["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"],ds={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 qt(r){let e={};for(let t of nt)e[t]=(...i)=>{let s=r();return s?s[t](...i):ds[t]()};return e}var at=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],ot=[...at,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],lt=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Ut(r,e,t){let i={container:r};for(let s of ot)i[s]=e[s];for(let s of lt)i[s]=t[s];return i}var ps=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),hs=2e4,us=480,ms=180*1e3,fs=900*1e3,gs=.8,bs=30*1e3,vs=1e5,ys=4,xs=50;function ct(r){if(typeof r!="string")return r;let e=document.querySelector(r);if(!e)throw new Error(`EmbeddedDesigner container not found: ${r}`);return e}function ws(r){let e=(r??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var ks={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."}},qe=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.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"||!ps.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},s=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",n=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(s||i.chartId!==void 0),a=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(s||i.workspaceId!==void 0);if(n||a){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 o=ws(i.code);if(o==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:o!=="load"||this.phase!=="ready")&&this.showError(o),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=ct(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 s=this.options.loadingTimeoutMs??hs;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}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,s=t.style.getPropertyValue("height"),n=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let a=i();t.style.setProperty("height",`${vs}px`,"important");let o=i();return s?t.style.setProperty("height",s,n):t.style.removeProperty("height"),!(o-a>ys)&&a>=xs?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??us;if(this.fillMode==="container"&&this.containerEl){let s=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));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,s]of Object.entries(e))this.frame.style.setProperty(i,s,"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<fs?t*gs:t-ms,s=Math.max(bs,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{ct(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=ct(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 s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(s):this.buildErrorCard(s,i??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
42
42
  @media (prefers-reduced-motion: no-preference) {
43
43
  @keyframes seatlayer-designer-shimmer {
44
44
  0% { background-position: -320px 0; }
@@ -48,7 +48,7 @@
48
48
  animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
49
49
  background-size: 640px 100%;
50
50
  }
51
- }`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",s=document.createElement("div");Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let n=c=>{let h=document.createElement("div");return h.className="sl-shimmer",Object.assign(h.style,{background:i,borderRadius:"8px"}),Object.assign(h.style,c),h};s.append(n({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(n({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(n({flex:"1 1 auto",height:"100%"})),s.append(o),e.append(s);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=Fi[t],s=document.createElement("div");Object.assign(s.style,{maxWidth:"420px",margin:"0 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 n=document.createElement("h2");n.textContent=i.title,Object.assign(n.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=i.body,Object.assign(o.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()),s.append(n,o,a),e.append(s)}};var v=require("@seatlayer/core"),Ae=require("@seatlayer/core/view3d/crossfade/panorama"),ct=require("@seatlayer/core/core/seatConfidence");function wt(r){return r?.previousPrice!=null&&r.previousPrice>r.price?r.previousPrice:null}function kt(r){return _i(r)+(r.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!r.collapsed}">${r.moreLabel}</button>`:"")+ji(r.status)}function _i(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let s=r.priceOf(i),n=r.rangeOf(i),o=r.offerOf(i.key),a=wt(o),l=r.activeKey===i.key;return`<div class="sl-price-row${r.bandKeys!=null&&!r.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(r.titleFor(i,l))}"><span class="sl-dot" style="background:${e(r.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${r.leftCount(r.left[i.key]??0)}</span>`+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(n!=null?`<span class="sl-price-amt">${n.min===n.max?t(n.min):`${t(n.min)}\u2013${t(n.max)}`}</span>`:s!=null?`<span class="sl-price-amt">${t(s)}</span>`:"")+"</div>"}).join("")}function ji(r){return`<div class="sl-status-key" aria-label="${r.legend}"><span class="sl-status-item"><i class="sl-status-icon" aria-hidden="true"><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></i>${r.held}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${r.sold}</span></div>`}function St(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let s=r.rangeOf(i),n=r.priceOf(i),o=s?s.min===s.max?t(s.min):`${t(s.min)}+`:n!=null?t(n):null,a=Object.prototype.hasOwnProperty.call(r.left,i.key)&&r.left[i.key]<=0,l=wt(r.offerOf(i.key)),c=o?`${i.label} \u2014 ${o}${a?` (${r.soldOutWord})`:""}`:i.label;return`<button type="button" class="sl-rc" data-cat="${e(i.key)}" aria-pressed="${r.activeKey===i.key}" aria-label="${e(c)}" title="${e(c)}"${a?" disabled":""}><i class="sl-rc-dot" style="background:${e(r.colorOf(i))}"></i>`+(l!=null?`<span class="sl-rc-was">${e(t(l))}</span>`:"")+`<span class="sl-rc-t">${e(o??i.label)}</span></button>`}).join("")}var Vi=/^[a-zA-Z0-9._-]+$/;function Ni(r){let e;try{e=new URL(r,"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]),s=decodeURIComponent(t[2]);return!i||!Vi.test(s)?null:{eventKey:i,asset:s}}catch{return null}}function Ui(r){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(r,"https://seatlayer.invalid").pathname)}catch{return!1}}var $e=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=Ni(e);if(!t)return Promise.resolve(Ui(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 s=this.load(this.eventKey,t.asset).then(n=>{let o=URL.createObjectURL(n);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(n=>{throw this.pending.delete(e),n});return this.pending.set(e,s),s}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var qi=["on-sale","low","sold-out","presale","closed"];function Se(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function Tt(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function Ct(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r,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 s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let n={index:i,count:t,remaining:s??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;n.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;n.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;n.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=Tt(e[o]);if(a===void 0)return;n[o]=a}return n}function Ki(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let o of e.channels){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,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=[],h=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let d=p,f=typeof d.categoryKey=="string"?d.categoryKey.trim():"",m=d.tierId===null?null:typeof d.tierId=="string"&&d.tierId.trim()?d.tierId.trim():void 0,g=Se(d.price);if(!f||m===void 0||g===void 0||g===null)return;let w=`${f}\0${m??""}`;if(h.has(w))return;h.add(w),c.push({categoryKey:f,tierId:m,price:g})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let s=[],n=new Set;for(let o of e.objects){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!i.has(c))return;n.add(l),s.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:s}}function ze(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let e=r,t=qi.find(h=>h===e.state);if(!t)return null;let i=Se(e.fromPrice),s=Se(e.previousPrice);if(i===void 0||s===void 0)return null;let n=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(n===void 0)return null;let o=Ct(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:Ct(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let h=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let d=p,f=typeof d.categoryKey=="string"?d.categoryKey.trim():"";if(!f)return null;let m=Se(d.price),g=Se(d.previousPrice);if(m==null||g===void 0)return null;let w={categoryKey:f,price:m,previousPrice:g};if(d.offerId!==void 0){if(typeof d.offerId!="string"||!d.offerId.trim())return null;w.offerId=d.offerId.trim()}if(d.offerName!==void 0){if(typeof d.offerName!="string"||!d.offerName.trim())return null;w.offerName=d.offerName.trim()}if(d.remaining!==void 0){if(d.remaining!==null&&(typeof d.remaining!="number"||!Number.isInteger(d.remaining)||d.remaining<0))return null;w.remaining=d.remaining==null?null:d.remaining}for(let k of["startsAt","endsAt"]){if(d[k]===void 0)continue;let x=Tt(d[k]);if(x===void 0)return null;w[k]=x}h.push(w)}l=h}let c=Ki(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:s,currency:n,release:o,upcoming:a,prices:l,channelPricing:c}}function Et(r,e){if(!r)return null;let t=null,i=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[r.release,r.upcoming])i(s?.startsAt),i(s?.endsAt);for(let s of r.prices)i(s.startsAt),i(s.endsAt);return t}function Be(r){let e={};for(let t of r?.prices??[])e[t.categoryKey]=t.price;return e}var At="seatlayer-picker-style",Wi=`
51
+ }`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",s=document.createElement("div");Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let n=c=>{let h=document.createElement("div");return h.className="sl-shimmer",Object.assign(h.style,{background:i,borderRadius:"8px"}),Object.assign(h.style,c),h};s.append(n({height:"40px",width:"100%",flex:"0 0 auto"}));let a=document.createElement("div");Object.assign(a.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),a.append(n({width:"220px",height:"100%",flex:"0 0 auto"})),a.append(n({flex:"1 1 auto",height:"100%"})),s.append(a),e.append(s);let o=document.createElement("div");Object.assign(o.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:i,flex:"0 0 auto"}),o.append(l),o.append(document.createTextNode("Loading designer\u2026")),e.append(o)}buildErrorCard(e,t){let i=ks[t],s=document.createElement("div");Object.assign(s.style,{maxWidth:"420px",margin:"0 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 n=document.createElement("h2");n.textContent=i.title,Object.assign(n.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let a=document.createElement("p");a.textContent=i.body,Object.assign(a.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let o=document.createElement("button");o.type="button",o.textContent="Try again",Object.assign(o.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),o.addEventListener("click",()=>this.handleTryAgain()),s.append(n,a,o),e.append(s)}};var b=require("@seatlayer/core"),ze=require("@seatlayer/core/view3d/crossfade/panorama"),wt=require("@seatlayer/core/core/seatConfidence");function Gt(r){return r?.previousPrice!=null&&r.previousPrice>r.price?r.previousPrice:null}function Kt(r){return Ss(r)+(r.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!r.collapsed}">${r.moreLabel}</button>`:"")+Ts(r.status)}function Ss(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let s=r.priceOf(i),n=r.rangeOf(i),a=r.offerOf(i.key),o=Gt(a),l=r.activeKey===i.key;return`<div class="sl-price-row${r.bandKeys!=null&&!r.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(r.titleFor(i,l))}"><span class="sl-dot" style="background:${e(r.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(a?.offerName?`<small class="sl-price-offer">${e(a.offerName)}</small>`:"")+`</span><span class="sl-price-left">${r.leftCount(r.left[i.key]??0)}</span>`+(o!=null?`<span class="sl-price-was">${e(t(o))}</span>`:"")+(n!=null?`<span class="sl-price-amt">${n.min===n.max?t(n.min):`${t(n.min)}\u2013${t(n.max)}`}</span>`:s!=null?`<span class="sl-price-amt">${t(s)}</span>`:"")+"</div>"}).join("")}function Ts(r){return`<div class="sl-status-key" aria-label="${r.legend}"><span class="sl-status-item"><i class="sl-status-icon" aria-hidden="true"><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></i>${r.held}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${r.sold}</span></div>`}function dt(r){let e=Math.abs(r.scrollLeft),t=e>2,i=e+r.clientWidth<r.scrollWidth-2;return r.dataset.fadeStart=String(t),r.dataset.fadeEnd=String(i),{start:t,end:i}}function Wt(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let s=r.rangeOf(i),n=r.priceOf(i),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:n!=null?t(n):null,o=Object.prototype.hasOwnProperty.call(r.left,i.key)&&r.left[i.key]<=0,l=Gt(r.offerOf(i.key)),c=a?`${i.label} \u2014 ${a}${o?` (${r.soldOutWord})`:""}`:i.label;return`<button type="button" class="sl-rc" data-cat="${e(i.key)}" aria-pressed="${r.activeKey===i.key}" aria-label="${e(c)}" title="${e(c)}"${o?" disabled":""}><i class="sl-rc-dot" style="background:${e(r.colorOf(i))}"></i>`+(l!=null?`<span class="sl-rc-was">${e(t(l))}</span>`:"")+`<span class="sl-rc-t">${e(a??i.label)}</span></button>`}).join("")}var Es=/^[a-zA-Z0-9._-]+$/;function Cs(r){let e;try{e=new URL(r,"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]),s=decodeURIComponent(t[2]);return!i||!Es.test(s)?null:{eventKey:i,asset:s}}catch{return null}}function As(r){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(r,"https://seatlayer.invalid").pathname)}catch{return!1}}var Ue=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=Cs(e);if(!t)return Promise.resolve(As(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 s=this.load(this.eventKey,t.asset).then(n=>{let a=URL.createObjectURL(n);return this.disposed?(URL.revokeObjectURL(a),null):(this.created.add(a),a)}).catch(n=>{throw this.pending.delete(e),n});return this.pending.set(e,s),s}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Ls=["on-sale","low","sold-out","presale","closed"];function He(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function Qt(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function Yt(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r,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 s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let n={index:i,count:t,remaining:s??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;n.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;n.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;n.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let a of["startsAt","endsAt"]){if(e[a]===void 0)continue;let o=Qt(e[a]);if(o===void 0)return;n[a]=o}return n}function Ps(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let a of e.channels){if(!a||typeof a!="object"||Array.isArray(a))return;let o=a,l=typeof o.channelId=="string"?o.channelId.trim():"";if(!l||i.has(l)||!Number.isInteger(o.pricingVersion)||o.pricingVersion<0||!Array.isArray(o.priceOverrides))return;let c=[],h=new Set;for(let p of o.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let d=p,f=typeof d.categoryKey=="string"?d.categoryKey.trim():"",m=d.tierId===null?null:typeof d.tierId=="string"&&d.tierId.trim()?d.tierId.trim():void 0,g=He(d.price);if(!f||m===void 0||g===void 0||g===null)return;let S=`${f}\0${m??""}`;if(h.has(S))return;h.add(S),c.push({categoryKey:f,tierId:m,price:g})}i.add(l),t.push({channelId:l,pricingVersion:o.pricingVersion,priceOverrides:c})}let s=[],n=new Set;for(let a of e.objects){if(!a||typeof a!="object"||Array.isArray(a))return;let o=a,l=typeof o.label=="string"?o.label.trim():"",c=typeof o.channelId=="string"?o.channelId.trim():"";if(!l||n.has(l)||!i.has(c))return;n.add(l),s.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:s}}function Ge(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let e=r,t=Ls.find(h=>h===e.state);if(!t)return null;let i=He(e.fromPrice),s=He(e.previousPrice);if(i===void 0||s===void 0)return null;let n=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(n===void 0)return null;let a=Yt(e.release);if(a===void 0)return null;let o=e.upcoming===void 0?null:Yt(e.upcoming);if(o===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let h=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let d=p,f=typeof d.categoryKey=="string"?d.categoryKey.trim():"";if(!f)return null;let m=He(d.price),g=He(d.previousPrice);if(m==null||g===void 0)return null;let S={categoryKey:f,price:m,previousPrice:g};if(d.offerId!==void 0){if(typeof d.offerId!="string"||!d.offerId.trim())return null;S.offerId=d.offerId.trim()}if(d.offerName!==void 0){if(typeof d.offerName!="string"||!d.offerName.trim())return null;S.offerName=d.offerName.trim()}if(d.remaining!==void 0){if(d.remaining!==null&&(typeof d.remaining!="number"||!Number.isInteger(d.remaining)||d.remaining<0))return null;S.remaining=d.remaining==null?null:d.remaining}for(let k of["startsAt","endsAt"]){if(d[k]===void 0)continue;let w=Qt(d[k]);if(w===void 0)return null;S[k]=w}h.push(S)}l=h}let c=Ps(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:s,currency:n,release:a,upcoming:o,prices:l,channelPricing:c}}function Xt(r,e){if(!r)return null;let t=null,i=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[r.release,r.upcoming])i(s?.startsAt),i(s?.endsAt);for(let s of r.prices)i(s.startsAt),i(s.endsAt);return t}function Ke(r){let e={};for(let t of r?.prices??[])e[t.categoryKey]=t.price;return e}var Zt="seatlayer-picker-style",Ms=`
52
52
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
53
53
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
54
54
  --sl-r-sm:calc(var(--sl-radius) * .55);
@@ -158,7 +158,11 @@
158
158
  /* With the price list expanded the sheet takes the with-selection height so
159
159
  the tray (cart + best-seats) is never crushed under the fixed-size list. */
160
160
  .sl-picker[data-layout="narrow"][data-sheet="open"][data-prices-open="true"] .sl-side{height:calc(min(480px,74%) + var(--sl-safe-b))}
161
- .sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-side{height:calc(76px + var(--sl-safe-b));overflow:hidden}
161
+ /* SLIM CHROME (owner call 2026-08-19): the peek is ONE 50px row. The grab
162
+ handle no longer owns a row of its own \u2014 it is a 3px bar painted at the
163
+ top of the same head, and the pills inside are 34px, so the whole thing
164
+ still clears the 44px touch floor while giving the map 26px back. */
165
+ .sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-side{height:calc(50px + var(--sl-safe-b));overflow:hidden}
162
166
  .sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-side > :not(.sl-sheet-head){display:none}
163
167
  .sl-picker[data-layout="narrow"] .sl-tray{flex:1;min-height:96px;overflow-y:auto;overscroll-behavior:contain}
164
168
  .sl-picker[data-layout="narrow"][data-prices-open="true"] .sl-tray{min-height:48px}
@@ -224,7 +228,7 @@
224
228
  painted on the map, and a phone buyer is matching a colour to a number.
225
229
  Chips scroll rather than truncate \u2014 a legend that hides a ticket type is
226
230
  worse than one that has to be swiped. */
227
- .sl-rail{display:none;align-items:center;gap:7px;padding:7px 10px;flex:none;
231
+ .sl-rail{display:none;align-items:center;gap:6px;padding:3px 10px;flex:none;
228
232
  background:var(--sl-surface);border-bottom:1px solid var(--sl-line)}
229
233
  .sl-picker[data-layout="narrow"] .sl-rail.has{display:flex}
230
234
  /* 3D frames itself; focusCategory drives the 2D map, so the rail has nothing
@@ -232,18 +236,37 @@
232
236
  .sl-picker[data-view3d="on"] .sl-rail{display:none!important}
233
237
  /* The accessibility chips are pinned OUTSIDE the scroller: they are the one
234
238
  control that must never be discoverable-only-by-swipe. */
235
- .sl-picker[data-layout="narrow"] .sl-rail .sl-chips{flex:none;display:flex;gap:6px;
236
- padding-right:7px;margin-right:1px;border-right:1px solid var(--sl-line)}
237
- .sl-rail-scroll{display:flex;align-items:center;gap:6px;flex:1;min-width:0;
239
+ .sl-picker[data-layout="narrow"] .sl-rail .sl-chips{flex:none;display:flex;gap:5px;
240
+ padding-right:6px;margin-right:1px;border-right:1px solid var(--sl-line)}
241
+ .sl-picker[data-layout="narrow"] .sl-rail .sl-chip-f{padding:0 9px;min-height:24px;font-size:11px}
242
+ .sl-picker[data-layout="narrow"] .sl-rail .sl-chip-f svg{width:12px;height:12px}
243
+ .sl-rail-scroll{display:flex;align-items:center;gap:5px;flex:1;min-width:0;
238
244
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;
239
245
  scroll-snap-type:x proximity;padding:1px}
246
+ /* Fade ONLY a clipping edge, so a hidden sixth chip reads as "more" and a
247
+ rail that fits keeps every rounded end intact (syncRailEdges sets these).
248
+ "start" is the left edge in LTR and the right edge in RTL, so the gradient
249
+ direction follows the root's dir. */
250
+ .sl-rail-scroll[data-fade-end="true"]{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 18px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 18px),transparent)}
251
+ .sl-rail-scroll[data-fade-start="true"]{-webkit-mask-image:linear-gradient(90deg,transparent,#000 18px);mask-image:linear-gradient(90deg,transparent,#000 18px)}
252
+ .sl-rail-scroll[data-fade-start="true"][data-fade-end="true"]{-webkit-mask-image:linear-gradient(90deg,transparent,#000 18px,#000 calc(100% - 18px),transparent);mask-image:linear-gradient(90deg,transparent,#000 18px,#000 calc(100% - 18px),transparent)}
253
+ .sl-picker[dir="rtl"] .sl-rail-scroll[data-fade-end="true"]{-webkit-mask-image:linear-gradient(-90deg,#000 calc(100% - 18px),transparent);mask-image:linear-gradient(-90deg,#000 calc(100% - 18px),transparent)}
254
+ .sl-picker[dir="rtl"] .sl-rail-scroll[data-fade-start="true"]{-webkit-mask-image:linear-gradient(-90deg,transparent,#000 18px);mask-image:linear-gradient(-90deg,transparent,#000 18px)}
240
255
  .sl-rail-scroll::-webkit-scrollbar{display:none}
241
- .sl-rc{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:34px;padding:7px 11px;
256
+ /* 24px ink, taller target: the chip stays small so five prices fit a phone
257
+ without a swipe, and the invisible ::before grows the tap area to the full
258
+ rail strip (the scroller clips it, so ~33px on narrow \u2014 the same
259
+ grow-the-target-not-the-ink pattern the coarse-pointer block uses). */
260
+ .sl-rc{position:relative;display:inline-flex;align-items:center;gap:5px;flex:none;min-height:24px;padding:0 9px 0 7px;
242
261
  border-radius:999px;background:var(--sl-bg);border:1px solid var(--sl-line);color:var(--sl-text);
243
- font-size:12px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap;
262
+ font-size:11px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap;
244
263
  scroll-snap-align:start;transition:border-color .15s,background .15s}
264
+ .sl-rc::before{content:'';position:absolute;top:50%;left:0;right:0;height:44px;transform:translateY(-50%)}
245
265
  .sl-rc:hover,.sl-rc:focus-visible{border-color:var(--sl-muted)}
246
- .sl-rc-dot{width:9px;height:9px;border-radius:50%;flex:none}
266
+ .sl-rc-dot{width:7px;height:7px;border-radius:50%;flex:none}
267
+ /* On the filled (pinned) chip the dot would vanish into an accent of the
268
+ same hue \u2014 ring it in ink so the colour key survives the highlight. */
269
+ .sl-rc[aria-pressed="true"] .sl-rc-dot{box-shadow:0 0 0 1.5px var(--sl-accent-ink)}
247
270
  .sl-rc-was{color:var(--sl-muted);font-weight:500;text-decoration:line-through}
248
271
  /* Pinned = this category is framed on the map. The state lives on the control
249
272
  the buyer used, so there is never a second place to go and clear it. */
@@ -258,11 +281,24 @@
258
281
  head is the tap/swipe toggle target (min 44px), so it reads as one control. */
259
282
  .sl-sheet-head{display:none;flex-direction:column;justify-content:center;padding:6px 12px 8px;min-height:56px;
260
283
  cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;flex:none}
261
- .sl-picker[data-layout="narrow"] .sl-sheet-head{display:flex;min-height:52px;padding:3px 10px 5px}
284
+ .sl-picker[data-layout="narrow"] .sl-sheet-head{display:flex;position:relative;min-height:50px;padding:0 6px 0 12px}
285
+ .sl-picker[data-layout="narrow"] .sl-sheet-grab{position:absolute;top:4px;left:50%;width:32px;height:3px;margin:0;transform:translateX(-50%);opacity:.5}
286
+ .sl-picker[data-layout="narrow"] .sl-sheet-bar{min-height:50px;gap:6px}
287
+ .sl-picker[data-layout="narrow"] .sl-sheet-peek{font-size:12.5px}
288
+ .sl-picker[data-layout="narrow"] .sl-sheet-peek .go{min-height:34px;padding:0 14px;font-size:12.5px}
289
+ .sl-picker[data-layout="narrow"] .sl-sheet-peek .go.ghost{padding:0 10px}
290
+ .sl-picker[data-layout="narrow"] .sl-sheet-toggle{width:36px;height:36px;margin:0}
291
+ /* The hold clock rides INSIDE the Continue pill while the sheet is collapsed
292
+ (that pill is the way to pay from the peek), so the header pill can go
293
+ quiet: one live clock on screen, not two. The open sheet hides the peek
294
+ pill, so the header pill comes back there. */
295
+ .sl-peek-time{opacity:.72;font-weight:700;font-variant-numeric:tabular-nums;margin-inline-start:6px}
296
+ .sl-picker[data-layout="narrow"][data-sheet="peek"][data-peek-clock="true"] .sl-hold-pill.on:not(.is-expiring){display:none}
262
297
  /* OPEN sheet: the head is context, not controls \u2014 the pill it carries at peek
263
298
  ("Best seats"/"Continue") duplicates the card and CTA right below it, and
264
299
  every saved pixel is tray room (owner call 2026-08-14). */
265
300
  .sl-picker[data-layout="narrow"][data-sheet="open"] .sl-sheet-head{min-height:42px}
301
+ .sl-picker[data-layout="narrow"][data-sheet="open"] .sl-sheet-grab{top:5px}
266
302
  .sl-picker[data-layout="narrow"][data-sheet="open"] .sl-sheet-bar{min-height:32px}
267
303
  .sl-picker[data-layout="narrow"][data-sheet="open"] .sl-sheet-peek .go{display:none}
268
304
  .sl-picker[data-layout="narrow"][data-sheet="peek"] .sl-sheet-head{height:100%}
@@ -325,6 +361,19 @@
325
361
  .sl-cbbtn:hover{border-color:var(--sl-muted)}
326
362
  .sl-cbbtn svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
327
363
 
364
+ /* Language switcher \u2014 docked with the colour-blind toggle because both answer
365
+ "how this looks to me" rather than "where am I". Sized to the same control
366
+ rhythm as its neighbour so the column reads as one cluster, and it inherits
367
+ the map-palette re-tokening applied to the .sl-map subtree. Native <select>
368
+ on purpose: it gets the platform's own picker, keyboard model and, on a
369
+ phone, a full-height wheel that a custom menu would have to reinvent. */
370
+ .sl-langsel{height:32px;max-width:132px;border-radius:999px;background:var(--sl-surface);
371
+ border:1px solid var(--sl-line);color:var(--sl-text);cursor:pointer;
372
+ padding:0 8px;font:600 11px/1 inherit;appearance:none;text-align:center;
373
+ text-align-last:center;transition:border-color .15s}
374
+ .sl-langsel:hover{border-color:var(--sl-muted)}
375
+ .sl-langsel:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}
376
+
328
377
  /* price panel \u2014 one compact filter control replaces the wrapping price-chip row. */
329
378
  .sl-offer{display:none;margin:12px 14px 2px;padding:12px;border:1px solid color-mix(in srgb,var(--sl-accent) 34%,var(--sl-line));
330
379
  border-radius:12px;background:color-mix(in srgb,var(--sl-accent) 8%,var(--sl-surface));color:var(--sl-text)}
@@ -429,6 +478,80 @@
429
478
  .sl-ga-qty button:hover{border-color:var(--sl-muted)}
430
479
  .sl-ga-qty span{min-width:16px;text-align:center;font-weight:800;font-variant-numeric:tabular-nums}
431
480
 
481
+ /* GA quantity prompt. The map is the thing being chosen, so it stays visible:
482
+ a popover anchored at the tap on wide layouts, a bottom sheet on narrow.
483
+ Both are the same <section>, restyled \u2014 one DOM, one focus trap. */
484
+ .sl-ga-pop-layer{position:absolute;inset:0;z-index:46}
485
+ .sl-ga-scrim{position:absolute;inset:0;z-index:46;display:flex;align-items:flex-end;
486
+ background:rgba(5,7,12,.58);backdrop-filter:blur(3px)}
487
+ .sl-ga-pop,.sl-ga-sheet{background:var(--sl-surface);color:var(--sl-text);border:1px solid var(--sl-line);
488
+ box-shadow:0 28px 70px rgba(0,0,0,.42)}
489
+ .sl-ga-pop{position:absolute;width:272px;border-radius:calc(var(--sl-radius) * 1.05);pointer-events:auto;
490
+ transform-origin:var(--sl-ga-arrow-x,50%) 100%;animation:sl-ga-spring .16s cubic-bezier(.2,.9,.3,1.2)}
491
+ .sl-ga-pop[data-side="below"]{transform-origin:var(--sl-ga-arrow-x,50%) 0}
492
+ .sl-ga-pop::after{content:"";position:absolute;left:var(--sl-ga-arrow-x,50%);width:11px;height:11px;margin-left:-6px;
493
+ background:var(--sl-surface);border:1px solid var(--sl-line);transform:rotate(45deg)}
494
+ .sl-ga-pop[data-side="above"]::after{bottom:-6px;border-width:0 1px 1px 0}
495
+ .sl-ga-pop[data-side="below"]::after{top:-6px;border-width:1px 0 0 1px}
496
+ .sl-ga-sheet{width:100%;max-height:min(80%,640px);overflow:auto;border-radius:18px 18px 0 0;border-width:1px 0 0;
497
+ animation:sl-ga-rise .18s cubic-bezier(.2,.9,.3,1)}
498
+ @keyframes sl-ga-spring{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)}}
499
+ @keyframes sl-ga-rise{from{transform:translateY(14px)}to{transform:translateY(0)}}
500
+ .sl-ga-pop-layer[data-motion="reduced"] .sl-ga-pop,.sl-ga-scrim[data-motion="reduced"] .sl-ga-sheet{animation:none}
501
+ @media (prefers-reduced-motion:reduce){.sl-ga-pop,.sl-ga-sheet{animation:none}}
502
+ /* The close button is inset-inline-end, so the head reserves that side in the
503
+ same axis. A physical right put the x straight on top of the eyebrow under
504
+ dir=rtl (ar/fa/he \u2014 ku is Kurmanji in Latin script and is LTR). No backticks
505
+ in here: the whole sheet is a template literal. */
506
+ .sl-ga-prompt-head{position:relative;padding:14px 15px 11px;padding-inline-end:44px;
507
+ border-bottom:1px solid var(--sl-line)}
508
+ .sl-ga-sheet .sl-ga-prompt-head{padding:20px 18px 13px;padding-inline-end:46px}
509
+ .sl-ga-prompt-eyebrow{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--sl-muted);font-weight:800}
510
+ .sl-ga-prompt-title{margin-top:4px;font-size:18px;line-height:1.15;font-weight:850}
511
+ .sl-ga-sheet .sl-ga-prompt-title{font-size:22px}
512
+ .sl-ga-prompt-sub{margin-top:3px;font-size:12px;color:var(--sl-muted);font-weight:700}
513
+ .sl-ga-prompt-close{position:absolute;top:8px;inset-inline-end:8px;width:28px;height:28px;border-radius:999px;
514
+ color:var(--sl-muted)!important;font-size:19px;line-height:1}
515
+ .sl-ga-prompt-body{padding:13px 15px}
516
+ .sl-ga-sheet .sl-ga-prompt-body{padding:16px 18px}
517
+ .sl-ga-prompt-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 0}
518
+ .sl-ga-prompt-row + .sl-ga-prompt-row{border-top:1px solid color-mix(in srgb,var(--sl-line) 60%,transparent)}
519
+ .sl-ga-prompt-label{min-width:0;font-size:13px;font-weight:750}
520
+ .sl-ga-prompt-label small{display:block;margin-top:1px;color:var(--sl-muted);font-size:11px;font-weight:700}
521
+ .sl-ga-stepper{display:grid;grid-template-columns:40px 44px 40px;align-items:center;flex:none;
522
+ border:1px solid var(--sl-line);border-radius:11px;overflow:hidden;background:var(--sl-bg)}
523
+ .sl-ga-stepper button{height:40px;font-size:20px;font-weight:700;
524
+ background:color-mix(in srgb,var(--sl-line) 34%,transparent)!important}
525
+ .sl-ga-stepper button:disabled{opacity:.5;cursor:not-allowed}
526
+ .sl-ga-stepper output{text-align:center;font-size:17px;font-weight:850;font-variant-numeric:tabular-nums}
527
+ .sl-ga-prompt-total{display:flex;justify-content:space-between;align-items:baseline;margin-top:11px;padding-top:10px;
528
+ border-top:1px solid var(--sl-line);font-size:12px;color:var(--sl-muted);font-weight:700}
529
+ .sl-ga-prompt-total b{color:var(--sl-text);font-size:16px;font-weight:850}
530
+ .sl-ga-prompt-hint{margin-top:8px;color:var(--sl-muted);font-size:11px;font-weight:700}
531
+ .sl-ga-prompt-hint:empty{display:none}
532
+ .sl-ga-prompt-actions{display:flex;gap:8px;padding:0 15px 14px}
533
+ .sl-ga-sheet .sl-ga-prompt-actions{padding:0 18px max(18px,env(safe-area-inset-bottom))}
534
+ .sl-ga-prompt-actions button{flex:1;min-height:42px;border-radius:10px;font-weight:800;font-size:13px}
535
+ .sl-ga-sheet .sl-ga-prompt-actions button{min-height:48px;font-size:15px}
536
+ .sl-ga-prompt-remove{flex:0 0 auto!important;padding:0 14px;border:1px solid var(--sl-line)!important;color:var(--sl-muted)!important}
537
+ .sl-ga-prompt-confirm{background:var(--sl-accent)!important;color:var(--sl-accent-ink)!important}
538
+ .sl-ga-prompt-confirm:disabled{opacity:.55;cursor:not-allowed}
539
+
540
+ /* The tray's collapsed second entry point into the same prompt. */
541
+ .sl-ga-areas{border:1px dashed var(--sl-line);border-radius:var(--sl-r-sm);overflow:hidden}
542
+ .sl-ga-areas-toggle{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:9px 11px;
543
+ font-size:12px;font-weight:800;color:var(--sl-muted)!important}
544
+ .sl-ga-areas-toggle small{padding:1px 7px;border-radius:999px;font-size:10px;font-weight:800;
545
+ background:color-mix(in srgb,var(--sl-line) 40%,transparent)}
546
+ .sl-ga-areas-list{display:flex;flex-direction:column;border-top:1px solid var(--sl-line)}
547
+ .sl-ga-area-open{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px;text-align:start}
548
+ .sl-ga-area-open + .sl-ga-area-open{border-top:1px solid color-mix(in srgb,var(--sl-line) 55%,transparent)}
549
+ .sl-ga-area-open:hover:not(:disabled){background:color-mix(in srgb,var(--sl-line) 26%,transparent)}
550
+ .sl-ga-area-open:disabled{opacity:.5;cursor:not-allowed}
551
+ .sl-ga-area-open .name{min-width:0;font-size:13px;font-weight:750}
552
+ .sl-ga-area-open .name small{display:block;margin-top:1px;color:var(--sl-muted);font-size:10px;font-weight:700}
553
+ .sl-ga-area-open .meta{flex:none;font-size:11px;color:var(--sl-muted);font-weight:700}
554
+
432
555
  /* footer */
433
556
  .sl-foot{position:relative;z-index:2;padding:10px 16px 8px;border-top:1px solid var(--sl-line);flex:none;
434
557
  background:var(--sl-bg);box-shadow:0 -10px 24px -22px rgba(0,0,0,.72)}
@@ -525,6 +648,39 @@
525
648
  narrow layout had hidden, and the rail is that legend now, already in view. */
526
649
  .sl-head .sl-fs-pill{min-height:34px;min-width:34px;width:34px;padding:0;flex:none}
527
650
  .sl-head .sl-fs-pill .sl-zfs-lbl{display:none}
651
+ /* NARROW HEADER IS ONE 38px LINE. On a phone the host page (or the popup)
652
+ already names the event above the picker, so identity demotes to the
653
+ thumb + name density that data-event-details-hidden already defined, and
654
+ the hold clock becomes a quiet tinted pill: it must stay legible, not
655
+ compete with the Continue pill that actually takes the money. Every token
656
+ is theme-relative (accent-text is contrast-checked against bg AND surface
657
+ in resolvePickerTokens), so light org themes get a readable pill too. */
658
+ .sl-picker[data-layout="narrow"] .sl-head{gap:8px;padding:6px 10px 6px 12px;min-height:38px}
659
+ .sl-picker[data-layout="narrow"] .sl-logo{width:22px;height:22px;border-radius:6px;font-size:11px}
660
+ .sl-picker[data-layout="narrow"] .sl-head-name{font-size:12.5px}
661
+ .sl-picker[data-layout="narrow"] .sl-head-meta{display:none}
662
+ .sl-picker[data-layout="narrow"] .sl-head .sl-fs-pill{min-height:26px;min-width:26px;width:26px;color:var(--sl-muted)}
663
+ .sl-picker[data-layout="narrow"] .sl-head .sl-fs-pill svg{width:12px;height:12px}
664
+ .sl-picker[data-layout="narrow"] .sl-hold-pill{padding:4px 9px;font-size:11px;gap:5px;
665
+ background:color-mix(in srgb,var(--sl-accent) 14%,var(--sl-surface));color:var(--sl-accent-text)}
666
+ .sl-picker[data-layout="narrow"] .sl-hold-pill.is-expiring{background:var(--sl-accent);color:var(--sl-accent-ink)}
667
+ .sl-picker[data-layout="narrow"] .sl-closed-pill{padding:4px 9px;font-size:11px}
668
+ .sl-picker[data-layout="narrow"] .sl-close{width:26px;height:26px}
669
+ .sl-picker[data-layout="narrow"] .sl-close svg{width:12px;height:12px}
670
+ /* ON-MAP CONTROLS SHARE ONE SIZE ON A PHONE: 36px round (zoom column, minimap
671
+ toggle, colour-blind), 28px pills for level/mode groups. Every one of them
672
+ sits over seats, so the smaller they read the more map survives; the 44px
673
+ coarse-pointer floor still applies through the ::after targets below. */
674
+ .sl-picker[data-layout="narrow"] .sl-minimap-toggle{width:36px;height:36px;border-radius:999px}
675
+ .sl-picker[data-layout="narrow"] .sl-minimap-toggle svg{width:16px;height:16px}
676
+ .sl-picker[data-layout="narrow"] .sl-cbbtn{width:36px;height:36px}
677
+ /* One control size on phones \u2014 match the 36px round rhythm the rest of the
678
+ zoom column uses, but keep width for the language name to be readable. */
679
+ .sl-picker[data-layout="narrow"] .sl-langsel{height:36px;max-width:112px;font-size:11.5px}
680
+ .sl-picker[data-layout="narrow"] .sl-floors{padding:3px;gap:1px}
681
+ .sl-picker[data-layout="narrow"] .sl-floors button[data-floor]{min-height:28px;padding:4px 10px;font-size:10.5px}
682
+ .sl-picker[data-layout="narrow"] .sl-floor-info{flex-basis:26px;width:26px;height:26px;font-size:11px}
683
+ .sl-picker[data-layout="narrow"] .sl-projection button{min-height:28px}
528
684
 
529
685
  /* toast + boot states (toast flows in the bottom-center region) */
530
686
  .sl-toast{transform:translateY(6px) scale(.98);max-width:100%;
@@ -824,9 +980,10 @@
824
980
  (the cart chip's remove/view rail) instead get real height on narrow. */
825
981
  @media (pointer:coarse){
826
982
  .sl-zoom button,.sl-cbbtn,.sl-close,.sl-ga-qty button,.sl-ba-qty button,.sl-price-more,
827
- .sl-hold-change,.sl-seccard-x,.sl-fs-pill,.sl-side-toggle,.sl-ba-reopen{position:relative}
983
+ .sl-hold-change,.sl-seccard-x,.sl-fs-pill,.sl-side-toggle,.sl-ba-reopen,.sl-minimap-toggle,.sl-floor-info{position:relative}
828
984
  .sl-zoom button::after,.sl-cbbtn::after,.sl-close::after,.sl-ga-qty button::after,.sl-ba-qty button::after,
829
- .sl-price-more::after,.sl-hold-change::after,.sl-seccard-x::after,.sl-fs-pill::after,.sl-side-toggle::after,.sl-ba-reopen::after{
985
+ .sl-price-more::after,.sl-hold-change::after,.sl-seccard-x::after,.sl-fs-pill::after,.sl-side-toggle::after,.sl-ba-reopen::after,
986
+ .sl-minimap-toggle::after,.sl-floor-info::after{
830
987
  content:'';position:absolute;top:50%;left:50%;width:max(100%,44px);height:max(100%,44px);
831
988
  transform:translate(-50%,-50%)}
832
989
  /* The chip rail stacks remove over view in ~53px \u2014 pseudo-targets would
@@ -1102,13 +1259,20 @@
1102
1259
  .sl-confirm-3d svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round}
1103
1260
 
1104
1261
  /* One compact multi-floor selector (flows within the left-rail region). */
1105
- .sl-floors{display:none;align-items:center;gap:6px;max-width:min(260px,100%);padding:5px;border-radius:999px;
1262
+ .sl-floors{display:none;align-items:center;gap:2px;max-width:min(420px,100%);overflow-x:auto;
1263
+ scrollbar-width:none;padding:5px;border-radius:999px;
1106
1264
  background:color-mix(in srgb,var(--sl-surface) 92%,transparent);border:1px solid var(--sl-line);
1107
1265
  box-shadow:var(--sl-shadow);backdrop-filter:blur(8px)}
1108
1266
  .sl-floors.on{display:flex}
1109
- .sl-floors select{min-width:0;max-width:210px;min-height:34px;padding:6px 30px 6px 10px;border:0;border-radius:999px;
1110
- font:700 12px/1 inherit;color:var(--sl-text);background:var(--sl-surface);cursor:pointer}
1111
- .sl-floors select:focus-visible,.sl-floor-info:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}
1267
+ /* One tap per level. Mirrors .sl-rungs, which sits directly above it and reads
1268
+ as the same kind of control \u2014 a dropdown here asked for two interactions and
1269
+ hid what the other levels even were. */
1270
+ .sl-floors button[data-floor]{min-height:34px;padding:6px 13px;border:0;border-radius:999px;
1271
+ font:600 11px/1 inherit;letter-spacing:.05em;color:var(--sl-muted);background:transparent;
1272
+ white-space:nowrap;cursor:pointer;transition:color .15s,background-color .15s}
1273
+ .sl-floors button[data-floor]:hover{color:var(--sl-text)}
1274
+ .sl-floors button[data-floor][aria-pressed="true"]{background:var(--sl-accent);color:var(--sl-accent-ink)}
1275
+ .sl-floors button[data-floor]:focus-visible,.sl-floor-info:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}
1112
1276
  .sl-floor-info{display:inline-grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border-radius:999px;
1113
1277
  border:1px solid var(--sl-line);color:var(--sl-muted);background:transparent;font:800 13px/1 inherit;cursor:help}
1114
1278
  .sl-floor-info:hover{color:var(--sl-text);border-color:var(--sl-accent)}
@@ -1309,7 +1473,7 @@
1309
1473
  corners, and it is the frame. */
1310
1474
  .sl-modal-frame > .sl-picker{border-radius:0}
1311
1475
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
1312
- `;function Ze(){if(document.getElementById(At))return;let r=document.createElement("style");r.id=At,r.textContent=Wi,document.head.appendChild(r)}var Fe=require("@seatlayer/core/core/color");function ee(r){if(!r)return null;let e=r.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 s=t.length<=4?[...t].map(n=>`${n}${n}`).join(""):t;return{r:Number.parseInt(s.slice(0,2),16),g:Number.parseInt(s.slice(2,4),16),b:Number.parseInt(s.slice(4,6),16)}}let 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 De(r){return(0,Fe.relativeLuminance255)([r.r,r.g,r.b])}function Y(r,e){let t=ee(r),i=ee(e);if(!t||!i)return null;let s=Math.max(De(t),De(i)),n=Math.min(De(t),De(i));return(s+.05)/(n+.05)}function Ce(r,e="#172033",t="#eef1f8"){return(Y(e,r)??0)>=(Y(t,r)??0)?e:t}function Gi(r){return(0,Fe.rgb255ToHex)(r.r,r.g,r.b)}function Je(r,e,t){let i=ee(r),s=ee(e);if(!i||!s)return null;let n=Math.max(0,Math.min(1,t));return Gi({r:i.r*n+s.r*(1-n),g:i.g*n+s.g*(1-n),b:i.b*n+s.b*(1-n)})}function Yi(r,e,t,i){if((Y(r,t)??4.5)>=4.5&&(Y(r,i)??4.5)>=4.5)return r;if(!ee(r)||!ee(e))return e;for(let s=.15;s<=1;s+=.05){let n=Je(r,e,1-s);if(n&&(Y(n,t)??0)>=4.5&&(Y(n,i)??0)>=4.5)return n}return e}function _e(r,e){let t=e?.background??r?.background??"#0f1522",i=ee(t)?Ce(t)==="#172033":!1,s=e?.surface??(i?"#ffffff":"#1a2234"),n=e?.accent??r?.accent??"#f4b740",o=r?.accentInk,a=e?.accentInk??(o&&(Y(o,n)??4.5)>=4.5?o:Ce(n,"#1a1200","#ffffff")),l=r?.textColor,c=e?.text??(l&&(Y(l,t)??4.5)>=4.5&&(Y(l,s)??4.5)>=4.5?l:Ce(t));return{"--sl-accent":n,"--sl-accent-ink":a,"--sl-accent-text":Yi(n,c,t,s),"--sl-bg":t,"--sl-surface":s,"--sl-text":c,"--sl-muted":e?.muted??(i?"#667085":"#a5aec2"),"--sl-line":e?.line??(i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),"--sl-font":e?.fontFamily??r?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function Lt(r,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,r.appendChild(i),Object.entries(_e(void 0,t)).forEach(([n,o])=>i.style.setProperty(n,o)),i.innerHTML=`
1476
+ `;function pt(){if(document.getElementById(Zt))return;let r=document.createElement("style");r.id=Zt,r.textContent=Ms,document.head.appendChild(r)}var ve=require("@seatlayer/core");var Ye=require("@seatlayer/core/core/color");function J(r){if(!r)return null;let e=r.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 s=t.length<=4?[...t].map(n=>`${n}${n}`).join(""):t;return{r:Number.parseInt(s.slice(0,2),16),g:Number.parseInt(s.slice(2,4),16),b:Number.parseInt(s.slice(4,6),16)}}let 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 We(r){return(0,Ye.relativeLuminance255)([r.r,r.g,r.b])}function Z(r,e){let t=J(r),i=J(e);if(!t||!i)return null;let s=Math.max(We(t),We(i)),n=Math.min(We(t),We(i));return(s+.05)/(n+.05)}function te(r,e="#172033",t="#eef1f8"){return(Z(e,r)??0)>=(Z(t,r)??0)?e:t}function Hs(r){return(0,Ye.rgb255ToHex)(r.r,r.g,r.b)}function ht(r,e,t){let i=J(r),s=J(e);if(!i||!s)return null;let n=Math.max(0,Math.min(1,t));return Hs({r:i.r*n+s.r*(1-n),g:i.g*n+s.g*(1-n),b:i.b*n+s.b*(1-n)})}function Jt(r,e,t,i){if((Z(r,t)??4.5)>=4.5&&(Z(r,i)??4.5)>=4.5)return r;if(!J(r)||!J(e))return e;for(let s=.15;s<=1;s+=.05){let n=ht(r,e,1-s);if(n&&(Z(n,t)??0)>=4.5&&(Z(n,i)??0)>=4.5)return n}return e}function ei(r,e){let t=e??r["--sl-bg"],i=J(t)?te(t)==="#172033":!1,s=J(r["--sl-bg"])?te(r["--sl-bg"])==="#172033":!1;if(i===s)return null;let n=i?"#ffffff":"#1a2234",a=te(t),o=r["--sl-accent"];return{"--sl-bg":t,"--sl-surface":n,"--sl-text":a,"--sl-muted":i?"#667085":"#a5aec2","--sl-line":i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":Jt(o,a,t,n)}}function Re(r,e){let t=e?.background??r?.background??"#0f1522",i=J(t)?te(t)==="#172033":!1,s=e?.surface??(i?"#ffffff":"#1a2234"),n=e?.accent??r?.accent??"#f4b740",a=r?.accentInk,o=e?.accentInk??(a&&(Z(a,n)??4.5)>=4.5?a:te(n,"#1a1200","#ffffff")),l=r?.textColor,c=e?.text??(l&&(Z(l,t)??4.5)>=4.5&&(Z(l,s)??4.5)>=4.5?l:te(t));return{"--sl-accent":n,"--sl-accent-ink":o,"--sl-accent-text":Jt(n,c,t,s),"--sl-bg":t,"--sl-surface":s,"--sl-text":c,"--sl-muted":e?.muted??(i?"#667085":"#a5aec2"),"--sl-line":e?.line??(i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),"--sl-font":e?.fontFamily??r?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function ti(r,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,ve.getLocale)(),i.dir=(0,ve.localeDirection)(),r.appendChild(i),Object.entries(Re(void 0,t)).forEach(([n,a])=>i.style.setProperty(n,a)),i.innerHTML=`
1313
1477
  <div class="sl-head">
1314
1478
  <div class="sl-logo" data-ref="logo"></div>
1315
1479
  <div class="sl-head-info" data-ref="headInfo">
@@ -1321,28 +1485,28 @@
1321
1485
  <svg viewBox="0 0 24 24" aria-hidden="true"><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg>
1322
1486
  <span data-ref="closedPillText"></span>
1323
1487
  </span>
1324
- <button type="button" class="sl-close" data-ref="close" aria-label="${e("picker.close","Close")}">
1488
+ <button type="button" class="sl-close" data-ref="close" data-sl-a="picker.close" aria-label="${e("picker.close","Close")}">
1325
1489
  <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>
1326
1490
  </button>
1327
1491
  </div>
1328
- <div class="sl-rail" data-ref="rail" role="group" aria-label="${e("picker.ticketPrices","Ticket prices")}">
1492
+ <div class="sl-rail" data-ref="rail" role="group" data-sl-a="picker.ticketPrices" aria-label="${e("picker.ticketPrices","Ticket prices")}">
1329
1493
  <div class="sl-rail-scroll" data-ref="railScroll"></div>
1330
1494
  </div>
1331
1495
  <div class="sl-body">
1332
1496
  <div class="sl-map">
1333
1497
  <div class="sl-map-host" data-ref="map"></div>
1334
1498
  <div class="sl-zoom" data-ref="zoom">
1335
- <button type="button" aria-label="${e("picker.zoomIn","Zoom in")}" title="${e("picker.zoomIn","Zoom in")}" data-ref="zin">+</button>
1336
- <button type="button" aria-label="${e("picker.zoomOut","Zoom out")}" title="${e("picker.zoomOut","Zoom out")}" data-ref="zout">\u2212</button>
1337
- <button type="button" aria-label="${e("picker.fitToScreen","Fit to screen")}" title="${e("picker.fitToScreen","Fit to screen")}" data-ref="zfit">
1499
+ <button type="button" data-sl-a="picker.zoomIn" aria-label="${e("picker.zoomIn","Zoom in")}" data-sl-ti="picker.zoomIn" title="${e("picker.zoomIn","Zoom in")}" data-ref="zin">+</button>
1500
+ <button type="button" data-sl-a="picker.zoomOut" aria-label="${e("picker.zoomOut","Zoom out")}" data-sl-ti="picker.zoomOut" title="${e("picker.zoomOut","Zoom out")}" data-ref="zout">\u2212</button>
1501
+ <button type="button" data-sl-a="picker.fitToScreen" aria-label="${e("picker.fitToScreen","Fit to screen")}" data-sl-ti="picker.fitToScreen" title="${e("picker.fitToScreen","Fit to screen")}" data-ref="zfit">
1338
1502
  <svg viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"/></svg>
1339
1503
  </button>
1340
- <button type="button" aria-label="${e("picker.fullScreen","Full screen")}" title="${e("picker.fullScreen","Full screen")}" aria-pressed="false" data-ref="zfs">
1504
+ <button type="button" data-sl-a="picker.fullScreen" aria-label="${e("picker.fullScreen","Full screen")}" data-sl-ti="picker.fullScreen" title="${e("picker.fullScreen","Full screen")}" aria-pressed="false" data-ref="zfs">
1341
1505
  <svg viewBox="0 0 24 24"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg>
1342
- <span class="sl-zfs-lbl" aria-hidden="true">${e("picker.fullScreen","Full screen")}</span>
1506
+ <span class="sl-zfs-lbl" data-sl-t="picker.fullScreen" aria-hidden="true">${e("picker.fullScreen","Full screen")}</span>
1343
1507
  </button>
1344
1508
  </div>
1345
- <div class="sl-boot" data-ref="boot"><span class="sl-boot-spin"></span>${e("picker.loadingSeatMap","Loading seat map\u2026")}</div>
1509
+ <div class="sl-boot" data-ref="boot"><span class="sl-boot-spin"></span><span data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span></div>
1346
1510
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
1347
1511
  </div>
1348
1512
  <div class="sl-side" data-ref="side">
@@ -1350,23 +1514,23 @@
1350
1514
  <div class="sl-sheet-grab"></div>
1351
1515
  <div class="sl-sheet-bar">
1352
1516
  <div class="sl-sheet-peek" data-ref="peek"></div>
1353
- <button type="button" class="sl-sheet-toggle" data-ref="sheetToggle" aria-label="${e("picker.openTicketPanel","Open ticket panel")}" aria-expanded="false">
1517
+ <button type="button" class="sl-sheet-toggle" data-ref="sheetToggle" data-sl-a="picker.openTicketPanel" aria-label="${e("picker.openTicketPanel","Open ticket panel")}" aria-expanded="false">
1354
1518
  <svg viewBox="0 0 24 24"><path d="M6 15l6-6 6 6"/></svg>
1355
1519
  </button>
1356
1520
  </div>
1357
1521
  </div>
1358
- <div class="sl-sec sl-filtersec" data-ref="filtersSec">${e("picker.filters","Filters")}</div>
1522
+ <div class="sl-sec sl-filtersec" data-ref="filtersSec" data-sl-t="picker.filters">${e("picker.filters","Filters")}</div>
1359
1523
  <div class="sl-filters" data-ref="filters"></div>
1360
1524
  <div class="sl-offer" data-ref="offer" role="status" aria-live="polite"></div>
1361
- <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span>${e("picker.ticketPrices","Ticket prices")}</span></div>
1525
+ <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span></div>
1362
1526
  <div class="sl-prices-hint" data-ref="pricesHint"></div>
1363
1527
  <div class="sl-prices" data-ref="prices"></div>
1364
1528
  <div class="sl-live" data-ref="live" role="status" aria-live="polite">
1365
1529
  <span class="dot" aria-hidden="true"></span>
1366
- <span data-ref="liveText">${e("picker.liveAvailability","Live availability \u2014 seats update in real time")}</span>
1530
+ <span data-ref="liveText" data-sl-t="picker.liveAvailability">${e("picker.liveAvailability","Live availability \u2014 seats update in real time")}</span>
1367
1531
  </div>
1368
1532
  <div class="sl-sec sl-seats-sec">
1369
- <span>${e("picker.yourSeats","Your seats")}</span>
1533
+ <span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>
1370
1534
  <span class="sl-seat-summary" data-ref="seatSummary"></span>
1371
1535
  </div>
1372
1536
  <div class="sl-tray" data-ref="tray"></div>
@@ -1374,13 +1538,15 @@
1374
1538
  <div class="sl-hold-note" data-ref="holdNote" role="status" aria-live="polite">
1375
1539
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6L9 17l-5-5"/></svg>
1376
1540
  <span>
1377
- <b data-ref="holdTitle">${e("picker.seatsSecured","Seats secured")}</b>
1378
- <span class="sl-hold-copy" data-ref="holdCopy">${e("picker.notChargedYet","You won\u2019t be charged yet.")}</span>
1541
+ <b data-ref="holdTitle" data-sl-t="picker.seatsSecured">${e("picker.seatsSecured","Seats secured")}</b>
1542
+ <span class="sl-hold-copy" data-ref="holdCopy" data-sl-t="picker.notChargedYet">${e("picker.notChargedYet","You won\u2019t be charged yet.")}</span>
1379
1543
  </span>
1380
- <button type="button" class="sl-hold-change" data-ref="holdChange" aria-label="${e("picker.releaseHeldTickets","Release held tickets and choose different seats")}">${e("picker.change","Change")}</button>
1544
+ <button type="button" class="sl-hold-change" data-ref="holdChange" data-sl-a="picker.releaseHeldTickets" data-sl-t="picker.change" aria-label="${e("picker.releaseHeldTickets","Release held tickets and choose different seats")}">${e("picker.change","Change")}</button>
1381
1545
  </div>
1382
1546
  <div class="sl-total"><span data-ref="count"></span><b data-ref="total"></b></div>
1383
1547
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
1384
1548
  </div>
1385
1549
  </div>
1386
- </div>`;let s={};return i.querySelectorAll("[data-ref]").forEach(n=>{s[n.dataset.ref]=n}),{root:i,mapHost:s.map,els:s}}var Q=require("@seatlayer/core/view/panoramaDelivery");function Pt(r){let{root:e,source:t,caption:i,real:s,closeLabel:n,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:h,onClose:p}=r,d=document.createElement("div");d.className="sl-view",d.setAttribute("role","dialog"),d.setAttribute("aria-label",a),d.innerHTML=`<div class="sl-view-head"><span class="sl-view-title">${a}</span><span class="sl-view-cap">${i}</span><button type="button" class="sl-view-x" aria-label="${n}"><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">${s?l:c}</span><span class="sl-view-hint">${o}</span></div>`,e.appendChild(d);let f=d.querySelector(".sl-view-pano"),m=(0,Q.planPanoramaDelivery)(t,(0,Q.browserPanoramaConstraints)()),g=new AbortController;f.style.backgroundImage=`url("${m.initialUrl}")`;let w=()=>{};m.upgradeUrl&&(w=(0,Q.schedulePanoramaUpgrade)(()=>{h(m.upgradeUrl).then(T=>!T||g.signal.aborted?null:(0,Q.loadPanoramaImage)(T,g.signal).then(()=>T)).then(T=>{!T||!d.isConnected||g.signal.aborted||(f.style.backgroundImage=`url("${T}")`)}).catch(()=>{})}));let k=70,x=35,y=1,E=f.clientHeight||1,u=f.clientWidth||1,b=-(E*(180/k)*2/2-u/2),C=0,A=()=>{let T=f.clientHeight||1,$=T*(180/k)*y,R=Math.max(0,$-T),ge=Math.min(R/2,x/180*$);C=Math.min(ge,Math.max(-ge,C)),f.style.backgroundSize=`auto ${$}px`,f.style.backgroundPosition=`${b}px ${C-R/2}px`};A();let H=!1,L=0,M=0,_=T=>{H=!0,L=T.clientX,M=T.clientY,f.classList.add("drag"),f.setPointerCapture?.(T.pointerId)},K=T=>{H&&(b+=T.clientX-L,C+=T.clientY-M,L=T.clientX,M=T.clientY,A())},W=T=>{H=!1,f.classList.remove("drag"),f.releasePointerCapture?.(T.pointerId)},se=T=>{T.preventDefault(),y=Math.min(2.4,Math.max(1,y+(T.deltaY<0?.12:-.12))),A()};f.addEventListener("pointerdown",_),f.addEventListener("pointermove",K),f.addEventListener("pointerup",W),f.addEventListener("pointercancel",W),f.addEventListener("wheel",se,{passive:!1});let fe=d.querySelector(".sl-view-x");fe.addEventListener("click",p);let be=T=>{T.key==="Escape"&&(T.stopPropagation(),p())};return d.addEventListener("keydown",be),fe.focus(),{element:d,dispose(){w(),g.abort(),f.removeEventListener("pointerdown",_),f.removeEventListener("pointermove",K),f.removeEventListener("pointerup",W),f.removeEventListener("pointercancel",W),f.removeEventListener("wheel",se),d.removeEventListener("keydown",be),fe.removeEventListener("click",p)}}}var Vt=require("@seatlayer/core/core/seatConfidence");var $t=require("@seatlayer/core"),ts={};function S(r,e){let t=(0,$t.t)(r);return t===r?e:t}function zt(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}function V(r){return String(r??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}var es=(()=>{if(typeof document<"u"&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src)return document.currentScript.src;try{let r=ts.url;if(typeof r=="string"&&r)return r}catch{}})(),he=null;function Bt(){if(he!==null)return he;try{if(typeof document>"u")return he=!1;he=!!document.createElement("canvas").getContext("webgl2")}catch{he=!1}return he}function tt(r){let e=es??(typeof location<"u"?location.href:void 0);if(!e)throw new Error(`seatlayer: cannot resolve the ${r} chunk URL`);return new URL(`./${r}`,e).href}async function Dt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(tt("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")}async function Ft(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(tt("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function _t(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(tt("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(It(),Ot))}function jt(r){return r==="unavailable_for_event"||r==="payments_off_for_event"?r:"not_configured"}function je(r,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(r);if(e)try{return s.toLocaleString(t,{...i,timeZone:e})}catch{}return s.toLocaleString(t,i)}function U(r){return String(r??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function ue(r){return r?.restrictedView?S("picker.restrictedView","Restricted view"):r?.obstructedView?S("picker.obstructedView","Obstructed view"):""}function Nt(r){if(!r)return"";let e=[];r.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${S("picker.premiumSeat","Premium seat")}</div>`);let t=ue(r);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${r.note?`<span class="sl-cx-note">${U(r.note)}</span>`:""}</span></div>`):r.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${U(r.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function it(r){let e=ue(r);if(!e)return"";let t=U(r?.note?r.note:e);return`<span class="sl-cx-mark" role="img" aria-label="${t}" title="${t}">\u25D0</span>`}function Te(r){return r==="no-seat"?S("picker.emptyWheelchairSpace","Empty wheelchair space"):r==="seat-present"?S("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Ut(r){let e=Te(r);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function st(r){let e=Te(r);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function rt(r,e){if(!r)return"";let t=e?S("picker.viewFromThisSeat","View from this seat"):S("picker.seeItIn3d","See it in 3D");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>${t}</span></button>`}function qt(r){if(!r)return"";let e=r.previous.label||r.previous.id,t=r.next.label||r.next.id;return`<span class="sl-seccard-nav" aria-label="${S("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${V(r.previous.id)}" aria-label="${S("picker.previousSection","Previous section")}: ${V(e)}" title="${V(e)}">\u2190</button><button type="button" data-section-nav="${V(r.next.id)}" aria-label="${S("picker.nextSection","Next section")}: ${V(t)}" title="${V(t)}">\u2192</button></span>`}function Kt(r,e){if(!e)return"";let t=e,i=t.includes(r.id),s=i?t.length>1?S("picker.openComparison","Open comparison"):S("picker.savedForComparison","Saved for comparison"):t.length?S("picker.compareWithSaved","Compare with saved"):S("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>${U(s)}</span></button>`}function Wt(r,e,t){if(!t)return"";let i=(0,Vt.seatConfidenceDisclosure)(r.confidenceEvidence),s=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${U(r.displayLabel??r.label)}"><span><em>${U(e)}</em><strong>${U(i.headline)}</strong><small>${U(s)}</small></span><b>Passport</b></button>`}function te(r){let e=r?.rowLabel,t=r?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let s=`${t}${i}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return e}var Gt=require("@seatlayer/core"),me=require("@seatlayer/core/picker/minimapGeometry");function Yt(r,e){let t=new nt(r);return t.build(e),t}var nt=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}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",S("picker.openVenueMap","Open venue overview map")),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 s=document.createElement("div");s.className="sl-minimap",s.setAttribute("role","group");let n=document.createElement("div");n.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",S("picker.minimapStateKey","Focused, selected, available, and inactive sections")),a.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",S("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",n.append(o,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",S("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),s.append(n,c),e.appendChild(s),this.miniWrap=s,this.miniLabel=o,this.miniCanvas=c;let h=document.createElement("canvas");this.miniBase=h,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 s=196,n=146,o=6,a=i.width/Math.max(1,i.height),l=s,c=Math.round(s/a);c>n&&(c=n,l=Math.round(n*a)),l=Math.max(64,l),c=Math.max(48,c);let h=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*h),e.height=Math.round(c*h),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,me.createMinimapTransform)(i,e.width,e.height,h,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?S("picker.allFloors","All floors"):e.find(h=>h.id===this.host.controller.getActiveFloorId())?.name??S("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,n=i.find(h=>h.active)?.label??this.host.focusedSectionLabel(),o=n?`${t} \xB7 ${n}`:t;this.miniLabel.textContent=o;let a=i.filter(h=>h.state==="selected").length,l=i.filter(h=>h.state==="available").length,c=i.filter(h=>h.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${S("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${S("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}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 s=p=>p*t.scale+t.offX,n=p=>p*t.scale+t.offY,o=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",h=this.host.controller.getMinimapSnapshot();for(let p of h.sections)p.outline.length<3||(i.beginPath(),p.outline.forEach((d,f)=>f===0?i.moveTo(s(d.x),n(d.y)):i.lineTo(s(d.x),n(d.y))),i.closePath(),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=o,i.stroke(),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,!h.sections.length){let p=Math.max(1,t.dpr);for(let d of h.seats)i.globalAlpha=d.state==="inactive"?.22:.78,i.fillStyle=d.state==="inactive"?a:d.state==="selected"?l:c,i.beginPath(),i.arc(s(d.x),n(d.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 s=e.getContext("2d");if(!s)return;s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);let n=this.host.controller.getViewport();if(!n)return;let o=(0,me.minimapViewportPlan)(n.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";s.save(),s.globalAlpha=.1,s.fillStyle=a,s.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=.9,s.lineJoin="round",s.lineWidth=Math.max(4,i.dpr*3.25),s.strokeStyle=l,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=1,s.lineWidth=Math.max(2,i.dpr*1.75),s.strokeStyle=a,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(s.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),s.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),s.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let s=t.getBoundingClientRect(),n=(e.clientX-s.left)*(t.width/Math.max(1,s.width)),o=(e.clientY-s.top)*(t.height/Math.max(1,s.height));return{...(0,me.minimapPointToWorld)({x:n,y:o},i),px:n,py:o}}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,s=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!s||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+s}),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,Gt.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var Ve=require("@seatlayer/core");var is=12;function Xt(r,e){let t=e.floors(),i=new Set(t.map(g=>g.label.trim().toLocaleLowerCase())),s=e.zones().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),n=e.sections().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),o=s.length>1?[]:n,a=t.length>1,l=s.length>1,c=o.length>1;if(!a&&!l&&!c)return;let h=document.createElement("div");h.className="sl-view3d-nav";let p=document.createElement("button");p.type="button",p.className="sl-view3d-nav-toggle",p.setAttribute("aria-expanded","false");let d=g=>{h.classList.toggle("is-open",g),p.setAttribute("aria-expanded",String(g)),p.textContent=g?S("picker.closeVenueNav","Close"):a&&(l||c)?S("picker.levelsAndAreas","Levels & areas"):a?S("picker.levels","Levels"):S("picker.areas","Areas")};p.addEventListener("click",()=>d(!h.classList.contains("is-open"))),h.addEventListener("keydown",g=>{g.key!=="Escape"||!h.classList.contains("is-open")||(g.preventDefault(),g.stopPropagation(),d(!1),p.focus())}),d(!1),h.appendChild(p);let f=g=>{},m=g=>{};if(a){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",S("picker.levels","Levels"));let w=[];m=y=>{w.forEach(E=>{E.setAttribute("aria-pressed",String((E.dataset.floor===""?null:Number(E.dataset.floor))===y))})};let k=y=>{e.focusFloor(y)&&(m(y),f(y))},x=(y,E)=>{let u=document.createElement("button");u.type="button",u.textContent=y,u.dataset.floor=E===null?"":String(E),u.setAttribute("aria-pressed",String(E===null)),u.addEventListener("click",()=>{k(E),d(!1)}),w.push(u),g.appendChild(u)};x(S("picker.allLevels","All levels"),null);for(let y of t)x(y.label||(0,Ve.t)("picker.levelNumber",{number:y.index+1}),y.index);h.appendChild(g)}if(l||c){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",S("picker.areas","Areas"));let w=l?s.map(x=>({id:x.id,label:x.label||x.id,go:()=>{e.focusZone(x.id)}})):o.map(x=>({id:x.id,label:x.label||x.id,floorIndex:x.floorIndex,go:()=>{e.focusSection(x.id),Number.isFinite(x.floorIndex)&&m(x.floorIndex)}})),k=x=>{let y=l||x===null?w:w.filter(E=>E.floorIndex===void 0||E.floorIndex===x);if(g.replaceChildren(),!y.length){g.remove();return}if(g.isConnected||h.appendChild(g),!l&&y.length>is){let E=document.createElement("select");E.setAttribute("aria-label",S("picker.jumpToSection","Jump to section"));let u=document.createElement("option");u.value="",u.textContent=S("picker.jumpToSection","Jump to section"),E.appendChild(u);for(let b of y){let C=document.createElement("option");C.value=b.id,C.textContent=b.label,E.appendChild(C)}E.addEventListener("change",()=>{y.find(b=>b.id===E.value)?.go()}),g.appendChild(E);return}for(let E of y){let u=document.createElement("button");u.type="button",u.textContent=E.label,u.addEventListener("click",()=>{E.go(),d(!1)}),g.appendChild(u)}};f=k,k(null)}r.appendChild(h)}var Ne=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",S("picker.savedSeatComparison","Saved seat comparison"));let n=document.createElement("button");n.type="button",n.className="main",n.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(S("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",S("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(n,o),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=i>1?(0,Ve.t)("picker.compareCount",{count:i}):S("picker.oneSeatSaved","1 seat saved"),s.setAttribute("aria-label",i>1?(0,Ve.t)("picker.openComparisonOfSeats",{count:i}):S("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};var Ee=require("@seatlayer/core");function Qt(r){return Array.isArray(r)?r.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function ot(r,e,t=!1){let i=r.violations[0];return i==="numberOfPlacesToSelect"?r.remaining>0?(0,Ee.t)("picker.selectExactMore",{count:r.remaining}):(0,Ee.t)("picker.selectExactCount",{count:r.required}):i==="minimumSelectedPlaces"?(0,Ee.t)("picker.selectMinimumMore",{count:r.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,Ee.t)("picker.orphanHint")}var ie=require("@seatlayer/core");function at(r){let e=Math.max(0,r),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Zt({d:r,area:e,label:t,objectType:i,quantity:s=1,identity:n}){let o=h=>String(h??"\u2014").replace(/[&<>"]/g,p=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[p]),a=i==="ga"?"ga":r?.objectType??i,l=n?.displayType?.trim()||r?.displayType?.trim()||e?.displayType?.trim()||(a==="table"?S("picker.table","Table"):a==="booth"?S("picker.booth","Booth"):a==="ga"?S("picker.generalAdmission","General admission"):S("picker.row","Row")),c=n?.rowLabel??n?.displayLabel??r?.rowLabel??r?.displayLabel??e?.displayLabel??e?.label??t;return a==="table"&&n?.bookingMode?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span><span class="fld mid"><span class="sl-chip-eb">${S("picker.guests","Guests")}</span><span class="val">${s}</span></span></div>`:a==="ga"?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span>`+(s>1?`<span class="fld mid"><span class="sl-chip-eb">${S("picker.tickets","Tickets")}</span><span class="val">${s}</span></span>`:"")+"</div>":a==="booth"?'<div class="sl-chip-id">'+(r?.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${S("picker.section","Section")}</span><span class="val">${o(r.sectionLabel)}</span></span>`:"")+`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span></div>`:!r?.sectionLabel&&!r?.rowLabel&&!r?.seatNumber?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${S("picker.seat","Seat")}</span><span class="val">${o(c)}</span></span></div>`:'<div class="sl-chip-id">'+(r.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${S("picker.section","Section")}</span><span class="val">${o(r.sectionLabel)}</span></span>`:"")+(r.rowLabel?`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(te(r))}</span></span>`:"")+(r.seatNumber?`<span class="fld mid"><span class="sl-chip-eb">${S("picker.seat","Seat")}</span><span class="val">${o(r.seatNumber)}</span></span>`:"")+"</div>"}function Jt(r,e){return`<div class="sl-chip-rail"><button type="button" class="rm" aria-label="${r}"><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>`+(e?`<button type="button" class="view" data-view-label="${e}" aria-label="${(0,ie.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>`:"")+"</div>"}function ei(r){return r.salesClosed||r.hasHold||r.ctaPhase!=="idle"||r.formOpen||r.room<=0?null:Math.max(1,Math.min(r.wanted,r.room))}function ti({count:r,total:e,pendingCount:t,ctaPhase:i,hasHold:s,salesClosed:n,fromPrice:o,addMore:a,money:l}){if(r&&i==="holding")return`<span>${S("picker.securingSeats","Securing your seats\u2026")}</span>`;if(r&&i==="checkout")return`<span>${(0,ie.t)("picker.peekSecured",{count:r,total:l(e)})}</span>`;if(r){let c=!!s;return`<span>${(0,ie.tCount)("picker.peekTicketsTotal",r,{total:l(e)})}</span>`+(a?`<button type="button" class="go ghost sl-sheet-go" data-act="best" aria-label="${S("picker.findTogetherInstead","Find seats together instead")}">\u2726 +${a}</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="${c?"checkout":"open"}">${s?t?S("picker.secureMore","Secure more"):S("picker.continue","Continue"):S("picker.review","Review")}</button>`}else return n?`<span>${S("picker.salesClosedPill","Sales are closed")}</span>`:(o!=null?`<span>${(0,ie.t)("picker.peekFromPrice",{price:l(o)})}</span>`:`<span>${S("picker.pickYourSeats","Pick your seats")}</span>`)+`<button type="button" class="go sl-sheet-go" data-act="open">${S("picker.bestSeatsStar","\u2726 Best seats")}</button>`}function lt(r,e=Date.now()){return(0,ie.t)("picker.holdReassurance",{time:at(r-e)})}var ss="https://api.seatlayer.io",rs=10,ii=6e4,si=6e4,ri=new Set;function ns(r){let e=ri.has(r);return ri.add(r),e}var ni="seatmap.a11y.cb";function os(){try{if(typeof window>"u")return null;let r=window.localStorage.getItem(ni);return r==null?null:r==="1"}catch{return null}}function as(r){try{window.localStorage.setItem(ni,r?"1":"0")}catch{}}var Ue=class r{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";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.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;this.gaQty=new Map;this.tipEl=null;this.tipPos={x:0,y:0};this.confirmEl=null;this.confirmSeat=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.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=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 Ne({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.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.secCardEl=null;this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.lastSection=null;this.secCardCollapsed=!1;this.secCardShownAt=0;this.lastTrayCount=0;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yChipsEl=null;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;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.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??ss).replace(/\/+$/,""),this.access=e.transport?null:pe(e,{onExpired:n=>{this.opts.onAccessExpired?.(n),n.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:n=>{this.opts.onAccessUnavailable?.(n),this.showAccessPanel(n)}}),this.pubApi=e.transport?null:new oe(this.apiBase,{access:this.access??void 0,onObjectUnavailable:n=>this.opts.onSelectedObjectUnavailable?.(n)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new $e(e.event,this.api.asset?(n,o)=>this.api.asset(n,o):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 t=e.numberOfPlacesToSelect;if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=t??null;let i=Qt(e.selectionValidators);if(this.exactTickets!=null&&i>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(rs,i)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<i)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=os()??!!e.colorblindSafe,this.controller=this.wireController(e)}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let s of i)if(s.type==="shape"&&(s.role==="stage"||s.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=e.viewUrl??"",s=this.chartHasStage();if(!i&&!s)return"";let n=null;if(!i)try{n=(0,v.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let o=s&&n!=null?`<div class="sl-confirm-sight">${(0,v.t)("picker.sightline",{m:n})}</div>`:"";return(i?`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${(0,v.t)("picker.viewFromSeat",{label:e.label})}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${this.tf("picker.viewFromHere","View from here")}</span></button>`:`<button type="button" class="sl-confirm-view sl-confirm-viewbtn" aria-label="${(0,v.t)("picker.viewFromSeat",{label:e.label})}"><span aria-hidden="true">\u{1F52D}</span><span>${this.tf("picker.viewFromHere","View from here")}</span></button>`)+o}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(this.isFramed())try{window.parent.postMessage(e,"*")}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()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),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))}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}),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){Ze();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",S("picker.seatSelection","Seat selection")),s.tabIndex=-1,i.appendChild(s),document.body.appendChild(i);let n=document.body.style.overflow;document.body.style.overflow="hidden";let o=new r({...e,container:s});o.modalScrim=i,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let m=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(g=>g.isConnected&&!g.closest('[hidden], [aria-hidden="true"], [inert]'));return m[m.length-1]??s},c=(m,g)=>{let w=m;for(;w;){let k=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||k.display==="none"||k.visibility==="hidden"||k.visibility==="collapse")return!0;if(w===g)return!1;w=w.parentElement}return!0},h=m=>[...m.querySelectorAll(a)].filter(g=>g.tabIndex>=0&&!g.matches(":disabled")&&!c(g,m)),p=(m,g)=>{let w=h(m),k=g?w[w.length-1]:w[0];k?k.focus({preventScroll:!0}):(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.focus({preventScroll:!0}))},d=!1,f=()=>{if(d)return;d=!0,document.body.style.overflow=n,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let m=o.prevFocus;o.prevFocus=null,m?.isConnected&&m.focus({preventScroll:!0});let g=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(g):g()};return o.closeModal=f,i.addEventListener("mousedown",m=>{m.target===i&&f()}),o.escHandler=m=>{if(m.key==="Tab"){if(m.defaultPrevented)return;let g=l(),w=h(g),k=w[0],x=w[w.length-1],y=document.activeElement;!k||!x?(m.preventDefault(),p(g,m.shiftKey)):y===g||!y||!g.contains(y)?(m.preventDefault(),(m.shiftKey?x:k).focus({preventScroll:!0})):m.shiftKey&&y===k?(m.preventDefault(),x.focus({preventScroll:!0})):!m.shiftKey&&y===x&&(m.preventDefault(),k.focus({preventScroll:!0}));return}m.key==="Escape"&&(o.tableDialog?(m.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(m.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(m.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(m.preventDefault(),f()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",f),p(l(),!1),o}wireController(e){return new v.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,mapTheme:e.theme?.map??null,onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.toast((0,v.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning"),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,v.t)("picker.maxTicketsForOrder",{count: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),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>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,Ze();let s=performance.now();await(0,v.loadLocale)(this.opts.locale),t.loadLocale=i(s),this.opts.messages&&(0,v.setStringOverrides)(this.opts.messages),this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let n=performance.now(),o=zt(this.opts.container),{root:a,els:l,mapHost:c}=Lt(o,(b,C)=>this.tf(b,C),this.opts.theme);this.root=a,this.els=l,this.mapHost=c,a.addEventListener("keydown",b=>{b.key==="Escape"&&(this.tableDialog?(b.preventDefault(),b.stopPropagation(),this.cancelTableDialog()):this.confirmSeat?(b.preventDefault(),b.stopPropagation(),this.cancelConfirm()):this.bestAvailableConfirm&&(b.preventDefault(),b.stopPropagation(),this.bestAvailableConfirm=!1,this.syncTray()))}),this.syncFullscreenButtons(),this.wireBuyerShell(a);let h=document.createElement("div");h.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(h),t.mountBuyerShell=i(n);let p=await this.loadChart(h,t,i);if(!p)return this;this.els.boot.remove();let d=performance.now();if(this.startRealtime(),this.salesClosed=!!p.salesClosed||!!this.opts.readOnly,a.dataset.eventMode=p.mode==="test"?"test":"live",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),p.mode==="test"){let b=document.createElement("div");b.className="sl-testbadge",b.textContent=(0,v.t)("picker.testMode"),b.setAttribute("aria-label",(0,v.t)("picker.testMode")),this.regions["top-left"].appendChild(b)}let f=this.controller.doc?.theme;Object.entries(_e(f,this.opts.theme)).forEach(([b,C])=>a.style.setProperty(b,C)),this.currency=p.currency??this.opts.currency??"USD",this.eventTimezone=p.timezone??null;let m=this.opts.theme?.logoUrl??f?.logoUrl??p.posterUrl??null;m?this.els.logo.innerHTML=`<img src="${m}" alt="">`:this.els.logo.textContent=(this.opts.theme?.brandName??f?.brandName??p.eventName??"?").slice(0,1).toUpperCase(),this.els.name.textContent=p.eventName??"";let g=p.startsAt?je(p.startsAt,p.timezone??null,this.opts.locale):"";this.eventWhenText=g||null,this.els.meta.textContent=[p.venue,g].filter(Boolean).join(" \xB7 "),this.els.pricesHint&&(this.els.pricesHint.textContent=this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.buildBadge(f);let w=new Set,k=!1;if(this.controller.doc)for(let b of(0,v.expandChart)(this.controller.doc)){for(let C of b.accessibility??[])w.add(C);b.accessible&&!b.accessibility?.length&&w.add("wheelchair"),(b.commercial?.restrictedView||b.commercial?.obstructedView)&&(k=!0)}let x=()=>{this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())};if(w.size||k){let b=document.createElement("div");if(b.className="sl-chips",this.regions["top-left"].appendChild(b),this.a11yChipsEl=b,w.size){let C=(L,M)=>`<button type="button" class="sl-chip-f${L==="all"?" on":""}" data-a11y="1" data-f="${L}">${M}</button>`;b.insertAdjacentHTML("beforeend",C("all",this.tf("picker.allSeats","All seats"))+v.ACCESSIBILITY_TYPES.filter(({key:L})=>w.has(L)).map(({key:L,short:M,icon:_})=>C(L,`${_} ${M}`)).join(""));let A=new Set,H=()=>{b.querySelectorAll("button[data-a11y]").forEach(M=>{let _=M.dataset.f,K=_==="all"?A.size===0:A.has(_);M.classList.toggle("on",K),M.setAttribute("aria-pressed",String(K))});let L=A.size?[...A]:null;this.controller.setAccessibilityFilter(L),L&&x()};b.querySelectorAll("button[data-a11y]").forEach(L=>{L.addEventListener("click",()=>{let M=L.dataset.f;M==="all"?A.clear():A.has(M)?A.delete(M):A.add(M),H()})})}if(k){let C=document.createElement("button");C.type="button",C.className="sl-chip-f",C.setAttribute("aria-pressed","false"),C.innerHTML=`\u25D0 ${this.tf("picker.hideLimitedView","Hide limited-view seats")}`,b.appendChild(C),C.addEventListener("click",()=>{let A=!this.limitedViewFilter;this.limitedViewFilter=A,C.classList.toggle("on",A),C.setAttribute("aria-pressed",String(A)),this.controller.setCommercialLimitedFilter(A),this.pushAvailabilityTo3d(),A&&x()})}}let y=document.createElement("button");y.type="button",y.className="sl-cbbtn",this.cbEl=y,y.setAttribute("aria-label",this.tf("picker.toggleColorblindColors","Toggle colorblind-friendly colors")),y.setAttribute("aria-pressed",String(this.cbSafe)),y.innerHTML='<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>',this.els.zfit.parentElement.appendChild(y),y.addEventListener("click",()=>{this.setColorblindSafe(!this.cbSafe)}),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),a.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(d);let E=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(E),this.destroyed)return this;this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc;return this.emitAnalytics("chart_rendered",{renderingTimeMillis:i(e),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(b=>b.type==="section").length??0,view:this.buyerView,eventKey:this.opts.event,chartName:u?.name,floorCount:this.controller.getFloors().length,transport:this.opts.transport?"custom":"pubapi",load:ns(this.opts.event)?"repeat":"cold"}),this}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),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.zoomToFit()),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 s=this.els.sheetToggle,n=c=>{e.dataset.sheet=c?"open":"peek",s?.setAttribute("aria-expanded",String(c)),s?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};n(e.dataset.sheet==="open"),s?.addEventListener("click",c=>{c.stopPropagation(),n(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let h=c.target.closest(".sl-sheet-go");h&&(c.stopPropagation(),h.dataset.act==="checkout"?this.handleCta():h.dataset.act==="best"?(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray(),n(!0),this.els.tray?.querySelector(".sl-ba-go")?.focus()):n(!0))});let o=0,a=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,a=!1,o=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||a)return;let h=c.clientY-o;h<-18?(n(!0),a=!0):h>18&&(n(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&n(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let s=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!s)),this.els.pricesSec?.setAttribute("aria-expanded",String(!s)),!s&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let n=this.els.sheetToggle;n?.setAttribute("aria-expanded","true"),n?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",s=>{s.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",s=>{s.key!=="Enter"&&s.key!==" "||s.target.closest("select,button")||(s.preventDefault(),i())}),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("mousemove",s=>{let n=this.els.map.getBoundingClientRect();this.tipPos={x:s.clientX-n.left,y:s.clientY-n.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let s=e.clientHeight,n=i!==this.pickerLayoutSize.width||s!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:s},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=s<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome()),n&&this.minimap?.refreshMinimap()};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let s=performance.now(),n=await this.controller.render(e);return t.loadChartAndStatuses=i(s),this.destroyed?null:n?(Object.assign(t,n.performanceProfile),n):(this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new r({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted"||typeof location>"u")return;let e=new URLSearchParams(location.search),t=e.get("order");if(!t)return;let i=e.get("status");e.delete("order"),e.delete("status");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}i==="success"&&this.openCheckoutPanel({kind:"resume",orderId:t})}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()}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 s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.cbEl&&this.els.zoom?.appendChild(this.cbEl),this.a11yChipsEl&&(e?this.els.rail?.insertBefore(this.a11yChipsEl,this.els.railScroll??null):this.regions["top-left"]?.appendChild(this.a11yChipsEl)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}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>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]')}tf(e,t){return S(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();e.innerHTML=`<div class="sl-soldout-eyebrow">${t}</div><div class="sl-soldout-title">${this.tf("picker.soldOutTitle","Sold out")}</div><p class="sl-soldout-copy">${this.tf("picker.soldOutCopy","No reserved seats are currently available for this event.")}</p>`,this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,i);s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(s=>(t[s.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();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer")),i.innerHTML='<span class="sl-powered-mark" aria-hidden="true">'+Re+`</span><span>${this.tf("picker.poweredBy","Powered by SeatLayer")}</span>`,t.appendChild(i)}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){if(this.reducedMotion())return;(e.items??[]).filter(i=>i.objectType!=="ga").map(i=>i.label).slice(0,10).forEach((i,s)=>{let n=this.controller.seatByLabel(i);n&&this.scheduleMotion(()=>this.controller.flashSeat(n.id,this.cssVar("--sl-accent")||"#f4b740"),s*55)})}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(){let e=this.hold?.items??[],t=new Set(e.map(s=>s.label));return this.committedSelection().filter(s=>!t.has(s.label)).reduce((s,n)=>s+(n.quantity??1),0)+this.pendingGACount()}heldGACounts(){let e=new Map;for(let t of(this.hold?.items??[]).filter(i=>i.objectType==="ga"))e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}pendingGACount(){let e=this.heldGACounts();return[...this.gaQty.entries()].reduce((t,[i,s])=>t+Math.max(0,s-(e.get(i)??0)),0)}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,s)=>i+(s.quantity??1),0);return this.heldTicketCount()+t+this.pendingGACount()}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(s=>s.label)),t=this.committedSelection().filter(s=>e.has(s.label)).reduce((s,n)=>s+(n.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-this.pendingGACount());this.controller.setMaxSelection(t+i)}canAddTicket(){return this.totalTicketCount()<this.maxTickets?!0:(this.toast((0,v.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),!1)}pendingGATotal(e){let t=new Map;for(let i of(this.hold?.items??[]).filter(s=>s.objectType==="ga"))t.set(i.objectId,(t.get(i.objectId)??0)+(i.quantity??1));return e.reduce((i,s)=>i+this.paidPrice(s.categoryKey,null,s.price,s.id)*Math.max(0,(this.gaQty.get(s.id)??0)-(t.get(s.id)??0)),0)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(!i)return;if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=ot(s,(n,o)=>this.tf(n,o),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,v.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()),e==="checkout"&&this.scheduleMotion(()=>{this.ctaPhase==="checkout"&&(this.ctaPhase="idle",this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()))},1100)}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i)return null;let s={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=s,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(s.expiresAt),this.rememberHold(s),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(s,s.seats??[],this.buildHandoff(s)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),s}catch(i){let s=i?.status;return s===404||s===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(s=>s.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){this.els.map&&(this.minimap=Yt({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}catPrice(e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:this.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}catPriceRange(e){let t=e.tiers?.length?e.tiers.map(i=>this.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[this.paidPrice(e.key,null,e.price)];if(e.key)for(let i of this.pricesByChannel.values())for(let s of i)s.categoryKey===e.key&&t.push(s.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}priceBands(){let e=this.controller.doc;if(!e)return[];let t=e.categories.map(a=>({key:a.key,range:this.catPriceRange(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?this.money(a.min):`${this.money(a.min)}\u2013${this.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 s=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),n=Math.ceil(s.length/4),o=[];for(let a=0;a<s.length;a+=n){let l=s.slice(a,a+n),c=Math.min(...l.map(p=>p.range.min)),h=Math.max(...l.map(p=>p.range.max));o.push({id:`b${a}`,label:c===h?this.money(c):`${this.money(c)}\u2013${this.money(h)}`,keys:l.map(p=>p.key),min:c,max:h})}return o}buildPriceFilter(){if(!this.els.prices||!this.els.pricesSec)return;let e=this.priceBands();if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price")),t.innerHTML=`<option value="all">${this.tf("picker.allPrices","All prices")}</option>`+e.map(i=>`<option value="${i.id}">${i.label}</option>`).join(""),this.els.pricesSec.appendChild(t),t.addEventListener("change",()=>{let s=e.find(n=>n.id===t.value)?.keys??null;this.focusedCatKey=null,this.priceBandKeys=s?new Set(s):null,this.controller.setCategoryFilter(s),this.controller.focusCategoryFilter(s),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)})}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(s=>s.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.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(s=>{s.addEventListener("click",()=>{this.setBuyerView(s.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(h=>h.objects)],s=new Set((e.zones??[]).map(h=>h.id)),o=i.some(h=>h.type==="section"&&typeof h.zone=="string"&&s.has(h.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on",a.setAttribute("role","group"),a.setAttribute("aria-label",(0,v.t)("picker.zoomLevel"));let l={zones:(0,v.t)("picker.rungLabel.zones"),sections:(0,v.t)("picker.rungLabel.sections"),seats:(0,v.t)("picker.rungLabel.seats")},c={zones:(0,v.t)("picker.rungTip.zones"),sections:(0,v.t)("picker.rungTip.sections"),seats:(0,v.t)("picker.rungTip.seats")};a.innerHTML=o.map(h=>`<button type="button" data-rung="${h}" title="${c[h]}" aria-pressed="false">${l[h]}</button>`).join(""),a.querySelectorAll("button").forEach(h=>{h.addEventListener("click",()=>{let p=h.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=this.controller.getFloors(),s=document.createElement("div");s.className="sl-floors on";let n=document.createElement("select");n.setAttribute("aria-label",this.tf("picker.chooseLevel","Choose level"));let o=document.createElement("option");o.value="",o.textContent=this.tf("picker.allFloors","All floors"),n.appendChild(o);for(let c of i){let h=document.createElement("option");h.value=c.id,h.textContent=c.name,n.appendChild(h)}n.addEventListener("change",()=>{n.value===""?this.controller.setFloorOverview(!0):this.controller.setFloor(n.value),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}),s.appendChild(n);let a=document.createElement("button");a.type="button",a.className="sl-floor-info",a.textContent="i";let l=this.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");a.setAttribute("aria-label",l),a.title=l,s.appendChild(a),this.regions["left-rail"].appendChild(s),this.floorsEl=s,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=e==="seats";this.root&&(this.root.dataset.zoomed=String(t)),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let s=i.dataset.rung===e;i.classList.toggle("on",s),i.setAttribute("aria-pressed",String(s))})}syncProjection(){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||!Bt()?!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)?si/2:si}syncFloors(){if(!this.floorsEl)return;let e=this.controller.getActiveFloorId(),t=this.controller.isFloorOverview(),i=this.floorsEl.querySelector("select");i&&(i.value=t?"":e)}showSectionCard(e){if(this.lastSection=e,this.secCardEl?.remove(),this.secCardEl=null,!e){this.minimap?.refreshMinimap();return}this.secCardCollapsed=this.controller.getRung()==="seats",this.secCardShownAt=Date.now(),this.renderSectionCard(e),this.minimap?.refreshMinimap()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let i=t.findIndex(s=>s.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}wireSectionNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let s=t.dataset.sectionNav;s&&this.controller.focusSection(s)})})}renderSectionCard(e){if(!this.els.map)return;this.secCardEl?.remove();let t=e.categories.length?e.categories.map(p=>{let d=this.controller.doc?.categories.find(f=>f.key===p.key);return d?this.catPriceRange(d):{min:p.priceMin,max:p.priceMax}}).filter(p=>p!=null):[{min:e.priceMin,max:e.priceMax}],i=Math.min(...t.map(p=>p.min)),s=Math.max(...t.map(p=>p.max)),n=i===s?this.money(i):`${this.money(i)}\u2013${this.money(s)}`,o=(0,v.tCount)("picker.seatsLeftInSection",e.seatsLeft),a=`<button type="button" class="sl-seccard-x" aria-label="${(0,v.t)("picker.closeSectionSummary")}">\u2715</button>`,l=qt(this.sectionNeighbours(e.id)),c=document.createElement("div");if(this.root?.dataset.layout==="narrow")c.className="sl-seccard strip on",c.setAttribute("role","status"),c.setAttribute("aria-label",(0,v.t)("picker.sectionSummaryAria",{label:e.label})),c.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${o}</span>`+l+a,this.wireSectionNavigation(c),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),this.els.map.appendChild(c);else if(this.secCardCollapsed)c.className="sl-seccard mini on",c.setAttribute("role","button"),c.setAttribute("aria-label",(0,v.t)("picker.sectionSummaryAria",{label:e.label})),c.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${o}</span>`+l+a,this.wireSectionNavigation(c),c.addEventListener("click",p=>{p.target.closest(".sl-seccard-x")||(this.secCardCollapsed=!1,this.secCardShownAt=Date.now(),this.renderSectionCard(e))}),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(c);else{c.className="sl-seccard on",c.setAttribute("role","dialog"),c.setAttribute("aria-label",(0,v.t)("picker.sectionSummaryAria",{label:e.label}));let p=e.categories.map(d=>{let f=this.priceBandKeys!=null&&!this.priceBandKeys.has(d.key),m=this.controller.doc?.categories.find(k=>k.key===d.key),g=m?this.catPriceRange(m):{min:d.priceMin,max:d.priceMax},w=g&&g.min!==g.max?`${this.money(g.min)}\u2013${this.money(g.max)}`:this.money(g?.min??d.price);return`<span class="sl-seccard-mix-item${f?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${d.color}"></span>${d.label} <span class="sl-seccard-mix-price">${w}</span></span>`}).join("");c.innerHTML=`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span>`+(e.categories.length?`<span class="sl-seccard-price">${n}</span>`:"")+a+`</div><div class="sl-seccard-zone">${e.zoneLabel?`${e.zoneLabel} \xB7 `:""}<span class="sl-seccard-left">${o}</span></div>`+(e.entrance?`<div class="sl-seccard-entrance">${(0,v.t)("picker.entrance")} ${String(e.entrance).replace(/[&<>"]/g,d=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[d])}</div>`:"")+(p?`<div class="sl-seccard-mix">${p}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${(0,v.t)("picker.overview")}</button>`+l+`<span class="sl-seccard-hint">${(0,v.t)("picker.tapSeatHint")}</span></div>`,this.wireSectionNavigation(c),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),c.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(c)}this.secCardEl=c}collapseSectionCard(){!this.secCardEl||this.secCardCollapsed||!this.lastSection||this.root?.dataset.layout!=="narrow"&&(this.secCardCollapsed=!0,this.renderSectionCard(this.lastSection))}sectionCardOnView(){if(!(!this.secCardEl||this.secCardCollapsed||!this.lastSection)&&this.root?.dataset.layout!=="narrow"){if(this.controller.getRung()==="seats"){this.collapseSectionCard();return}if(Date.now()-this.secCardShownAt<1400){this.sectionCardCoverage()>.25&&this.collapseSectionCard();return}this.collapseSectionCard()}}sectionCardCoverage(){let e=this.secCardEl,t=this.lastSection;if(!e||!t||!this.els.map)return 0;let i=this.activeFloorObjects().find(k=>k.type==="section"&&k.id===t.id)?.outline;if(!i||i.length<3)return 0;let s=i.map(k=>this.controller.worldToScreen(k)),n=s.map(k=>k.x),o=s.map(k=>k.y),a=Math.min(...n),l=Math.min(...o),c=Math.max(...n)-a,h=Math.max(...o)-l;if(c<=0||h<=0)return 0;let p=this.els.map.getBoundingClientRect(),d=e.getBoundingClientRect(),f=d.left-p.left,m=d.top-p.top,g=Math.max(0,Math.min(f+d.width,a+c)-Math.max(f,a)),w=Math.max(0,Math.min(m+d.height,l+h)-Math.max(m,l));return g*w/(c*h)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.controller.doc?.categories.find(d=>d.key===e.categoryKey),i=this.controller.getStatus(e.id)??"free",s=i==="free"?this.tf("picker.statusAvailable","available"):i==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),n=t?this.catPriceRange(t):void 0,o=n?n.min===n.max?this.money(n.min):`${this.money(n.min)}\u2013${this.money(n.max)}`:void 0,a=this.controller.tableSelection(e.id),l=a??this.controller.seatDetails(e.id),c=this.rowTypeWord(l),h=l?.rowLabel??l?.displayLabel??e.displayLabel??e.label,p=a?`${c} ${h}, ${a.bookingMode==="variable"?(0,v.t)("picker.minToMaxGuests",{min:a.minOccupancy,max:a.maxOccupancy}):(0,v.t)("picker.capacityGuests",{count:a.capacity})}`:l?.objectType==="booth"?`${c} ${h}`:l?.objectType==="table"?`${c} ${h}, ${(0,v.t)("picker.seatNumberLower",{label:l.seatNumber??e.label})}`:(0,v.t)("picker.seatLabel",{label:l?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${p}, ${t?.label??e.categoryKey}${o?`, ${o}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let s=c=>String(c??"").replace(/[&<>"']/g,h=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[h]),n=this.controller.doc?.categories.find(c=>c.key===e.categoryKey),o=e.bookingMode==="variable",a=this.rowTypeWord(e),l=document.createElement("div");l.className="sl-table-scrim",l.innerHTML=`<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">${s(o?(0,v.t)("picker.flexiblePartyTypeWord",{typeWord:a}):(0,v.t)("picker.wholeTypeWord",{typeWord:a}))}</div><h2 class="sl-table-title" id="sl-table-title">${s(e.displayLabel??e.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${o?this.tf("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,v.t)("picker.allPlacesBookedTogether",{count:e.capacity})}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${s(n?.label??e.categoryKey)}</span><b data-table-unit>${(0,v.t)("picker.perGuestPrice",{price:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))})}</b><span class="muted">${this.tf("picker.tableCapacity","Table capacity")}</span><span>${(0,v.t)("picker.guestsCount",{count:e.capacity})}</span><span class="muted">${this.tf("picker.total","Total")}</span><b data-table-total></b></div>`+(o?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${this.tf("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="${this.tf("picker.fewerGuests","Fewer guests")}">\u2212</button><output aria-live="polite" data-table-qty>${e.quantity}</output><button type="button" data-table-step="1" aria-label="${this.tf("picker.moreGuests","More guests")}">+</button></div><div class="sl-table-range">${(0,v.t)("picker.chooseMinMaxGuests",{min:e.minOccupancy,max:e.maxOccupancy})}</div>`:`<input type="hidden" data-table-qty value="${e.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${(0,v.t)("common.cancel")}</button><button type="button" class="sl-table-confirm">${t?this.tf("picker.updateTable","Update table"):o?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table")}</button></div></div></section>`,this.root.appendChild(l),this.tableDialogEl=l,this.renderTableDialogState(),l.querySelectorAll("[data-table-step]").forEach(c=>{c.addEventListener("click",()=>{if(!this.tableDialog)return;let h=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(c.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:h},this.renderTableDialogState()})}),l.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),l.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),l.addEventListener("mousedown",c=>{c.target===l&&this.cancelTableDialog()}),l.addEventListener("keydown",c=>{if(c.key!=="Tab")return;let h=[...l.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!h.length)return;let p=h[0],d=h[h.length-1];c.shiftKey&&document.activeElement===p?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),p.focus())}),requestAnimationFrame(()=>l.querySelector(o?'[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 s=t.querySelector("input[data-table-qty]");s&&(s.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 n=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(n*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 s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){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:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,v.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),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())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(x=>x.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),s=this.controller.doc?.categories.find(x=>x.key===e.categoryKey),n=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=n!=null?this.paidPrice(e.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,n,e.label):void 0,a=x=>String(x??"\u2014").replace(/[&<>"]/g,y=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[y]),l=[i?.sectionLabel?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.section","Section")}</span><span class="sl-confirm-value">${a(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${a(this.rowTypeWord(i))}</span><span class="sl-confirm-value">${a(te(i)??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.seat","Seat")}</span><span class="sl-confirm-value">${a(i?.seatNumber??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:""].filter(Boolean).join(""),c=i?.tiers??s?.tiers??[],h=i?.tierId??c[0]?.id,p=x=>x.buyerMessage?.trim()||(x.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0),d=c.length>1?`<fieldset class="sl-confirm-tiers"><legend>${this.tf("picker.ticketType","Ticket type")}</legend>`+c.map(x=>{let y=p(x);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${a(x.id)}" aria-pressed="${x.id===h}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${a(x.name)}</span>`+(y?`<small class="sl-confirm-tier-note">${a(y)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${this.money(this.paidPrice(e.categoryKey,x.id,x.price,e.label))}</span></button>`}).join("")+"</fieldset>":c[0]&&p(c[0])?`<p class="sl-confirm-tier-note">${a(p(c[0]))}</p>`:"",f=this.buyerView==="venue3d",m=document.createElement("div");m.className="sl-confirm",m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,v.t)("picker.confirmSeatLabel",{label:e.label}));let g=s?.color??"#6e7bff",w=Je(g,this.cssVar("--sl-surface")||"#1a2234",.76)??g;m.style.setProperty("--sl-cat",g),m.style.setProperty("--sl-cat-ink",Ce(w,"#172033","#ffffff")),m.innerHTML='<div class="sl-confirm-grid">'+l+`</div><div class="sl-confirm-cat"><span class="sl-dot" style="background:${s?.color??"#6e7bff"}"></span><span class="sl-confirm-cat-name">${a(i?.categoryLabel??s?.label??e.categoryKey)}</span>`+(o!=null?`<span class="sl-confirm-price">${this.money(o)}</span>`:"")+'</div><div class="sl-confirm-body">'+d+Ut(i?.wheelchairSpaceType)+Nt(e.commercial)+(this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"")+(f?`${Wt(e,`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${o==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(o)}`,f)}<div class="sl-confirm-inspect-row">${Kt(e,f?this.view3dCompareSeatIds:null)}${rt(this.canOffer3d(),f)}</div>`:rt(this.canOffer3d(),f))+`<div class="sl-confirm-row"><button type="button" class="sl-confirm-cancel">${(0,v.t)("common.cancel")}</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>${this.tf("picker.select","Select")}</button></div></div>`,this.els.map.appendChild(m),this.confirmEl=m;let k=m.querySelector(".sl-confirm-thumb");if(k&&e.viewUrl){let x=e.viewMeta?.previewUrl??e.viewUrl;this.buyerAssetUrls.resolve(x).then(y=>{y&&m.isConnected&&this.confirmEl===m&&(k.src=y)}).catch(y=>this.opts.onError?.(y))}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",x=>{this.openSeatConfidencePassport(e,x.currentTarget instanceof HTMLElement?x.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(x=>{x.addEventListener("click",()=>{let y=x.dataset.confirmTier,E=c.find(b=>b.id===y);if(!E)return;this.controller.setSeatTier(e.id,E.id),m.querySelectorAll("[data-confirm-tier]").forEach(b=>{b.setAttribute("aria-pressed",String(b===x))});let u=m.querySelector(".sl-confirm-price");u&&(u.textContent=this.money(this.paidPrice(e.categoryKey,E.id,E.price,e.label))),this.reanchorConfirm()})}),m.querySelector(".sl-confirm-3d")?.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))}),m.querySelector(".sl-confirm-add").addEventListener("click",()=>this.commitConfirm()),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>m.querySelector(".sl-confirm-add")?.focus())}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow")return;let t=this.els.map.clientWidth,i=this.els.map.clientHeight,s=this.confirmEl.offsetWidth||276,n=this.confirmEl.offsetHeight||230,o=s/2+12,a=Math.max(o,Math.min(t-o,e.x)),l=e.y+n+24<=i,c=e.y<n+24&&l;this.confirmEl.dataset.placement=c?"below":"above",this.confirmEl.style.left=`${a}px`,this.confirmEl.style.top=`${Math.max(8,Math.min(i-8,e.y))}px`}dismissConfirm(){this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=null,this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}commitConfirm(){this.confirmSeat&&(this.dismissConfirm(),this.collapseSectionCard(),this.syncTray(),this.syncSelectionTo3d())}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){if(!this.allSeatsCache){let e=this.controller.doc;this.allSeatsCache=e?(0,v.expandChart)(e):[]}return this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,s=this.controller.getActiveFloorId(),n=e.focalPoint??i?.floors?.find(p=>p.id===s)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let p,d=null;try{let m=e.viewMeta?.previewUrl;m&&m!==e.viewUrl?(d=await this.buyerAssetUrls.resolve(m),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!d||!this.root||!this.seatViewEnabled())return;let f={url:p,...d?{previewUrl:d}:{},...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?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};o=f,a=(0,Ae.seatViewDisclosure)(f),l=(0,Ae.isAuthoredSeatView)(f)}else{let p;try{let{generateSeatPanorama:d}=await Ft();p=d(e,n,this.allSeats())}catch(d){t===this.seatViewGen&&this.opts.onError?.(d);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:p.url,generated:!0},a=(0,v.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,v.t)("picker.viewFromSeat",{label:e.label}),h=Pt({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:this.tf("picker.dragToLookAround","Drag to look around \xB7 scroll to zoom"),viewFromSeatLabel:c,real360Label:(0,v.t)("picker.real360"),previewLabel:(0,v.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=h.element,this.viewCleanup=()=>h.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;return t?t(e,this.currency):(0,v.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(i,s)=>`${i} ${s}`})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Et(e,t);if(i==null)return;let s=6*36e5,n=Math.min(Math.max(i-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},n)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=ze(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let s=Be(i),n={...this.hostPricing?.prices??{},...s},o=Object.keys(n).length>0||this.hostPricing?.formatter?{prices:n,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),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){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}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;let t=this.offerAvailability,i=t?.release??null,s=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!s){e.classList.remove("has"),e.replaceChildren();return}let n=i??s,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=n.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let h=document.createElement("span");h.className="sl-offer-line";let p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&n.remaining!=null&&p.push((0,v.t)("picker.offerRemainingAvailable",{count:n.remaining})),i&&n.endsAt!=null&&p.push((0,v.t)("picker.offerUntil",{time:je(n.endsAt,this.eventTimezone,this.opts.locale)})),s?.startsAt!=null&&p.push((0,v.t)("picker.offerStarts",{time:je(s.startsAt,this.eventTimezone,this.opts.locale)})),h.textContent=p.join(" \xB7 "),a.append(l,c,h);let d=document.createElement("details");d.className="sl-offer-info";let f=document.createElement("summary");f.setAttribute("aria-label",(0,v.t)("picker.howOfferWorks",{name:c.textContent??""})),f.textContent="i";let m=document.createElement("div");m.className="sl-offer-detail",m.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."),d.append(f,m),o.append(a,d),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,s){let n=s?this.channelByObject.get(s):void 0;if(n&&e){let a=this.pricesByChannel.get(n)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let o=e?this.opts.pricing?.prices?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}legendDeps(){return{colorOf:e=>this.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:V}}syncPriceRail(e,t){let i=this.els.railScroll,s=e.length>1;this.els.rail?.classList.toggle("has",s||!!this.a11yChipsEl?.children.length),i&&(i.innerHTML=s?St({...this.legendDeps(),categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out")}):"",i.querySelectorAll(".sl-rc").forEach(n=>{n.addEventListener("click",()=>this.focusCategory(n.dataset.cat??""))}))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(l=>!l.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t),this.syncPriceRail(i,t);let s=5,n=i.length-s,o=n>1&&!this.pricesExpanded,a=o?i.slice(0,s):i;this.els.prices.classList.toggle("sl-expanded",n>1&&this.pricesExpanded),this.els.prices.innerHTML=kt({...this.legendDeps(),categories:a,left:t,collapsed:o,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:l=>(0,v.tCount)("picker.leftCount",l),titleFor:(l,c)=>c?this.tf("picker.showAllSeats","Show all seats"):(0,v.t)("picker.showLabelSeatsOnMap",{label:l.label}),moreLabel:n>1?o?(0,v.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(l=>{l.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(l.dataset.cat??null)),l.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let c=()=>this.focusCategory(l.dataset.cat??"");l.addEventListener("click",c),l.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,s=this.lastCatAvail;this.lastCatAvail={...t};let n=this.controller.getActiveFloorId();if(n!==this.lastAvailFloorId&&(this.lastAvailFloorId=n,this.availQuietUntil=performance.now()+2e3),!(!i||!s||performance.now()<this.availQuietUntil))for(let o of e){let a=s[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,v.tCount)("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}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,v.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let e=this.committedSelection(),t=this.controller.getGAAreas(),i=this.hold?.items??[],s=[],n=new Set;if(this.salesClosed&&!e.length&&!i.length){let u=this.eventWhenText?`<span class="when">${String(this.eventWhenText).replace(/[&<>"]/g,b=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[b])}</span>`:"";s.push(`<div class="sl-closed-note" role="status"><b>${this.tf("picker.salesClosedPill","Sales are closed")}</b><span>${this.tf("picker.salesClosedCopy","Ticket sales for this event have ended.")}${u}</span></div>`)}else!e.length&&!i.length&&!t.length?s.push(`<div class="sl-tray-hint">${this.tf("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`):!e.length&&!i.length&&s.push(`<div class="sl-tray-hint">${this.tf("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below.")}</div>`);let o=!e.length&&!i.length&&!this.pendingGACount();if(o&&(this.baReopen=!1),!this.salesClosed&&!this.hold&&(o||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let u=(this.controller.doc?.categories??[]).filter(C=>!C.notForSale),b=this.controller.getBestAvailableZones();this.baZone&&!b.some(C=>C.id===this.baZone)&&(this.baZone=""),s.push(this.bestAvailableConfirm?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,v.t)("picker.willFindSeatsTogether",{count:this.baQty})}</b><span>${this.tf("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>${this.tf("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${this.tf("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.findBestSeatsTogether","Find the best seats together")}</div><div class="sl-ba-copy"><span class="wide">${this.tf("picker.willChooseClosestGroup","We\u2019ll choose the closest available group for you.")}</span><span class="narrow">${this.tf("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</span></div>`+(this.controller.hasPremiumSeats()?`<button type="button" class="sl-ba-premium${this.baPremium?" on":""}" data-ba-premium aria-pressed="${this.baPremium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${this.tf("picker.bestSeatsPremium","Best seats")}</button>`:"")+(u.length>1?`<select aria-label="${this.tf("picker.preferredTicketType","Preferred ticket type")}" data-ba-cat><option value="">${this.tf("picker.anyTicketType","Any ticket type")}</option>`+u.map(C=>`<option value="${C.key}"${this.baCat===C.key?" selected":""}>${C.label}</option>`).join("")+"</select>":'<span aria-hidden="true"></span>')+(b.length?`<select aria-label="${this.tf("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${this.tf("picker.anyVenueZone","Any venue zone")}</option>`+b.map(C=>`<option value="${V(C.id)}"${this.baZone===C.id?" selected":""}>${V(C.label)}</option>`).join("")+"</select>":"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${this.tf("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${this.baQty}</span><button type="button" data-ba="1" aria-label="${this.tf("picker.moreSeats","More seats")}">+</button></div><button type="button" class="sl-ba-go${this.bestAvailableBusy?" sl-busy":""}"${this.bestAvailableBusy?" disabled":""}>`+(this.bestAvailableBusy?`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,v.tCount)("picker.findBestSeatsCount",this.baQty))+"</button>"+(this.baReopen?`<button type="button" class="sl-ba-back" data-ba-close>${this.tf("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>")}let a=(u,b,C,A=1,H,L)=>Zt({d:u?this.controller.seatDetails(u):null,area:C==="ga"?t.find(M=>M.id===H):void 0,label:b,objectType:C,quantity:A,identity:L}),l=Jt;for(let u of i){let b=`held:${u.label}`;n.add(b);let C=this.controller.doc?.categories.find(_=>_.key===u.categoryKey),A=u.tierId?C?.tiers?.find(_=>_.id===u.tierId)?.name:void 0,H=u.objectType!=="ga"?this.controller.seatByLabel(u.label):null,L=u.objectType==="table"?this.controller.tableSelection(u.label):null,M=this.seatViewEnabled()&&!!H&&u.objectType!=="table";s.push(`<div class="sl-chip sl-held${this.lastTrayKeys.has(b)?"":" sl-enter"}" data-key="${b}" data-held="${encodeURIComponent(u.label)}"${H?` data-locate="${H.id}"`:""}><div class="sl-chip-main">`+a(H?.id??null,u.label,u.objectType,u.quantity??1,u.objectId,L??void 0)+`<div class="sl-chip-sub"><span class="sl-ticket-state held" aria-label="${this.tf("picker.heldForYou","Held for you")}" title="${this.tf("picker.heldForYou","Held for you")}"><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><span class="cat">${C?.label??u.categoryKey}${A?` \xB7 ${A}`:""}</span>`+(L?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,v.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+st(H?.wheelchairSpaceType)+it(H?.commercial)+`<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId,u.unitPrice,u.label)*(u.quantity??1))}</span></div></div>`+l((0,v.t)("picker.removeHeldTicketLabel",{label:u.label}),M?u.label:null)+"</div>")}let c=new Set(i.map(u=>u.label)),h=this.seatViewEnabled();for(let u of e.filter(b=>!c.has(b.label))){let b=`seat:${u.id}`;n.add(b);let C=this.controller.doc?.categories.find(M=>M.key===u.categoryKey),A=u.tiers&&u.tiers.length?`<select class="tier" data-tier="${u.id}" aria-label="${(0,v.t)("picker.ticketTierFor",{label:u.label})}">`+u.tiers.map(M=>`<option value="${M.id}"${M.id===u.tierId?" selected":""}>${M.name} \xB7 ${this.money(this.paidPrice(u.categoryKey,M.id,M.price,u.label))}</option>`).join("")+"</select>":"",H=u.tiers?.find(M=>M.id===u.tierId)??u.tiers?.[0],L=H?.buyerMessage?.trim()||(H?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):"");s.push(`<div class="sl-chip${this.lastTrayKeys.has(b)?"":" sl-enter"}" data-key="${b}" data-seat="${u.id}" data-locate="${u.id}"><div class="sl-chip-main">`+a(u.id,u.label,u.objectType,u.quantity??1,u.objectId,u)+`<div class="sl-chip-sub"><span class="sl-ticket-state" aria-label="${this.tf("picker.selected","Selected")}" title="${this.tf("picker.selected","Selected")}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span><span class="cat">${C?.label??u.categoryKey}</span>`+(u.objectType==="table"&&u.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,v.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+`${st(u.wheelchairSpaceType)}${it(u.commercial)}${A}<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1))}</span></div>`+(L?`<small class="sl-tier-note">${V(L)}</small>`:"")+"</div>"+l((0,v.t)("picker.removeSeatLabel",{label:u.label}),h&&u.objectType!=="table"?u.label:null)+"</div>")}for(let u of t){let b=this.gaQty.get(u.id)??0;s.push(`<div class="sl-ga" data-ga="${u.id}"><div class="sl-ga-info"><div class="sl-ga-name">${u.displayLabel??u.label}</div><div class="sl-ga-sub">${u.displayType??this.tf("picker.generalAdmission","General admission")} \xB7 ${this.money(this.paidPrice(u.categoryKey,null,u.price,u.id))} \xB7 ${(0,v.tCount)("picker.leftCount",u.available)}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${this.tf("picker.fewer","Fewer")}">\u2212</button><span>${b}</span><button type="button" data-d="1" aria-label="${this.tf("picker.more","More")}">+</button></div></div>`)}!this.salesClosed&&!this.hold&&!o&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&s.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${this.tf("picker.findTogetherInstead","Find seats together instead")}</button>`),this.els.tray.innerHTML=s.join(""),this.lastTrayKeys=n,this.els.tray.querySelectorAll("[data-ba]").forEach(u=>{u.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(u.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",u=>{this.baCat=u.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",u=>{this.baZone=u.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-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.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(u=>{u.addEventListener("click",()=>{let b=u.closest(".sl-chip");if(b.dataset.held){this.removeHeldLabel(decodeURIComponent(b.dataset.held),b);return}let C=b.dataset.seat,A=this.controller.getSelection().find(L=>L.id===C)?.label??this.tf("picker.seat","Seat"),H=()=>{this.controller.deselect([C]),this.toast((0,v.t)("picker.labelRemoved",{label:A}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let L=this.controller.select([C]);this.toast(L.length?(0,v.t)("picker.labelRestored",{label:A}):(0,v.t)("picker.labelNoLongerAvailable",{label:A}),L.length?"success":"warning")}})};if(this.reducedMotion()){H();return}b.classList.add("sl-leave"),this.scheduleMotion(H,150)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(u=>{u.addEventListener("click",b=>{b.stopPropagation();let C=decodeURIComponent(u.dataset.tableEdit??""),A=this.controller.tableSelection(C);if(!A)return;let H=i.find(L=>L.label===C&&L.objectType==="table");this.showTableDialog({...A,quantity:H?.quantity??A.quantity},!!H,u)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(u=>{u.addEventListener("change",()=>this.controller.setSeatTier(u.dataset.tier,u.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(u=>{u.addEventListener("click",()=>{let b=this.controller.seatByLabel(u.dataset.viewLabel);b&&this.openSeatView(b)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(u=>{let b=()=>this.controller.flashSeat(u.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");u.addEventListener("mouseenter",b),u.addEventListener("focusin",b)}),this.els.tray.querySelectorAll(".sl-ga button").forEach(u=>{u.addEventListener("click",()=>{let C=u.closest(".sl-ga").dataset.ga,A=t.find(M=>M.id===C),H=Number(u.dataset.d);if(H>0&&!this.canAddTicket())return;let L=Math.max(0,Math.min(A?.available??0,(this.gaQty.get(C)??0)+H));this.gaQty.set(C,L),this.syncTray()})}),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(u=>{u.disabled=!0});let p=this.pendingGATotal(t),d=this.pendingGACount(),f=i.reduce((u,b)=>u+this.paidPrice(b.categoryKey,b.tierId,b.unitPrice,b.label)*(b.quantity??1),0),m=i.reduce((u,b)=>u+(b.quantity??1),0),g=e.filter(u=>!c.has(u.label)),w=g.reduce((u,b)=>u+this.paidPrice(b.categoryKey,b.tierId??null,b.price,b.label)*(b.quantity??1),0)+p+f,k=g.reduce((u,b)=>u+(b.quantity??1),0)+d+m,x=this.pendingSelectionCount(),y=this.lastTrayCount,E=this.lastTrayTotal;if(this.els.count.textContent=k?(0,v.tCount)("picker.ticketsCount",k):this.tf("picker.noSeatsSelected","No seats selected"),this.els.total.textContent=k?this.money(w):"",this.root?.setAttribute("data-has-selection",String(k>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",k===0),this.els.seatSummary&&(this.els.seatSummary.textContent=k?(0,v.tCount)("picker.seatsSelectedCount",k):""),this.syncCta(k,x),this.hold){let u=m||this.hold.seats?.length||0;this.els.holdTitle&&(this.els.holdTitle.textContent=(0,v.t)("picker.securedCount",{count:u})),this.els.holdCopy&&(this.holdCopyPending=x>0,this.els.holdCopy.textContent=x?(0,v.t)("picker.moreSelectedCount",{count:x}):lt(this.holdExpiresAt));let b=this.els.holdChange;b&&(b.disabled=this.releasingHold,b.textContent=this.releasingHold?this.tf("picker.releasingEllipsis","Releasing\u2026"):this.tf("picker.change","Change"))}k!==y&&this.animateOnce(this.els.count,"sl-value-pop",380),w!==E&&this.animateOnce(this.els.total,"sl-value-pop",380),y===0&&k>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(k,w,x),this.lastTrayCount=k,this.lastTrayTotal=w,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(k,e)}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)}renderPeek(e,t,i){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(n=>this.catPrice(n)).filter(n=>n!=null);this.els.peek.innerHTML=ti({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,fromPrice:s.length?Math.min(...s):null,addMore:ei({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),money:n=>this.money(n)})}async removeHeldLabel(e,t){if(!e||this.releasingLabels.has(e))return!1;this.releasingLabels.add(e),t?.setAttribute("aria-busy","true");let i=t?.querySelector(".rm");i&&(i.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels([e]))return this.toast((0,v.t)("picker.couldNotRemoveLabel",{label:e}),"error"),!1;let o=this.controller.currentHold();return this.hold=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.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(),this.toast((0,v.t)("picker.labelRemovedFromHold",{label:e}),"success"),!0}finally{this.releasingLabels.delete(e),t?.removeAttribute("aria-busy"),i?.isConnected&&(i.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(ot(e,(i,s)=>this.tf(i,s)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,v.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(s=>s.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.setCtaPhase("checkout"),this.checkoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,s=[...this.gaQty.entries()].filter(([,o])=>o>0),n=this.committedSelection();if(n.length){let o=await this.controller.hold(void 0,this.opts.holdTtlMs);i=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}for(let[o,a]of s){let l=await this.controller.holdGA(o,a,{ttlMs:this.opts.holdTtlMs});i=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:i}if(!i){this.toast(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again."),"error"),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.handedOff=!0,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.setCtaPhase("checkout"),this.emitHoldChange(),this.checkoutHandoff(i,i.seats??n)}catch(i){this.opts.onError?.(i);let s=i,n=(s.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);s.reason==="event_closed"&&this.setSalesClosed(!0);let o=s.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):s.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):n.length?n.length===1?(0,v.t)("picker.labelsNoLongerAvailable.one",{labels:n.join(", ")}):(0,v.t)("picker.labelsNoLongerAvailable.other",{labels:n.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.toast(o,"error"),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let s=()=>{let n=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=at(n)),!this.holdCopyPending&&this.els.holdCopy&&(this.els.holdCopy.textContent=lt(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",n>0&&n<=ii),this.setExtendPrompt(n>0&&n<=ii,n),n<=0&&this.stopHoldTimer()};s(),this.holdTimer=setInterval(s,500)}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),s=Math.floor(i/60),n=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,v.t)("picker.seatsHeldForNeedMoreTime",{time:`${s}:${n}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&this.showBooked()}showBooked(){if(this.bookedShown||!this.hold)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((i,s)=>i+s.quantity,0);this.els.bookedSub&&(this.els.bookedSub.innerHTML=`<span class="sl-booked-seats">${(0,v.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.bookedEl?.classList.add("on"),this.opts.onBooked?.(e)}checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){this.startHostedCheckout(e,t);return}this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let n=s?.providers?.[0];if(!n){let o=jt(s?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:n,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await _t())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,formatMoney:i=>this.money(i),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=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice,o.label),currency:o.currency??this.currency,quantity:o.quantity??1}}),s=i[0]?.currency??this.currency,n=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:i,total:n}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let s=this.els.toast;if(!s)return;s.replaceChildren();let n=document.createElement("span");if(n.textContent=e,s.appendChild(n),s.classList.toggle("has-action",!!i),i){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=i.label,o.addEventListener("click",i.onClick,{once:!0}),s.appendChild(o)}s.dataset.tone=t,s.classList.add("on"),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on"),s.classList.remove("has-action"),s.dataset.tone="neutral"},4200)}placeTooltip(){if(!this.tipEl)return;let e=this.els.map.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,n=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),n<8&&(n=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,n)}px`}rowTypeWord(e){let t=e?.displayType?.trim()||e?.rowType?.trim();return t||(e?.objectType==="table"?this.tf("picker.table","Table"):e?.objectType==="booth"?this.tf("picker.booth","Booth"):this.tf("picker.row","Row"))}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=m=>String(m??"\u2014").replace(/[&<>"]/g,g=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[g]),i=this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),s=e.objectType==="table"&&!!e.bookingMode,n=e.objectType==="booth",o=e.sectionLabel||e.rowLabel||e.seatNumber,a=s?`<div class="sl-tip-grid"><div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.guests","Guests")}</span><span class="sl-tip-val">${e.bookingMode==="variable"?`${e.minOccupancy}\u2013${e.maxOccupancy}`:e.capacity}</span></div></div>`:n?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div></div>`:o?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+(e.rowLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(te(e))}</span></div>`:"")+(e.seatNumber?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.seatNumber)}</span></div>`:"")+"</div>":`<div class="sl-tip-grid one"><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.displayLabel??e.label)}</span></div></div>`,l=e.status==="not_for_sale",c=e.status==="free"?"":`<div class="sl-tip-status">${l?this.tf("picker.notAvailable","Not available"):e.status==="held"?(0,v.t)("map.statusHeld"):(0,v.t)("map.statusTaken")}</div>`,h=ue(e.commercial),p=h?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${t(h)}</div>`:"",d=Te(e.wheelchairSpaceType),f=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${t(d)}</div>`:"";this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=a+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${e.categoryColor}"></span><span class="sl-tip-name">${t(e.categoryLabel)}</span>`+(l?"":`<span class="sl-tip-amt">${i}</span>`)+"</div>"+f+p+c,this.tipEl.style.display="block",this.placeTooltip()}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}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.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))}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}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(),as(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"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,n=s?await this.buyerAssetUrls.resolve(i):null,o=s?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||s&&!n?null:{url:o,...n?{previewUrl:n}:{},...s?{resolveUrl:a=>this.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?.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 this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(a=>a.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(a=>i?a.label===i.label:a.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let n=this.controller.getStatus(t.id);if(n==="held"||n==="booked"||n==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),n),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}showUnavailable3dSeat(e,t,i){let s=this.view3dEl;if(!s)return;this.dismissUnavailable3dSeat();let n=this.controller.seatDetails(e.id),o=n?.displayLabel??e.displayLabel??e.label,a=n?.sectionLabel,l=te(n),c=[a,l?(0,v.t)("picker.rowLabel",{label:l}):null,o].filter(Boolean).join(" \xB7 "),h=i==="held"?{title:this.tf("picker.temporarilyHeld","Temporarily held"),message:this.tf("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:i==="booked"?{title:this.tf("picker.sold","Sold"),message:this.tf("picker.soldSeatExplanation","This seat has already been booked.")}:{title:this.tf("picker.notForSale","Not for sale"),message:this.tf("picker.notForSaleExplanation","This seat is not included in the current sale.")},p=document.createElement("div");p.className="sl-view3d-unavailable",p.dataset.state=t,p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let d=document.createElement("span");d.className="sl-view3d-unavailable-eyebrow",d.textContent=c||o;let f=document.createElement("strong");f.textContent=h.title;let m=document.createElement("div");m.className="sl-view3d-unavailable-copy",m.append(d,f);let g=document.createElement("button");g.type="button",g.setAttribute("aria-label",this.tf("picker.closeSeatStatus","Close seat status")),g.textContent="\xD7";let w=document.createElement("p");w.textContent=h.message,p.append(m,g,w),g.addEventListener("click",()=>p.remove()),s.appendChild(p),this.announceSeat(e)}dismissUnavailable3dSeat(){this.view3dEl?.querySelector(".sl-view3d-unavailable")?.remove()}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(f=>f.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),s=this.controller.doc?.categories.find(f=>f.key===t.categoryKey),n=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),o=n!=null?this.paidPrice(t.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,n,t.label):void 0,a=this.controller.getStatus(t.id),l=a==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?this.tf("picker.sold","Sold"):a==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),c=t.viewUrl?(0,Ae.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}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),h=ue(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=i?.wheelchairSpaceType?`${Te(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),d=(0,ct.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:te(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??s?.label??t.categoryKey,price:o==null?this.tf("picker.priceNotSupplied","Not supplied"):this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:h,accessibility:p,confidence:d}}openSeatConfidencePassport(e,t=null){let i=this.view3dEl;if(!i)return;this.closeSeatConfidencePassport(!1);let s=(0,ct.seatConfidenceDisclosure)(e.confidenceEvidence),n=e.confidenceEvidence,o=this.controller.seatDetails(e.id),a=y=>U(y),l=s.limitations.length?`<h4>Known limits</h4><ul>${s.limitations.map(y=>`<li>${a(y)}</li>`).join("")}</ul>`:"",c=s.modeledTarget?`<div><dt>Modeled target</dt><dd>${a(s.modeledTarget)}</dd></div>`:"",h=n?`<div><dt>Evidence ID</dt><dd>${a(n.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${a(n.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${a(n.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${a(n.approvedByRole??"No external approval supplied")}</dd></div>`+(n.validUntil?`<div><dt>Valid until</dt><dd>${a(n.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",p=ue(e.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=`<div><dt>View restriction</dt><dd>${a(p)}</dd></div>`+(e.commercial?.note?`<div><dt>Organizer note</dt><dd>${a(e.commercial.note)}</dd></div>`:""),f=document.createElement("div");f.className="sl-view3d-passport-shell",f.innerHTML=`<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">${a(o?.displayLabel??e.displayLabel??e.label)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${a(s.headline)}</strong><span>${a(s.coverage)} \xB7 ${a(s.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${a(s.model)}</dd></div><div><dt>Reality evidence</dt><dd>${a(s.reality)}</dd></div><div><dt>Source</dt><dd>${a(s.provenance)}</dd></div>`+d+c+h+`</dl>${l}<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></section>`;let m=[...new Set([...i.children,...[...this.els.map.children].filter(y=>y!==i)])].filter(y=>y instanceof HTMLElement),g=m.map(y=>({element:y,inert:y.inert,ariaHidden:y.getAttribute("aria-hidden")}));for(let y of m)y.inert=!0,y.setAttribute("aria-hidden","true");i.appendChild(f),i.classList.add("has-passport"),this.view3dPassportEl=f;let w=f.querySelector(".sl-view3d-passport"),k=()=>[...w.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],x=y=>{if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation(),this.closeSeatConfidencePassport();return}if(y.key!=="Tab")return;let E=k();if(!E.length)return;let u=E[0],b=E[E.length-1];y.shiftKey&&document.activeElement===u?(y.preventDefault(),b.focus()):!y.shiftKey&&document.activeElement===b&&(y.preventDefault(),u.focus())};window.addEventListener("keydown",x,!0),this.view3dPassportCleanup=()=>{window.removeEventListener("keydown",x,!0);for(let b of g)b.element.inert=b.inert,b.ariaHidden===null?b.element.removeAttribute("aria-hidden"):b.element.setAttribute("aria-hidden",b.ariaHidden);let y=t?.isConnected?t:this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareEl?.querySelector("[data-passport-seat]")??null,E=y?.closest(".sl-confirm,.sl-view3d-compare");E?.isConnected&&(E.inert=!1,E.removeAttribute("aria-hidden")),f.remove(),i.classList.remove("has-passport"),this.view3dPassportEl===f&&(this.view3dPassportEl=null);let u=y??this.view3dCompareEl?.querySelector("[data-passport-seat]")??this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareChip.mainButton();(t?.isConnected?t:u)?.focus()},f.addEventListener("click",y=>{let E=y.target instanceof HTMLElement?y.target:null;(E?.closest("[data-close]")||E?.classList.contains("sl-view3d-passport-scrim"))&&this.closeSeatConfidencePassport()}),requestAnimationFrame(()=>k()[0]?.focus()),this.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:n?.evidenceId??null,eventConfigurationId:n?.eventConfigurationId??null,modelLevel:n?.modelLevel??"unverified",realityLevel:n?.realityLevel??"none"})}closeSeatConfidencePassport(e=!0){let t=this.view3dPassportCleanup;if(this.view3dPassportCleanup=null,!t){this.view3dPassportEl?.remove(),this.view3dPassportEl=null,this.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}openView3dComparison(){let e=this.view3dEl;if(!e||this.view3dCompareSeatIds.length<2)return;this.closeView3dComparison(!1);let t=this.view3dCompareSeatIds.map(d=>this.view3dComparisonSnapshot(d)).filter(d=>!!d);if(t.length<2){this.clearView3dComparison();return}let i=d=>U(d),s=document.createElement("div");s.className="sl-view3d-compare-shell";let n=t.map((d,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${i(d.label)}</strong><small>Section ${i(d.section)} \xB7 Row ${i(d.row)}</small><dl><div><dt>Current price</dt><dd>${i(d.price)}</dd></div><div><dt>Ticket type</dt><dd>${i(d.category)}</dd></div><div><dt>Availability</dt><dd>${i(d.availability)}</dd></div><div><dt>View source</dt><dd>${i(d.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(d.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(d.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(d.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(d.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(d.seat.id)}">Passport</button><button type="button" data-view-seat="${i(d.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(d.seat.id)}"${d.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.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">Current price and availability come from this picker. Modeled views are chart-derived unless organizer media is labeled; SeatLayer does not invent why a seat has its price.</p><div class="sl-view3d-compare-grid">${n}</div></section>`;let o=document.activeElement instanceof HTMLElement?document.activeElement:null,a=[...e.children].filter(d=>d instanceof HTMLElement),l=a.map(d=>({element:d,inert:d.inert,ariaHidden:d.getAttribute("aria-hidden")}));for(let d of a)d.inert=!0,d.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),this.view3dCompareEl=s;let c=s.querySelector(".sl-view3d-compare"),h=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=d=>{if(d.key==="Escape"){d.preventDefault(),this.closeView3dComparison();return}if(d.key!=="Tab")return;let f=h();if(!f.length)return;let m=f[0],g=f[f.length-1];d.shiftKey&&document.activeElement===m?(d.preventDefault(),g.focus()):!d.shiftKey&&document.activeElement===g&&(d.preventDefault(),m.focus())};window.addEventListener("keydown",p),this.view3dCompareCleanup=()=>{window.removeEventListener("keydown",p);for(let d of l)d.element.inert=d.inert,d.ariaHidden===null?d.element.removeAttribute("aria-hidden"):d.element.setAttribute("aria-hidden",d.ariaHidden);s.remove(),e.classList.remove("has-comparison"),this.view3dCompareEl===s&&(this.view3dCompareEl=null),o?.isConnected?o.focus():this.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>this.closeView3dComparison()),s.querySelectorAll("[data-passport-seat]").forEach(d=>d.addEventListener("click",()=>{let f=d.dataset.passportSeat,m=f?this.allSeats().find(g=>g.id===f):void 0;m&&this.openSeatConfidencePassport(m,d)})),s.querySelectorAll("[data-view-seat]").forEach(d=>d.addEventListener("click",()=>{let f=d.dataset.viewSeat;this.closeView3dComparison(!1),f&&this.view3dHandle?.flyToSeat(f)})),s.querySelectorAll("[data-select-seat]").forEach(d=>d.addEventListener("click",()=>{let f=d.dataset.selectSeat;f&&this.selectComparedSeat(f)})),requestAnimationFrame(()=>h()[0]?.focus()),this.emit3dAnalytics("3d_comparison_opened",{seatIds:this.view3dCompareSeatIds.slice()})}closeView3dComparison(e=!0){let t=this.view3dCompareCleanup;if(this.view3dCompareCleanup=null,!t){this.view3dCompareEl?.remove(),this.view3dCompareEl=null,this.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}selectComparedSeat(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=this.allSeats().find(s=>s.id===e);if(!t)return;if(this.closeView3dComparison(!1),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.toast(this.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}this.syncSelectionTo3d(),this.showConfirm(t),this.emit3dAnalytics("3d_comparison_selected",{seatId:e})}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection();let i=document.createElement("div");i.className="sl-view3d",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let n=s.querySelector("span"),o=h=>{this.view3dTargetSeatId=h;let p=!!h;i.classList.toggle("is-seat-focused",p);let d=p?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");n&&(n.textContent=d),s.setAttribute("aria-label",d)};s.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),i.appendChild(s);let a=document.createElement("button");a.type="button",a.className="sl-view3d-fs",a.textContent="\u26F6",a.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),a.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),a.addEventListener("click",()=>this.toggleFullscreen()),i.appendChild(a);let l=document.createElement("div");l.className="sl-view3d-loading",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),l.textContent=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(l),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let c=++this.view3dGen;try{let h=(0,v.expandChart)(t),p=await Dt();if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let d=await p.prepareVenue3D({doc:t,seats:h});if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let f=p.mountVenue3D(i,{doc:t,seats:h,prepared:d},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,seatViewActionLabel:m=>this.allSeats().find(g=>g.id===m)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.onView3dSeatPick(m),onSeatInspect:m=>this.onView3dSeatPick(m),onSectionFocusChange:m=>{let g=i.querySelector('select[data-locator="section"]'),w=m??"";!g||g.value===w||(g.value=w,g.dispatchEvent(new Event("change")))},onViewTargetChange:m=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!m),o(m),this.opts.onBuyerViewChange?.({view:"venue3d",...m?{seatId:m}:{}})},getSeatView:m=>new Promise((g,w)=>{let k=()=>{this.seatViewFor3d(m).then(y=>{y?g(y):w(new Error("seat_view_unavailable"))})},x=globalThis.requestIdleCallback;typeof x=="function"?x(k,{timeout:1500}):setTimeout(k,50)}),onAnalytics:(m,g)=>this.emit3dAnalytics(m,g)});this.view3dHandle=f,l.remove(),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),Xt(i,f),e&&f.flyToSeat(e)}catch(h){if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(h),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove();try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}async removeHeldTicket(e){return this.removeHeldLabel(e)}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e))),this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let n=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return n?(this.hold={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(n.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&n.seats.length&&!n.seats.every(o=>o.commercial?.premium)&&this.toast((0,v.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}catch(n){this.opts.onError?.(n);let o=n?.reason,a=o==="not_enough_together"?(0,v.t)("picker.couldNotFindSeatsTogether",{count:e}):o==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):o==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):o==="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(a,"error"),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 s=[...new Set([...(e.items??[]).map(n=>n.label),...(e.seats??[]).map(n=>n.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(n){this.opts.onError?.(n),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 q({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:ne(this.controller,{flashOnLiveChange:!0,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")}})}),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)}showAccessPanel(e){if(this.destroyed||!this.root)return;let t=this.accessCopy(e.reason);this.dismissAccessPanel();let i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let s=document.createElement("div"),n=document.createElement("div");n.className="sl-access-title",n.textContent=t.title;let o=document.createElement("div");if(o.className="sl-access-body",o.textContent=t.body,s.appendChild(n),s.appendChild(o),t.action){let a=document.createElement("button");a.type="button",a.className="sl-access-act",a.textContent=t.action,a.addEventListener("click",()=>{this.refreshAccess()}),s.appendChild(a)}i.appendChild(s),(this.regions?.["bottom-center"]??this.root).appendChild(i),this.accessEl=i}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}accessCopy(e){switch(e){case"paused":return{title:this.tf("picker.accessPausedTitle","These seats are on hold right now"),body:this.tf("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:this.tf("picker.accessRetry","Try again")};case"revoked":return{title:this.tf("picker.accessRevokedTitle","This access link is no longer active"),body:this.tf("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:this.tf("picker.accessExpiredTitle","Your access session has ended"),body:this.tf("picker.accessExpiredBody","Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours."),action:this.tf("picker.accessRetry","Try again")};default:return{title:this.tf("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:this.tf("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}destroy(){this.destroyed=!0,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=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.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.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};function oi(r,e={}){let t=e.origin??"";if(!t)try{t=new URL(r.src,window.location.href).origin}catch{t=""}let i=!1,s=null,n=null,o=null,a="",l=null,c=()=>{if(i)return;i=!0,s=r.getAttribute("style"),Object.assign(r.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let d=document.documentElement;n=d.style.overflow,d.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&h()},window.addEventListener("keydown",l)},h=()=>{i&&(i=!1,s===null?r.removeAttribute("style"):r.setAttribute("style",s),s=null,a&&(r.style.height=a),n!==null&&(document.documentElement.style.overflow=n,n=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},p=d=>{if(d.source!==r.contentWindow||t&&d.origin!==t||!d.data||typeof d.data!="object")return;let f=d.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(a=`${Math.round(f.px)}px`,i||(r.style.height=a));return}f.type==="seatlayer:fullscreen"&&(f.on===!0?c():f.on===!1&&h())};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),h()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,ticketOfferPrices});
1550
+ </div>`;let s={};return i.querySelectorAll("[data-ref]").forEach(n=>{s[n.dataset.ref]=n}),{root:i,mapHost:s.map,els:s}}function ii(r){let e=(t,i)=>{for(let s of r.querySelectorAll(`[${t}]`)){let n=s.getAttribute(t);if(!n)continue;let a=(0,ve.t)(n);a!==n&&i(s,a)}};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)})}var ie=require("@seatlayer/core/view/panoramaDelivery");function si(r){let{root:e,source:t,caption:i,real:s,closeLabel:n,dragHint:a,viewFromSeatLabel:o,real360Label:l,previewLabel:c,resolveAsset:h,onClose:p}=r,d=document.createElement("div");d.className="sl-view",d.setAttribute("role","dialog"),d.setAttribute("aria-label",o),d.innerHTML=`<div class="sl-view-head"><span class="sl-view-title">${o}</span><span class="sl-view-cap">${i}</span><button type="button" class="sl-view-x" aria-label="${n}"><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">${s?l:c}</span><span class="sl-view-hint">${a}</span></div>`,e.appendChild(d);let f=d.querySelector(".sl-view-pano"),m=(0,ie.planPanoramaDelivery)(t,(0,ie.browserPanoramaConstraints)()),g=new AbortController;f.style.backgroundImage=`url("${m.initialUrl}")`;let S=()=>{};m.upgradeUrl&&(S=(0,ie.schedulePanoramaUpgrade)(()=>{h(m.upgradeUrl).then(C=>!C||g.signal.aborted?null:(0,ie.loadPanoramaImage)(C,g.signal).then(()=>C)).then(C=>{!C||!d.isConnected||g.signal.aborted||(f.style.backgroundImage=`url("${C}")`)}).catch(()=>{})}));let k=70,w=35,y=1,E=f.clientHeight||1,u=f.clientWidth||1,v=-(E*(180/k)*2/2-u/2),x=0,A=()=>{let C=f.clientHeight||1,D=C*(180/k)*y,R=Math.max(0,D-C),Te=Math.min(R/2,w/180*D);x=Math.min(Te,Math.max(-Te,x)),f.style.backgroundSize=`auto ${D}px`,f.style.backgroundPosition=`${v}px ${x-R/2}px`};A();let L=!1,$=0,H=0,B=C=>{L=!0,$=C.clientX,H=C.clientY,f.classList.add("drag"),f.setPointerCapture?.(C.pointerId)},G=C=>{L&&(v+=C.clientX-$,x+=C.clientY-H,$=C.clientX,H=C.clientY,A())},V=C=>{L=!1,f.classList.remove("drag"),f.releasePointerCapture?.(C.pointerId)},oe=C=>{C.preventDefault(),y=Math.min(2.4,Math.max(1,y+(C.deltaY<0?.12:-.12))),A()};f.addEventListener("pointerdown",B),f.addEventListener("pointermove",G),f.addEventListener("pointerup",V),f.addEventListener("pointercancel",V),f.addEventListener("wheel",oe,{passive:!1});let ke=d.querySelector(".sl-view-x");ke.addEventListener("click",p);let Se=C=>{C.key==="Escape"&&(C.stopPropagation(),p())};return d.addEventListener("keydown",Se),ke.focus(),{element:d,dispose(){S(),g.abort(),f.removeEventListener("pointerdown",B),f.removeEventListener("pointermove",G),f.removeEventListener("pointerup",V),f.removeEventListener("pointercancel",V),f.removeEventListener("wheel",oe),d.removeEventListener("keydown",Se),ke.removeEventListener("click",p)}}}var bi=require("@seatlayer/core/core/seatConfidence");var ci=require("@seatlayer/core"),di=require("@seatlayer/core/core/cdnAsset"),zs=require("@seatlayer/core/core/cdnAsset");function T(r,e){let t=(0,ci.t)(r);return t===r?e:t}function pi(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}function U(r){return String(r??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}var ye=null;function hi(){if(ye!==null)return ye;try{if(typeof document>"u")return ye=!1;ye=!!document.createElement("canvas").getContext("webgl2")}catch{ye=!1}return ye}function mt(r){return(0,di.cdnAssetUrl)(r)}async function ui(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(mt("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")}async function mi(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(mt("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function fi(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(mt("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(li(),oi))}function gi(r){return r==="unavailable_for_event"||r==="payments_off_for_event"?r:"not_configured"}function Qe(r,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(r);if(e)try{return s.toLocaleString(t,{...i,timeZone:e})}catch{}return s.toLocaleString(t,i)}function W(r){return String(r??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function xe(r){return r?.restrictedView?T("picker.restrictedView","Restricted view"):r?.obstructedView?T("picker.obstructedView","Obstructed view"):""}function vi(r){if(!r)return"";let e=[];r.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${T("picker.premiumSeat","Premium seat")}</div>`);let t=xe(r);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${r.note?`<span class="sl-cx-note">${W(r.note)}</span>`:""}</span></div>`):r.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${W(r.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function ft(r){let e=xe(r);if(!e)return"";let t=W(r?.note?r.note:e);return`<span class="sl-cx-mark" role="img" aria-label="${t}" title="${t}">\u25D0</span>`}function Oe(r){return r==="no-seat"?T("picker.emptyWheelchairSpace","Empty wheelchair space"):r==="seat-present"?T("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function yi(r){let e=Oe(r);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function gt(r){let e=Oe(r);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function bt(r,e){if(!r)return"";let t=e?T("picker.viewFromThisSeat","View from this seat"):T("picker.seeItIn3d","See it in 3D");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>${t}</span></button>`}function xi(r){if(!r)return"";let e=r.previous.label||r.previous.id,t=r.next.label||r.next.id;return`<span class="sl-seccard-nav" aria-label="${T("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${U(r.previous.id)}" aria-label="${T("picker.previousSection","Previous section")}: ${U(e)}" title="${U(e)}">\u2190</button><button type="button" data-section-nav="${U(r.next.id)}" aria-label="${T("picker.nextSection","Next section")}: ${U(t)}" title="${U(t)}">\u2192</button></span>`}function wi(r,e){if(!e)return"";let t=e,i=t.includes(r.id),s=i?t.length>1?T("picker.openComparison","Open comparison"):T("picker.savedForComparison","Saved for comparison"):t.length?T("picker.compareWithSaved","Compare with saved"):T("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>${W(s)}</span></button>`}function ki(r,e,t){if(!t)return"";let i=(0,bi.seatConfidenceDisclosure)(r.confidenceEvidence),s=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${W(r.displayLabel??r.label)}"><span><em>${W(e)}</em><strong>${W(i.headline)}</strong><small>${W(s)}</small></span><b>Passport</b></button>`}function ne(r){let e=r?.rowLabel,t=r?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let s=`${t}${i}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return e}function Si(r){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",r.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:r.tf("picker.allFloors","All floors")},...r.floors.map(n=>({id:n.id,name:n.name}))];for(let n of t){let a=document.createElement("button");a.type="button",a.dataset.floor=n.id,a.textContent=n.name,a.setAttribute("aria-pressed","false"),a.addEventListener("click",()=>r.onChoose(n.id)),e.appendChild(a)}let i=document.createElement("button");i.type="button",i.className="sl-floor-info",i.textContent="i";let s=r.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return i.setAttribute("aria-label",s),i.title=s,e.appendChild(i),e}function Ti(r,e,t){if(!r)return;let i=t?"":e;r.querySelectorAll("button[data-floor]").forEach(s=>{s.setAttribute("aria-pressed",String(s.dataset.floor===i))})}var Ei=require("@seatlayer/core"),we=require("@seatlayer/core/picker/minimapGeometry");function Ci(r,e){let t=new vt(r);return t.build(e),t}var vt=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}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",T("picker.openVenueMap","Open venue overview map")),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 s=document.createElement("div");s.className="sl-minimap",s.setAttribute("role","group");let n=document.createElement("div");n.className="sl-minimap-bar";let a=document.createElement("span");a.className="sl-minimap-label";let o=document.createElement("span");o.className="sl-minimap-key",o.setAttribute("aria-label",T("picker.minimapStateKey","Focused, selected, available, and inactive sections")),o.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",T("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",n.append(a,o,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",T("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),s.append(n,c),e.appendChild(s),this.miniWrap=s,this.miniLabel=a,this.miniCanvas=c;let h=document.createElement("canvas");this.miniBase=h,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 s=196,n=146,a=6,o=i.width/Math.max(1,i.height),l=s,c=Math.round(s/o);c>n&&(c=n,l=Math.round(n*o)),l=Math.max(64,l),c=Math.max(48,c);let h=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*h),e.height=Math.round(c*h),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,we.createMinimapTransform)(i,e.width,e.height,h,a)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?T("picker.allFloors","All floors"):e.find(h=>h.id===this.host.controller.getActiveFloorId())?.name??T("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,n=i.find(h=>h.active)?.label??this.host.focusedSectionLabel(),a=n?`${t} \xB7 ${n}`:t;this.miniLabel.textContent=a;let o=i.filter(h=>h.state==="selected").length,l=i.filter(h=>h.state==="available").length,c=i.filter(h=>h.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${a}. ${o} selected, ${l} available, ${c} inactive sections.`:a),this.miniCanvas?.setAttribute("aria-label",i.length?`${a}. ${o} selected, ${l} available, ${c} inactive sections. ${T("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${a}. ${T("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}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 s=p=>p*t.scale+t.offX,n=p=>p*t.scale+t.offY,a=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",o=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",h=this.host.controller.getMinimapSnapshot();for(let p of h.sections)p.outline.length<3||(i.beginPath(),p.outline.forEach((d,f)=>f===0?i.moveTo(s(d.x),n(d.y)):i.lineTo(s(d.x),n(d.y))),i.closePath(),i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?o:p.state==="selected"?l:c,i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=a,i.stroke(),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,!h.sections.length){let p=Math.max(1,t.dpr);for(let d of h.seats)i.globalAlpha=d.state==="inactive"?.22:.78,i.fillStyle=d.state==="inactive"?o:d.state==="selected"?l:c,i.beginPath(),i.arc(s(d.x),n(d.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 s=e.getContext("2d");if(!s)return;s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);let n=this.host.controller.getViewport();if(!n)return;let a=(0,we.minimapViewportPlan)(n.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),o=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";s.save(),s.globalAlpha=.1,s.fillStyle=o,s.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),s.globalAlpha=.9,s.lineJoin="round",s.lineWidth=Math.max(4,i.dpr*3.25),s.strokeStyle=l,s.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),s.globalAlpha=1,s.lineWidth=Math.max(2,i.dpr*1.75),s.strokeStyle=o,s.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(s.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),s.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),s.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let s=t.getBoundingClientRect(),n=(e.clientX-s.left)*(t.width/Math.max(1,s.width)),a=(e.clientY-s.top)*(t.height/Math.max(1,s.height));return{...(0,we.minimapPointToWorld)({x:n,y:a},i),px:n,py:a}}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,s=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!s||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+s}),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,Ei.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var Xe=require("@seatlayer/core");var Bs=12;function Ai(r,e){let t=e.floors(),i=new Set(t.map(g=>g.label.trim().toLocaleLowerCase())),s=e.zones().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),n=e.sections().filter(g=>g.seatCount>0&&!i.has(g.label.trim().toLocaleLowerCase())),a=s.length>1?[]:n,o=t.length>1,l=s.length>1,c=a.length>1;if(!o&&!l&&!c)return;let h=document.createElement("div");h.className="sl-view3d-nav";let p=document.createElement("button");p.type="button",p.className="sl-view3d-nav-toggle",p.setAttribute("aria-expanded","false");let d=g=>{h.classList.toggle("is-open",g),p.setAttribute("aria-expanded",String(g)),p.textContent=g?T("picker.closeVenueNav","Close"):o&&(l||c)?T("picker.levelsAndAreas","Levels & areas"):o?T("picker.levels","Levels"):T("picker.areas","Areas")};p.addEventListener("click",()=>d(!h.classList.contains("is-open"))),h.addEventListener("keydown",g=>{g.key!=="Escape"||!h.classList.contains("is-open")||(g.preventDefault(),g.stopPropagation(),d(!1),p.focus())}),d(!1),h.appendChild(p);let f=g=>{},m=g=>{};if(o){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",T("picker.levels","Levels"));let S=[];m=y=>{S.forEach(E=>{E.setAttribute("aria-pressed",String((E.dataset.floor===""?null:Number(E.dataset.floor))===y))})};let k=y=>{e.focusFloor(y)&&(m(y),f(y))},w=(y,E)=>{let u=document.createElement("button");u.type="button",u.textContent=y,u.dataset.floor=E===null?"":String(E),u.setAttribute("aria-pressed",String(E===null)),u.addEventListener("click",()=>{k(E),d(!1)}),S.push(u),g.appendChild(u)};w(T("picker.allLevels","All levels"),null);for(let y of t)w(y.label||(0,Xe.t)("picker.levelNumber",{number:y.index+1}),y.index);h.appendChild(g)}if(l||c){let g=document.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",T("picker.areas","Areas"));let S=l?s.map(w=>({id:w.id,label:w.label||w.id,go:()=>{e.focusZone(w.id)}})):a.map(w=>({id:w.id,label:w.label||w.id,floorIndex:w.floorIndex,go:()=>{e.focusSection(w.id),Number.isFinite(w.floorIndex)&&m(w.floorIndex)}})),k=w=>{let y=l||w===null?S:S.filter(E=>E.floorIndex===void 0||E.floorIndex===w);if(g.replaceChildren(),!y.length){g.remove();return}if(g.isConnected||h.appendChild(g),!l&&y.length>Bs){let E=document.createElement("select");E.setAttribute("aria-label",T("picker.jumpToSection","Jump to section"));let u=document.createElement("option");u.value="",u.textContent=T("picker.jumpToSection","Jump to section"),E.appendChild(u);for(let v of y){let x=document.createElement("option");x.value=v.id,x.textContent=v.label,E.appendChild(x)}E.addEventListener("change",()=>{y.find(v=>v.id===E.value)?.go()}),g.appendChild(E);return}for(let E of y){let u=document.createElement("button");u.type="button",u.textContent=E.label,u.addEventListener("click",()=>{E.go(),d(!1)}),g.appendChild(u)}};f=k,k(null)}r.appendChild(h)}var Ze=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",T("picker.savedSeatComparison","Saved seat comparison"));let n=document.createElement("button");n.type="button",n.className="main",n.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(T("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let a=document.createElement("button");a.type="button",a.className="clear",a.textContent="\xD7",a.setAttribute("aria-label",T("picker.clearSavedSeatComparison","Clear saved seat comparison")),a.addEventListener("click",()=>this.host.clearComparison()),t.append(n,a),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=i>1?(0,Xe.t)("picker.compareCount",{count:i}):T("picker.oneSeatSaved","1 seat saved"),s.setAttribute("aria-label",i>1?(0,Xe.t)("picker.openComparisonOfSeats",{count:i}):T("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};var Ie=require("@seatlayer/core");function Li(r){return Array.isArray(r)?r.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function yt(r,e,t=!1){let i=r.violations[0];return i==="numberOfPlacesToSelect"?r.remaining>0?(0,Ie.t)("picker.selectExactMore",{count:r.remaining}):(0,Ie.t)("picker.selectExactCount",{count:r.required}):i==="minimumSelectedPlaces"?(0,Ie.t)("picker.selectMinimumMore",{count:r.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,Ie.t)("picker.orphanHint")}var ae=require("@seatlayer/core");function $e(r){let e=Math.max(0,r),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Pi({d:r,area:e,label:t,objectType:i,quantity:s=1,identity:n}){let a=h=>String(h??"\u2014").replace(/[&<>"]/g,p=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[p]),o=i==="ga"?"ga":r?.objectType??i,l=n?.displayType?.trim()||r?.displayType?.trim()||e?.displayType?.trim()||(o==="table"?T("picker.table","Table"):o==="booth"?T("picker.booth","Booth"):o==="ga"?T("picker.generalAdmission","General admission"):T("picker.row","Row")),c=n?.rowLabel??n?.displayLabel??r?.rowLabel??r?.displayLabel??e?.displayLabel??e?.label??t;return o==="table"&&n?.bookingMode?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${a(l)}</span><span class="val">${a(c)}</span></span><span class="fld mid"><span class="sl-chip-eb">${T("picker.guests","Guests")}</span><span class="val">${s}</span></span></div>`:o==="ga"?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${a(l)}</span><span class="val">${a(c)}</span></span>`+(s>1?`<span class="fld mid"><span class="sl-chip-eb">${T("picker.tickets","Tickets")}</span><span class="val">${s}</span></span>`:"")+"</div>":o==="booth"?'<div class="sl-chip-id">'+(r?.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${T("picker.section","Section")}</span><span class="val">${a(r.sectionLabel)}</span></span>`:"")+`<span class="fld mid"><span class="sl-chip-eb">${a(l)}</span><span class="val">${a(c)}</span></span></div>`:!r?.sectionLabel&&!r?.rowLabel&&!r?.seatNumber?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${T("picker.seat","Seat")}</span><span class="val">${a(c)}</span></span></div>`:'<div class="sl-chip-id">'+(r.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${T("picker.section","Section")}</span><span class="val">${a(r.sectionLabel)}</span></span>`:"")+(r.rowLabel?`<span class="fld mid"><span class="sl-chip-eb">${a(l)}</span><span class="val">${a(ne(r))}</span></span>`:"")+(r.seatNumber?`<span class="fld mid"><span class="sl-chip-eb">${T("picker.seat","Seat")}</span><span class="val">${a(r.seatNumber)}</span></span>`:"")+"</div>"}function Mi(r,e){return`<div class="sl-chip-rail"><button type="button" class="rm" aria-label="${r}"><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>`+(e?`<button type="button" class="view" data-view-label="${e}" aria-label="${(0,ae.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>`:"")+"</div>"}function Hi(r){return r.salesClosed||r.hasHold||r.ctaPhase!=="idle"||r.formOpen||r.room<=0?null:Math.max(1,Math.min(r.wanted,r.room))}function Ri({count:r,total:e,pendingCount:t,ctaPhase:i,hasHold:s,salesClosed:n,fromPrice:a,addMore:o,holdTime:l,money:c}){if(r&&i==="holding")return`<span>${T("picker.securingSeats","Securing your seats\u2026")}</span>`;if(r&&i==="checkout")return`<span>${(0,ae.t)("picker.peekSecured",{count:r,total:c(e)})}</span>`;if(r){let h=!!s;return`<span>${(0,ae.tCount)("picker.peekTicketsTotal",r,{total:c(e)})}</span>`+(o?`<button type="button" class="go ghost sl-sheet-go" data-act="best" aria-label="${T("picker.findTogetherInstead","Find seats together instead")}">\u2726 +${o}</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="${h?"checkout":"open"}">${s?t?T("picker.secureMore","Secure more"):T("picker.continue","Continue"):T("picker.review","Review")}`+(s&&l?`<span class="sl-peek-time" aria-hidden="true">${l}</span>`:"")+"</button>"}else return n?`<span>${T("picker.salesClosedPill","Sales are closed")}</span>`:(a!=null?`<span>${(0,ae.t)("picker.peekFromPrice",{price:c(a)})}</span>`:`<span>${T("picker.pickYourSeats","Pick your seats")}</span>`)+`<button type="button" class="go sl-sheet-go" data-act="open">${T("picker.bestSeatsStar","\u2726 Best seats")}</button>`}function xt(r,e=Date.now()){return(0,ae.t)("picker.holdReassurance",{time:$e(r-e)})}var Ds="https://api.seatlayer.io",Fs=10,Oi=6e4,Ii=6e4,$i=new Set;function _s(r){let e=$i.has(r);return $i.add(r),e}var zi="seatmap.a11y.cb";function js(){try{if(typeof window>"u")return null;let r=window.localStorage.getItem(zi);return r==null?null:r==="1"}catch{return null}}function Ns(r){try{window.localStorage.setItem(zi,r?"1":"0")}catch{}}var Je=class r{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";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.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;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.confirmEl=null;this.confirmSeat=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.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=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 Ze({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.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.secCardEl=null;this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.lastSection=null;this.secCardCollapsed=!1;this.secCardShownAt=0;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.a11yChipsEl=null;this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;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.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??Ds).replace(/\/+$/,""),this.access=e.transport?null:fe(e,{onExpired:n=>{this.opts.onAccessExpired?.(n),n.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:n=>{this.opts.onAccessUnavailable?.(n),this.showAccessPanel(n)}}),this.pubApi=e.transport?null:new de(this.apiBase,{access:this.access??void 0,onObjectUnavailable:n=>this.opts.onSelectedObjectUnavailable?.(n)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new Ue(e.event,this.api.asset?(n,a)=>this.api.asset(n,a):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 t=e.numberOfPlacesToSelect;if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=t??null;let i=Li(e.selectionValidators);if(this.exactTickets!=null&&i>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Fs,i)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<i)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=js()??!!e.colorblindSafe,this.controller=this.wireController(e)}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let s of i)if(s.type==="shape"&&(s.role==="stage"||s.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=e.viewUrl??"",s=this.chartHasStage();if(!i&&!s)return"";let n=null;if(!i)try{n=(0,b.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let a=s&&n!=null?`<div class="sl-confirm-sight">${(0,b.t)("picker.sightline",{m:n})}</div>`:"";return(i?`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${(0,b.t)("picker.viewFromSeat",{label:e.label})}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${this.tf("picker.viewFromHere","View from here")}</span></button>`:`<button type="button" class="sl-confirm-view sl-confirm-viewbtn" aria-label="${(0,b.t)("picker.viewFromSeat",{label:e.label})}"><span aria-hidden="true">\u{1F52D}</span><span>${this.tf("picker.viewFromHere","View from here")}</span></button>`)+a}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(this.isFramed())try{window.parent.postMessage(e,"*")}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()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),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))}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}),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){pt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",T("picker.seatSelection","Seat selection")),s.tabIndex=-1,i.appendChild(s),document.body.appendChild(i);let n=document.body.style.overflow;document.body.style.overflow="hidden";let a=new r({...e,container:s});a.modalScrim=i,a.prevFocus=t;let o=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let m=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(g=>g.isConnected&&!g.closest('[hidden], [aria-hidden="true"], [inert]'));return m[m.length-1]??s},c=(m,g)=>{let S=m;for(;S;){let k=window.getComputedStyle(S);if(S.hidden||S.getAttribute("aria-hidden")==="true"||S.hasAttribute("inert")||k.display==="none"||k.visibility==="hidden"||k.visibility==="collapse")return!0;if(S===g)return!1;S=S.parentElement}return!0},h=m=>[...m.querySelectorAll(o)].filter(g=>g.tabIndex>=0&&!g.matches(":disabled")&&!c(g,m)),p=(m,g)=>{let S=h(m),k=g?S[S.length-1]:S[0];k?k.focus({preventScroll:!0}):(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.focus({preventScroll:!0}))},d=!1,f=()=>{if(d)return;d=!0,document.body.style.overflow=n,a.escHandler&&document.removeEventListener("keydown",a.escHandler),i.remove(),a.modalScrim=null;let m=a.prevFocus;a.prevFocus=null,m?.isConnected&&m.focus({preventScroll:!0});let g=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff?a.release().finally(g):g()};return a.closeModal=f,i.addEventListener("mousedown",m=>{m.target===i&&f()}),a.escHandler=m=>{if(m.key==="Tab"){if(m.defaultPrevented)return;let g=l(),S=h(g),k=S[0],w=S[S.length-1],y=document.activeElement;!k||!w?(m.preventDefault(),p(g,m.shiftKey)):y===g||!y||!g.contains(y)?(m.preventDefault(),(m.shiftKey?w:k).focus({preventScroll:!0})):m.shiftKey&&y===k?(m.preventDefault(),w.focus({preventScroll:!0})):!m.shiftKey&&y===w&&(m.preventDefault(),k.focus({preventScroll:!0}));return}m.key==="Escape"&&(a.tableDialog?(m.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(m.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(m.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(m.preventDefault(),f()))},document.addEventListener("keydown",a.escHandler),await a.render(),a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",f),p(l(),!1),a}wireController(e){return new b.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,mapTheme:e.theme?.map??null,onGAClick:t=>{let i=this.controller.getGAAreas().find(s=>s.id===t);i&&st(this,i,this.lastMapPoint)},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.toast((0,b.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning"),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,b.t)("picker.maxTicketsForOrder",{count: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),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=x=>Math.round((performance.now()-x)*100)/100;this.rendered=!0,pt();let s=performance.now();await(0,b.loadLocale)(this.opts.locale),t.loadLocale=i(s),this.opts.messages&&(0,b.setStringOverrides)(this.opts.messages),this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let n=performance.now(),a=pi(this.opts.container),{root:o,els:l,mapHost:c}=ti(a,(x,A)=>this.tf(x,A),this.opts.theme);this.root=o,this.els=l,this.mapHost=c,o.addEventListener("keydown",x=>{x.key==="Escape"&&(this.tableDialog?(x.preventDefault(),x.stopPropagation(),this.cancelTableDialog()):this.confirmSeat?(x.preventDefault(),x.stopPropagation(),this.cancelConfirm()):this.bestAvailableConfirm&&(x.preventDefault(),x.stopPropagation(),this.bestAvailableConfirm=!1,this.syncTray()))}),this.syncFullscreenButtons(),this.wireBuyerShell(o);let h=document.createElement("div");h.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(h),t.mountBuyerShell=i(n);let p=await this.loadChart(h,t,i);if(!p)return this;this.els.boot.remove();let d=performance.now();if(this.startRealtime(),this.salesClosed=!!p.salesClosed||!!this.opts.readOnly,o.dataset.eventMode=p.mode==="test"?"test":"live",!this.opts.locale&&p.locale&&await this.setLocale(p.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),p.mode==="test"){let x=document.createElement("div");x.className="sl-testbadge",x.textContent=(0,b.t)("picker.testMode"),x.setAttribute("aria-label",(0,b.t)("picker.testMode")),this.regions["top-left"].appendChild(x)}let f=this.controller.doc?.theme,m=Re(f,this.opts.theme);Object.entries(m).forEach(([x,A])=>o.style.setProperty(x,A)),this.applyMapChromeTokens(),this.currency=p.currency??this.opts.currency??"USD",this.eventTimezone=p.timezone??null;let g=this.opts.theme?.logoUrl??f?.logoUrl??p.posterUrl??null;g?this.els.logo.innerHTML=`<img src="${g}" alt="">`:this.els.logo.textContent=(this.opts.theme?.brandName??f?.brandName??p.eventName??"?").slice(0,1).toUpperCase(),this.els.name.textContent=p.eventName??"";let S=p.startsAt?Qe(p.startsAt,p.timezone??null,this.opts.locale):"";this.eventWhenText=S||null,this.els.meta.textContent=[p.venue,S].filter(Boolean).join(" \xB7 "),this.els.pricesHint&&(this.els.pricesHint.textContent=this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.buildBadge(f);let k=new Set,w=!1;if(this.controller.doc)for(let x of(0,b.expandChart)(this.controller.doc)){for(let A of x.accessibility??[])k.add(A);x.accessible&&!x.accessibility?.length&&k.add("wheelchair"),(x.commercial?.restrictedView||x.commercial?.obstructedView)&&(w=!0)}let y=()=>{this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())};if(k.size||w){let x=document.createElement("div");if(x.className="sl-chips",this.regions["top-left"].appendChild(x),this.a11yChipsEl=x,k.size){let A=(H,B)=>`<button type="button" class="sl-chip-f${H==="all"?" on":""}" data-a11y="1" data-f="${H}">${B}</button>`;x.insertAdjacentHTML("beforeend",A("all",this.tf("picker.allSeats","All seats"))+b.ACCESSIBILITY_TYPES.filter(({key:H})=>k.has(H)).map(({key:H,short:B,icon:G})=>A(H,`${G} ${B}`)).join(""));let L=new Set,$=()=>{x.querySelectorAll("button[data-a11y]").forEach(B=>{let G=B.dataset.f,V=G==="all"?L.size===0:L.has(G);B.classList.toggle("on",V),B.setAttribute("aria-pressed",String(V))});let H=L.size?[...L]:null;this.controller.setAccessibilityFilter(H),H&&y()};x.querySelectorAll("button[data-a11y]").forEach(H=>{H.addEventListener("click",()=>{let B=H.dataset.f;B==="all"?L.clear():L.has(B)?L.delete(B):L.add(B),$()})})}if(w){let A=document.createElement("button");A.type="button",A.className="sl-chip-f",A.setAttribute("aria-pressed","false"),A.innerHTML=`\u25D0 ${this.tf("picker.hideLimitedView","Hide limited-view seats")}`,x.appendChild(A),A.addEventListener("click",()=>{let L=!this.limitedViewFilter;this.limitedViewFilter=L,A.classList.toggle("on",L),A.setAttribute("aria-pressed",String(L)),this.controller.setCommercialLimitedFilter(L),this.pushAvailabilityTo3d(),L&&y()})}}let E=document.createElement("button");E.type="button",E.className="sl-cbbtn",this.cbEl=E,E.setAttribute("aria-label",this.tf("picker.toggleColorblindColors","Toggle colorblind-friendly colors")),E.setAttribute("aria-pressed",String(this.cbSafe)),E.innerHTML='<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>',this.els.zfit.parentElement.appendChild(E),E.addEventListener("click",()=>{this.setColorblindSafe(!this.cbSafe)}),this.buildLanguageSwitcher(E.parentElement),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),o.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(d);let u=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(u),this.destroyed)return this;this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let v=this.controller.doc;return this.emitAnalytics("chart_rendered",{renderingTimeMillis:i(e),performanceProfile:t,seatCount:this.allSeats().length,objectCount:v?.objects.length??0,sectionCount:v?.objects.filter(x=>x.type==="section").length??0,view:this.buyerView,eventKey:this.opts.event,chartName:v?.name,floorCount:this.controller.getFloors().length,transport:this.opts.transport?"custom":"pubapi",load:_s(this.opts.event)?"repeat":"cold"}),this}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),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.zoomToFit()),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 s=this.els.sheetToggle,n=c=>{e.dataset.sheet=c?"open":"peek",s?.setAttribute("aria-expanded",String(c)),s?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};n(e.dataset.sheet==="open"),s?.addEventListener("click",c=>{c.stopPropagation(),n(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let h=c.target.closest(".sl-sheet-go");h&&(c.stopPropagation(),h.dataset.act==="checkout"?this.handleCta():h.dataset.act==="best"?(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray(),n(!0),this.els.tray?.querySelector(".sl-ba-go")?.focus()):n(!0))});let a=0,o=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,o=!1,a=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||o)return;let h=c.clientY-a;h<-18?(n(!0),o=!0):h>18&&(n(!1),o=!0)}),t.addEventListener("pointerup",c=>{l&&!o&&Math.abs(c.clientY-a)<6&&n(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let s=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!s)),this.els.pricesSec?.setAttribute("aria-expanded",String(!s)),!s&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let n=this.els.sheetToggle;n?.setAttribute("aria-expanded","true"),n?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",s=>{s.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",s=>{s.key!=="Enter"&&s.key!==" "||s.target.closest("select,button")||(s.preventDefault(),i())}),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",s=>{this.lastMapPoint={x:s.clientX,y:s.clientY}},!0),this.els.map.addEventListener("mousemove",s=>{let n=this.els.map.getBoundingClientRect();this.tipPos={x:s.clientX-n.left,y:s.clientY-n.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let s=e.clientHeight,n=i!==this.pickerLayoutSize.width||s!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:s},this.reportFramedHeight();let a=i<640?"narrow":"wide",o=s<560?"compact":"comfortable";(e.dataset.layout!==a||e.dataset.density!==o)&&(e.dataset.layout=a,e.dataset.density=o,a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome()),n&&this.minimap?.refreshMinimap()};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let s=performance.now(),n=await this.controller.render(e);return t.loadChartAndStatuses=i(s),this.destroyed?null:n?(Object.assign(t,n.performanceProfile),n):(this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let a=this.opts.container,o=this.opts;this.destroy(),new r({...o,container:a}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted"||typeof location>"u")return;let e=new URLSearchParams(location.search),t=e.get("order");if(!t)return;let i=e.get("status");e.delete("order"),e.delete("status");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}i==="success"&&this.openCheckoutPanel({kind:"resume",orderId:t})}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()}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 s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.cbEl&&this.els.zoom?.appendChild(this.cbEl),this.a11yChipsEl&&(e?this.els.rail?.insertBefore(this.a11yChipsEl,this.els.railScroll??null):this.regions["top-left"]?.appendChild(this.a11yChipsEl)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}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>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]')}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return T(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();e.innerHTML=`<div class="sl-soldout-eyebrow">${t}</div><div class="sl-soldout-title">${this.tf("picker.soldOutTitle","Sold out")}</div><p class="sl-soldout-copy">${this.tf("picker.soldOutCopy","No reserved seats are currently available for this event.")}</p>`,this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,i);s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(s=>(t[s.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();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer")),i.innerHTML='<span class="sl-powered-mark" aria-hidden="true">'+Ne+`</span><span>${this.tf("picker.poweredBy","Powered by SeatLayer")}</span>`,t.appendChild(i)}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){if(this.reducedMotion())return;(e.items??[]).filter(i=>i.objectType!=="ga").map(i=>i.label).slice(0,10).forEach((i,s)=>{let n=this.controller.seatByLabel(i);n&&this.scheduleMotion(()=>this.controller.flashSeat(n.id,this.cssVar("--sl-accent")||"#f4b740"),s*55)})}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(){let e=this.hold?.items??[],t=new Set(e.map(s=>s.label));return this.committedSelection().filter(s=>!t.has(s.label)).reduce((s,n)=>s+(n.quantity??1),0)+be(this.gaQty,this.hold?.items??[])}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,s)=>i+(s.quantity??1),0);return this.heldTicketCount()+t+be(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(s=>s.label)),t=this.committedSelection().filter(s=>e.has(s.label)).reduce((s,n)=>s+(n.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-be(this.gaQty,this.hold?.items??[]));this.controller.setMaxSelection(t+i)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(!i)return;if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=yt(s,(n,a)=>this.tf(n,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,b.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()),e==="checkout"&&this.scheduleMotion(()=>{this.ctaPhase==="checkout"&&(this.ctaPhase="idle",this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()))},1100)}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i)return null;let s={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=s,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(s.expiresAt),this.rememberHold(s),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(s,s.seats??[],this.buildHandoff(s)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),s}catch(i){let s=i?.status;return s===404||s===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(s=>s.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){this.els.map&&(this.minimap=Ci({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}catPrice(e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:this.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}catPriceRange(e){let t=e.tiers?.length?e.tiers.map(i=>this.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[this.paidPrice(e.key,null,e.price)];if(e.key)for(let i of this.pricesByChannel.values())for(let s of i)s.categoryKey===e.key&&t.push(s.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}priceBands(){let e=this.controller.doc;if(!e)return[];let t=e.categories.map(o=>({key:o.key,range:this.catPriceRange(o)})).filter(o=>o.range!=null);if(!t.length)return[];let i=[...new Map(t.map(o=>[`${o.range.min}:${o.range.max}`,o.range])).values()].sort((o,l)=>o.min-l.min||o.max-l.max);if(i.length<=5)return i.map(o=>({id:`p${o.min}-${o.max}`,label:o.min===o.max?this.money(o.min):`${this.money(o.min)}\u2013${this.money(o.max)}`,keys:t.filter(l=>l.range.min===o.min&&l.range.max===o.max).map(l=>l.key),min:o.min,max:o.max}));let s=[...t].sort((o,l)=>o.range.min-l.range.min||o.range.max-l.range.max),n=Math.ceil(s.length/4),a=[];for(let o=0;o<s.length;o+=n){let l=s.slice(o,o+n),c=Math.min(...l.map(p=>p.range.min)),h=Math.max(...l.map(p=>p.range.max));a.push({id:`b${o}`,label:c===h?this.money(c):`${this.money(c)}\u2013${this.money(h)}`,keys:l.map(p=>p.key),min:c,max:h})}return a}buildPriceFilter(){if(!this.els.prices||!this.els.pricesSec)return;let e=this.priceBands();if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price")),t.innerHTML=`<option value="all">${this.tf("picker.allPrices","All prices")}</option>`+e.map(i=>`<option value="${i.id}">${i.label}</option>`).join(""),this.els.pricesSec.appendChild(t),t.addEventListener("change",()=>{let s=e.find(n=>n.id===t.value)?.keys??null;this.focusedCatKey=null,this.priceBandKeys=s?new Set(s):null,this.controller.setCategoryFilter(s),this.controller.focusCategoryFilter(s),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)})}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(s=>s.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.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(s=>{s.addEventListener("click",()=>{this.setBuyerView(s.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(h=>h.objects)],s=new Set((e.zones??[]).map(h=>h.id)),a=i.some(h=>h.type==="section"&&typeof h.zone=="string"&&s.has(h.zone))?["zones","sections","seats"]:["sections","seats"],o=document.createElement("div");o.className="sl-rungs on",o.setAttribute("role","group"),o.setAttribute("aria-label",(0,b.t)("picker.zoomLevel"));let l={zones:(0,b.t)("picker.rungLabel.zones"),sections:(0,b.t)("picker.rungLabel.sections"),seats:(0,b.t)("picker.rungLabel.seats")},c={zones:(0,b.t)("picker.rungTip.zones"),sections:(0,b.t)("picker.rungTip.sections"),seats:(0,b.t)("picker.rungTip.seats")};o.innerHTML=a.map(h=>`<button type="button" data-rung="${h}" title="${c[h]}" aria-pressed="false">${l[h]}</button>`).join(""),o.querySelectorAll("button").forEach(h=>{h.addEventListener("click",()=>{let p=h.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(o),this.rungsEl=o,this.syncRung()}if(this.controller.isMultiFloor()){let i=Si({floors:this.controller.getFloors(),tf:(s,n)=>this.tf(s,n),onChoose:s=>{s===""?this.controller.setFloorOverview(!0):this.controller.setFloor(s),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(i),this.floorsEl=i,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=e==="seats";this.root&&(this.root.dataset.zoomed=String(t)),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let s=i.dataset.rung===e;i.classList.toggle("on",s),i.setAttribute("aria-pressed",String(s))})}syncProjection(){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||!hi()?!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)?Ii/2:Ii}syncFloors(){Ti(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}showSectionCard(e){if(this.lastSection=e,this.secCardEl?.remove(),this.secCardEl=null,!e){this.minimap?.refreshMinimap();return}this.secCardCollapsed=this.controller.getRung()==="seats",this.secCardShownAt=Date.now(),this.renderSectionCard(e),this.minimap?.refreshMinimap()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let i=t.findIndex(s=>s.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}wireSectionNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let s=t.dataset.sectionNav;s&&this.controller.focusSection(s)})})}renderSectionCard(e){if(!this.els.map)return;this.secCardEl?.remove();let t=e.categories.length?e.categories.map(p=>{let d=this.controller.doc?.categories.find(f=>f.key===p.key);return d?this.catPriceRange(d):{min:p.priceMin,max:p.priceMax}}).filter(p=>p!=null):[{min:e.priceMin,max:e.priceMax}],i=Math.min(...t.map(p=>p.min)),s=Math.max(...t.map(p=>p.max)),n=i===s?this.money(i):`${this.money(i)}\u2013${this.money(s)}`,a=(0,b.tCount)("picker.seatsLeftInSection",e.seatsLeft),o=`<button type="button" class="sl-seccard-x" aria-label="${(0,b.t)("picker.closeSectionSummary")}">\u2715</button>`,l=xi(this.sectionNeighbours(e.id)),c=document.createElement("div");if(this.root?.dataset.layout==="narrow")c.className="sl-seccard strip on",c.setAttribute("role","status"),c.setAttribute("aria-label",(0,b.t)("picker.sectionSummaryAria",{label:e.label})),c.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${a}</span>`+l+o,this.wireSectionNavigation(c),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),this.els.map.appendChild(c);else if(this.secCardCollapsed)c.className="sl-seccard mini on",c.setAttribute("role","button"),c.setAttribute("aria-label",(0,b.t)("picker.sectionSummaryAria",{label:e.label})),c.innerHTML=`<span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span><span class="sl-seccard-left">${a}</span>`+l+o,this.wireSectionNavigation(c),c.addEventListener("click",p=>{p.target.closest(".sl-seccard-x")||(this.secCardCollapsed=!1,this.secCardShownAt=Date.now(),this.renderSectionCard(e))}),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(c);else{c.className="sl-seccard on",c.setAttribute("role","dialog"),c.setAttribute("aria-label",(0,b.t)("picker.sectionSummaryAria",{label:e.label}));let p=e.categories.map(d=>{let f=this.priceBandKeys!=null&&!this.priceBandKeys.has(d.key),m=this.controller.doc?.categories.find(k=>k.key===d.key),g=m?this.catPriceRange(m):{min:d.priceMin,max:d.priceMax},S=g&&g.min!==g.max?`${this.money(g.min)}\u2013${this.money(g.max)}`:this.money(g?.min??d.price);return`<span class="sl-seccard-mix-item${f?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${d.color}"></span>${d.label} <span class="sl-seccard-mix-price">${S}</span></span>`}).join("");c.innerHTML=`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${e.color}"></span><span class="sl-seccard-name">${e.label}</span>`+(e.categories.length?`<span class="sl-seccard-price">${n}</span>`:"")+o+`</div><div class="sl-seccard-zone">${e.zoneLabel?`${e.zoneLabel} \xB7 `:""}<span class="sl-seccard-left">${a}</span></div>`+(e.entrance?`<div class="sl-seccard-entrance">${(0,b.t)("picker.entrance")} ${String(e.entrance).replace(/[&<>"]/g,d=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[d])}</div>`:"")+(p?`<div class="sl-seccard-mix">${p}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${(0,b.t)("picker.overview")}</button>`+l+`<span class="sl-seccard-hint">${(0,b.t)("picker.tapSeatHint")}</span></div>`,this.wireSectionNavigation(c),c.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),c.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.controller.overview()),(this.regions["top-center"]??this.els.map).appendChild(c)}this.secCardEl=c}collapseSectionCard(){!this.secCardEl||this.secCardCollapsed||!this.lastSection||this.root?.dataset.layout!=="narrow"&&(this.secCardCollapsed=!0,this.renderSectionCard(this.lastSection))}sectionCardOnView(){if(!(!this.secCardEl||this.secCardCollapsed||!this.lastSection)&&this.root?.dataset.layout!=="narrow"){if(this.controller.getRung()==="seats"){this.collapseSectionCard();return}if(Date.now()-this.secCardShownAt<1400){this.sectionCardCoverage()>.25&&this.collapseSectionCard();return}this.collapseSectionCard()}}sectionCardCoverage(){let e=this.secCardEl,t=this.lastSection;if(!e||!t||!this.els.map)return 0;let i=this.activeFloorObjects().find(k=>k.type==="section"&&k.id===t.id)?.outline;if(!i||i.length<3)return 0;let s=i.map(k=>this.controller.worldToScreen(k)),n=s.map(k=>k.x),a=s.map(k=>k.y),o=Math.min(...n),l=Math.min(...a),c=Math.max(...n)-o,h=Math.max(...a)-l;if(c<=0||h<=0)return 0;let p=this.els.map.getBoundingClientRect(),d=e.getBoundingClientRect(),f=d.left-p.left,m=d.top-p.top,g=Math.max(0,Math.min(f+d.width,o+c)-Math.max(f,o)),S=Math.max(0,Math.min(m+d.height,l+h)-Math.max(m,l));return g*S/(c*h)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.controller.doc?.categories.find(d=>d.key===e.categoryKey),i=this.controller.getStatus(e.id)??"free",s=i==="free"?this.tf("picker.statusAvailable","available"):i==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),n=t?this.catPriceRange(t):void 0,a=n?n.min===n.max?this.money(n.min):`${this.money(n.min)}\u2013${this.money(n.max)}`:void 0,o=this.controller.tableSelection(e.id),l=o??this.controller.seatDetails(e.id),c=this.rowTypeWord(l),h=l?.rowLabel??l?.displayLabel??e.displayLabel??e.label,p=o?`${c} ${h}, ${o.bookingMode==="variable"?(0,b.t)("picker.minToMaxGuests",{min:o.minOccupancy,max:o.maxOccupancy}):(0,b.t)("picker.capacityGuests",{count:o.capacity})}`:l?.objectType==="booth"?`${c} ${h}`:l?.objectType==="table"?`${c} ${h}, ${(0,b.t)("picker.seatNumberLower",{label:l.seatNumber??e.label})}`:(0,b.t)("picker.seatLabel",{label:l?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${p}, ${t?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let s=c=>String(c??"").replace(/[&<>"']/g,h=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[h]),n=this.controller.doc?.categories.find(c=>c.key===e.categoryKey),a=e.bookingMode==="variable",o=this.rowTypeWord(e),l=document.createElement("div");l.className="sl-table-scrim",l.innerHTML=`<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">${s(a?(0,b.t)("picker.flexiblePartyTypeWord",{typeWord:o}):(0,b.t)("picker.wholeTypeWord",{typeWord:o}))}</div><h2 class="sl-table-title" id="sl-table-title">${s(e.displayLabel??e.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${a?this.tf("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,b.t)("picker.allPlacesBookedTogether",{count:e.capacity})}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${s(n?.label??e.categoryKey)}</span><b data-table-unit>${(0,b.t)("picker.perGuestPrice",{price:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))})}</b><span class="muted">${this.tf("picker.tableCapacity","Table capacity")}</span><span>${(0,b.t)("picker.guestsCount",{count:e.capacity})}</span><span class="muted">${this.tf("picker.total","Total")}</span><b data-table-total></b></div>`+(a?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${this.tf("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="${this.tf("picker.fewerGuests","Fewer guests")}">\u2212</button><output aria-live="polite" data-table-qty>${e.quantity}</output><button type="button" data-table-step="1" aria-label="${this.tf("picker.moreGuests","More guests")}">+</button></div><div class="sl-table-range">${(0,b.t)("picker.chooseMinMaxGuests",{min:e.minOccupancy,max:e.maxOccupancy})}</div>`:`<input type="hidden" data-table-qty value="${e.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${(0,b.t)("common.cancel")}</button><button type="button" class="sl-table-confirm">${t?this.tf("picker.updateTable","Update table"):a?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table")}</button></div></div></section>`,this.root.appendChild(l),this.tableDialogEl=l,this.renderTableDialogState(),l.querySelectorAll("[data-table-step]").forEach(c=>{c.addEventListener("click",()=>{if(!this.tableDialog)return;let h=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(c.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:h},this.renderTableDialogState()})}),l.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),l.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),l.addEventListener("mousedown",c=>{c.target===l&&this.cancelTableDialog()}),l.addEventListener("keydown",c=>{if(c.key!=="Tab")return;let h=[...l.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!h.length)return;let p=h[0],d=h[h.length-1];c.shiftKey&&document.activeElement===p?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),p.focus())}),requestAnimationFrame(()=>l.querySelector(a?'[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 s=t.querySelector("input[data-table-qty]");s&&(s.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(o=>{let l=Number(o.dataset.tableStep);o.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let n=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),a=t.querySelector("[data-table-total]");a&&(a.textContent=this.money(n*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 s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){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:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,b.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),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())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(w=>w.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),s=this.controller.doc?.categories.find(w=>w.key===e.categoryKey),n=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),a=n!=null?this.paidPrice(e.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,n,e.label):void 0,o=w=>String(w??"\u2014").replace(/[&<>"]/g,y=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[y]),l=[i?.sectionLabel?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.section","Section")}</span><span class="sl-confirm-value">${o(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${o(this.rowTypeWord(i))}</span><span class="sl-confirm-value">${o(ne(i)??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${this.tf("picker.seat","Seat")}</span><span class="sl-confirm-value">${o(i?.seatNumber??i?.displayLabel??e.displayLabel??e.label)}</span></div>`:""].filter(Boolean).join(""),c=i?.tiers??s?.tiers??[],h=i?.tierId??c[0]?.id,p=w=>w.buyerMessage?.trim()||(w.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0),d=c.length>1?`<fieldset class="sl-confirm-tiers"><legend>${this.tf("picker.ticketType","Ticket type")}</legend>`+c.map(w=>{let y=p(w);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(w.id)}" aria-pressed="${w.id===h}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(w.name)}</span>`+(y?`<small class="sl-confirm-tier-note">${o(y)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${this.money(this.paidPrice(e.categoryKey,w.id,w.price,e.label))}</span></button>`}).join("")+"</fieldset>":c[0]&&p(c[0])?`<p class="sl-confirm-tier-note">${o(p(c[0]))}</p>`:"",f=this.buyerView==="venue3d",m=document.createElement("div");m.className="sl-confirm",m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,b.t)("picker.confirmSeatLabel",{label:e.label}));let g=s?.color??"#6e7bff",S=ht(g,this.cssVar("--sl-surface")||"#1a2234",.76)??g;m.style.setProperty("--sl-cat",g),m.style.setProperty("--sl-cat-ink",te(S,"#172033","#ffffff")),m.innerHTML='<div class="sl-confirm-grid">'+l+`</div><div class="sl-confirm-cat"><span class="sl-dot" style="background:${s?.color??"#6e7bff"}"></span><span class="sl-confirm-cat-name">${o(i?.categoryLabel??s?.label??e.categoryKey)}</span>`+(a!=null?`<span class="sl-confirm-price">${this.money(a)}</span>`:"")+'</div><div class="sl-confirm-body">'+d+yi(i?.wheelchairSpaceType)+vi(e.commercial)+(this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"")+(f?`${ki(e,`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${a==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(a)}`,f)}<div class="sl-confirm-inspect-row">${wi(e,f?this.view3dCompareSeatIds:null)}${bt(this.canOffer3d(),f)}</div>`:bt(this.canOffer3d(),f))+`<div class="sl-confirm-row"><button type="button" class="sl-confirm-cancel">${(0,b.t)("common.cancel")}</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>${this.tf("picker.select","Select")}</button></div></div>`,this.els.map.appendChild(m),this.confirmEl=m;let k=m.querySelector(".sl-confirm-thumb");if(k&&e.viewUrl){let w=e.viewMeta?.previewUrl??e.viewUrl;this.buyerAssetUrls.resolve(w).then(y=>{y&&m.isConnected&&this.confirmEl===m&&(k.src=y)}).catch(y=>this.opts.onError?.(y))}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",w=>{this.openSeatConfidencePassport(e,w.currentTarget instanceof HTMLElement?w.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(w=>{w.addEventListener("click",()=>{let y=w.dataset.confirmTier,E=c.find(v=>v.id===y);if(!E)return;this.controller.setSeatTier(e.id,E.id),m.querySelectorAll("[data-confirm-tier]").forEach(v=>{v.setAttribute("aria-pressed",String(v===w))});let u=m.querySelector(".sl-confirm-price");u&&(u.textContent=this.money(this.paidPrice(e.categoryKey,E.id,E.price,e.label))),this.reanchorConfirm()})}),m.querySelector(".sl-confirm-3d")?.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))}),m.querySelector(".sl-confirm-add").addEventListener("click",()=>this.commitConfirm()),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>m.querySelector(".sl-confirm-add")?.focus())}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow")return;let t=this.els.map.clientWidth,i=this.els.map.clientHeight,s=this.confirmEl.offsetWidth||276,n=this.confirmEl.offsetHeight||230,a=s/2+12,o=Math.max(a,Math.min(t-a,e.x)),l=e.y+n+24<=i,c=e.y<n+24&&l;this.confirmEl.dataset.placement=c?"below":"above",this.confirmEl.style.left=`${o}px`,this.confirmEl.style.top=`${Math.max(8,Math.min(i-8,e.y))}px`}dismissConfirm(){this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=null,this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}commitConfirm(){this.confirmSeat&&(this.dismissConfirm(),this.collapseSectionCard(),this.syncTray(),this.syncSelectionTo3d())}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){if(!this.allSeatsCache){let e=this.controller.doc;this.allSeatsCache=e?(0,b.expandChart)(e):[]}return this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,s=this.controller.getActiveFloorId(),n=e.focalPoint??i?.floors?.find(p=>p.id===s)?.focalPoint??i?.focalPoint??{x:0,y:0},a,o,l=!1;if(e.viewUrl){let p,d=null;try{let m=e.viewMeta?.previewUrl;m&&m!==e.viewUrl?(d=await this.buyerAssetUrls.resolve(m),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!d||!this.root||!this.seatViewEnabled())return;let f={url:p,...d?{previewUrl:d}:{},...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?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};a=f,o=(0,ze.seatViewDisclosure)(f),l=(0,ze.isAuthoredSeatView)(f)}else{let p;try{let{generateSeatPanorama:d}=await mi();p=d(e,n,this.allSeats())}catch(d){t===this.seatViewGen&&this.opts.onError?.(d);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;a={url:p.url,generated:!0},o=(0,b.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,b.t)("picker.viewFromSeat",{label:e.label}),h=si({root:this.root,source:a,caption:o,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:this.tf("picker.dragToLookAround","Drag to look around \xB7 scroll to zoom"),viewFromSeatLabel:c,real360Label:(0,b.t)("picker.real360"),previewLabel:(0,b.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=h.element,this.viewCleanup=()=>h.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,b.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(s,n)=>`${s} ${n}`,...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=Xt(e,t);if(i==null)return;let s=6*36e5,n=Math.min(Math.max(i-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},n)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=Ge(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let s=Ke(i),n={...this.hostPricing?.prices??{},...s},a=Object.keys(n).length>0||this.hostPricing?.formatter?{prices:n,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(a),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){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}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;let t=this.offerAvailability,i=t?.release??null,s=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!s){e.classList.remove("has"),e.replaceChildren();return}let n=i??s,a=document.createElement("div");a.className="sl-offer-main";let o=document.createElement("div");o.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=n.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let h=document.createElement("span");h.className="sl-offer-line";let p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&n.remaining!=null&&p.push((0,b.t)("picker.offerRemainingAvailable",{count:n.remaining})),i&&n.endsAt!=null&&p.push((0,b.t)("picker.offerUntil",{time:Qe(n.endsAt,this.eventTimezone,this.opts.locale)})),s?.startsAt!=null&&p.push((0,b.t)("picker.offerStarts",{time:Qe(s.startsAt,this.eventTimezone,this.opts.locale)})),h.textContent=p.join(" \xB7 "),o.append(l,c,h);let d=document.createElement("details");d.className="sl-offer-info";let f=document.createElement("summary");f.setAttribute("aria-label",(0,b.t)("picker.howOfferWorks",{name:c.textContent??""})),f.textContent="i";let m=document.createElement("div");m.className="sl-offer-detail",m.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."),d.append(f,m),a.append(o,d),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,s){let n=s?this.channelByObject.get(s):void 0;if(n&&e){let o=this.pricesByChannel.get(n)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(o)return o.price}let a=e?this.opts.pricing?.prices?.[e]:void 0;return a===void 0?i:typeof a=="number"?a:t&&a.tiers?.[t]!==void 0?a.tiers[t]:a.base??i}legendDeps(){return{colorOf:e=>this.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:U}}syncPriceRail(e,t){let i=this.els.railScroll,s=e.length>1;this.els.rail?.classList.toggle("has",s||!!this.a11yChipsEl?.children.length),i&&(i.innerHTML=s?Wt({...this.legendDeps(),categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out")}):"",i.querySelectorAll(".sl-rc").forEach(n=>{n.addEventListener("click",()=>this.focusCategory(n.dataset.cat??""))}),this.railEdgesBound||(this.railEdgesBound=!0,i.addEventListener("scroll",()=>dt(i),{passive:!0})),requestAnimationFrame(()=>dt(i)))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(l=>!l.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t),this.syncPriceRail(i,t);let s=5,n=i.length-s,a=n>1&&!this.pricesExpanded,o=a?i.slice(0,s):i;this.els.prices.classList.toggle("sl-expanded",n>1&&this.pricesExpanded),this.els.prices.innerHTML=Kt({...this.legendDeps(),categories:o,left:t,collapsed:a,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:l=>(0,b.tCount)("picker.leftCount",l),titleFor:(l,c)=>c?this.tf("picker.showAllSeats","Show all seats"):(0,b.t)("picker.showLabelSeatsOnMap",{label:l.label}),moreLabel:n>1?a?(0,b.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(l=>{l.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(l.dataset.cat??null)),l.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let c=()=>this.focusCategory(l.dataset.cat??"");l.addEventListener("click",c),l.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,s=this.lastCatAvail;this.lastCatAvail={...t};let n=this.controller.getActiveFloorId();if(n!==this.lastAvailFloorId&&(this.lastAvailFloorId=n,this.availQuietUntil=performance.now()+2e3),!(!i||!s||performance.now()<this.availQuietUntil))for(let a of e){let o=s[a.key],l=t[a.key]??0;if(o===void 0||l>=o)continue;let c=o-l;i.textContent=(0,b.tCount)("picker.seatsJustTakenInCategory",c,{label:a.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}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,b.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let e=this.committedSelection(),t=this.controller.getGAAreas(),i=this.hold?.items??[],s=[],n=new Set;if(this.salesClosed&&!e.length&&!i.length){let u=this.eventWhenText?`<span class="when">${String(this.eventWhenText).replace(/[&<>"]/g,v=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[v])}</span>`:"";s.push(`<div class="sl-closed-note" role="status"><b>${this.tf("picker.salesClosedPill","Sales are closed")}</b><span>${this.tf("picker.salesClosedCopy","Ticket sales for this event have ended.")}${u}</span></div>`)}else if(!e.length&&!i.length&&!t.length)s.push(`<div class="sl-tray-hint">${this.tf("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`);else if(!e.length&&!i.length){let u=this.controller.doc?.objects?.some(v=>v.type!=="gaArea");s.push(`<div class="sl-tray-hint">${u?this.tf("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):this.tf("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets.")}</div>`)}let a=!e.length&&!i.length&&!be(this.gaQty,this.hold?.items??[]);if(a&&(this.baReopen=!1),!this.salesClosed&&!this.hold&&(a||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let u=(this.controller.doc?.categories??[]).filter(x=>!x.notForSale),v=this.controller.getBestAvailableZones();this.baZone&&!v.some(x=>x.id===this.baZone)&&(this.baZone=""),s.push(this.bestAvailableConfirm?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,b.t)("picker.willFindSeatsTogether",{count:this.baQty})}</b><span>${this.tf("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>${this.tf("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${this.tf("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${this.tf("picker.findBestSeatsTogether","Find the best seats together")}</div><div class="sl-ba-copy"><span class="wide">${this.tf("picker.willChooseClosestGroup","We\u2019ll choose the closest available group for you.")}</span><span class="narrow">${this.tf("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</span></div>`+(this.controller.hasPremiumSeats()?`<button type="button" class="sl-ba-premium${this.baPremium?" on":""}" data-ba-premium aria-pressed="${this.baPremium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${this.tf("picker.bestSeatsPremium","Best seats")}</button>`:"")+(u.length>1?`<select aria-label="${this.tf("picker.preferredTicketType","Preferred ticket type")}" data-ba-cat><option value="">${this.tf("picker.anyTicketType","Any ticket type")}</option>`+u.map(x=>`<option value="${x.key}"${this.baCat===x.key?" selected":""}>${x.label}</option>`).join("")+"</select>":'<span aria-hidden="true"></span>')+(v.length?`<select aria-label="${this.tf("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${this.tf("picker.anyVenueZone","Any venue zone")}</option>`+v.map(x=>`<option value="${U(x.id)}"${this.baZone===x.id?" selected":""}>${U(x.label)}</option>`).join("")+"</select>":"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${this.tf("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${this.baQty}</span><button type="button" data-ba="1" aria-label="${this.tf("picker.moreSeats","More seats")}">+</button></div><button type="button" class="sl-ba-go${this.bestAvailableBusy?" sl-busy":""}"${this.bestAvailableBusy?" disabled":""}>`+(this.bestAvailableBusy?`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,b.tCount)("picker.findBestSeatsCount",this.baQty))+"</button>"+(this.baReopen?`<button type="button" class="sl-ba-back" data-ba-close>${this.tf("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>")}let o=(u,v,x,A=1,L,$)=>Pi({d:u?this.controller.seatDetails(u):null,area:x==="ga"?t.find(H=>H.id===L):void 0,label:v,objectType:x,quantity:A,identity:$}),l=Mi;for(let u of $t(i)){let v=u.objectType==="ga"?`held:ga:${u.objectId}:${u.tierId??""}`:`held:${u.label}`;n.add(v);let x=this.controller.doc?.categories.find(B=>B.key===u.categoryKey),A=u.tierId?x?.tiers?.find(B=>B.id===u.tierId)?.name:void 0,L=u.objectType!=="ga"?this.controller.seatByLabel(u.label):null,$=u.objectType==="table"?this.controller.tableSelection(u.label):null,H=this.seatViewEnabled()&&!!L&&u.objectType!=="table";s.push(`<div class="sl-chip sl-held${this.lastTrayKeys.has(v)?"":" sl-enter"}" data-key="${v}" data-held="${encodeURIComponent(u.labels.join(`
1551
+ `))}"${L?` data-locate="${L.id}"`:""}><div class="sl-chip-main">`+o(L?.id??null,u.label,u.objectType,u.quantity??1,u.objectId,$??void 0)+`<div class="sl-chip-sub"><span class="sl-ticket-state held" aria-label="${this.tf("picker.heldForYou","Held for you")}" title="${this.tf("picker.heldForYou","Held for you")}"><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><span class="cat">${x?.label??u.categoryKey}${A?` \xB7 ${A}`:""}</span>`+($?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,b.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+gt(L?.wheelchairSpaceType)+ft(L?.commercial)+`<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId,u.unitPrice,u.label)*(u.quantity??1))}</span></div></div>`+l((0,b.t)("picker.removeHeldTicketLabel",{label:Bt(u,t)}),H?u.label:null)+"</div>")}let c=new Set(i.map(u=>u.label)),h=this.seatViewEnabled();for(let u of e.filter(v=>!c.has(v.label))){let v=`seat:${u.id}`;n.add(v);let x=this.controller.doc?.categories.find(H=>H.key===u.categoryKey),A=u.tiers&&u.tiers.length?`<select class="tier" data-tier="${u.id}" aria-label="${(0,b.t)("picker.ticketTierFor",{label:u.label})}">`+u.tiers.map(H=>`<option value="${H.id}"${H.id===u.tierId?" selected":""}>${H.name} \xB7 ${this.money(this.paidPrice(u.categoryKey,H.id,H.price,u.label))}</option>`).join("")+"</select>":"",L=u.tiers?.find(H=>H.id===u.tierId)??u.tiers?.[0],$=L?.buyerMessage?.trim()||(L?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):"");s.push(`<div class="sl-chip${this.lastTrayKeys.has(v)?"":" sl-enter"}" data-key="${v}" data-seat="${u.id}" data-locate="${u.id}"><div class="sl-chip-main">`+o(u.id,u.label,u.objectType,u.quantity??1,u.objectId,u)+`<div class="sl-chip-sub"><span class="sl-ticket-state" aria-label="${this.tf("picker.selected","Selected")}" title="${this.tf("picker.selected","Selected")}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span><span class="cat">${x?.label??u.categoryKey}</span>`+(u.objectType==="table"&&u.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${encodeURIComponent(u.label)}">${(0,b.t)("picker.guestsCountEdit",{count:u.quantity??1})}</button>`:"")+`${gt(u.wheelchairSpaceType)}${ft(u.commercial)}${A}<span class="amt">${this.money(this.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1))}</span></div>`+($?`<small class="sl-tier-note">${U($)}</small>`:"")+"</div>"+l((0,b.t)("picker.removeSeatLabel",{label:u.label}),h&&u.objectType!=="table"?u.label:null)+"</div>")}t.length&&s.push(jt(this,t,i)),!this.salesClosed&&!this.hold&&!a&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&s.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${this.tf("picker.findTogetherInstead","Find seats together instead")}</button>`),this.els.tray.innerHTML=s.join(""),this.lastTrayKeys=n,this.els.tray.querySelectorAll("[data-ba]").forEach(u=>{u.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(u.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",u=>{this.baCat=u.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",u=>{this.baZone=u.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-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.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(u=>{u.addEventListener("click",()=>{let v=u.closest(".sl-chip");if(v.dataset.held){this.removeHeldLabels(decodeURIComponent(v.dataset.held).split(`
1552
+ `),v);return}let x=v.dataset.seat,A=this.controller.getSelection().find($=>$.id===x)?.label??this.tf("picker.seat","Seat"),L=()=>{this.controller.deselect([x]),this.toast((0,b.t)("picker.labelRemoved",{label:A}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let $=this.controller.select([x]);this.toast($.length?(0,b.t)("picker.labelRestored",{label:A}):(0,b.t)("picker.labelNoLongerAvailable",{label:A}),$.length?"success":"warning")}})};if(this.reducedMotion()){L();return}v.classList.add("sl-leave"),this.scheduleMotion(L,150)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(u=>{u.addEventListener("click",v=>{v.stopPropagation();let x=decodeURIComponent(u.dataset.tableEdit??""),A=this.controller.tableSelection(x);if(!A)return;let L=i.find($=>$.label===x&&$.objectType==="table");this.showTableDialog({...A,quantity:L?.quantity??A.quantity},!!L,u)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(u=>{u.addEventListener("change",()=>this.controller.setSeatTier(u.dataset.tier,u.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(u=>{u.addEventListener("click",()=>{let v=this.controller.seatByLabel(u.dataset.viewLabel);v&&this.openSeatView(v)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(u=>{let v=()=>this.controller.flashSeat(u.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");u.addEventListener("mouseenter",v),u.addEventListener("focusin",v)}),Nt(this,this.els.tray,t),this.controller.setGASelection(Rt(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(u=>{u.disabled=!0});let p=It(this,t,this.hold?.items??[]),d=be(this.gaQty,this.hold?.items??[]),f=i.reduce((u,v)=>u+this.paidPrice(v.categoryKey,v.tierId,v.unitPrice,v.label)*(v.quantity??1),0),m=i.reduce((u,v)=>u+(v.quantity??1),0),g=e.filter(u=>!c.has(u.label)),S=g.reduce((u,v)=>u+this.paidPrice(v.categoryKey,v.tierId??null,v.price,v.label)*(v.quantity??1),0)+p+f,k=g.reduce((u,v)=>u+(v.quantity??1),0)+d+m,w=this.pendingSelectionCount(),y=this.lastTrayCount,E=this.lastTrayTotal;if(this.els.count.textContent=k?(0,b.tCount)("picker.ticketsCount",k):this.tf("picker.noSeatsSelected","No seats selected"),this.els.total.textContent=k?this.money(S):"",this.root?.setAttribute("data-has-selection",String(k>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",k===0),this.els.seatSummary&&(this.els.seatSummary.textContent=k?(0,b.tCount)("picker.seatsSelectedCount",k):""),this.syncCta(k,w),this.hold){let u=m||this.hold.seats?.length||0;this.els.holdTitle&&(this.els.holdTitle.textContent=(0,b.t)("picker.securedCount",{count:u})),this.els.holdCopy&&(this.holdCopyPending=w>0,this.els.holdCopy.textContent=w?(0,b.t)("picker.moreSelectedCount",{count:w}):xt(this.holdExpiresAt));let v=this.els.holdChange;v&&(v.disabled=this.releasingHold,v.textContent=this.releasingHold?this.tf("picker.releasingEllipsis","Releasing\u2026"):this.tf("picker.change","Change"))}k!==y&&this.animateOnce(this.els.count,"sl-value-pop",380),S!==E&&this.animateOnce(this.els.total,"sl-value-pop",380),y===0&&k>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(k,S,w),this.lastTrayCount=k,this.lastTrayTotal=S,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(k,e)}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)}renderPeek(e,t,i){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(n=>this.catPrice(n)).filter(n=>n!=null);this.els.peek.innerHTML=Ri({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,fromPrice:s.length?Math.min(...s):null,addMore:Hi({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),holdTime:this.hold&&this.holdTimer?$e(Math.max(0,this.holdExpiresAt-Date.now())):null,money:n=>this.money(n)}),this.root&&(this.root.dataset.peekClock=String(!!this.els.peek.querySelector(".sl-peek-time")))}async removeHeldLabels(e,t){let i=e.filter(a=>a&&!this.releasingLabels.has(a));if(!i.length)return!1;let s=i[0];i.forEach(a=>this.releasingLabels.add(a)),t?.setAttribute("aria-busy","true");let n=t?.querySelector(".rm");n&&(n.disabled=!0);try{let a=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,b.t)("picker.couldNotRemoveLabel",{label:s}),"error"),!1;zt(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&&a,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast((0,b.t)("picker.labelRemovedFromHold",{label:s}),"success"),!0}finally{i.forEach(a=>this.releasingLabels.delete(a)),t?.removeAttribute("aria-busy"),n?.isConnected&&(n.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(yt(e,(i,s)=>this.tf(i,s)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,b.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(s=>s.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.setCtaPhase("checkout"),this.checkoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,s=Ht(this.gaQty),n=this.committedSelection();if(n.length){let a=await this.controller.hold(void 0,this.opts.holdTtlMs);i=a?{holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}:null}for(let{areaId:a,tierId:o,qty:l}of s){let c=await this.controller.holdGA(a,l,{tierId:o,ttlMs:this.opts.holdTtlMs});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.toast(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again."),"error"),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.handedOff=!0,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.setCtaPhase("checkout"),this.emitHoldChange(),this.checkoutHandoff(i,i.seats??n)}catch(i){this.opts.onError?.(i);let s=i,n=(s.conflicts??[]).map(o=>o.label).filter(Boolean).slice(0,3);s.reason==="event_closed"&&this.setSalesClosed(!0);let a=s.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):s.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):n.length?n.length===1?(0,b.t)("picker.labelsNoLongerAvailable.one",{labels:n.join(", ")}):(0,b.t)("picker.labelsNoLongerAvailable.other",{labels:n.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.toast(a,"error"),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let s=()=>{let n=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=$e(n));let a=this.els.peek?.querySelector(".sl-peek-time");a&&(a.textContent=$e(n)),!this.holdCopyPending&&this.els.holdCopy&&(this.els.holdCopy.textContent=xt(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",n>0&&n<=Oi),this.setExtendPrompt(n>0&&n<=Oi,n),n<=0&&this.stopHoldTimer()};s(),this.holdTimer=setInterval(s,500)}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.root&&delete this.root.dataset.peekClock,this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),s=Math.floor(i/60),n=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,b.t)("picker.seatsHeldForNeedMoreTime",{time:`${s}:${n}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&this.showBooked()}showBooked(){if(this.bookedShown||!this.hold)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((i,s)=>i+s.quantity,0);this.els.bookedSub&&(this.els.bookedSub.innerHTML=`<span class="sl-booked-seats">${(0,b.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.bookedEl?.classList.add("on"),this.opts.onBooked?.(e)}checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){this.startHostedCheckout(e,t);return}this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let n=s?.providers?.[0];if(!n){let a=gi(s?.reason),o=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:i}),this.opts.onCheckout?.(e,t,i),o||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:n,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(a=>a.displayLabel??a.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await fi())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,formatMoney:i=>this.money(i),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=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(a=>{let o=this.controller.lineItemDisplay(a);return{label:a.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},objectId:a.objectId,objectType:a.objectType,categoryKey:a.categoryKey,tierId:a.tierId,unitPrice:this.paidPrice(a.categoryKey,a.tierId,a.unitPrice,a.label),currency:a.currency??this.currency,quantity:a.quantity??1}}),s=i[0]?.currency??this.currency,n=i.reduce((a,o)=>a+o.unitPrice*o.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:i,total:n}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let s=this.els.toast;if(!s)return;s.replaceChildren();let n=document.createElement("span");if(n.textContent=e,s.appendChild(n),s.classList.toggle("has-action",!!i),i){let a=document.createElement("button");a.type="button",a.className="sl-toast-action",a.textContent=i.label,a.addEventListener("click",i.onClick,{once:!0}),s.appendChild(a)}s.dataset.tone=t,s.classList.add("on"),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on"),s.classList.remove("has-action"),s.dataset.tone="neutral"},4200)}placeTooltip(){if(!this.tipEl)return;let e=this.els.map.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,s=this.tipPos.x+14,n=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),n<8&&(n=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,n)}px`}rowTypeWord(e){let t=e?.displayType?.trim()||e?.rowType?.trim();return t||(e?.objectType==="table"?this.tf("picker.table","Table"):e?.objectType==="booth"?this.tf("picker.booth","Booth"):this.tf("picker.row","Row"))}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=m=>String(m??"\u2014").replace(/[&<>"]/g,g=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[g]),i=this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),s=e.objectType==="table"&&!!e.bookingMode,n=e.objectType==="booth",a=e.sectionLabel||e.rowLabel||e.seatNumber,o=s?`<div class="sl-tip-grid"><div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.guests","Guests")}</span><span class="sl-tip-val">${e.bookingMode==="variable"?`${e.minOccupancy}\u2013${e.maxOccupancy}`:e.capacity}</span></div></div>`:n?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(e.rowLabel??e.displayLabel??e.label)}</span></div></div>`:a?'<div class="sl-tip-grid">'+(e.sectionLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.section","Section")}</span><span class="sl-tip-val">${t(e.sectionLabel)}</span></div>`:"")+(e.rowLabel?`<div class="sl-tip-field"><span class="sl-tip-key">${t(this.rowTypeWord(e))}</span><span class="sl-tip-val">${t(ne(e))}</span></div>`:"")+(e.seatNumber?`<div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.seatNumber)}</span></div>`:"")+"</div>":`<div class="sl-tip-grid one"><div class="sl-tip-field"><span class="sl-tip-key">${this.tf("picker.seat","Seat")}</span><span class="sl-tip-val">${t(e.displayLabel??e.label)}</span></div></div>`,l=e.status==="not_for_sale",c=e.status==="free"?"":`<div class="sl-tip-status">${l?this.tf("picker.notAvailable","Not available"):e.status==="held"?(0,b.t)("map.statusHeld"):(0,b.t)("map.statusTaken")}</div>`,h=xe(e.commercial),p=h?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${t(h)}</div>`:"",d=Oe(e.wheelchairSpaceType),f=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${t(d)}</div>`:"";this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=o+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${e.categoryColor}"></span><span class="sl-tip-name">${t(e.categoryLabel)}</span>`+(l?"":`<span class="sl-tip-amt">${i}</span>`)+"</div>"+f+p+c,this.tipEl.style.display="block",this.placeTooltip()}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}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.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())}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Re(this.controller.doc?.theme,this.opts.theme),i=this.opts.theme?.map?.background??this.controller.doc?.theme?.background??void 0,s=ei(t,i);for(let n of["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text"])s?e.style.setProperty(n,s[n]):e.style.removeProperty(n)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){if(!e)return;let t=(this.opts.languages??[]).map(s=>(0,b.resolveLocale)(s)).filter((s,n,a)=>a.indexOf(s)===n);if(t.length<2)return;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",this.tf("picker.preferredTicketType","Language"));for(let s of t){let n=document.createElement("option");n.value=s,n.textContent=b.LOCALE_NAMES[s]??s,n.selected=s===(0,b.getLocale)(),i.appendChild(n)}i.addEventListener("change",()=>{this.setLocale(i.value)}),this.langSel=i,e.appendChild(i)}async setLocale(e){let t=(0,b.getLocale)(),i=await(0,b.loadLocale)(e);if(this.opts.messages&&(0,b.setStringOverrides)(this.opts.messages),i===t)return i;let s=this.root;if(!s)return i;s.lang=i,s.dir=(0,b.localeDirection)(),ii(s);try{this.syncTray()}catch{}try{this.syncPrices()}catch{}try{this.syncOffer()}catch{}try{this.syncRung()}catch{}try{this.syncFloors()}catch{}try{this.syncPanelToggle()}catch{}try{this.syncFullscreenButtons()}catch{}return this.controller.refreshMapCopy(),this.langSel&&this.langSel.value!==i&&(this.langSel.value=i),i}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(),Ns(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"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,n=s?await this.buyerAssetUrls.resolve(i):null,a=s?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!a||s&&!n?null:{url:a,...n?{previewUrl:n}:{},...s?{resolveUrl:o=>this.buyerAssetUrls.resolve(o)}:{},...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?.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 this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(o=>o.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(o=>i?o.label===i.label:o.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let n=this.controller.getStatus(t.id);if(n==="held"||n==="booked"||n==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),n),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}showUnavailable3dSeat(e,t,i){let s=this.view3dEl;if(!s)return;this.dismissUnavailable3dSeat();let n=this.controller.seatDetails(e.id),a=n?.displayLabel??e.displayLabel??e.label,o=n?.sectionLabel,l=ne(n),c=[o,l?(0,b.t)("picker.rowLabel",{label:l}):null,a].filter(Boolean).join(" \xB7 "),h=i==="held"?{title:this.tf("picker.temporarilyHeld","Temporarily held"),message:this.tf("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:i==="booked"?{title:this.tf("picker.sold","Sold"),message:this.tf("picker.soldSeatExplanation","This seat has already been booked.")}:{title:this.tf("picker.notForSale","Not for sale"),message:this.tf("picker.notForSaleExplanation","This seat is not included in the current sale.")},p=document.createElement("div");p.className="sl-view3d-unavailable",p.dataset.state=t,p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let d=document.createElement("span");d.className="sl-view3d-unavailable-eyebrow",d.textContent=c||a;let f=document.createElement("strong");f.textContent=h.title;let m=document.createElement("div");m.className="sl-view3d-unavailable-copy",m.append(d,f);let g=document.createElement("button");g.type="button",g.setAttribute("aria-label",this.tf("picker.closeSeatStatus","Close seat status")),g.textContent="\xD7";let S=document.createElement("p");S.textContent=h.message,p.append(m,g,S),g.addEventListener("click",()=>p.remove()),s.appendChild(p),this.announceSeat(e)}dismissUnavailable3dSeat(){this.view3dEl?.querySelector(".sl-view3d-unavailable")?.remove()}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(f=>f.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),s=this.controller.doc?.categories.find(f=>f.key===t.categoryKey),n=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),a=n!=null?this.paidPrice(t.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,n,t.label):void 0,o=this.controller.getStatus(t.id),l=o==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):o==="booked"?this.tf("picker.sold","Sold"):o==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),c=t.viewUrl?(0,ze.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}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),h=xe(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=i?.wheelchairSpaceType?`${Oe(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),d=(0,wt.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:ne(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??s?.label??t.categoryKey,price:a==null?this.tf("picker.priceNotSupplied","Not supplied"):this.money(a),availability:l,selectable:o==null||o==="free",viewSource:c,limited:h,accessibility:p,confidence:d}}openSeatConfidencePassport(e,t=null){let i=this.view3dEl;if(!i)return;this.closeSeatConfidencePassport(!1);let s=(0,wt.seatConfidenceDisclosure)(e.confidenceEvidence),n=e.confidenceEvidence,a=this.controller.seatDetails(e.id),o=y=>W(y),l=s.limitations.length?`<h4>Known limits</h4><ul>${s.limitations.map(y=>`<li>${o(y)}</li>`).join("")}</ul>`:"",c=s.modeledTarget?`<div><dt>Modeled target</dt><dd>${o(s.modeledTarget)}</dd></div>`:"",h=n?`<div><dt>Evidence ID</dt><dd>${o(n.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${o(n.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${o(n.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${o(n.approvedByRole??"No external approval supplied")}</dd></div>`+(n.validUntil?`<div><dt>Valid until</dt><dd>${o(n.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",p=xe(e.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),d=`<div><dt>View restriction</dt><dd>${o(p)}</dd></div>`+(e.commercial?.note?`<div><dt>Organizer note</dt><dd>${o(e.commercial.note)}</dd></div>`:""),f=document.createElement("div");f.className="sl-view3d-passport-shell",f.innerHTML=`<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">${o(a?.displayLabel??e.displayLabel??e.label)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${o(s.headline)}</strong><span>${o(s.coverage)} \xB7 ${o(s.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${o(s.model)}</dd></div><div><dt>Reality evidence</dt><dd>${o(s.reality)}</dd></div><div><dt>Source</dt><dd>${o(s.provenance)}</dd></div>`+d+c+h+`</dl>${l}<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></section>`;let m=[...new Set([...i.children,...[...this.els.map.children].filter(y=>y!==i)])].filter(y=>y instanceof HTMLElement),g=m.map(y=>({element:y,inert:y.inert,ariaHidden:y.getAttribute("aria-hidden")}));for(let y of m)y.inert=!0,y.setAttribute("aria-hidden","true");i.appendChild(f),i.classList.add("has-passport"),this.view3dPassportEl=f;let S=f.querySelector(".sl-view3d-passport"),k=()=>[...S.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],w=y=>{if(y.key==="Escape"){y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation(),this.closeSeatConfidencePassport();return}if(y.key!=="Tab")return;let E=k();if(!E.length)return;let u=E[0],v=E[E.length-1];y.shiftKey&&document.activeElement===u?(y.preventDefault(),v.focus()):!y.shiftKey&&document.activeElement===v&&(y.preventDefault(),u.focus())};window.addEventListener("keydown",w,!0),this.view3dPassportCleanup=()=>{window.removeEventListener("keydown",w,!0);for(let v of g)v.element.inert=v.inert,v.ariaHidden===null?v.element.removeAttribute("aria-hidden"):v.element.setAttribute("aria-hidden",v.ariaHidden);let y=t?.isConnected?t:this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareEl?.querySelector("[data-passport-seat]")??null,E=y?.closest(".sl-confirm,.sl-view3d-compare");E?.isConnected&&(E.inert=!1,E.removeAttribute("aria-hidden")),f.remove(),i.classList.remove("has-passport"),this.view3dPassportEl===f&&(this.view3dPassportEl=null);let u=y??this.view3dCompareEl?.querySelector("[data-passport-seat]")??this.confirmEl?.querySelector(".sl-confirm-confidence")??this.view3dCompareChip.mainButton();(t?.isConnected?t:u)?.focus()},f.addEventListener("click",y=>{let E=y.target instanceof HTMLElement?y.target:null;(E?.closest("[data-close]")||E?.classList.contains("sl-view3d-passport-scrim"))&&this.closeSeatConfidencePassport()}),requestAnimationFrame(()=>k()[0]?.focus()),this.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:n?.evidenceId??null,eventConfigurationId:n?.eventConfigurationId??null,modelLevel:n?.modelLevel??"unverified",realityLevel:n?.realityLevel??"none"})}closeSeatConfidencePassport(e=!0){let t=this.view3dPassportCleanup;if(this.view3dPassportCleanup=null,!t){this.view3dPassportEl?.remove(),this.view3dPassportEl=null,this.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}openView3dComparison(){let e=this.view3dEl;if(!e||this.view3dCompareSeatIds.length<2)return;this.closeView3dComparison(!1);let t=this.view3dCompareSeatIds.map(d=>this.view3dComparisonSnapshot(d)).filter(d=>!!d);if(t.length<2){this.clearView3dComparison();return}let i=d=>W(d),s=document.createElement("div");s.className="sl-view3d-compare-shell";let n=t.map((d,f)=>`<article><span>Seat ${f===0?"A":"B"}</span><strong>${i(d.label)}</strong><small>Section ${i(d.section)} \xB7 Row ${i(d.row)}</small><dl><div><dt>Current price</dt><dd>${i(d.price)}</dd></div><div><dt>Ticket type</dt><dd>${i(d.category)}</dd></div><div><dt>Availability</dt><dd>${i(d.availability)}</dd></div><div><dt>View source</dt><dd>${i(d.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(d.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(d.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(d.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(d.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(d.seat.id)}">Passport</button><button type="button" data-view-seat="${i(d.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(d.seat.id)}"${d.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.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">Current price and availability come from this picker. Modeled views are chart-derived unless organizer media is labeled; SeatLayer does not invent why a seat has its price.</p><div class="sl-view3d-compare-grid">${n}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=[...e.children].filter(d=>d instanceof HTMLElement),l=o.map(d=>({element:d,inert:d.inert,ariaHidden:d.getAttribute("aria-hidden")}));for(let d of o)d.inert=!0,d.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),this.view3dCompareEl=s;let c=s.querySelector(".sl-view3d-compare"),h=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=d=>{if(d.key==="Escape"){d.preventDefault(),this.closeView3dComparison();return}if(d.key!=="Tab")return;let f=h();if(!f.length)return;let m=f[0],g=f[f.length-1];d.shiftKey&&document.activeElement===m?(d.preventDefault(),g.focus()):!d.shiftKey&&document.activeElement===g&&(d.preventDefault(),m.focus())};window.addEventListener("keydown",p),this.view3dCompareCleanup=()=>{window.removeEventListener("keydown",p);for(let d of l)d.element.inert=d.inert,d.ariaHidden===null?d.element.removeAttribute("aria-hidden"):d.element.setAttribute("aria-hidden",d.ariaHidden);s.remove(),e.classList.remove("has-comparison"),this.view3dCompareEl===s&&(this.view3dCompareEl=null),a?.isConnected?a.focus():this.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>this.closeView3dComparison()),s.querySelectorAll("[data-passport-seat]").forEach(d=>d.addEventListener("click",()=>{let f=d.dataset.passportSeat,m=f?this.allSeats().find(g=>g.id===f):void 0;m&&this.openSeatConfidencePassport(m,d)})),s.querySelectorAll("[data-view-seat]").forEach(d=>d.addEventListener("click",()=>{let f=d.dataset.viewSeat;this.closeView3dComparison(!1),f&&this.view3dHandle?.flyToSeat(f)})),s.querySelectorAll("[data-select-seat]").forEach(d=>d.addEventListener("click",()=>{let f=d.dataset.selectSeat;f&&this.selectComparedSeat(f)})),requestAnimationFrame(()=>h()[0]?.focus()),this.emit3dAnalytics("3d_comparison_opened",{seatIds:this.view3dCompareSeatIds.slice()})}closeView3dComparison(e=!0){let t=this.view3dCompareCleanup;if(this.view3dCompareCleanup=null,!t){this.view3dCompareEl?.remove(),this.view3dCompareEl=null,this.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||this.root?.focus({preventScroll:!0})}selectComparedSeat(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=this.allSeats().find(s=>s.id===e);if(!t)return;if(this.closeView3dComparison(!1),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.toast(this.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}this.syncSelectionTo3d(),this.showConfirm(t),this.emit3dAnalytics("3d_comparison_selected",{seatId:e})}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection();let i=document.createElement("div");i.className="sl-view3d",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let n=s.querySelector("span"),a=h=>{this.view3dTargetSeatId=h;let p=!!h;i.classList.toggle("is-seat-focused",p);let d=p?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");n&&(n.textContent=d),s.setAttribute("aria-label",d)};s.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),i.appendChild(s);let o=document.createElement("button");o.type="button",o.className="sl-view3d-fs",o.textContent="\u26F6",o.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),o.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),o.addEventListener("click",()=>this.toggleFullscreen()),i.appendChild(o);let l=document.createElement("div");l.className="sl-view3d-loading",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),l.textContent=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(l),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let c=++this.view3dGen;try{let h=(0,b.expandChart)(t),p=await ui();if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let d=await p.prepareVenue3D({doc:t,seats:h});if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let f=p.mountVenue3D(i,{doc:t,seats:h,prepared:d},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,seatViewActionLabel:m=>this.allSeats().find(g=>g.id===m)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.onView3dSeatPick(m),onSeatInspect:m=>this.onView3dSeatPick(m),onSectionFocusChange:m=>{let g=i.querySelector('select[data-locator="section"]'),S=m??"";!g||g.value===S||(g.value=S,g.dispatchEvent(new Event("change")))},onViewTargetChange:m=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!m),a(m),this.opts.onBuyerViewChange?.({view:"venue3d",...m?{seatId:m}:{}})},getSeatView:m=>new Promise((g,S)=>{let k=()=>{this.seatViewFor3d(m).then(y=>{y?g(y):S(new Error("seat_view_unavailable"))})},w=globalThis.requestIdleCallback;typeof w=="function"?w(k,{timeout:1500}):setTimeout(k,50)}),onAnalytics:(m,g)=>this.emit3dAnalytics(m,g)});this.view3dHandle=f,l.remove(),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),Ai(i,f),e&&f.flyToSeat(e)}catch(h){if(c!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(h),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove();try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}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))),this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let n=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return n?(this.hold={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(n.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&n.seats.length&&!n.seats.every(a=>a.commercial?.premium)&&this.toast((0,b.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}catch(n){this.opts.onError?.(n);let a=n?.reason,o=a==="not_enough_together"?(0,b.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"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):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(o,"error"),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 s=[...new Set([...(e.items??[]).map(n=>n.label),...(e.seats??[]).map(n=>n.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(n){this.opts.onError?.(n),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 Y({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:ce(this.controller,{flashOnLiveChange:!0,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")}})}),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)}showAccessPanel(e){if(this.destroyed||!this.root)return;let t=this.accessCopy(e.reason);this.dismissAccessPanel();let i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let s=document.createElement("div"),n=document.createElement("div");n.className="sl-access-title",n.textContent=t.title;let a=document.createElement("div");if(a.className="sl-access-body",a.textContent=t.body,s.appendChild(n),s.appendChild(a),t.action){let o=document.createElement("button");o.type="button",o.className="sl-access-act",o.textContent=t.action,o.addEventListener("click",()=>{this.refreshAccess()}),s.appendChild(o)}i.appendChild(s),(this.regions?.["bottom-center"]??this.root).appendChild(i),this.accessEl=i}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}accessCopy(e){switch(e){case"paused":return{title:this.tf("picker.accessPausedTitle","These seats are on hold right now"),body:this.tf("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:this.tf("picker.accessRetry","Try again")};case"revoked":return{title:this.tf("picker.accessRevokedTitle","This access link is no longer active"),body:this.tf("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:this.tf("picker.accessExpiredTitle","Your access session has ended"),body:this.tf("picker.accessExpiredBody","Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours."),action:this.tf("picker.accessRetry","Try again")};default:return{title:this.tf("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:this.tf("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}destroy(){this.destroyed=!0,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),X(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=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.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.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};function Bi(r,e={}){let t=e.origin??"";if(!t)try{t=new URL(r.src,window.location.href).origin}catch{t=""}let i=!1,s=null,n=null,a=null,o="",l=null,c=()=>{if(i)return;i=!0,s=r.getAttribute("style"),Object.assign(r.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let d=document.documentElement;n=d.style.overflow,d.style.overflow="hidden",document.body&&(a=document.body.style.overflow,document.body.style.overflow="hidden"),l=f=>{f.key==="Escape"&&h()},window.addEventListener("keydown",l)},h=()=>{i&&(i=!1,s===null?r.removeAttribute("style"):r.setAttribute("style",s),s=null,o&&(r.style.height=o),n!==null&&(document.documentElement.style.overflow=n,n=null),a!==null&&document.body&&(document.body.style.overflow=a,a=null),l&&(window.removeEventListener("keydown",l),l=null))},p=d=>{if(d.source!==r.contentWindow||t&&d.origin!==t||!d.data||typeof d.data!="object")return;let f=d.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(o=`${Math.round(f.px)}px`,i||(r.style.height=o));return}f.type==="seatlayer:fullscreen"&&(f.on===!0?c():f.on===!1&&h())};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),h()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,ticketOfferPrices});